batch_job.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
00003 Copyright (C) 2005- The University of Notre Dame
00004 This software is distributed under the GNU General Public License.
00005 See the file COPYING for details.
00006 */
00007 
00008 #ifndef BATCH_JOB_H
00009 #define BATCH_JOB_H
00010 
00011 #include <time.h>
00012 
00021 typedef int batch_job_id_t;
00022 
00024 typedef enum {
00025         BATCH_QUEUE_TYPE_UNKNOWN=-1, 
00026         BATCH_QUEUE_TYPE_UNIX,       
00027         BATCH_QUEUE_TYPE_CONDOR,     
00028         BATCH_QUEUE_TYPE_SGE,        
00029         BATCH_QUEUE_TYPE_WORK_QUEUE  
00030 } batch_queue_type_t;
00031 
00033 struct batch_job_info {
00034         time_t submitted;       
00035         time_t started;         
00036         time_t finished;        
00037         int exited_normally;    
00038         int exit_code;          
00039         int exit_signal;        
00040 };
00041 
00046 struct batch_queue * batch_queue_create( batch_queue_type_t type );
00047 
00056 batch_job_id_t batch_job_submit_simple(
00057         struct batch_queue *q,
00058         const char *cmdline,
00059         const char *input_files,
00060         const char *output_files );
00061 
00074 batch_job_id_t batch_job_submit(
00075         struct batch_queue *q,
00076         const char *cmd,
00077         const char *args,
00078         const char *infile,
00079         const char *outfile,
00080         const char *errfile,
00081         const char *extra_input_files,
00082         const char *extra_output_files );
00083 
00093 batch_job_id_t batch_job_wait( struct batch_queue *q, struct batch_job_info *info );
00094 
00106 batch_job_id_t batch_job_wait_timeout( struct batch_queue *q, struct batch_job_info *info, time_t stoptime );
00107 
00116 int batch_job_remove( struct batch_queue *q, batch_job_id_t jobid );
00117 
00122 batch_queue_type_t batch_queue_type_from_string( const char *str );
00123 
00128 const char * batch_queue_type_to_string( batch_queue_type_t t );
00129 
00136 void batch_queue_set_logfile( struct batch_queue *q, const char *logfile );
00137 
00149 void batch_queue_set_options( struct batch_queue *q, const char *options );
00150 
00158 void batch_queue_delete( struct batch_queue *q );
00159 
00160 #endif

Generated on Fri Jan 8 15:30:02 2010 for cctools by  doxygen 1.6.1