Changeset - 25d211484bef
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-07-14 19:42:04

Some commenting
1 file changed with 8 insertions and 11 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -82,17 +82,17 @@ struct general_info {
 
struct blendjob {
 
  struct blendjob *next; /* next will be NULL unless if there is another blendjob */
 
  char *name;
 
  char *submitter;
 
  char *email;
 
  unsigned int jobnum;
 
  int priority;  // 1 is lowest, 10 is highest, 0 is done
 
  int priority;  // 1 is lowest, 10 is highest, 0 means the job is done
 
  int percent_done;
 
  int completed_frames; // number of completed frames for stats/etc
 
  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
 
  int total_frames; // how many frames are in the animation for stats/etc (unassigned frames)
 
  int avg_render_time; // average seconds it took to render a frame
 
  unsigned int time_remaining; // estimated seconds remaining till render is complete (up to 49, 710 days)
 
							   // we can have the client computer convert it into days, hours, etc if they wish to view it
 
  struct frameset *frameset;
 
};
 

	
 
@@ -124,15 +124,15 @@ void start_data(){
 
}
 

	
 
// **** Finish-Setter: Sets a frame to the "completed" status.
 
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);
 
  blendjob[jobnum].frameset[frame].time_to_render = (clock() - blendjob[jobnum].frameset[frame].start_time); // Consider changin time-to-render to time-for-frame or something?
 

	
 
  general_info.total_frames_rendered++;
 
  general_info.total_frames_rendered++; // Increase total frames var for stats
 
}
 

	
 

	
 
// **** Queuer: Adds files to the queue
 
void queue(int type, char *name, char *submitter, char *email, int priority, int mode, int spp, struct frameset *frameset) {
 
	// Type: 1 = blender, add more types later
 
@@ -221,13 +221,13 @@ void frame_num_struct_builder(struct ble
 
	job->total_frames = total; // sets the total number of frames in animation for status purposes
 
	job->jobnum = jobnum_new;
 

	
 
	for(counter = 0; counter < total; counter ++)
 
	  /* This builds the array, with the array starting at zero and the frame_num starting at sframe */
 
	  job->frameset[counter].frame_num = counter + 1;
 
	
 

	
 
	highest_jobnum++; // After it has created the job, it adds one to the highest_jobnum interger
 
}
 

	
 

	
 

	
 
// Frame Assigner: matches your computer up with a lovely frame to render
 
@@ -298,13 +298,13 @@ void blend_frame_watchdog(){
 

	
 

	
 
/* ************************** Main ************************* */
 

	
 
int main(int argc, char *argv[])
 
{
 
//// Begin Getopt Sample
 
//// Begin Getopt Sample, EDITME!Sometime
 
		   int aflag = 0;
 
	       int bflag = 0;
 
	       char *cvalue = NULL;
 
	       int index;
 
	       int c;
 

	
 
@@ -497,18 +497,15 @@ void loginuser(char *username, int secre
 
  execio_close(testrem);
 
}
 

	
 

	
 
// Executors
 

	
 
// It seems that the client will need to know the job number. Is finish_frame going to be on the client or the server? we gotta figure that out!
 
void exec_blender(char *input, char *output, int frame, int jobnum) {
 
  char *frame_str;
 
  asprintf(frame,frame_str); // GNU/*nix compatible only, fix before releasing win32!
 
  asprintf(frame,frame_str); // GNU/*nix compatible only, fix before releasing win32, although dll for windows for asprintf exists!
 
  int ret;
 
  /* SEGFAULTAGE :-D */
 
  char *cmd[] = { "blender", "-b", "-o", output, input, "-f", frame_str, (char *)0 };
 
  ret = execv("/usr/bin/blender", cmd);
 

	
 
  // OHNOBINKI! ... check this... Its supposed to send a command back to the server and run the_finisher(); function which sets the frame status to complete.
 
  /* You can't print the return value of a function that returns nothing (void) */
 
  finish_frame(jobnum, frame);
 
}
0 comments (0 inline, 0 general)