Changeset - 558bdb8753cd
[Not reviewed]
default
0 1 0
lordofwar - 16 years ago 2009-07-02 00:06:34

Got rid of a small amount of crap I made earlier.

Added a function to the slave portion that should tell the server that it completed its frame. Ohnobinki should check if it is correct ;) .
1 file changed with 5 insertions and 11 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -215,100 +215,94 @@ void frame_array_builder(int sframe, int
 
// matches your computer up with a lovely frame to render
 
int frame_finder(){
 
	int your_frame = 0;  // your_frame is an interger value that will be given to the client as the frame number to render
 

	
 
	while(your_frame < eframe){ // this finds a frame with the value of zero, which is a frame that is ready to be rendered
 
		if (blendjob[jobnum].frameset[your_frame] = 0)
 
			break;
 

	
 
		your_frame++;
 
	}
 
blendjob[jobnum].frameset[your_frame]++; // sets the value of the frame to 2, which means its taken
 

	
 
return your_frame; // your_frame is returned as the frame to be rendered
 
}
 

	
 
// This function makes the value of the frame 2, which means its completed.
 
void the_finisher(int frame){
 
	blendjob[jobnum].frameset[frame]++;
 
}
 

	
 
// Queuer: this function should add files to the queue
 
// Type: 0 = blender, 1 = luxrender
 
// jobnum is the current job number
 

	
 
void queue(int type, char *name, char *submitter, char *email, int priority, int mode, int spp, *frameset) {
 
  if(type == 1){
 
    blendjob[jobnum].name = name;
 
    blendjob[jobnum].submitter = submitter;
 
    blendjob[jobnum].email = email;
 
    blendjob[jobnum].priority = priority;
 
    blendjob[jobnum].frameset =  frameset;
 
  }
 
  if(type == 2){
 
    luxjob[jobnum].name = name;
 
    luxjob[jobnum].submitter = submitter;
 
    luxjob[jobnum].email = email;
 
    luxjob[jobnum].priority = priority;
 
    luxjob[jobnum].mode = mode;
 
    luxjob[jobnum].spp = spp;
 
    luxjob[jobnum].frameset = frameset;
 
    // handle lux modes somehow.
 
}
 
  else{
 
    // Throw error.
 
  }
 
jobnum++;
 
}
 

	
 
/*
 
 * struct frameset[]
 
 * {
 
 *   status;
 
 * }
 
 *
 
 *
 
 */
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 
/*
 
Slave execution code lies below
 

	
 

	
 
Slave listens on server for a command in the format of each function...
 
We need if's for returns... ==> watchdog
 
*/
 

	
 

	
 
// Executors
 

	
 
void exec_blender(char *input, char *output, int sframe, int eframe) {
 
void exec_blender(char *input, char *output, int frame) {
 
  int ret;
 
  /* SEGFAULTAGE :-D */
 
  char *cmd[] = { "blender", "-b", "-o", output, input, "-s", sframe, "-e", eframe, (char *)0 };
 
  char *cmd[] = { "blender", "-b", "-o", output, input, "-f", frame, (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.
 
  fprintf{stdin, the_finisher(frame)};
 

	
 
void exec_luxrender_single(char *input, char *output) {
 
  int ret;
 
  char *cmd[] = { "luxrender", "-something", "something", "something", (char *)0 };
 
  ret = execv("/usr/bin/luxrender", cmd);
 
}
 

	
 
void exec_luxrender_anim(char *input, char *output, int sframe, int eframe, int spp) {
 
// spp is samples per pixel limitation on each frame
 
  int ret;
 
  char *cmd[] = { "luxrender", "-something", "something", "something", (char *)0 };
 
  ret = execv ("/usr/bin/luxrender", cmd);
 
}
 

	
 

	
 

	
 
  return 0;
 
}
0 comments (0 inline, 0 general)