Changeset - 13533b1094bd
[Not reviewed]
default
0 2 0
LordOfWar - 16 years ago 2009-09-14 02:22:57

-removed TODO saying that we needed to add \"int type\" to framestruct, added comments about \"type\"
--In status_report_generator()--
-now starts scanning on jobs after the head job
-changed while statement to a for loop, much more reliable
-removed the setting of priority of the job to zero to say its complete, is useless since it is removed from the queue in the next statement.
-if the job has not been started, it is not scanned
-since queue is now a linked list, the total number of jobs simply equals the amount of times the for loop iterates which is counted by numjobs
2 files changed with 7 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -169,7 +169,7 @@ void prepare_distrenjob(struct frameset 
 

	
 
  struct distrenjob *distrenjob;
 

	
 
  distrenjob->type = 1; /*@TODO: add type to blendjob struct*/
 
  distrenjob->type = 1;
 
  distrenjob->name = name;
 
  distrenjob->submitter = submitter;
 
  distrenjob->email = email;
 
@@ -233,14 +233,13 @@ void status_report_generator(struct dist
 
  unsigned short workers_working; /*< used to count the total number of workers working */
 
  unsigned int numjobs; /*< used to track number of jobs */
 

	
 
  distrenjob_ptr = *distrenjobs_head;
 
  workers_working = 0;
 
  workers_working = 0; /*@TODO is there another way to trade how many workers are working, this is equal to assigned frames*/
 
  numjobs = 0;
 

	
 
  while(distrenjob_ptr)
 
  for(distrenjob_ptr = *distrenjobs_head; distrenjob_ptr; distrenjob_ptr = distrenjob_ptr->next)
 
    {
 
      if(distrenjob_ptr->priority != 0)
 
	/* If the job is not done, scan it */
 
      if(distrenjob_ptr->frameset[0].status == 0 && distrenjob_ptr->frameset[1].status == 0)
 
	/* If the job has been started, scan it */
 
	{
 
	  unsigned int framecounter;  /*< to scan through frames */
 
	  unsigned long finished_frames; /*< variable that counts the completed frames */
 
@@ -287,7 +286,6 @@ void status_report_generator(struct dist
 
	  if(finished_frames == distrenjob_ptr->total_frames)
 
	    /* If all frames are complete */
 
	    {
 
	      distrenjob_ptr->priority = 0; /*< set priority to zero to indicate job is complete */
 
	      distrenjob_remove(distrenjobs_head, distrenjob_ptr); /*< remove this job from the linkedlist */
 
	      distrenjob_free(distrenjob_ptr);
 
	      general_info.total_finished_jobs++; /*< add one to the total finished jobs */
 
@@ -306,11 +304,10 @@ void status_report_generator(struct dist
 

	
 
      general_info.rendering_clients = workers_working; /*< should this be a +=? */
 

	
 
      distrenjob_ptr = distrenjob_ptr->next; /*< This is the essence of linked lists and iterating through them */
 
      numjobs ++;
 
    } /* while(distrenjob_ptr) */
 

	
 
  general_info.jobs_in_queue = (highest_jobnum - general_info.total_finished_jobs); /*< extraneous parentheses! */
 
  general_info.jobs_in_queue = numjobs;
 
}
 

	
 

	
src/server/distrenjob.h
Show inline comments
 
@@ -34,7 +34,7 @@ typedef unsigned int jobnum_t;
 
*/
 
struct distrenjob {
 
  struct distrenjob *next; /*< next will be NULL unless if there is another distrenjob */
 
  int type;
 
  int type; // 1:Blender, 2:something else
 
  char *name;
 
  char *submitter;
 
  char *email; /*< This should be looked up based on the value of submitter, not stored in this struct */
0 comments (0 inline, 0 general)