# HG changeset patch # User NEO # Date 2009-07-12 18:59:13 # Node ID a6a648e19f3472b3060a1cf123c715110974c3c7 # Parent 4511fa3bd7684399bbb593f899773dfd6835de0d added struct general_info and added statements through out the code to update it... but due to errors it doesn't seem to have recognized the struct... diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -71,7 +71,13 @@ struct distrend_config Then we will need some sort of watchdog to monitor slaves on the main server to check for stales. Maybe not worry about this for now. */ - +struct general_info { + short int jobs_in_queue; // + unsigned short int free_clients; + unsigned short int rendering_clients;// + unsigned short int total_finished_jobs; // + unsigned int total_frames_rendered; // +}; // Stores Blender Job Info struct blendjob { @@ -110,6 +116,8 @@ void finish_frame(int jobnum, int frame) blendjob[jobnum].frameset[frame].frame_status = 2; blendjob[jobnum].frameset[frame].time_to_render = (clock() - blendjob[jobnum].frameset[frame].start_time); + + general_info.total_frames_rendered++; } @@ -139,6 +147,7 @@ void status_report_generator(){ hcfjob++; // adds 1 to the highest consecutively finished job and checks the next one, till the job after the hcfjob is not done int num1 = hcfjob+1; // to scan through jobs + unsigned short int workers_working; // used to count the total number of workers working while(num1 <= highest_jobnum){ @@ -156,9 +165,10 @@ void status_report_generator(){ total_time = total_time + blendjob[num1].frameset[num2].time_to_render; } - if(blendjob[num1].frameset[num2].frame_status == 1) // If the frame is assigned + if(blendjob[num1].frameset[num2].frame_status == 1){ // If the frame is assigned pending_frames++; - + workers_working++; + } num2++; } @@ -172,12 +182,18 @@ void status_report_generator(){ blendjob[num1].avg_render_time = (total_time / finished_frames); blendjob[num1].time_remaining = (blendjob[num1].avg_render_time * (blendjob[num1].total_frames - finished_frames)); - if(finished_frames == blendjob[num1].total_frames) // If all frames are complete, set priority to zero to indicate job is complete - blendjob[num1].priority = 0; + if(finished_frames == blendjob[num1].total_frames){ // If all frames are complete + blendjob[num1].priority = 0; //set priority to zero to indicate job is complete + general_info.total_finished_jobs++; // add one to the total finished jobs + + } } num1++; + general_info.rendering_clients = workers_working; } + + general_info.jobs_in_queue = (highest_jobnum - general_info.total_finished_jobs); } @@ -190,13 +206,13 @@ void frame_num_struct_builder(int sframe blendjob[jobnum_new].total_frames = total; // sets the total number of frames in animation for status purposes - while(x < total){ + while(x < total){ // This builds the array, with the array starting at zero and the frame_num starting at sframe blendjob[jobnum_new].frameset[x].frame_num = fcount; x++; fcount++; } - highest_jobnum++; + highest_jobnum++; // After it has created the job, it adds one to the highest_jobnum interger }