Changeset - 43a343738d88
[Not reviewed]
default
0 1 0
LordOfWar - 16 years ago 2009-07-05 13:21:16

tweaked the blendjob structure

tweaked my functions to support the two new global variables hcfjob and highest_jobnum. Need to check functions for 100% accuracy due to start frame - end frame not = 0 frames to be rendered.

added a bit more to the status report generator

for the frame_finder function... it only returns a interger for the frame to be rendered... but the slave also needs the name of the folder the source files are stored in, and the name of the blend file to open to render the frame. Maybe return a string? and have the slave parse it for variables?
1 file changed with 13 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -265,24 +265,26 @@ void loginuser(char *username, int secre
 
 Have a script crawl through each job in the arrays, ordered by priority?, and assign a certain number of frames to each slave.
 
 Then we will need some sort of watchdog to monitor slaves on the main server to check for stales.
 
*/
 

	
 

	
 
/* This function creates frame array based on the total number of frames to be rendered, which will then be parsed by function frame_farmer. */
 
void frame_num_struct_builder(int sframe, int eframe) {
 
	int jobnum_new = highest_jobnum + 1;
 
	int total = sframe - eframe;
 
	int fcount = sframe; // Used to create all the frames in the structure from sframe to eframe
 
	int x = 0;
 

	
 
	blendjob[jobnum_new].total_frames = total; // sets the total number of frames in animation for status purposes
 

	
 
	while(x < total){
 
		blendjob[jobnum_new].frameset[x].frame_num = fcount;
 
		x++;
 
		fcount++;
 
	}
 

	
 
	highest_jobnum++;
 
}
 

	
 
// matches your computer up with a lovely frame to render
 
int frame_finder(){
 
	int your_frame = null;  // your_frame is an interger value that will be given to the client as the frame number to render
 
@@ -320,37 +322,38 @@ blendjob[jobnum].frameset[x].frame_statu
 

	
 
your_frame = blendjob[jobnum].frameset[x].frame_num; //  Takes the frameset found in the while statement above, and extracts the frame number from it and assigns it to the int your_frame
 

	
 
if(your_frame = null)  // If that job had no open frames for some reason, run the status report generator so that
 
	status_report_generator();  //the job priority can be changed to 0
 

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

	
 
// This figures out how much of the job is done, where jobnum corresponds to the job number
 
// This uses pointers, so when it is run it updates certain values in memory
 
void status_report_generator(){
 
	int num1 = hcfjob+1;
 
	int num2 = 0;
 
	int num3 = 0;
 
	int num1 = hcfjob+1; // to scan through jobs
 
	int num2 = 0;		 // to scan through frames
 

	
 
	if(blendjob[num1].priority = 0)
 
	if(blendjob[num1].priority = 0)  //If the job after the highest consecutively finished job is finished
 
		hcfjob+1;  // adds 1 to the highest consecutively finished job
 

	
 
	while(blendjob[num1].frameset[num2].name != null){
 
		if(blendjob[num1].priority = 0) // if job is done, go to next one
 
			num1++;
 

	
 
		if(blendjob[num1].frameset[num2].priority !=0)
 
			break;
 
	while(num1 <= highest_jobnum){
 
		if(blendjob[num1].frameset[num2].priority != 0){
 
			while(num2 <= blendjob[jobnum].total_frames){
 
				int finished_frames = 0;
 
				if(blendjob[jobnum].frameset[num2])
 
					finished_frames++;
 
			}
 
		}
 
	}
 

	
 
}
 

	
 
// 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
0 comments (0 inline, 0 general)