Changeset - 8489c0f926e6
[Not reviewed]
Merge default
0 2 0
ethanzonca - 16 years ago 2009-08-08 15:17:00

2 files changed with 14 insertions and 22 deletions:
0 comments (0 inline, 0 general)
configure.ac
Show inline comments
 
@@ -45,7 +45,7 @@ AC_TYPE_SIZE_T
 

	
 
PKG_PROG_PKG_CONFIG(0.17.2)
 

	
 
PKG_CHECK_MODULES(DISTLIBS, libconfuse >= 2.6 libcurl)
 
PKG_CHECK_MODULES(DISTLIBS, libconfuse >= 2.6 libcurl libxml-2.0)
 
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
 

	
 
AC_DEFINE_DIR([SYSCONFDIR], [sysconfdir], [Directory to find configuration files in])
src/server/distrend.c
Show inline comments
 
@@ -163,7 +163,6 @@ void remotio_send_to_client()
 
}
 
/** Fill variables after crash / shutdown from XML dumps */
 
void start_data(){
 

	
 
	if(1 == 0){
 
		// retrieve total_finished_jobs and total_finished_frames from xml file
 
	}
 
@@ -173,7 +172,7 @@ void start_data(){
 
	}
 
}
 

	
 
// **** Finish-Setter: Sets a frame to the "completed" status.
 
/** Finish-Setter: Sets a frame to the "completed" status.*/
 
void finish_frame(struct blendjob *blendjob, int frame){
 
  blendjob->frameset[frame].status = 2;
 
  blendjob->frameset[frame].time_to_render = (clock() - blendjob[jobnum].frameset[frame].start_time); // Consider changing time-to-render to time-for-frame or something?
 
@@ -182,7 +181,7 @@ void finish_frame(struct blendjob *blend
 
}
 

	
 

	
 
// **** Queuer: Adds files to the queue
 
/** Queuer: Adds files to the queue */
 
void queue(struct blendjob *blendjob, int type, char *name, char *submitter, char *email, int priority, int mode, int spp, struct frameset *frameset) {
 
	// Type: 1 = blender, add more types later
 
	// jobnum is the next available job number
 
@@ -293,7 +292,7 @@ void status_report_generator(struct blen
 
}
 

	
 

	
 
// **** Structure Builder: This function creates frame array based on the total number of frames to be rendered, which will then be parsed by function frame_farmer.
 
/** Structure Builder: This function creates frame array based on the total number of frames to be rendered, which will then be parsed by function frame_farmer. */
 
void frame_num_struct_builder(struct blendjob *job, unsigned int startframe, unsigned int numframes) {
 
  int jobnum_new = highest_jobnum + 1; /* global vars will someday leave us  */
 
  unsigned int counter;
 
@@ -387,6 +386,7 @@ int frame_finder(struct blendjob *head, 
 
  return 0;
 
}
 

	
 
/** Checks for dying slaves */
 
void blend_frame_watchdog(struct blendjob *blendjob_head)
 
{
 
  unsigned short int watchdog_forgiveness; /*< seconds to wait on a frame before re-assigning it */
 
@@ -511,7 +511,7 @@ int distrend_config_free(struct distrend
 
int main(int argc, char *argv[])
 
{
 

	
 
  /* TODO: Put some arg-grabbing code here */
 
  /* @TODO: Put some arg-grabbing code here */
 

	
 
  struct blendjob *head;
 

	
 
@@ -519,6 +519,8 @@ int main(int argc, char *argv[])
 
  struct distrend_listenset *listenset;
 
  struct distrend_config *config;
 

	
 
  start_data(); // Starts fresh or loads data from xml dump
 

	
 
  enum clientstatus
 
  {
 
    CLIENTSTATUS_UNINITIALIZED = 0,
 
@@ -541,10 +543,7 @@ int main(int argc, char *argv[])
 
      distrend_accept(&action);
 
      cont = distrend_do(action);
 

	
 

	
 
      /* Somewhat Pseudo-code for basic server operation, should be more event-driven */
 

	
 
      start_data();
 
      /* Make the following code more event-driven */
 
      status_report_generator(&head);
 
      blend_frame_watchdog(head);
 

	
 
@@ -552,33 +551,26 @@ int main(int argc, char *argv[])
 
      struct frameset *frame;
 
      struct blendjob *job;
 

	
 
      /* If the client is idle (meaning a client without the "busy" status connected via ssh), all clients should be idle by default. */
 
      /* If the client is idle, must be modified for climbing through linked list of clients (client->clientnum) */
 
      if(clientstatus == CLIENTSTATUS_IDLE)
 
	{
 
	  /**
 
	      normaldotcom: learn about ``return by pointer''
 
	  */
 
	  int returnnum = frame_finder(head, &job, &frame); // give framefinder args, framefinder should return job number and frame number somehow
 
	  int returnnum = frame_finder(head, &job, &frame); // Finds a frame to render
 
	  if(returnnum)
 
	    {
 
	      fprintf(stderr,"No frames are available to render at this time");
 
	      fprintf(stderr,"No frames are available to render at this time. Idling...\n");
 
	      sleep(10);
 
	    }
 
	  else
 
	    /* returnnum == 0 */
 
	    remotio_send_to_client(frame->num, job->jobnum); // Did you actually make this function, ohnobinki? --normaldotcom
 
	    remotio_send_to_client(frame->num, job->jobnum); // Pseudo-sends data to client
 
	}
 

	
 
      /* If the client states that they finished the frame */
 
      	if(clientsays == DISTREN_REQUEST_DONEFRAME){
 
      		clientstatus = CLIENTSTATUS_IDLE; // Sets the client back to idle
 
      		// finish_frame(jobnum, framenumprevious); // make it finish the previous frame or something, why framenumprevios? Is that the whole linked list thing coming in?
 
      		finish_frame(head, jobnum); // @TODO: update so it fits the purpose of the previous line
 
      	  finish_frame(head, frame->num); // @TODO: Check that finish_frame really gets the jobnum somehow
 
      	}
 

	
 
      /* End Somewhat Pseudo-code */
 

	
 

	
 
      distrend_action_free(action);
 
    }
 

	
0 comments (0 inline, 0 general)