14 #define _XOPEN_SOURCE 700
25 #include "sion_error_handler.h"
57 #define DFUNCTION "_sion_paropen_generic_buddy"
66 if (cb_args == NULL) {
67 _sion_errorprint(SION_NOT_SUCCESS,_SION_ERROR_RETURN,
"cannot allocate cb_args structure of size %lu (sion_file_check_par_args), aborting ...\n",
72 cb_args->file_mode=strdup(file_mode);
75 cb_args->numfiles=numfiles;
81 #define DFUNCTION "sion_file_check_par_args_free_mpi"
85 if(cb_args->file_mode!=NULL) {
86 free(cb_args->file_mode);
94 #define DFUNCTION "sion_file_check_par_cb_mpi"
95 int sion_file_check_par_cb_mpi(
char *fname,
void *v_args ) {
97 int rc=SION_NOT_SUCCESS;
98 int gtasks, gRank, sid;
99 sion_int64 chunksize=0;
100 sion_int32 fsblksize=-1;
104 MPI_Comm_size(cb_args->gComm, >asks);
105 MPI_Comm_rank(cb_args->gComm, &gRank);
107 DPRINTFP((1, DFUNCTION, gRank,
"enter parallel check of file %s with mode %s\n", fname,cb_args->file_mode));
109 _sion_errorprint_set_flag(_SION_ERROR_FLAG_SUPPRESS_MSG);
110 sid =
sion_paropen_mpi(fname, cb_args->file_mode, &cb_args->numfiles, cb_args->gComm, &cb_args->lComm, &chunksize, &fsblksize, &globalrank, NULL, NULL);
111 _sion_errorprint_set_flag(_SION_ERROR_FLAG_NONE);
119 DPRINTFP((1, DFUNCTION, gRank,
"leave parallel check of file %s with mode %s rc=%d\n", fname,cb_args->file_mode,rc));
int sion_paropen_mpi(const char *fname, const char *file_mode, int *numFiles, MPI_Comm gComm, const MPI_Comm *lComm, sion_int64 *chunksize, sion_int32 *fsblksize, int *globalrank, FILE **fileptr, char **newfname)
Open a sion file using MPI.
int sion_parclose_mpi(int sid)
Close a sion file using MPI.