Changeset - e74139e8f884
[Not reviewed]
Merge default
0 1 0
Nathan Brink (binki) - 16 years ago 2009-06-29 23:06:25
ohnobinki@ohnopublishing.net
merge
1 file changed with 18 insertions and 43 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -18,7 +18,7 @@
 

	
 
*/
 

	
 
#include <stdio.h>
 
/* 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 <stdio.h>
 
#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;
0 comments (0 inline, 0 general)