Changeset - 7eabd89b211a
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-06-29 00:37:36

More edits, execs, etc.
1 file changed with 37 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -89,11 +89,11 @@ int main(int argc, char *argv[])
 

	
 

	
 

	
 
/* Blender Rendering Code:
 
/* The (mostly psuedo) Blender Rendering Code, by Ethan Zonca:
 

	
 
/////////////////////// MASTER ///////////////////////////////
 

	
 
// MySQL Setup Code (put in common maybe)
 
// MySQL Setup Code (put in common maybe). Even though you don't want to use mysql, I'm going to write it anyway. Clients can be compiled without mysql...
 
#include <mysql.h>
 
MYSQL *conn;
 
MYSQL_RES *res;
 
@@ -115,24 +115,53 @@ void queue(char *filename, int priority,
 
 
 
// Todo... store frame status in mysql tables, along with table with list of jobs/submitters/contact info/whatever else we want
 

	
 
/* Create a table with a row for each job, and a column for each frame. Rows will be ordered by priority. Each cell will have a status of
 
 * "0" - cancelled
 
 * "1" - not queued
 
 * "2" - queued / assigned to slave
 
 * "3" - completed by slave and uploaded
 
// Have a script crawl through each job, ordered by priority, and assign a certain number of frames
 
// to each slave. Then we will need some sort of watchdog to monitor slaves.
 

	
 

	
 
/*
 

	
 
}
 

	
 

	
 

	
 
///////////////////////// SLAVE ///////////////////////////////
 

	
 
// Slave listens on server for a command in the format of each function...
 
// We need if's for returns... ==> watchdog
 

	
 
// Execution Function
 
void blendrend(char *input, char *output, int sframe, int eframe) {
 

	
 

	
 
// Executors
 

	
 
void exec_blender(char *input, char *output, int sframe, int eframe) {
 
  int ret;
 
  char *cmd[] = { "blender", "-b", "-o", output, input, "-s", sframe, "-e", eframe, (char *)0 };
 
  ret = execv ("/usr/bin/blender", cmd);
 
  // fprintf(stderr, "blender -b -o %s %s -s %d -e %d \n",output,input,sframe,eframe); 
 
}
 
blendrend(input,output,100, 206); // arbitrary example referencing the function
 

	
 
void exec_luxrender_single(char *input, char *output) {
 
  int ret;
 
  char *cmd[] = { "luxrender", "-something", "something", "something", (char *)0 };
 
  ret = execv {"/usr/bin/luxrender", cmd);
 
}
 

	
 

	
 
void exec_luxrender_anim(char *input, char *output, int sframe, int eframe, int spp) {
 
// spp is samples per pixel limitation on each frame
 
  int ret;
 
  char *cmd[] = { "luxrender", "-something", "something", "something", (char *)0 };
 
  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);
 
}
 

	
 
 */
0 comments (0 inline, 0 general)