cctools
batch_task.h
1 /*
2 Copyright (C) 2018- The University of Notre Dame
3 This software is distributed under the GNU General Public License.
4 See the file COPYING for details.
5 */
6 
7 #ifndef BATCH_TASK_H
8 #define BATCH_TASK_H
9 
10 #include "batch_file.h"
11 #include "list.h"
12 #include "sha1.h"
13 #include "jx.h"
14 #include "rmsummary.h"
15 
16 struct batch_task {
17  int taskid; /* Indicates the id provided by the creating system. I.E. Makeflow */
18  int jobid; /* Indicates the id assigned to the job by the submission system. */
19 
20  struct batch_queue *queue; /* The queue this task is assigned to. */
21 
22  char *command; /* The command line to execute. */
23 
24  struct list *input_files; /* Task's required inputs, type batch_file */
25  struct list *output_files; /* Task's expected outputs, type batch_file */
26 
27  struct rmsummary *resources; /* Resources assigned to task */
28 
29  struct jx *envlist; /* JSON formatted environment list */
30 
31  struct batch_job_info *info; /* Stores the info struct created by batch_job. */
32 
33  char *hash; /* Checksum based on CMD, input contents, and output names. */
34 };
35 
40 struct batch_task *batch_task_create(struct batch_queue *queue );
41 
46 void batch_task_delete(struct batch_task *t);
47 
57 struct batch_file * batch_task_add_input_file(struct batch_task *task, const char * outer_name, const char * inner_name);
58 
68 struct batch_file * batch_task_add_output_file(struct batch_task *task, const char * outer_name, const char * inner_name);
69 
75 void batch_task_set_command(struct batch_task *t, const char *command);
76 
83 void batch_task_set_command_spec(struct batch_task *t, struct jx *command);
84 
92 void batch_task_wrap_command(struct batch_task *t, const char *command);
93 
99 void batch_task_set_resources(struct batch_task *t, const struct rmsummary *resources);
100 
106 void batch_task_set_envlist(struct batch_task *t, struct jx *envlist);
107 
113 void batch_task_set_info(struct batch_task *t, struct batch_job_info *info);
114 
121 char * batch_task_generate_id(struct batch_task *t);
122 
123 #endif
124 /* vim: set noexpandtab tabstop=4: */
Definition: batch_file.h:20
Definition: batch_task.h:16
Robust, reentrant linked list structure.
JSON Expressions (JX) library.
Definition: rmsummary.h:26
Definition: batch_job_internal.h:50
Routines for computing SHA1 checksums.
JX value representing any expression type.
Definition: jx.h:115
Describes a batch job when it has completed.
Definition: batch_job.h:58