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 <sys/stat.h>
00012 
00013 #include <inttypes.h>
00014 #include <stdint.h>
00015 #include <time.h>
00016 
00025 typedef int64_t batch_job_id_t;
00026 #define PRIbjid  PRId64
00027 #define SCNbjid  SCNd64
00028 
00030 /* Must be kept in sync with batch_job_subsystems. */
00031 typedef enum {
00032         BATCH_QUEUE_TYPE_LOCAL,               
00033         BATCH_QUEUE_TYPE_CONDOR,              
00034         BATCH_QUEUE_TYPE_SGE,                 
00035         BATCH_QUEUE_TYPE_MOAB,                
00036         BATCH_QUEUE_TYPE_TORQUE,              
00037         BATCH_QUEUE_TYPE_CLUSTER,             
00038         BATCH_QUEUE_TYPE_WORK_QUEUE,          
00039         BATCH_QUEUE_TYPE_WORK_QUEUE_SHAREDFS, 
00040         BATCH_QUEUE_TYPE_XGRID,               
00041         BATCH_QUEUE_TYPE_HADOOP,              
00042         BATCH_QUEUE_TYPE_MPI_QUEUE,           
00043         BATCH_QUEUE_TYPE_CHIRP,               
00044         BATCH_QUEUE_TYPE_UNKNOWN = -1         
00045 } batch_queue_type_t;
00046 
00048 struct batch_job_info {
00049         time_t submitted;    
00050         time_t started;      
00051         time_t finished;     
00052         int exited_normally; 
00053         int exit_code;       
00054         int exit_signal;     
00055 };
00056 
00061 struct batch_queue *batch_queue_create(batch_queue_type_t type);
00062 
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 
00083 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);
00084 
00093 batch_job_id_t batch_job_wait(struct batch_queue *q, struct batch_job_info *info);
00094 
00105 batch_job_id_t batch_job_wait_timeout(struct batch_queue *q, struct batch_job_info *info, time_t stoptime);
00106 
00114 int batch_job_remove(struct batch_queue *q, batch_job_id_t jobid);
00115 
00116 int batch_fs_chdir (struct batch_queue *q, const char *path);
00117 int batch_fs_getcwd (struct batch_queue *q, char *buf, size_t size);
00118 int batch_fs_mkdir (struct batch_queue *q, const char *path, mode_t mode, int recursive);
00119 int batch_fs_putfile (struct batch_queue *q, const char *lpath, const char *rpath);
00120 int batch_fs_stat (struct batch_queue *q, const char *path, struct stat *buf);
00121 int batch_fs_unlink (struct batch_queue *q, const char *path);
00122 
00127 batch_queue_type_t batch_queue_type_from_string(const char *str);
00128 
00133 const char *batch_queue_type_to_string(batch_queue_type_t t);
00134 
00141 void batch_queue_set_logfile(struct batch_queue *q, const char *logfile);
00142 
00155 void batch_queue_set_option(struct batch_queue *q, const char *what, const char *value);
00156 
00164 const char *batch_queue_get_option(struct batch_queue *q, const char *what);
00165 
00171 batch_queue_type_t batch_queue_get_type(struct batch_queue *q);
00172 
00180 void batch_queue_delete(struct batch_queue *q);
00181 
00186 const char *batch_queue_type_string();
00187 
00192 int batch_queue_port(struct batch_queue *q);
00193 
00194 #endif

Generated on 6 Aug 2014 for cctools by  doxygen 1.6.1