Changeset - d7b349e0d490
[Not reviewed]
default
0 3 0
LordOfWar - 16 years ago 2009-09-18 20:51:08

-created hibernate in general_info and distrenjob structures
-implimented it into find_jobframe() and the functions that initialize the jobs variables
3 files changed with 8 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -54,6 +54,7 @@ struct general_info {
 
  unsigned short int total_finished_jobs; //
 
  unsigned int total_frames_rendered; //
 
  unsigned int highest_jobnum;
 
  short int hibernate;
 
} general_info;
 

	
 

	
 
@@ -126,6 +127,7 @@ void remotio_send_to_client()
 
/** Fill variables after crash / shutdown from XML dumps */
 
int start_data()
 
{
 
  general_info.hibernate = 0;
 
  struct stat buffer;
 
  if(stat(SYSCONFDIR "/data.xml", &buffer) == 0){
 

	
 
@@ -282,6 +284,9 @@ void change_job_priority(struct distrenj
 
*/
 
int find_jobframe(struct distrenjob *head, struct distrenjob **job, struct frameset **frame)
 
{
 
  if(general_info.hibernate)
 
    return 1;
 

	
 
  unsigned int frame_counter;
 
  short int your_job_type;
 
  unsigned short int found;
 
@@ -291,7 +296,7 @@ int find_jobframe(struct distrenjob *hea
 
  your_job_type = 0;
 
  found = 0;
 
  /* iterate through jobs from first to last */
 
  for(distrenjob_ptr = head->next; !found && !distrenjob_ptr; distrenjob_ptr = distrenjob_ptr->next)
 
  for(distrenjob_ptr = head->next; (!found && !distrenjob_ptr) && !distrenjob_ptr->hibernate; distrenjob_ptr = distrenjob_ptr->next)
 
    for(frame_counter = 0; !found && frame_counter < distrenjob_ptr->total_frames; frame_counter ++)
 
      if(distrenjob_ptr->frameset[frame_counter].status == FRAMESETSTATUS_UNASSIGNED)
 
	{
src/server/distrenjob.c
Show inline comments
 
@@ -61,6 +61,7 @@ int distrenjob_new(struct distrenjob **d
 
  dj->completed_frames = 0;
 
  dj->assigned_frames = 0;
 
  dj->total_render_time = 0;
 
  dj->hibernate = 0;
 
  dj->frameset = (struct frameset *)NULL; /*< @todo does frameset need to be initialized here? */
 

	
 
  return 0;
src/server/distrenjob.h
Show inline comments
 
@@ -44,6 +44,7 @@ struct distrenjob {
 
  int assigned_frames; // number of assigned frames (that are not yet completed) for stats/etc
 
  int total_frames; // how many frames are in the animation for stats/etc (unassigned frames)
 
  int watchdog_forgiveness; // how many seconds till the frame is re-assigned (if client computer crashes etc);
 
  short int hibernate;
 
  time_t total_render_time; // total seconds of time spent on all the completed frames
 
  char *output_format; /*< currently is the file extention of the request output format. @todo make this mime-type based/not a string */
 
  struct frameset *frameset;
0 comments (0 inline, 0 general)