Structure of a client program

The structure of a client program is very close to the structure of a usual DIET client. The general algorithm is as follow:

diet_initialize

create the workflow profile

call the method diet_wf_call

if success retrieve the results

free the workflow profile

diet_finalize

The following tables describe the methods provided by the DIET workflow API. The table 15.1 contains the main methods that are common to the DAG workflows API and to the functional workflows API. The table 15.2 contains the methods that are specific to the DAG API. The table 15.3 contains the methods that are specific to the functional workflows API.


Table 15.1: DIET workflow common API
Workflow function Description
diet_wf_desc_t*
diet_wf_profile_alloc(const char* wf_file_name, const char* wf_name, wf_level_t wf_level);
allocates a workflow profile to be used for a workflow submission.
wf_file_name : the file name containing the workflow XML description. wf_name : the name of the workflow (used for logs) wf_level : specifier for workflow type (DAG or FUNCTIONAL)
void
diet_wf_profile_free(diet_wf_desc_t * profile);
frees the workflow profile.
diet_error_t
diet_wf_call(diet_wf_desc_t* wf_profile);
executes the workflow associated to profile wf_profile.
int
diet_wf_print_results(diet_wf_desc_t * profile,const char* filename);
prints all the results of the current executed workflow or DAG in the provided file or on the standard output if it is left empty.
 



Table 15.2: DIET workflow DAG-specific API
Workflow function Description
int
diet_wf_scalar_get(const char * id, void** value);
retrieves a workflow scalar result.
id : the output port identifier.
int
diet_wf_string_get(const char * id, char** value);
retrieves a workflow string result.
id : the output port identifier.
int
diet_wf_file_get(const char * id, size_t* size, char** path);
retrieves a workflow file result.
id : the output port identifier.
int
diet_wf_matrix_get(id, (void**)value, nb_rows, nb_cols, order);
retrieves a workflow matrix result.
id : the output port identifier.
 



Table 15.3: DIET workflow Functional-specific API
Workflow function Description
void
diet_wf_set_data_file(
diet_wf_desc_t * profile,
const char * data_file_name);
specifies the file containing the data description used to generate the workflow
void
diet_wf_set_transcript_file(
diet_wf_desc_t * profile,
const char * transcript_file_name);
specifies the file containing the tasks status and data (used to restart a DAG or workflow)
int
diet_wf_save_data_file(
diet_wf_desc_t * profile,
const char * data_file_name);
saves the input and output data description ('source' and 'sink' nodes) in XML format. The file can be used as input data file for another workflow execution.
int
diet_wf_save_transcript_file(
diet_wf_desc_t * profile,
const char * transcript_file_name);
saves the transcript of the current workflow (list of tasks with their status and data). This file can be used as input transcript file for another workflow execution (tasks already done with output data still available on the platform will not be executed again)
int
diet_wf_sink_get(
diet_wf_desc_t* wf_profile,
const char * id, char** dataID;
gets a container (DAGDA data) containing all the data received by a 'sink' node
 


The DIET Team - Mer 29 nov 2017 15:13:36 EST