34 #define NCMPI_CHECK(NCMPI_RETURN, MSG) do { \ 36 if (NCMPI_RETURN < 0) { \ 37 fprintf(stdout, "** error **\n"); \ 38 fprintf(stdout, "ERROR in %s (line %d): %s.\n", \ 39 __FILE__, __LINE__, MSG); \ 40 fprintf(stdout, "ERROR: %s.\n", ncmpi_strerror(NCMPI_RETURN)); \ 41 fprintf(stdout, "** exiting **\n"); \ 89 MPI_Info mpiHints = MPI_INFO_NULL;
94 fprintf(stdout,
"\nhints passed to MPI_File_open() {\n");
96 fprintf(stdout,
"}\n");
99 fd = (
int *)malloc(
sizeof(
int));
101 ERR(
"malloc() failed");
105 mpiHints, fd),
"cannot create file");
134 MPI_Info mpiHints = MPI_INFO_NULL;
139 fprintf(stdout,
"\nhints passed to MPI_File_open() {\n");
141 fprintf(stdout,
"}\n");
144 fd = (
int *)malloc(
sizeof(
int));
146 ERR(
"malloc() failed");
150 mpiHints, fd),
"cannot open file");
178 signed char *bufferPtr = (
signed char *)buffer;
179 static int firstReadCheck =
FALSE, startDataSet;
183 int segmentNum, transferNum;
191 sprintf(errMsg,
"length(%lld) != param->transferSize(%lld)\n",
204 if ((
int)(param->
offset - segmentPosition) == 0) {
212 if (firstReadCheck ==
TRUE) {
213 firstReadCheck =
FALSE;
215 firstReadCheck =
TRUE;
220 if (startDataSet ==
TRUE &&
222 if (access ==
WRITE) {
231 (*(
int *)fd,
"segments_times_np",
232 NC_UNLIMITED, &dim_id[0]),
233 "cannot define data set dimensions");
235 (*(
int *)fd,
"number_of_transfers",
236 numTransfers, &dim_id[1]),
237 "cannot define data set dimensions");
239 (*(
int *)fd,
"transfer_size",
241 "cannot define data set dimensions");
243 (*(
int *)fd,
"data_var", NC_BYTE,
NUM_DIMS,
245 "cannot define data set variables");
247 "cannot close data set define mode");
251 (*(
int *)fd,
"data_var", &var_id),
252 "cannot retrieve data set variable");
257 "cannot enable independent data mode");
261 startDataSet =
FALSE;
279 offset[1] = transferNum;
283 if (access ==
WRITE) {
286 (*(
int *)fd, var_id, offset, bufSize,
288 "cannot write to data set");
291 (*(
int *)fd, var_id, offset, bufSize,
293 "cannot write to data set");
298 (*(
int *)fd, var_id, offset, bufSize,
300 "cannot read from data set");
303 (*(
int *)fd, var_id, offset, bufSize,
305 "cannot read from data set");
327 "cannot disable independent data mode");
329 NCMPI_CHECK(ncmpi_close(*(
int *)fd),
"cannot close file");
346 return (
char *)ncmpi_inq_libvers();
359 fd_mode |= NC_NOWRITE;
362 fprintf(stdout,
"File write only not implemented in NCMPI\n");
368 fprintf(stdout,
"File append not implemented in NCMPI\n");
371 fd_mode |= NC_CLOBBER;
374 fprintf(stdout,
"Exclusive access not implemented in NCMPI\n");
377 fprintf(stdout,
"File truncation not implemented in NCMPI\n");
380 fprintf(stdout,
"O_DIRECT not implemented in NCMPI\n");
384 fd_mode |= NC_64BIT_OFFSET;
static char * NCMPI_GetVersion()
void ShowHints(MPI_Info *mpiHints)
IOR_offset_t transferSize
int aiori_posix_rmdir(const char *path, IOR_param_t *param)
static IOR_offset_t NCMPI_Xfer(int, void *, IOR_size_t *, IOR_offset_t, IOR_param_t *)
static int GetFileMode(IOR_param_t *)
int aiori_posix_mkdir(const char *path, mode_t mode, IOR_param_t *param)
static IOR_offset_t NCMPI_GetFileSize(IOR_param_t *, MPI_Comm, char *)
int aiori_posix_statfs(const char *path, ior_aiori_statfs_t *stat_buf, IOR_param_t *param)
void MPIIO_Delete(char *testFileName, IOR_param_t *param)
int MPIIO_Access(const char *path, int mode, IOR_param_t *param)
static void * NCMPI_Create(char *, IOR_param_t *)
int aiori_posix_stat(const char *path, struct stat *buf, IOR_param_t *param)
static void NCMPI_Fsync(void *, IOR_param_t *)
void SetHints(MPI_Info *mpiHints, char *hintsFileName)
static void * NCMPI_Open(char *, IOR_param_t *)
#define NCMPI_CHECK(NCMPI_RETURN, MSG)
long long int IOR_offset_t
static void NCMPI_Delete(char *, IOR_param_t *)
static void NCMPI_Close(void *, IOR_param_t *)
IOR_offset_t MPIIO_GetFileSize(IOR_param_t *test, MPI_Comm testComm, char *testFileName)
static int NCMPI_Access(const char *, int, IOR_param_t *)