batch_job.h
Go to the documentation of this file.
/*
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_TASK_H
#define BATCH_TASK_H
#include "list.h"
#include "jx.h"
#include "rmsummary.h"
struct batch_queue;
struct batch_file;
struct batch_job {
int taskid;
int jobid;
struct batch_queue *queue;
char *command;
struct list *input_files;
struct list *output_files;
struct rmsummary *resources;
struct jx *envlist;
struct batch_job_info *info;
char *hash;
};
struct batch_job *batch_job_create(struct batch_queue *queue );
void batch_job_delete(struct batch_job *t);
struct batch_file * batch_job_add_input_file(struct batch_job *task, const char * outer_name, const char * inner_name);
struct batch_file * batch_job_add_output_file(struct batch_job *task, const char * outer_name, const char * inner_name);
void batch_job_set_command(struct batch_job *t, const char *command);
void batch_job_set_command_spec(struct batch_job *t, struct jx *command);
void batch_job_wrap_command(struct batch_job *t, const char *command);
void batch_job_set_resources(struct batch_job *t, const struct rmsummary *resources);
void batch_job_set_envlist(struct batch_job *t, struct jx *envlist);
void batch_job_set_info(struct batch_job *t, struct batch_job_info *info);
char * batch_job_generate_id(struct batch_job *t);
#endif
/* vim: set noexpandtab tabstop=8: */
batch_job_create
struct batch_job * batch_job_create(struct batch_queue *queue)
Create a batch_job struct.
batch_job_generate_id
char * batch_job_generate_id(struct batch_job *t)
Generate a sha1 hash based on the specified task.
batch_job_set_info
void batch_job_set_info(struct batch_job *t, struct batch_job_info *info)
Set the batch_job_info of this task.
batch_job_set_envlist
void batch_job_set_envlist(struct batch_job *t, struct jx *envlist)
Set the envlist for this task.
batch_job_add_output_file
struct batch_file * batch_job_add_output_file(struct batch_job *task, const char *outer_name, const char *inner_name)
Add file to output list of batch_job Creates a new batch_file from outer_name and inner_name.
batch_job_set_command_spec
void batch_job_set_command_spec(struct batch_job *t, struct jx *command)
Set the batch task's command to the given JX command spec.
batch_job_add_input_file
struct batch_file * batch_job_add_input_file(struct batch_job *task, const char *outer_name, const char *inner_name)
Add file to input list of batch_job Creates a new batch_file from outer_name and inner_name.
batch_job_wrap_command
void batch_job_wrap_command(struct batch_job *t, const char *command)
Wrap the existing command with a template string.
batch_job_set_command
void batch_job_set_command(struct batch_job *t, const char *command)
Set the command of the batch_job.
batch_job_delete
void batch_job_delete(struct batch_job *t)
Delete a batch_job struct.
batch_job_set_resources
void batch_job_set_resources(struct batch_job *t, const struct rmsummary *resources)
Set the resources needed for task.
jx.h
JSON Expressions (JX) library.
list.h
Robust, reentrant linked list structure.
batch_file
Internal description of a single file used by a batch job.
Definition batch_file.h:28
batch_file::outer_name
char * outer_name
The name of the file in the submitters filesystem namespace.
Definition batch_file.h:29
batch_file::inner_name
char * inner_name
The name of the file as it should appear to the running job.
Definition batch_file.h:30
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_job::hash
char * hash
Checksum based on CMD, input contents, and output names.
Definition batch_job.h:37
batch_job::envlist
struct jx * envlist
JSON formatted environment list.
Definition batch_job.h:35
batch_job::output_files
struct list * output_files
Task's expected outputs, type batch_file.
Definition batch_job.h:33
batch_job::info
struct batch_job_info * info
Stores the info struct created by batch_queue.
Definition batch_job.h:36
batch_job::command
char * command
The command line to execute.
Definition batch_job.h:31
batch_job::queue
struct batch_queue * queue
The queue this task is assigned to.
Definition batch_job.h:30
batch_job::input_files
struct list * input_files
Task's required inputs, type batch_file.
Definition batch_job.h:32
batch_job::resources
struct rmsummary * resources
Resources assigned to task.
Definition batch_job.h:34
batch_job::taskid
int taskid
Indicates the id provided by the creating system.
Definition batch_job.h:28
batch_job::jobid
int jobid
Indicates the id assigned to the job by the submission system.
Definition batch_job.h:29
batch_queue
Definition batch_queue_internal.h:38
jx
JX value representing any expression type.
Definition jx.h:117
rmsummary
Definition rmsummary.h:27