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_LOCAL,               
00027         BATCH_QUEUE_TYPE_CONDOR,              
00028         BATCH_QUEUE_TYPE_SGE,                 
00029         BATCH_QUEUE_TYPE_MOAB,                
00030         BATCH_QUEUE_TYPE_TORQUE,              
00031         BATCH_QUEUE_TYPE_CLUSTER,                
00032         BATCH_QUEUE_TYPE_WORK_QUEUE,          
00033         BATCH_QUEUE_TYPE_WORK_QUEUE_SHAREDFS, 
00034         BATCH_QUEUE_TYPE_XGRID,               
00035         BATCH_QUEUE_TYPE_HADOOP,              
00036         BATCH_QUEUE_TYPE_MPI_QUEUE            
00037 } batch_queue_type_t;
00038 
00039 
00041 struct batch_job_info {
00042         time_t submitted;       
00043         time_t started;         
00044         time_t finished;        
00045         int exited_normally;    
00046         int exit_code;          
00047         int exit_signal;        
00048 };
00049 
00054 struct batch_queue *batch_queue_create(batch_queue_type_t type);
00055 
00060 struct work_queue *batch_queue_get_work_queue(struct batch_queue *q);
00061 
00070 batch_job_id_t batch_job_submit_simple(struct batch_queue *q, const char *cmdline, const char *input_files, const char *output_files);
00071 
00084 batch_job_id_t batch_job_submit(struct batch_queue *q, const char *cmd, const char *args, const char *infile, const char *outfile, const char *errfile, const char *extra_input_files, const char *extra_output_files);
00085 
00095 batch_job_id_t batch_job_wait(struct batch_queue *q, struct batch_job_info *info);
00096 
00108 batch_job_id_t batch_job_wait_timeout(struct batch_queue *q, struct batch_job_info *info, time_t stoptime);
00109 
00118 int batch_job_remove(struct batch_queue *q, batch_job_id_t jobid);
00119 
00124 batch_queue_type_t batch_queue_type_from_string(const char *str);
00125 
00130 const char *batch_queue_type_to_string(batch_queue_type_t t);
00131 
00138 void batch_queue_set_logfile(struct batch_queue *q, const char *logfile);
00139 
00151 void batch_queue_set_options(struct batch_queue *q, const char *options);
00152 
00159 char *batch_queue_options(struct batch_queue *q);
00160 
00166 batch_queue_type_t batch_queue_get_type(struct batch_queue *q);
00167 
00168 
00176 void batch_queue_delete(struct batch_queue *q);
00177 
00183 const char *batch_queue_type_string();
00184 
00190 int batch_queue_port(struct batch_queue *q);
00191 
00192 int batch_job_enable_caching(struct batch_queue * q);
00193 int batch_job_disable_caching(struct batch_queue * q);
00194 
00195 #endif

Generated on 10 Apr 2014 for cctools by  doxygen 1.6.1