Changeset - ef446502e0ae
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-07-28 17:26:29

Notes, updating pseudo
1 file changed with 9 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/server/slave.c
Show inline comments
 
@@ -124,22 +124,26 @@ options_init(argc,argv,&my_cfg, myopts, 
 
/* Somewhat pseudo Rendering code */
 
/*
 
	if('slave recieves "start frame#, job#"'){
 
		fprintf(stderr, "Got frame %d in job %d, preparing to render...",framenum,jobnum);
 
		fprintf(stderr, "Received %d in job %d, preparing to render...",framenum,jobnum);
 
		get('http://distren.protofusion.org/srv/job%d.tgz', jobnum); // use curl
 
		exec('tar -xvf job%d.tgz /tmp/distren/job%d',jobnum,jobnum); // somehow
 
		exec_blender("GIVE ME SOME ARGS!"); // (check the args, we'll need to adjust for different output formats, include this in the blendjob struct later)
 
			while('blender is running'){
 
				slavestatus=1; // really quite pointless now, but why not. Could be nice for logging.
 

	
 
		// Consider placing the following in the exec_blender() function
 
			while(blender_is_running == 1){
 
				tell_the_server(DISTREN_REQUEST_PROGRESS);
 
				fprintf(stderr, "Rendering frame %d in job %d...",framenum,jobnum);
 
				delay(1000); // or not... this should be more event-driven, but should still give a heartbeat to the server
 
			}
 
		slavestatus=2; // When done rendering, set this.
 

	
 

	
 
		telldone=1; // When done rendering, set this.
 
	}
 
	if(slavestatus==2){
 
	if(telldone==1){
 
		fprintf(stderr, "Finished frame %d in job %d, uploading...",framenum,jobnum);
 
		curl_POST("/path/to/output.jpg", "http://protofusion.org/distren/output/job%d",jobnum);
 
		tell_the_server(DISTREN_REQUEST_DONEFRAME); // AKA "I'm done rendering that frame you sent me"
 
		telldone=0;
 
		// Slave now becomes idle, doesn't need to tell the server anything, ssh handles this.
 
	}
 
*/
0 comments (0 inline, 0 general)