cctools
|
Represents a single batch job. More...
Go to the source code of this file.
Data Structures | |
struct | batch_job |
Internal description of a single batch job submitted to a queue. More... | |
Functions | |
struct batch_job * | batch_job_create (struct batch_queue *queue) |
Create a batch_job struct. | |
void | batch_job_delete (struct batch_job *t) |
Delete a batch_job struct. | |
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. | |
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 (struct batch_job *t, const char *command) |
Set the command of the batch_job. | |
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. | |
void | batch_job_wrap_command (struct batch_job *t, const char *command) |
Wrap the existing command with a template string. | |
void | batch_job_set_resources (struct batch_job *t, const struct rmsummary *resources) |
Set the resources needed for task. | |
void | batch_job_set_envlist (struct batch_job *t, struct jx *envlist) |
Set the envlist for this task. | |
void | batch_job_set_info (struct batch_job *t, struct batch_job_info *info) |
Set the batch_job_info of this task. | |
char * | batch_job_generate_id (struct batch_job *t) |
Generate a sha1 hash based on the specified task. | |
Represents a single batch job.
A batch_job describes a single batch job to be submitted to a batch queue using batch_queue_submit. This structure should not be manipulated manually, but created with batch_job_create and then elaborated with batch_job_set_command batch_job_add_input_file , batch_job_add_output_file and similar methods. This level of details permits the underlying system to appropriately manage the data used by each job. Once submitted to a queue, the batch_job object may be deleted.
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 | ||
) |
Add file to input list of batch_job Creates a new batch_file from outer_name and inner_name.
This newly created file is add to input_files. For clarifications on outer_name, inner_name, and their uses see batch_file.
task | The batch_job this file is being added to. |
outer_name | The name of the file at submission/host site. |
inner_name | The name of the file at execution site. |
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.
This newly created file is add to output_files. For clarifications on outer_name, inner_name, and their uses see batch_file.
task | The batch_job this file is being added to. |
outer_name | The name of the file at submission/host site. |
inner_name | The name of the file at execution site. |
void batch_job_set_command | ( | struct batch_job * | t, |
const char * | command | ||
) |
Set the batch task's command to the given JX command spec.
The JX command spec is first expanded, and replaces the batch task's previous command.
t | The batch_job to be updated. |
command | The spec to use. |
void batch_job_wrap_command | ( | struct batch_job * | t, |
const char * | command | ||
) |
Wrap the existing command with a template string.
This uses string_wrap_command to wrap command, see stringtools.h for details. This function allocates a new string with the result and free the previous command. Does not free passed command. Will use wrapper interface in future.
t | The batch_job whose command is being wrapped. |
command | The command template that will wrap existing command. |
Set the resources needed for task.
This function will make a copy of full copy of resources using rmsummary_copy().
t | The batch_job requiring specified resources. |
resources | A rmsummary specifying required resources. |
Set the envlist for this task.
This function will make a copy using jx_copy of envlist.
t | The batch_job using this environment. |
envlist | The jx_object specifying the environment. |
void batch_job_set_info | ( | struct batch_job * | t, |
struct batch_job_info * | info | ||
) |
Set the batch_job_info of this task.
Performs simple copy into already allocated memory.
t | The batch_job that was completed. |
info | The batch_job_info of the completed task. |
char * batch_job_generate_id | ( | struct batch_job * | t | ) |
Generate a sha1 hash based on the specified task.
Includes Command, Input files contents, Output files names Future improvement should include the Environment
t | The batch_job whose checksum will be generated. |