# HG changeset patch # User ethanzonca@localhost.localdomain # Date 2009-06-29 22:37:16 # Node ID bf4b6305c396790b2682610d2e13e3d6862b6efa # Parent 29260fa99dfad46d48550f2d56b60897a2df20a1 Minor edits diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -18,7 +18,7 @@ */ -#include +/* This file contains the code which both processes (renders) jobs as a slave, and the code which distributes frames to slaves after receiving them from the client portion of the codebase. */ /* Just some notes -- Ethan Zonca * ++ Make data availible for other apps to parse @@ -26,18 +26,18 @@ * Upload while rendering */ +#include #define max 100 // maximum number of stored jobs in memory, per job type (lux/blend). Eventually we can dump this data to disk, or atleast the remainder not in memory... int jobnum = 0; // Structures for storing job information -// tweak char lengths to save on mem? struct { char *name; char *submitter; char *email; int priority; - struct frameset **frameset; // array of frames as big as the total number of frames. Every value should be null/0 to start out with. Values can be changed to reflect frame render status. + struct frameset **frameset; // What exactly is this now? hehe } blendjob[max]; struct { @@ -45,7 +45,7 @@ struct { char *submitter; char *email; int priority; - int mode; // 0 = Static Render, stop at Spp, or infinity if spp is null? Framerange is ignored.; 1 = animation, stop at Spp and stay in framerange. + int mode; // 0 = Static Render, stop at Spp, or infinity if spp is null. Framerange is ignored || 1 = animation, stop at Spp and stay in framerange. int spp; struct frameset ** frameset; } luxjob[max]; @@ -53,25 +53,22 @@ struct { - int main(int argc, char *argv[]) { - - - -// frame[frame] Assignments: -// "0" - cancelled -// "1" - unassigned -// "2" - assigned to slave -// "3" - completed by slave and uploaded -// Have a script crawl through each job in the arrays, ordered by priority?, and assign a certain number of frames to each slave. -// Then we will need some sort of watchdog to monitor slaves on the main server to check for stales. - +/* + frame[frame] Assignments: + "0" - cancelled + "1" - unassigned + "2" - assigned to slave + "3" - completed by slave and uploaded + Have a script crawl through each job in the arrays, ordered by priority?, and assign a certain number of frames to each slave. + Then we will need some sort of watchdog to monitor slaves on the main server to check for stales. +*/ // Queuer: this function should add files to the queue -// Type: 0 = blender, 1 = lux +// Type: 0 = blender, 1 = luxrender // jobnum is the current job number void queue(int type, char *name, char *submitter, char *email, int priority, int mode, int spp, struct frameset **frameset) { @@ -97,25 +94,17 @@ if(type == 2){ else{ // Throw error. } - jobnum++; } - - - - - - - - ///////////////////////// SLAVE /////////////////////////////// -// Slave listens on server for a command in the format of each function... -// We need if's for returns... ==> watchdog - +/* +Slave listens on server for a command in the format of each function... +We need if's for returns... ==> watchdog +*/ // Executors @@ -140,20 +129,6 @@ void exec_luxrender_anim(char *input, ch ret = execv ("/usr/bin/luxrender", cmd); } - void exec_imagemagick (char *input, char *output, char *opts) { - int ret; - char *cmd[] = { "imagemagick", "-something", "something", "something", (char *)0 }; - ret = execv ("/usr/bin/imagemagick", cmd); -} - - - - - - - - - return 0;