batch_queue.h
Go to the documentation of this file.
/*
Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
Copyright (C) 2024 The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file COPYING for details.
*/
#ifndef BATCH_JOB_H
#define BATCH_JOB_H
#include <sys/stat.h>
#include <inttypes.h>
#include <stdint.h>
#include <time.h>
#include "batch_job.h"
#include "batch_file.h"
#include "batch_job_info.h"
#include "batch_wrapper.h"
#include "jx.h"
#include "rmsummary.h"
typedef int64_t batch_queue_id_t;
#define PRIbjid PRId64
#define SCNbjid SCNd64
typedef enum {
BATCH_QUEUE_TYPE_LOCAL,
BATCH_QUEUE_TYPE_CONDOR,
BATCH_QUEUE_TYPE_VINE,
BATCH_QUEUE_TYPE_WORK_QUEUE,
BATCH_QUEUE_TYPE_UGE,
BATCH_QUEUE_TYPE_SLURM,
BATCH_QUEUE_TYPE_CLUSTER,
BATCH_QUEUE_TYPE_MOAB,
BATCH_QUEUE_TYPE_PBS,
BATCH_QUEUE_TYPE_LSF,
BATCH_QUEUE_TYPE_TORQUE,
BATCH_QUEUE_TYPE_AMAZON,
BATCH_QUEUE_TYPE_K8S,
BATCH_QUEUE_TYPE_FLUX,
BATCH_QUEUE_TYPE_DRYRUN,
BATCH_QUEUE_TYPE_UNKNOWN = -1
} batch_queue_type_t;
struct batch_queue *batch_queue_create(batch_queue_type_t type, const char *ssl_key_file, const char *ssl_cert_file );
batch_queue_id_t batch_queue_submit(struct batch_queue *q, struct batch_job *task );
batch_queue_id_t batch_queue_wait(struct batch_queue *q, struct batch_job_info *info);
batch_queue_id_t batch_queue_wait_timeout(struct batch_queue *q, struct batch_job_info *info, time_t stoptime);
int batch_queue_remove(struct batch_queue *q, batch_queue_id_t jobid);
batch_queue_type_t batch_queue_type_from_string(const char *str);
const char *batch_queue_type_to_string(batch_queue_type_t t);
void batch_queue_set_logfile(struct batch_queue *q, const char *logfile);
void batch_queue_set_option(struct batch_queue *q, const char *what, const char *value);
void batch_queue_set_feature(struct batch_queue *q, const char *what, const char *value);
void batch_queue_set_int_option(struct batch_queue *q, const char *what, int value);
const char *batch_queue_get_option(struct batch_queue *q, const char *what);
int batch_queue_option_is_yes (struct batch_queue *q, const char *what);
const char *batch_queue_supports_feature (struct batch_queue *q, const char *what);
batch_queue_type_t batch_queue_get_type(struct batch_queue *q);
void batch_queue_delete(struct batch_queue *q);
const char *batch_queue_type_string();
int batch_queue_port(struct batch_queue *q);
#endif
batch_file.h
Describes a single input or output file of a batch job.
batch_job.h
Represents a single batch job.
batch_queue_create
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.
batch_queue_type_string
const char * batch_queue_type_string()
Returns the list of queue types supported by this module.
batch_queue_set_feature
void batch_queue_set_feature(struct batch_queue *q, const char *what, const char *value)
Expresses support for feature in the underlying batch system.
batch_queue_type_to_string
const char * batch_queue_type_to_string(batch_queue_type_t t)
Converts a batch queue type to a string.
batch_queue_remove
int batch_queue_remove(struct batch_queue *q, batch_queue_id_t jobid)
Remove a batch job.
batch_queue_supports_feature
const char * batch_queue_supports_feature(struct batch_queue *q, const char *what)
Get batch queue feature.
batch_queue_wait
batch_queue_id_t batch_queue_wait(struct batch_queue *q, struct batch_job_info *info)
Wait for any batch job to complete.
batch_queue_get_option
const char * batch_queue_get_option(struct batch_queue *q, const char *what)
Get batch queue options.
batch_queue_set_logfile
void batch_queue_set_logfile(struct batch_queue *q, const char *logfile)
Set the log file used by the batch queue.
batch_queue_option_is_yes
int batch_queue_option_is_yes(struct batch_queue *q, const char *what)
Check if option is set to yes.
batch_queue_wait_timeout
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.
batch_queue_port
int batch_queue_port(struct batch_queue *q)
Returns the port number of the batch queue.
batch_queue_get_type
batch_queue_type_t batch_queue_get_type(struct batch_queue *q)
Get batch queue type.
batch_queue_id_t
int64_t batch_queue_id_t
An integer type indicating a unique batch job number.
Definition batch_queue.h:62
batch_queue_set_int_option
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
batch_queue_type_t
Indicates which type of batch submission to use.
Definition batch_queue.h:68
BATCH_QUEUE_TYPE_LOCAL
@ BATCH_QUEUE_TYPE_LOCAL
Batch jobs will run as local processes.
Definition batch_queue.h:69
BATCH_QUEUE_TYPE_WORK_QUEUE
@ BATCH_QUEUE_TYPE_WORK_QUEUE
Batch jobs will be sent to Work Queue manager.
Definition batch_queue.h:72
BATCH_QUEUE_TYPE_CLUSTER
@ 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_QUEUE_TYPE_AMAZON
Batch jobs will be run inside Amazon EC2 Instances.
Definition batch_queue.h:80
BATCH_QUEUE_TYPE_CONDOR
@ BATCH_QUEUE_TYPE_CONDOR
Batch jobs will be sent to Condor pool.
Definition batch_queue.h:70
BATCH_QUEUE_TYPE_PBS
@ BATCH_QUEUE_TYPE_PBS
Batch jobs will be send to the PBS scheduler.
Definition batch_queue.h:77
BATCH_QUEUE_TYPE_LSF
@ BATCH_QUEUE_TYPE_LSF
Batch jobs will be sent to the LSF scheduler.
Definition batch_queue.h:78
BATCH_QUEUE_TYPE_TORQUE
@ BATCH_QUEUE_TYPE_TORQUE
Batch jobs will be send to the Torque scheduler.
Definition batch_queue.h:79
BATCH_QUEUE_TYPE_DRYRUN
@ BATCH_QUEUE_TYPE_DRYRUN
Batch jobs will not actually run.
Definition batch_queue.h:83
BATCH_QUEUE_TYPE_UGE
@ BATCH_QUEUE_TYPE_UGE
Batch jobs will be sent to Univa Grid Engine.
Definition batch_queue.h:73
BATCH_QUEUE_TYPE_VINE
@ BATCH_QUEUE_TYPE_VINE
Batch jobs will be sent to TaskVine manager.
Definition batch_queue.h:71
BATCH_QUEUE_TYPE_K8S
@ BATCH_QUEUE_TYPE_K8S
Batch jobs will be run inside Kubernetes pods.
Definition batch_queue.h:81
BATCH_QUEUE_TYPE_MOAB
@ BATCH_QUEUE_TYPE_MOAB
Batch jobs will be sent to the Moab Workload Manager.
Definition batch_queue.h:76
BATCH_QUEUE_TYPE_UNKNOWN
@ BATCH_QUEUE_TYPE_UNKNOWN
An invalid batch queue type.
Definition batch_queue.h:84
BATCH_QUEUE_TYPE_SLURM
@ BATCH_QUEUE_TYPE_SLURM
Batch jobs will be send to the SLURM scheduler.
Definition batch_queue.h:74
BATCH_QUEUE_TYPE_FLUX
@ BATCH_QUEUE_TYPE_FLUX
Batch jobs will be run on Flux.
Definition batch_queue.h:82
batch_queue_type_from_string
batch_queue_type_t batch_queue_type_from_string(const char *str)
Converts a string into a batch queue type.
batch_queue_submit
batch_queue_id_t batch_queue_submit(struct batch_queue *q, struct batch_job *task)
Submit a batch job.
batch_queue_set_option
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.
batch_queue_delete
void batch_queue_delete(struct batch_queue *q)
Delete a batch queue.
batch_wrapper.h
Wrapper operators for transforming batch jobs.
jx.h
JSON Expressions (JX) library.
batch_job_info
Describes a batch job when it has completed.
Definition batch_job_info.h:13
batch_job
Internal description of a single batch job submitted to a queue.
Definition batch_job.h:27
batch_queue
Definition batch_queue_internal.h:38