Changeset - 3b87c3653d08
[Not reviewed]
Merge default
0 2 0
Nathan Brink (binki) - 16 years ago 2009-08-16 22:24:12
ohnobinki@ohnopublishing.net
merge
2 files changed with 7 insertions and 7 deletions:
0 comments (0 inline, 0 general)
TODO
Show inline comments
 
@@ -20,14 +20,14 @@ Slave
 
 -Fix current bugs
 
*-Add calls to remoteio, once it works or even before it works
 
 -Add code to write arguments for exec_blender based on the contents of a job's xml file
 
*-Other XML-writing/reading
 
	+Parse XML file and toss data in blendjob struct
 
	+Update exec_blender() to use the struct rather than other vars
 
 -Add errorcatchers to return in libcurl functions
 
=-Make code more flexible for different types of jobs
 
 -Add errorcatchers to return in libcurl functions, can we detect 404?
 
=-Make code more flexible for different types of jobs and operating systems (such as paths, libs, etc)
 
 -Add code to allow pausing/resuming of the slave (including a running blender process)
 
 -Add a threads variable for software that doesn't support threads (blender takes care of this by itself)
 

	
 
Options
 
 -Rewrite some stuff, try to make it simpler
 
x-Move server and client confuse code into their individual files, rather than in the common file. -- note: there wasn't any client code in options.c. There was the ``server'' section. That section is passed multiple times and provides information to remoteio on how to connect to servers
src/server/slave.c
Show inline comments
 
@@ -110,17 +110,17 @@ options_init(argc,argv,&my_cfg, myopts, 
 
	else{
 
	  fprintf(stderr,"Something is terribly wrong!");
 
	}
 

	
 

	
 

	
 
/* These should all be filled by remotio and other code @TODO: Make this less blender-specific and more jobtype-flexible */
 
/* These should all be filled by remotio and other code @TODO: Make this less blender-specific and more jobtype-flexible... how should we go about doing this? */
 
int jobnum;
 
int framenum;
 

	
 
/* These should be filled by the xml file that comes with a job */
 
/* These should be filled by the xml file that comes with a job @TODO: Add calls to the xml function that ohnobinki's working on */
 
char *outputExt = "JPG";
 
char *outputRes = "1600x1200";
 

	
 
int gotframe; // set this to 1 after data for a job is received from the server
 
int busy = 0;     // Client business 1=busy 0=idle
 

	
 
@@ -135,13 +135,13 @@ char *pathtoOutput;  // Full path to the
 
if(gotframe ==1)
 
  {
 
    char *tarcmd;
 
    char *outdir;
 
    char *jobdatapath;
 

	
 
    fprintf(stderr, "Received %d in job %d, preparing to render...",framenum,jobnum);
 
    fprintf(stderr, "Received %d in job %d, preparing to render...\n",framenum,jobnum);
 

	
 
    /**
 
       Variable Preparation
 
       @todo find where to free() all of these
 
    */
 
    _distren_asprintf(&jobdatapath, "job%d", jobnum);
 
@@ -159,20 +159,20 @@ if(gotframe ==1)
 
      if(fstatus != -1){
 
              fprintf(stderr, "Using cached job file...\n");
 
              curlget(urltoTar, pathtoTar); // Downloads the Tar @TODO: add a progressbar
 
      }
 

	
 
    _distren_asprintf(&outdir, "/tmp/distren/job%d", jobnum); /*< @todo free() */
 
    mkdir("/tmp/distren", 0750);
 
    mkdir("/tmp/distren", 0750); /* @TODO: This is a tad unix-specific... */
 
    mkdir(outdir, 0750);
 

	
 
    _distren_asprintf(&tarcmd, "tar -xvf \"%s\" -C \"%s\"", pathtoTar, outdir);
 
    system(tarcmd);
 
    free(tarcmd);
 

	
 
    // exec_blender(distrenjob, pathtoJobfile, pathtoOutput, framenum); // @TODO: Make a xml --> struct function
 
    // exec_blender(distrenjob, pathtoJobfile, pathtoOutput, framenum); // @TODO: Implement the xml --> struct function
 

	
 
    // Consider placing the following in the exec_blender() function
 
    while(busy == 1){
 
      tell_the_server(DISTREN_REQUEST_PROGRESS);
 
        fprintf(stderr, "Rendering frame %d in job %d...",framenum,jobnum);
 
        sleep(5); // or not... this should be more event-driven, but should still give a heartbeat to the server
0 comments (0 inline, 0 general)