Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
|
A Tool for running Drmaa jobs. More...
#include <drmaa_tool.h>
Public Member Functions | |
DrmaaTool * | AllocateDrmaaTool (const char *program_name_s, const uuid_t id, GrassrootsServer *grassroots_p) |
Allocate a DrmaaTool to run the given program. More... | |
bool | InitDrmaaTool (DrmaaTool *tool_p, const char *program_name_s, const uuid_t id, GrassrootsServer *grassroots_p) |
Initialise a DrmaaTool to run the given program. More... | |
void | FreeDrmaaTool (DrmaaTool *tool_p) |
Free a DrmaaTool. More... | |
void | ClearDrmaaTool (DrmaaTool *tool_p) |
Clear a DrmaaTool. More... | |
bool | SetDrmaaToolCurrentWorkingDirectory (DrmaaTool *tool_p, const char *path_s) |
Set the current working directory for a DrmaaTool. More... | |
bool | SetDrmaaToolQueueName (DrmaaTool *tool_p, const char *queue_name_s) |
Set the queue name that a DrmaaTool will set for run its program on. More... | |
bool | SetDrmaaToolEnvVars (DrmaaTool *tool_p, const char *env_vars_s) |
Set the environment variables that a DrmaaTool will set when it runs its program. More... | |
bool | SetDrmaaToolCores (DrmaaTool *tool_p, uint32 num_cores) |
Set the number of cores that a DrmaaTool will use when it runs. More... | |
bool | SetDrmaaToolMemory (DrmaaTool *tool_p, uint32 mem) |
Set the amount of memory that a DrmaaTool will set for its program when it runs. More... | |
bool | SetDrmaaToolHostName (DrmaaTool *tool_p, const char *host_name_s) |
Set the host that a DrmaaTool will set for run its program on. More... | |
bool | SetDrmaaToolJobId (DrmaaTool *tool_p, const char *id_s) |
Set the id that represents the job that a DrmaaTool will run. More... | |
bool | SetDrmaaToolJobOutId (DrmaaTool *tool_p, const char *id_s) |
Set the id that represents the job output that a DrmaaTool will run. More... | |
bool | SetDrmaaToolJobName (DrmaaTool *tool_p, const char *job_name_s) |
Set the program that a DrmaaTool will run. More... | |
bool | SetDrmaaToolOutputFilename (DrmaaTool *tool_p, const char *output_name_s) |
Redirect the stdout/stderr streams from a DrmaaTool to a file. More... | |
bool | AddDrmaaToolArgument (DrmaaTool *tool_p, const char *arg_s) |
Add an argument to the program that a DrmaaTool will run. More... | |
bool | RunDrmaaTool (DrmaaTool *tool_p, const bool async_flag, const char *const log_s) |
Run a DrmaaTool. More... | |
OperationStatus | GetDrmaaToolStatus (DrmaaTool *tool_p) |
Get the status of job for a DrmaaTool. More... | |
bool | SetDrmaaToolEmailNotifications (DrmaaTool *tool_p, const char **email_addresses_ss) |
Set the email recipients for any job notifications for a DrmaaTool. More... | |
json_t * | ConvertDrmaaToolToJSON (const DrmaaTool *const tool_p) |
Serialise the DrmaaTool into a JSON fragment. More... | |
DrmaaTool * | ConvertDrmaaToolFromJSON (const json_t *const json_p, GrassrootsServer *grassroots_p) |
Deserialise a DrmaaTool from a JSON fragment. More... | |
unsigned char * | SerialiseDrmaaTool (const DrmaaTool *const job_p, const size_t *size_p) |
Convert a DrmaaTool into a raw unsigned char array for use with the APRJobsManager. More... | |
DrmaaTool * | DeserialiseDrmaaTool (const unsigned char *const data_s) |
Create a DrmaaTool from an unsigned char array. More... | |
A Tool for running Drmaa jobs.
Drmaa is a programmatic way of running jobs on grids, clusters or cloud-based systems. It allows to specify things such as the job to run, what resources it will use, whether to run asynchronously, etc.
DrmaaTool * AllocateDrmaaTool | ( | const char * | program_name_s, |
const uuid_t | id, | ||
GrassrootsServer * | grassroots_p | ||
) |
bool InitDrmaaTool | ( | DrmaaTool * | tool_p, |
const char * | program_name_s, | ||
const uuid_t | id, | ||
GrassrootsServer * | grassroots_p | ||
) |
void FreeDrmaaTool | ( | DrmaaTool * | tool_p | ) |
Free a DrmaaTool.
The DrmaaTool will be cleared and then the memory for the tool will be freed.
tool_p | The DrmaaTool to free. |
void ClearDrmaaTool | ( | DrmaaTool * | tool_p | ) |
bool SetDrmaaToolCurrentWorkingDirectory | ( | DrmaaTool * | tool_p, |
const char * | path_s | ||
) |
Set the current working directory for a DrmaaTool.
tool_p | The DrmaaTool to set the current working directory for. |
path_s | The new current working directory . The DrmaaTool will make a copy of this so the parameter does not need to remain in memory after this call. |
true
if the current working directory was set successfully, false
otherwise. bool SetDrmaaToolQueueName | ( | DrmaaTool * | tool_p, |
const char * | queue_name_s | ||
) |
Set the queue name that a DrmaaTool will set for run its program on.
tool_p | The DrmaaTool to set the queue name for. |
queue_name_s | The queue name to use. The DrmaaTool will make a copy of this so the parameter does not need to remain in memory after this call. |
true
if the queue name was set successfully, false
otherwise. bool SetDrmaaToolEnvVars | ( | DrmaaTool * | tool_p, |
const char * | env_vars_s | ||
) |
Set the environment variables that a DrmaaTool will set when it runs its program.
tool_p | The DrmaaTool to set the environment variables for. |
env_vars_s | The environment variables to use. The DrmaaTool will make a copy of this so the parameter does not need to remain in memory after this call. |
true
if the environment variables were set successfully, false
otherwise. bool SetDrmaaToolCores | ( | DrmaaTool * | tool_p, |
uint32 | num_cores | ||
) |
bool SetDrmaaToolMemory | ( | DrmaaTool * | tool_p, |
uint32 | mem | ||
) |
bool SetDrmaaToolHostName | ( | DrmaaTool * | tool_p, |
const char * | host_name_s | ||
) |
Set the host that a DrmaaTool will set for run its program on.
tool_p | The DrmaaTool to set the hostname for. |
host_name_s | The hostname to use. The DrmaaTool will make a copy of this so the parameter does not need to remain in memory after this call. |
true
if the hostname was set successfully, false
otherwise. bool SetDrmaaToolJobId | ( | DrmaaTool * | tool_p, |
const char * | id_s | ||
) |
bool SetDrmaaToolJobOutId | ( | DrmaaTool * | tool_p, |
const char * | id_s | ||
) |
bool SetDrmaaToolJobName | ( | DrmaaTool * | tool_p, |
const char * | job_name_s | ||
) |
Set the program that a DrmaaTool will run.
tool_p | The DrmaaTool to set the job for. |
job_name_s | The program that this DrmaaTool will run. The DrmaaTool will make a copy of this so the parameter does not need to remain in memory after this call. |
true
if the program was set successfully, false
otherwise. bool SetDrmaaToolOutputFilename | ( | DrmaaTool * | tool_p, |
const char * | output_name_s | ||
) |
Redirect the stdout/stderr streams from a DrmaaTool to a file.
tool_p | The DrmaaTool to redirect the streams for. |
output_name_s | The filename where the streams output will be written to. The DrmaaTool will make a copy of this so the parameter does not need to remain in memory after this call. |
true
if the filename was set successfully, false
otherwise. bool AddDrmaaToolArgument | ( | DrmaaTool * | tool_p, |
const char * | arg_s | ||
) |
Add an argument to the program that a DrmaaTool will run.
tool_p | The DrmaaTool to add the argument for. |
arg_s | The argument to add. The DrmaaTool will make a copy of this so the parameter does not need to remain in memory after this call. |
true
if the argument was added successfully, false
otherwise. bool RunDrmaaTool | ( | DrmaaTool * | tool_p, |
const bool | async_flag, | ||
const char *const | log_s | ||
) |
Run a DrmaaTool.
tool_p | The DrmaaTool to add the argument for. |
async_flag | If this is true then the method will return straight away and the job will continue to run asynchrnously or in the background. If this is false then this method will not return until the job has completed. |
log_s | Optional filename for where to store the id of the Drmaa job that this DrmaaTool runs. If this is NULL , then the id will not be written to a file. |
true
if the job was started successfully, false
otherwise. To get the status of whether the job completed successfully, use GetDrmaaToolStatus
OperationStatus GetDrmaaToolStatus | ( | DrmaaTool * | tool_p | ) |
bool SetDrmaaToolEmailNotifications | ( | DrmaaTool * | tool_p, |
const char ** | email_addresses_ss | ||
) |
json_t * ConvertDrmaaToolToJSON | ( | const DrmaaTool *const | tool_p | ) |
Serialise the DrmaaTool into a JSON fragment.
tool_p | The DrmaaTool. |
NULL
upon error.DrmaaTool * ConvertDrmaaToolFromJSON | ( | const json_t *const | json_p, |
GrassrootsServer * | grassroots_p | ||
) |
Deserialise a DrmaaTool from a JSON fragment.
json_p | The JSON fragment. |
NULL
upon error.unsigned char * SerialiseDrmaaTool | ( | const DrmaaTool *const | job_p, |
const size_t * | size_p | ||
) |
Convert a DrmaaTool into a raw unsigned char array for use with the APRJobsManager.
job_p | The DrmaaTool to serialise. |
size_p | Upon success, the size of the array will be stored here. |
NULL
upon error.DrmaaTool * DeserialiseDrmaaTool | ( | const unsigned char *const | data_s | ) |
Create a DrmaaTool from an unsigned char array.
data_s | The raw serialised data representing a DrmaaTool. |
NULL
upon error.