Changeset - 063d7fe1a866
[Not reviewed]
default
0 1 0
ethanzonca@localhost.localdomain - 16 years ago 2009-11-23 21:40:36
ethanzonca@localhost.localdomain
Slave updates
1 file changed with 16 insertions and 11 deletions:
0 comments (0 inline, 0 general)
src/server/slave.c
Show inline comments
 
@@ -84,7 +84,6 @@ int main(int argc, char *argv[])
 
  int jobnum;          /* The job number that we're currently working */
 
  int framenum;        /* @TODO: Remotio should fill this */
 

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

	
 
  char *urltoTar;      /* Full URL to the server-side location of job#.tgz */
 
@@ -102,15 +101,13 @@ int main(int argc, char *argv[])
 

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

	
 
  /* If the server says that every frame for the last jobnum is finished,
 
   * OR if the data is getting old
 
   */
 
  if(1 == 0){
 
    delete_jobdata(jobnum, datadir);
 
  }
 
  int cont = 1;
 
  int framesInLocalQueue = 1;
 
  
 
  while(cont)
 
    {
 
  /* If we got a frame */
 
  if(gotframe != 0)
 
    if(framesInLocalQueue > 0)
 
    {
 
      /* @TODO: Add remotio hooks */
 
      // jobnum = remoteio_read(jobnum); /* Set jobnum from remoteio (we could use info from struct, but we need this info to download the xmlfile */
 
@@ -118,7 +115,7 @@ int main(int argc, char *argv[])
 
      //framenum = remoteio_read(jobnum); /* Set framenum from remoteio */
 
      framenum = 0;
 

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

	
 
      /**
 
	 Variable Preparation
 
@@ -168,14 +165,16 @@ int main(int argc, char *argv[])
 
	}
 

	
 
      /* Variable-fillers which require XML */
 
      outputExt = myjob->output_format; /* @TODO: FIXME! <-- NEVER! */
 
        outputExt = myjob->output_format; /* @TODO: FIXME! <-- I WILL! */
 
      /* Prepares the path to the jobfile */
 
      _distren_asprintf(&pathtoOutput, "%s/job%d/output/job%d-frame%d.%s", datadir, jobnum, jobnum, framenum, outputExt );
 

	
 

	
 
      /** Series of ifs for jobtype based on xml content */
 
      if(1 == 1)
 
        while(1 == 1){
 
	exec_blender(myjob, pathtoJobfile, pathtoOutput, framenum); /* @TODO: This warning should be fixed :D */
 
          break;
 
        }
 

	
 
      /* When blender is finished, run this... */
 
      fprintf(stderr, "Finished frame %d in job %d, uploading...", framenum, jobnum);
 
@@ -183,8 +182,14 @@ int main(int argc, char *argv[])
 
      tell_the_server(DISTREN_REQUEST_DONEFRAME); /* Tells the server that it's finished rendering this frame */
 
      busy = 0;
 
      /* Slave now becomes idle, doesn't need to tell the server anything, ssh handles this. */
 
        framesInLocalQueue--;
 
    }
 

	
 
    // If the server says that every frame for the last jobnum is finished, OR if the data is getting old
 
    if(1 == 0){
 
      delete_jobdata(jobnum, datadir);
 
    }
 
  }
 

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