ZOO-Project
Data Structures | Functions
service_internal_hpc.c File Reference
#include "service_internal_hpc.h"
#include "response_print.h"
#include "server_internal.h"
#include "service_callback.h"
#include "mimetypes.h"
#include <sys/un.h>

Data Structures

struct  local_params
 Parameter definition to be used for sending parameters to a thread. More...
 

Functions

void addNestedOutputs (service **s)
 Add nested outputs to every outputs that is geographic format. More...
 
int addReadLocks (maps **conf)
 Acquire a read lock on every files used as input for executing a service. More...
 
int removeReadLocks (maps **conf)
 Remove all read locks set for files used as input for executing the service. More...
 
char * getConfiguration (maps **conf, maps **inputs, const char *confId)
 Get the section name depending on number of features and/or pixels of each inputs and the threshold defined in a section. More...
 
int zoo_hpc_support (maps **main_conf, map *request, service *s, maps **real_inputs, maps **real_outputs)
 Load and run a HPC Application corresponding to the service. More...
 

Data Structure Documentation

struct local_params

Parameter definition to be used for sending parameters to a thread.

Data Fields
maps * conf the main configuration file
char * local_file
json_object * res the JSON object to post
int state the current state [0,1]
int step the current step [0,6]
char * target_file
map * url the callback url maps

Function Documentation

void addNestedOutputs ( service **  s)

Add nested outputs to every outputs that is geographic format.

See also
isGeographic
Parameters
sthe service current definition
int addReadLocks ( maps **  conf)

Acquire a read lock on every files used as input for executing a service.

Parameters
confthe main configuration file map
Returns
0 if every file can be locked, -1 if one lock has failed.
char* getConfiguration ( maps **  conf,
maps **  inputs,
const char *  confId 
)

Get the section name depending on number of features and/or pixels of each inputs and the threshold defined in a section.

It supposes that your inputs has been published using MapServer support, implying that the number of features (nb_features), respectively pixels (nb_pixels), are defined. The section, identified by confId, should contain preview_max_features and preview_max_pixels defining the threshold values.

Parameters
confthe main configuration file maps pointer
inputsthe inputs maps pointer
confIdthe section identifier
Returns
"preview_conf" in case the numbers are lower than the threshold, "fullres_conf" in other cases.
int removeReadLocks ( maps **  conf)

Remove all read locks set for files used as input for executing the service.

Parameters
confthe main configuration maps pointer
Returns
0 in case of success, -1 if any error occured. In case of error, one can refer to the message map array from the lenv section.
int zoo_hpc_support ( maps **  main_conf,
map request,
service s,
maps **  real_inputs,
maps **  real_outputs 
)

Load and run a HPC Application corresponding to the service.

Parameters
main_confthe conf maps containing the main.cfg settings
requestthe map containing the HTTP request
sthe service structure
real_inputsthe maps containing the inputs
real_outputsthe maps containing the outputs
Returns
SERVICE_SUCCEEDED in case of success, -1 or SERVICE_FAILED when failing.