00001
00002
00003
00004
00005
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_XGRID
00031 } batch_queue_type_t;
00032
00034 struct batch_job_info {
00035 time_t submitted;
00036 time_t started;
00037 time_t finished;
00038 int exited_normally;
00039 int exit_code;
00040 int exit_signal;
00041 };
00042
00047 struct batch_queue * batch_queue_create( batch_queue_type_t type );
00048
00057 batch_job_id_t batch_job_submit_simple(
00058 struct batch_queue *q,
00059 const char *cmdline,
00060 const char *input_files,
00061 const char *output_files );
00062
00075 batch_job_id_t batch_job_submit(
00076 struct batch_queue *q,
00077 const char *cmd,
00078 const char *args,
00079 const char *infile,
00080 const char *outfile,
00081 const char *errfile,
00082 const char *extra_input_files,
00083 const char *extra_output_files );
00084
00094 batch_job_id_t batch_job_wait( struct batch_queue *q, struct batch_job_info *info );
00095
00107 batch_job_id_t batch_job_wait_timeout( struct batch_queue *q, struct batch_job_info *info, time_t stoptime );
00108
00117 int batch_job_remove( struct batch_queue *q, batch_job_id_t jobid );
00118
00123 batch_queue_type_t batch_queue_type_from_string( const char *str );
00124
00129 const char * batch_queue_type_to_string( batch_queue_type_t t );
00130
00137 void batch_queue_set_logfile( struct batch_queue *q, const char *logfile );
00138
00150 void batch_queue_set_options( struct batch_queue *q, const char *options );
00151
00159 void batch_queue_delete( struct batch_queue *q );
00160
00166 const char * batch_queue_type_string();
00167
00173 int batch_queue_port( struct batch_queue *q );
00174
00175 #endif