cctools
batch_job.h
Go to the documentation of this file.
1/*
2Copyright (C) 2024 The University of Notre Dame
3This software is distributed under the GNU General Public License.
4See the file COPYING for details.
5*/
6
7#ifndef BATCH_TASK_H
8#define BATCH_TASK_H
9
10#include "list.h"
11#include "jx.h"
12#include "rmsummary.h"
13
23struct batch_queue;
24struct batch_file;
25
27struct batch_job {
28 int taskid;
29 int jobid;
31 char *command;
32 struct list *input_files;
33 struct list *output_files;
35 struct jx *envlist;
37 char *hash;
38};
39
45
51
61struct batch_file * batch_job_add_input_file(struct batch_job *task, const char * outer_name, const char * inner_name);
62
72struct batch_file * batch_job_add_output_file(struct batch_job *task, const char * outer_name, const char * inner_name);
73
79void batch_job_set_command(struct batch_job *t, const char *command);
80
87void batch_job_set_command_spec(struct batch_job *t, struct jx *command);
88
96void batch_job_wrap_command(struct batch_job *t, const char *command);
97
103void batch_job_set_resources(struct batch_job *t, const struct rmsummary *resources);
104
110void batch_job_set_envlist(struct batch_job *t, struct jx *envlist);
111
117void batch_job_set_info(struct batch_job *t, struct batch_job_info *info);
118
126
127#endif
128/* vim: set noexpandtab tabstop=8: */
struct batch_job * batch_job_create(struct batch_queue *queue)
Create a batch_job struct.
char * batch_job_generate_id(struct batch_job *t)
Generate a sha1 hash based on the specified task.
void batch_job_set_info(struct batch_job *t, struct batch_job_info *info)
Set the batch_job_info of this task.
void batch_job_set_envlist(struct batch_job *t, struct jx *envlist)
Set the envlist for this task.
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.
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.
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.
void batch_job_wrap_command(struct batch_job *t, const char *command)
Wrap the existing command with a template string.
void batch_job_set_command(struct batch_job *t, const char *command)
Set the command of the batch_job.
void batch_job_delete(struct batch_job *t)
Delete a batch_job struct.
void batch_job_set_resources(struct batch_job *t, const struct rmsummary *resources)
Set the resources needed for task.
JSON Expressions (JX) library.
Robust, reentrant linked list structure.
Internal description of a single file used by a batch job.
Definition batch_file.h:28
char * outer_name
The name of the file in the submitters filesystem namespace.
Definition batch_file.h:29
char * inner_name
The name of the file as it should appear to the running job.
Definition batch_file.h:30
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
char * hash
Checksum based on CMD, input contents, and output names.
Definition batch_job.h:37
struct jx * envlist
JSON formatted environment list.
Definition batch_job.h:35
struct list * output_files
Task's expected outputs, type batch_file.
Definition batch_job.h:33
struct batch_job_info * info
Stores the info struct created by batch_queue.
Definition batch_job.h:36
char * command
The command line to execute.
Definition batch_job.h:31
struct batch_queue * queue
The queue this task is assigned to.
Definition batch_job.h:30
struct list * input_files
Task's required inputs, type batch_file.
Definition batch_job.h:32
struct rmsummary * resources
Resources assigned to task.
Definition batch_job.h:34
int taskid
Indicates the id provided by the creating system.
Definition batch_job.h:28
int jobid
Indicates the id assigned to the job by the submission system.
Definition batch_job.h:29
Definition batch_queue_internal.h:38
JX value representing any expression type.
Definition jx.h:117
Definition rmsummary.h:27