Changeset - fc875724cf6f
[Not reviewed]
default
0 4 0
ethanzonca - 16 years ago 2009-09-05 20:14:22

Added various fixes, and added code to discover the number of online processors in the resident system
4 files changed with 8 insertions and 3 deletions:
0 comments (0 inline, 0 general)
TODO
Show inline comments
 
@@ -6,12 +6,13 @@ E-normaldotcom needs to fix this
 
x-finished task
 
=-Long-term goal
 

	
 
Build
 

	
 
Master
 
*-Code dummy data/processes to test the current queueing system / watchdog / etc.
 
*-Add calls to remotio
 
 -Write more meat into the pseudo-code main() to pull everything together
 
 -Write a stub for getting info from the tarball/validifying the tarball. Read distren-job.xml, a file in the tarball, to find out 1. which rendering system to use (that system, e.g. blender/povray, can read more specifics, such as name of file to pass to blender and frames. Options common between different systems will be handled in common as best as possible)
 
 -Write a stub for publishing file and constructing job description so that the job can be shared
 
*-Other XML-writing/reading such as current stats / jobs / data / etc, xml writing for job creation, ...
 
*-charsets: the program should operate in UTF-8. This is partially required by libxml2's (and XML's) usage of UTF-8. We want the program's internal charset to be UTF-8 and figure out if we need w_char/whatever to fulfill UTF-8. I don't believe we do... mabye we just need a declaration that al data stored must be in UTF-8 format.
src/server/slave.c
Show inline comments
 
@@ -126,12 +126,13 @@ char *pathtoTar;     // Full path to the
 
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)
 

	
 
int threads = sysconf(_SC_NPROCESSORS_ONLN); // Equals the number of currently online processors
 
struct distrenjob *myjob; // Structure to hold data gathered from the XML file
 

	
 
// If the slave is getting job info...
 
if(gotframe ==1)
 
  {
 
    /* @TODO: fix these remoteio_read's */
 
@@ -194,13 +195,16 @@ if(gotframe ==1)
 

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

	
 

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

	
 
    // 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
src/server/slavefuncs.c
Show inline comments
 
@@ -361,13 +361,13 @@ return 1; // Success
 

	
 

	
 
/* Executors */
 

	
 

	
 
/** Executor function for Blender operations */
 
void exec_blender(struct distrenjob* distrenjob, char *input, char *output, int frame)
 
void exec_blender(struct distrenjob* distrenjob, char *input, char *output, int frame, int threads)
 
{
 
  int ret;
 
  char *frame_str;
 

	
 
  /* start execio code */
 
  char *command = "blender"; // @TODO: append .exe if win32?
src/server/slavefuncs.h
Show inline comments
 
@@ -31,11 +31,11 @@ size_t curl_writetodisk(void *ptr, size_
 
int curlget(char *url, char *out);
 
int curlpost(char *filename, char *url);
 
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, int frame);
 
void exec_blender(struct distrenjob* distrenjob, char *input, char *output, int frame, int threads);
 
void xmlinit();
 
void xmlcleanup();
 

	
 
#endif
0 comments (0 inline, 0 general)