# HG changeset patch # User ethanzonca # Date 2009-09-05 20:14:22 # Node ID fc875724cf6f1df537fdba51fec2b3c04b39a3e0 # Parent 6ca6d2672c6c380643baf75e13da8f98693c27fb Added various fixes, and added code to discover the number of online processors in the resident system diff --git a/TODO b/TODO --- a/TODO +++ b/TODO @@ -9,6 +9,7 @@ x-finished task 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) diff --git a/src/server/slave.c b/src/server/slave.c --- a/src/server/slave.c +++ b/src/server/slave.c @@ -129,6 +129,7 @@ char *pathtoXml; // Full path to the 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... @@ -197,7 +198,10 @@ if(gotframe ==1) _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){ diff --git a/src/server/slavefuncs.c b/src/server/slavefuncs.c --- a/src/server/slavefuncs.c +++ b/src/server/slavefuncs.c @@ -364,7 +364,7 @@ return 1; // Success /** 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; diff --git a/src/server/slavefuncs.h b/src/server/slavefuncs.h --- a/src/server/slavefuncs.h +++ b/src/server/slavefuncs.h @@ -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, int frame); +void exec_blender(struct distrenjob* distrenjob, char *input, char *output, int frame, int threads); void xmlinit(); void xmlcleanup();