cctools
batch_job.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3 Copyright (C) 2005- The University of Notre Dame
4 This software is distributed under the GNU General Public License.
5 See the file COPYING for details.
6 */
7 
8 #ifndef BATCH_JOB_H
9 #define BATCH_JOB_H
10 
11 #include <time.h>
12 
21 typedef int batch_job_id_t;
22 
24 typedef enum {
37 
40  time_t submitted;
41  time_t started;
42  time_t finished;
44  int exit_code;
46 };
47 
53 
62 batch_job_id_t batch_job_submit_simple(struct batch_queue *q, const char *cmdline, const char *input_files, const char *output_files);
63 
76 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);
77 
88 
100 batch_job_id_t batch_job_wait_timeout(struct batch_queue *q, struct batch_job_info *info, time_t stoptime);
101 
110 int batch_job_remove(struct batch_queue *q, batch_job_id_t jobid);
111 
117 
123 
130 void batch_queue_set_logfile(struct batch_queue *q, const char *logfile);
131 
143 void batch_queue_set_options(struct batch_queue *q, const char *options);
144 
152 void batch_queue_delete(struct batch_queue *q);
153 
159 const char *batch_queue_type_string();
160 
166 int batch_queue_port(struct batch_queue *q);
167 
168 #endif
batch_queue_type_t batch_queue_type_from_string(const char *str)
Converts a string into a batch queue type.
void batch_queue_delete(struct batch_queue *q)
Delete a batch queue.
int batch_job_remove(struct batch_queue *q, batch_job_id_t jobid)
Remove a batch job.
struct batch_queue * batch_queue_create(batch_queue_type_t type)
Create a new batch queue.
batch_job_id_t batch_job_wait_timeout(struct batch_queue *q, struct batch_job_info *info, time_t stoptime)
Wait for any batch job to complete, with a timeout.
Batch jobs will be sent to the Work Queue.
Definition: batch_job.h:31
time_t started
Time the job actually began executing.
Definition: batch_job.h:41
Batch jobs will be sent to the Moab Workload Manager.
Definition: batch_job.h:29
Batch jobs will be sent to Sun Grid Engine.
Definition: batch_job.h:28
int exit_code
The result code of the job, if it exited normally.
Definition: batch_job.h:44
const char * batch_queue_type_to_string(batch_queue_type_t t)
Converts a batch queue type to a string.
batch_job_id_t batch_job_submit_simple(struct batch_queue *q, const char *cmdline, const char *input_files, const char *output_files)
Submit a simple batch job.
void batch_queue_set_logfile(struct batch_queue *q, const char *logfile)
Set the log file used by the batch queue.
batch_queue_type_t
Indicates which type of batch submission to use.
Definition: batch_job.h:24
Batch jobs will be sent to Hadoop.
Definition: batch_job.h:34
time_t finished
Time at which the job actually completed.
Definition: batch_job.h:42
Batch jobs will be sent to the Work Queue, all files are stored on a shared filesystem.
Definition: batch_job.h:32
batch_job_id_t batch_job_wait(struct batch_queue *q, struct batch_job_info *info)
Wait for any batch job to complete.
int exit_signal
The signal by which the job was killed, if it exited abnormally.
Definition: batch_job.h:45
Batch jobs will be sent to a user-defined cluster manager.
Definition: batch_job.h:30
time_t submitted
Time the job was submitted to the system.
Definition: batch_job.h:40
const char * batch_queue_type_string()
Returns the list of queue types supported by this module.
int batch_job_id_t
An integer type indicating a unique batch job number.
Definition: batch_job.h:21
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)
Submit a batch job.
An invalid batch queue type.
Definition: batch_job.h:25
void batch_queue_set_options(struct batch_queue *q, const char *options)
Add extra options to pass to the underlying batch system.
Definition: batch_job_internal.h:11
Batch jobs will be sent to the MPI Queue.
Definition: batch_job.h:35
Batch jobs will be sent to Condor pool.
Definition: batch_job.h:27
int batch_queue_port(struct batch_queue *q)
Returns the port number of the batch queue.
Describes a batch job when it has completed.
Definition: batch_job.h:39
int exited_normally
Non-zero if the job ran to completion, zero otherwise.
Definition: batch_job.h:43
Batch jobs will run as local processes.
Definition: batch_job.h:26
Batch jobs will be sent to the Xgrid.
Definition: batch_job.h:33