The structure data type for the array associate handle is defined as followed: typedef struct { /*---- user provides the following parameters ----------------------------*/ int num; /* number of arrays */ char names[BUFFERSIZE]; /* array names */ int ndims; /* number of dimensions for arrays */ int *globalSizes; /* [ndims] global size in each dim */ int *numProc; /* [ndims] No. proc in each dimension most significant dimension first, eg. Z,Y,X etc */ char pattern[BUFFERSIZE];/* access pattern in each dimension */ char ioMode[BUFFERSIZE]; /* I/O mode */ int order; /* MPI array storage order flag */ MPI_Datatype eType; /* array elementary data type */ int iterNum; /* iteration number */ /*---- SDM sets the following parameters ---------------------------------*/ int acc_id; /* access pattern id */ int app_run_id; /* application run id */ int *localStartIndx; /* [ndims] local start index */ int *localSizes; /* [ndims] local array size */ MPI_File fp; /* file pointer */ char fileName[BUFFERSIZE]; int collectiveIO; /* suggest if use collective I/O */ MPI_Datatype fileType; /* file data type */ MPI_Offset offsetDisp; /* offset in the file */ /*---- the following parameters are for load operations ------------------*/ int status; /* for check pointing or data analysis */ int prevArray; /* array number in previous load */ int *arrayIndex; /* index for the current array */ SDM_array_index *iterIndex; /* iteration numbers for each array */ int numFiles; /* number of files for each array */ MPI_File *loadFiles; /* file pointers for each file */ } SDM_asc_handle; int SDM_init(app_name); char *app_name; /* IN: name of application */ Users provide the name of current application which will be referred by other applications in the future. int SDM_set_run_table_attr(num_param, param_names, param_value); int num_param; /* IN: number of run-time parameters */ char **param_names; /* IN: names of run-time parameters */ char **param_value; /* IN: values of run-time parameters */ This subroutine records the run-time parameters, date and time for this specific run. These information will be used by other applications in the future. int SDM_create_array_asc(num_arrays, array_names, num_dims, global_sizes, access_pattern, num_proc, io_mode, order, elm_type, asc_hd); int num_arrays; /* IN: number of arrays */ char **array_names; /* IN: names of arrays */ int num_dims; /* IN; number of dimensions */ int *global_sizes; /* IN: array global sizes */ char *access_pattern; /* IN: access pattern */ int *num_proc; /* IN: number of processors */ char *io_mode; /* IN: I/O mode */ int order; /* IN: array storage order flag */ MPI_Datatype elm_type; /* IN: array elementary data type */ SDM_asc_handle *asc_hd; /* OUT: array associate handle */ Given a list of arrays with the same attributes and access pattern, an associate handle is returned. Users can perform similar I/O operations on these arrays by providing the associate handle. MPI file data type is created according to the size of arrays and the number of processors in all dimensions. int SDM_save_init(asc_hd, iter_no, header, header_len, flag); SDM_asc_handle *asc_hd; /* IN/OUT: array associate handle */ int iter_no; /* IN: iteration number */ void *header; /* IN: file header */ int header_len; /* IN: size of the header in bytes */ int flag; /* IN: for check pointing or data analysis */ Initialization of save operation. A unique file name is generated and open for following save operations. MPI file view is set using the data type created in SDM_create_array_asc(). int SDM_save(asc_hd, array_name, buf, count, dataType); SDM_asc_handle *asc_hd; /* IN: array associate handle */ char *array_name; /* IN: array name */ void *buf; /* IN: pointer of data to be saved */ int count; /* IN: number of elements in buffer */ MPI_Datatype dataType; /* IN: datatype of each buffer element */ This subroutine writes to the file created in SDM_save_init(). The offset in byte for this write operation is recorded. int SDM_save_final(asc_hd); SDM_asc_handle *asc_hd; Finalize the save operations closes the file. int SDM_get_array_asc(app_name, array_name, asc_hd); char *app_name; /* IN: name of the enquired application */ char *array_name; /* IN: array name to be enquired */ SDM_asc_handle *asc_hd; /* OUT: array associate handle */ This subroutine returns a associate handle of the enquired array and the application. The information about this array will be retrieved from the tables in MDMS. The returned associate handle, asc_hd, can be used in the later load operations. int SDM_load_init(asc_hd, num_proc, pattern, flag); SDM_asc_handle *hd; /* IN/OUT: array associate handle */ int *num_proc; /* IN: number of processors */ char *pattern; /* IN: array access pattern */ int flag; /* IN: for check pointing or data analysis */ Initialization the load operations sets the file data type and open the files with respect to this associate handle. int SDM_load(buf, asc_hd, array_name, iter_num, count, dataType); void *buf; /* OUT: buffer of loading */ SDM_asc_handle *asc_hd; /* IN/OUT: array associate handle */ char *array_name; /* IN: array name */ int iter_num; /* IN: iteration number */ int count; /* IN: number of elements in buffer */ MPI_Datatype dataType; /* IN: datatype of each buffer element */ This subroutine sets the file view and reads from the file opened in SDM_load_init(). int SDM_load_final(asc_hd); SDM_asc_handle *asc_hd; /* IN/OUT: array associate handle */ Finalization of load operations closes the files.