14 #define _XOPEN_SOURCE 700
24 #include "sion_error_handler.h"
35 if (sion_apidesc == NULL) {
36 _sion_errorprint(SION_NOT_SUCCESS,_SION_ERROR_RETURN,
"cannot allocate apidescriptor structure of size %lu (sion_apidesc), aborting ...\n", (
unsigned long)
sizeof(
_sion_generic_apidesc));
52 int rc = SION_SUCCESS;
54 if (sion_apidesc == NULL) {
55 return(_sion_errorprint(SION_NOT_SUCCESS,_SION_ERROR_RETURN,
"_sion_generic_init_apidesc: cannot initalized, data structure is not allocated, aborting ...\n"));
57 sion_apidesc->aid = -1;
58 sion_apidesc->name = NULL;
59 sion_apidesc->level=SION_GENERIC_API_LEVEL_NONE;
60 sion_apidesc->create_lcg_cb = NULL;
61 sion_apidesc->free_lcg_cb = NULL;
62 sion_apidesc->barrier_cb = NULL;
63 sion_apidesc->bcastr_cb = NULL;
64 sion_apidesc->gatherr_cb = NULL;
65 sion_apidesc->gathervr_cb = NULL;
66 sion_apidesc->scatterr_cb = NULL;
67 sion_apidesc->scattervr_cb = NULL;
68 sion_apidesc->gather_execute_cb = NULL;
69 sion_apidesc->execute_scatter_cb = NULL;
70 sion_apidesc->get_multi_filename_cb = NULL;
71 sion_apidesc->get_capability_cb = NULL;
85 int rc = SION_SUCCESS;
87 if (sion_apidesc == NULL) {
88 return(_sion_errorprint(SION_NOT_SUCCESS,_SION_ERROR_RETURN,
"_sion_generic_free_apidesc: cannot free, data structure is not allocated, aborting ...\n"));
91 if (sion_apidesc->name) free(sion_apidesc->name);
108 if (sion_gendata == NULL) {
109 _sion_errorprint(SION_NOT_SUCCESS,_SION_ERROR_RETURN,
"cannot allocate gendata structure of size %lu (sion_gendata), aborting ...\n", (
unsigned long)
sizeof(
_sion_generic_gendata));
113 return(sion_gendata);
125 int rc = SION_SUCCESS;
127 if (sion_gendata == NULL) {
128 return(_sion_errorprint(SION_NOT_SUCCESS,_SION_ERROR_RETURN,
"_sion_generic_init_gendata: cannot initalized, data structure is not allocated, aborting ...\n"));
130 sion_gendata->apidesc = NULL;
131 sion_gendata->aid = -1;
132 sion_gendata->comm_data_global = NULL;
133 sion_gendata->comm_data_local = NULL;
148 int rc = SION_SUCCESS;
150 if (sion_gendata == NULL) {
151 return(_sion_errorprint(SION_NOT_SUCCESS,_SION_ERROR_RETURN,
"_sion_generic_free_gendata: cannot free, data structure is not allocated, aborting ...\n"));
169 int rc = SION_SUCCESS;
171 if (sion_apidesc == NULL) {
172 return(_sion_errorprint(SION_NOT_SUCCESS,_SION_ERROR_RETURN,
"_sion_generic_update_api_level: cannot update data structure, it is not allocated, aborting ...\n"));
176 (sion_apidesc->create_lcg_cb) &&
177 (sion_apidesc->free_lcg_cb) &&
178 (sion_apidesc->barrier_cb) &&
179 (sion_apidesc->bcastr_cb) &&
180 (sion_apidesc->gatherr_cb) &&
181 (sion_apidesc->gathervr_cb) &&
182 (sion_apidesc->scatterr_cb) &&
183 (sion_apidesc->scattervr_cb)
185 sion_apidesc->level=SION_GENERIC_API_LEVEL_STD;
188 (sion_apidesc->gather_execute_cb) &&
189 (sion_apidesc->execute_scatter_cb) &&
190 (sion_apidesc->get_capability_cb)
192 sion_apidesc->level=SION_GENERIC_API_LEVEL_FULL;
int _sion_generic_free_apidesc(_sion_generic_apidesc *sion_apidesc)
free apidesc structure
int _sion_generic_free_gendata(_sion_generic_gendata *sion_gendata)
Free sion gendata description.
int _sion_generic_init_apidesc(_sion_generic_apidesc *sion_apidesc)
Initialize the sion api description.
int _sion_generic_update_api_level(_sion_generic_apidesc *sion_apidesc)
Update API level.
_sion_generic_gendata * _sion_generic_alloc_gendata(void)
Allocates memory for internal sion api data structure needed for each SION file.
int _sion_generic_init_gendata(_sion_generic_gendata *sion_gendata)
Initialize the sion file description.
_sion_generic_apidesc * _sion_generic_alloc_apidesc(void)
Allocates memory for internal sion api desc structure.