Changeset - bcef1af0e63b
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-12-11 11:38:21
ez@ethanzonca.com
Warning-laden remotio additions
1 file changed with 5 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/server/slave.c
Show inline comments
 
@@ -94,53 +94,55 @@ int main(int argc, char *argv[])
 
    else
 
      {
 
	fprintf(stderr, "Please check your distrenslave.conf, it appears to be incorrectly formatted.\n");
 
      }
 

	
 

	
 
  int jobnum = 0;
 
  int framenum = 0;
 

	
 
  char *urltoTar;      /* Full URL to the server-side location of job#.tgz */
 
  char *pathtoTar;     /* Full path to the location of the job#.tgz */
 

	
 
  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 */
 
  char *outputExt;     /* Output Extension (e.g., JPG) */
 

	
 
  char *tarcmd;        /* Command to run for tar. Migrate to libtar sometime */
 
  char *outdir;        /* Output Directory for tar */
 
  char *jobdatapath;   /* Path to job data */
 

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

	
 
  struct remoteio *comm_slave; /* Structures for remotio */
 
  struct remoteio_opts *comm_slaveoptions;
 
  struct remoteio_opts *comm_slaveopts = {"ssh"};
 

	
 
  struct execio *remoteExec;
 
  struct remoteio *comm_slave = {0, comm_slaveopts, remoteExec}; /* Structures for remotio */
 

	
 
  fprintf(stderr,"Connecting to server...\n");
 
  remoteio_open(&comm_slave, comm_slaveoptions, "protofusion" );
 
  remoteio_open(&comm_slave, comm_slaveopts, "protofusion" );
 

	
 
  int haveWork = 0;
 

	
 
  while(1)
 
    {
 

	
 
    // request work
 
    fprintf(stderr,"Requesting work...\n");
 
    sendSignal(comm_slave, DISTREN_REQUEST_GETWORK);
 

	
 
    /* If we got a frame */
 
    if(haveWork)
 
      {
 

	
 
        fprintf(stderr,"Got work from server...\n");
 
        /* @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 */
 
        //framenum = remoteio_read(jobnum); /* Set framenum from remoteio */
 

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

	
 
        // Variable Preparation
 
        _distren_asprintf(&jobdatapath, "job%d", jobnum);
 
        _distren_asprintf(&urltoTar, "http://protofusion.org/distren/stor/job%d/job%d.tar.gz", jobnum); // Prepares URL to download from
0 comments (0 inline, 0 general)