Changeset - 03f549da3f73
[Not reviewed]
default
0 3 0
ethanzonca - 16 years ago 2009-08-26 20:29:39

Added xml-function calls to the slave, removed resolution from exec_blender()
3 files changed with 18 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/server/slave.c
Show inline comments
 
@@ -129,8 +129,11 @@ char *pathtoTar; // Full path to the loc
 

	
 
char *urltoOutput;   // Full URL where output is posted
 
char *pathtoJobfile; // Full path to the job's main file
 
char *pathtoXml;     // Full path to the job's xml file
 
char *pathtoOutput;  // Full path to the output (rendered) file
 

	
 
struct distrenjob *myjob; // Structure to hold data gathered from the XML file
 

	
 
// If the slave is getting job info...
 
if(gotframe ==1)
 
  {
 
@@ -150,6 +153,7 @@ if(gotframe ==1)
 

	
 
    _distren_asprintf(&pathtoJobfile, "%s/%s/job.blend", datadir, jobdatapath ); // Prepares the path to the jobfile
 
    _distren_asprintf(&urltoOutput, "http://protofusion.org/distren/stor/job%d/output/", jobdatapath ); // Prepares the URL where output is posted
 
    _distren_asprintf(&pathtoXml, "%s/job%d/job%d.xml",datadir, jobnum ); // Prepares the path to the job's XML file
 
    _distren_asprintf(&pathtoOutput, "%s/job%d/output/frame%d.%s", datadir, jobnum, framenum, outputExt ); // Prepares the path to the jobfile
 

	
 
    //  Download the data if it isn't  present. (prevents re-downloading for same-job frames) @TODO: Delete old job data
 
@@ -169,7 +173,17 @@ if(gotframe ==1)
 
    system(tarcmd);
 
    free(tarcmd);
 

	
 
    // exec_blender(distrenjob, pathtoJobfile, pathtoOutput, framenum); // @TODO: Implement the xml --> struct function
 
    // Grabs data from the XML file, throws it in the myjob struct.
 
    if(xml2distrenjob(&myjob, pathtoXml) == 0){
 
      fprintf(stderr,"Well, the XML craziness may have worked. Maybe. \n");
 
      distrenjob_free(&myjob); // Frees things up if it was successful. xml2distrenjob() really only fails if malloc'ing inside it fails
 
    }
 
    else{
 
      fprintf(stderr,"I think the XML craziness may have failed, so I'll terminate just for fun.\n");
 
      return 1;
 
    }
 

	
 
    exec_blender(&myjob, pathtoJobfile, pathtoOutput, framenum); // @TODO: Implement the xml --> struct function
 

	
 
    // Consider placing the following in the exec_blender() function
 
    while(busy == 1){
 
@@ -178,7 +192,7 @@ if(gotframe ==1)
 
        sleep(5); // or not... this should be more event-driven, but should still give a heartbeat to the server
 
      }
 
    busy = 2;
 
    busy = 1; // When done rendering, set this.
 
    busy = 1; // @TODO: When done rendering, set this.
 
     }
 
    // When blender is finished, run this...
 
      if(busy==2){
src/server/slavefuncs.c
Show inline comments
 
@@ -340,7 +340,7 @@ return 1; // Success
 
*/
 

	
 
/** Executor function for Blender operations */
 
void exec_blender(struct distrenjob* distrenjob, char *input, char *output, char *outputres, int frame)
 
void exec_blender(struct distrenjob* distrenjob, char *input, char *output, int frame)
 
{
 
  int ret;
 
  char *frame_str;
src/server/slavefuncs.h
Show inline comments
 
@@ -34,7 +34,7 @@ int ssh_keygen();
 
int register_user(char *username, char *email);
 
int login_user(char *username);
 
int conf_replace(char *username);
 
void exec_blender(struct distrenjob* distrenjob, char *input, char *output, char *outputres, int frame);
 
void exec_blender(struct distrenjob* distrenjob, char *input, char *output, int frame);
 
void xmlinit();
 
void xmlcleanup();
 

	
0 comments (0 inline, 0 general)