cctools
batch_queue.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3 Copyright (C) 2024 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 <sys/stat.h>
12 
13 #include <inttypes.h>
14 #include <stdint.h>
15 #include <time.h>
16 
17 #include "batch_job.h"
18 #include "batch_file.h"
19 #include "batch_job_info.h"
20 #include "batch_wrapper.h"
21 
22 #include "jx.h"
23 #include "rmsummary.h"
24 
62 typedef int64_t batch_queue_id_t;
63 
64 #define PRIbjid PRId64
65 #define SCNbjid SCNd64
66 
68 typedef enum {
85 
92 struct batch_queue *batch_queue_create(batch_queue_type_t type, const char *ssl_key_file, const char *ssl_cert_file );
93 
102 
114 
127 batch_queue_id_t batch_queue_wait_timeout(struct batch_queue *q, struct batch_job_info *info, time_t stoptime);
128 
137 
143 
149 
156 void batch_queue_set_logfile(struct batch_queue *q, const char *logfile);
157 
170 void batch_queue_set_option(struct batch_queue *q, const char *what, const char *value);
171 
180 void batch_queue_set_feature(struct batch_queue *q, const char *what, const char *value);
181 
187 void batch_queue_set_int_option(struct batch_queue *q, const char *what, int value);
188 
196 const char *batch_queue_get_option(struct batch_queue *q, const char *what);
197 
203 int batch_queue_option_is_yes (struct batch_queue *q, const char *what);
204 
212 const char *batch_queue_supports_feature (struct batch_queue *q, const char *what);
213 
214 
221 
230 
236 
242 
243 #endif
Describes a single input or output file of a batch job.
Represents a single batch job.
void batch_queue_set_feature(struct batch_queue *q, const char *what, const char *value)
Expresses support for feature in the underlying batch system.
const char * batch_queue_type_to_string(batch_queue_type_t t)
Converts a batch queue type to a string.
int batch_queue_remove(struct batch_queue *q, batch_queue_id_t jobid)
Remove a batch job.
const char * batch_queue_get_option(struct batch_queue *q, const char *what)
Get batch queue options.
batch_queue_id_t batch_queue_wait(struct batch_queue *q, struct batch_job_info *info)
Wait for any batch job to complete.
void batch_queue_set_logfile(struct batch_queue *q, const char *logfile)
Set the log file used by the batch queue.
int batch_queue_option_is_yes(struct batch_queue *q, const char *what)
Check if option is set to yes.
batch_queue_id_t batch_queue_wait_timeout(struct batch_queue *q, struct batch_job_info *info, time_t stoptime)
Wait for any batch job to complete, with a timeout.
int batch_queue_port(struct batch_queue *q)
Returns the port number of the batch queue.
batch_queue_type_t batch_queue_get_type(struct batch_queue *q)
Get batch queue type.
struct batch_queue * batch_queue_create(batch_queue_type_t type, const char *ssl_key_file, const char *ssl_cert_file)
Create a new batch queue.
int64_t batch_queue_id_t
An integer type indicating a unique batch job number.
Definition: batch_queue.h:62
const char * batch_queue_type_string()
Returns the list of queue types supported by this module.
void batch_queue_set_int_option(struct batch_queue *q, const char *what, int value)
As batch_queue_set_option, but allowing an integer argument.
batch_queue_type_t
Indicates which type of batch submission to use.
Definition: batch_queue.h:68
@ BATCH_QUEUE_TYPE_LOCAL
Batch jobs will run as local processes.
Definition: batch_queue.h:69
@ BATCH_QUEUE_TYPE_WORK_QUEUE
Batch jobs will be sent to Work Queue manager.
Definition: batch_queue.h:72
@ BATCH_QUEUE_TYPE_CLUSTER
Batch jobs will be sent to a user-defined cluster manager.
Definition: batch_queue.h:75
@ BATCH_QUEUE_TYPE_AMAZON
Batch jobs will be run inside Amazon EC2 Instances.
Definition: batch_queue.h:80
@ BATCH_QUEUE_TYPE_CONDOR
Batch jobs will be sent to Condor pool.
Definition: batch_queue.h:70
@ BATCH_QUEUE_TYPE_PBS
Batch jobs will be send to the PBS scheduler.
Definition: batch_queue.h:77
@ BATCH_QUEUE_TYPE_LSF
Batch jobs will be sent to the LSF scheduler.
Definition: batch_queue.h:78
@ BATCH_QUEUE_TYPE_TORQUE
Batch jobs will be send to the Torque scheduler.
Definition: batch_queue.h:79
@ BATCH_QUEUE_TYPE_DRYRUN
Batch jobs will not actually run.
Definition: batch_queue.h:82
@ BATCH_QUEUE_TYPE_UGE
Batch jobs will be sent to Univa Grid Engine.
Definition: batch_queue.h:73
@ BATCH_QUEUE_TYPE_VINE
Batch jobs will be sent to TaskVine manager.
Definition: batch_queue.h:71
@ BATCH_QUEUE_TYPE_K8S
Batch jobs will be run inside Kubernetes pods.
Definition: batch_queue.h:81
@ BATCH_QUEUE_TYPE_MOAB
Batch jobs will be sent to the Moab Workload Manager.
Definition: batch_queue.h:76
@ BATCH_QUEUE_TYPE_UNKNOWN
An invalid batch queue type.
Definition: batch_queue.h:83
@ BATCH_QUEUE_TYPE_SLURM
Batch jobs will be send to the SLURM scheduler.
Definition: batch_queue.h:74
batch_queue_type_t batch_queue_type_from_string(const char *str)
Converts a string into a batch queue type.
batch_queue_id_t batch_queue_submit(struct batch_queue *q, struct batch_job *task)
Submit a batch job.
void batch_queue_set_option(struct batch_queue *q, const char *what, const char *value)
Add extra options to pass to the underlying batch system.
void batch_queue_delete(struct batch_queue *q)
Delete a batch queue.
const char * batch_queue_supports_feature(struct batch_queue *q, const char *what)
Get batch queue feature.
Wrapper operators for transforming batch jobs.
JSON Expressions (JX) library.
Describes a batch job when it has completed.
Definition: batch_job_info.h:13
Internal description of a single batch job submitted to a queue.
Definition: batch_job.h:27
Definition: batch_queue_internal.h:38