Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Job Manager RSL Utilities

Job Manager RSL Utilities. More...

Functions

globus_rsl_t * globus_gram_job_manager_rsl_merge (globus_rsl_t *base_rsl, globus_rsl_t *override_rsl)
 Merge two sets of RSL relations. More...
 
globus_bool_t globus_gram_job_manager_rsl_attribute_exists (globus_rsl_t *rsl, const char *attribute)
 Attribute exists in an RSL. More...
 
int globus_gram_rsl_add_output (globus_gram_jobmanager_request_t *request, globus_rsl_t *rsl, const char *attribute, const char *value)
 Add an output attribute to an RSL. More...
 
int globus_gram_rsl_add_stream_out (globus_gram_jobmanager_request_t *request, globus_rsl_t *rsl, const char *source, const char *destination)
 Add a stage out value to the RSL. More...
 
int globus_gram_job_manager_rsl_env_add (globus_rsl_t *ast_node, const char *var, const char *value)
 Add an environment variable to the job RSL. More...
 
int globus_gram_job_manager_rsl_remove_attribute (globus_rsl_t *rsl, char *attribute)
 Remove an RSL attribute. More...
 

Detailed Description

Job Manager RSL Utilities.

Function Documentation

globus_bool_t globus_gram_job_manager_rsl_attribute_exists ( globus_rsl_t *  rsl,
const char *  attribute 
)

Attribute exists in an RSL.

Check to see if an RSL attribute exists in the given RSL.

Parameters
rslRSL parse tree to search
attributeAttribute name to search for.
Return values
GLOBUS_TRUEAttribute exists in the RSL.
GLOBUS_FALSEAttribute does not exist in the RSL.
int globus_gram_job_manager_rsl_env_add ( globus_rsl_t *  ast_node,
const char *  var,
const char *  value 
)

Add an environment variable to the job RSL.

This function adds a single environment variable to the job RSL. If there is no environment relation in the RSL, then one is added. Both the variable name and value are copied into the RSL, so the original values passed in may be static strings or pointers to data which is freed or overwritten once this function returns.

Parameters
ast_nodeA pointer to the RSL tree to update. This should point to the root of the rsl tree (the boolean &) on the invocation of the function, but will point to various relations in the RSL as it calls itself recursively.
varA pointer to a string containing the variable to be added to the RSL. No checking is done to see if this environment variable is already defined in the RSL. This will be duplicated and inserted into the RSL.
valueThe value of the environment variable named var. This will be duplicated and inserted into the RSL.
Return values
0The environment variable was added to the RSL.
1The ast_node points to a relation other than an environment relation
2The ast_node points to some unexpected part of the RSL.
Todo:
Remove old values of var if it is already in the RSL's environment attribute's value.
globus_rsl_t* globus_gram_job_manager_rsl_merge ( globus_rsl_t *  base_rsl,
globus_rsl_t *  override_rsl 
)

Merge two sets of RSL relations.

Create a new RSL consisting of the merging of the base_rsl and override_rsl. The result after completion is one RSL containing all of the relations from the base_rsl and the override_rsl with any conflicting definitions resolved by the override_rsl winning. The base_rsl and override_rsl are unmodified in this process.

int globus_gram_job_manager_rsl_remove_attribute ( globus_rsl_t *  rsl,
char *  attribute 
)

Remove an RSL attribute.

Remove an RSL attribute from and RSL tree.

Parameters
rslThe RSL parse tree to modify
attributeThe name of the attribute to remove from the RSL. The attribute and it's values will be freed.
Return values
GLOBUS_SUCCESSSuccess
GLOBUS_GRAM_PROTOCOL_ERROR_BAD_RSLBad RSL
int globus_gram_rsl_add_output ( globus_gram_jobmanager_request_t *  request,
globus_rsl_t *  rsl,
const char *  attribute,
const char *  value 
)

Add an output attribute to an RSL.

This function modifies the rsl parameter, adding a new relation of the form: attribute = ( value ) This function assumes that the specified attribute is not present in the RSL when called. Unlike the globus_rsl library, this function copies the attribute and value strings as needed to keep it so the RSL can be freed by calling globus_rsl_free_recursive().

Parameters
requestJob request
rslRSL to modify
attributeAttribute (either stdout or stderr)
valueLocal output path
Return values
GLOBUS_SUCCESSSuccess
GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILEDMalloc failed
int globus_gram_rsl_add_stream_out ( globus_gram_jobmanager_request_t *  request,
globus_rsl_t *  rsl,
const char *  source,
const char *  destination 
)

Add a stage out value to the RSL.

Creates a new entry in the RSL's filestreamout value list for the given (source, destination) pair. If the RSL does not contain filestageout, it is added; otherwise, the new pair is prepended to the existing list.

Parameters
requestJob request
rslRSL to modify
sourceSource URL
destinationDestination URL
Return values
GLOBUS_SUCCESSSuccess
GLOBUS_GRAM_PROTOCOL_ERROR_MALLOC_FAILEDMalloc failed