From f8e6cd033a9769ca9961af208fd960c7340c9151 Mon Sep 17 00:00:00 2001 From: VinsonLeung Date: Mon, 20 Nov 2017 13:56:36 -0600 Subject: [PATCH 1/2] change MPI_BYTE to MPI_SIGNED_CHAR From Pnetcdf 1.7, the MPI datatype corresponding to NC_BYTE is change from MPI_BYTE to MPI_SIGNED_CHAR. If not change, running IOR with NCMPI will cause a fatal error as below: ERROR in aiori-NCMPI.c (line 287): cannot write to data set. ERROR: NetCDF: Not a valid data type or _FillValue type mismatch. --- src/aiori-NCMPI.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/aiori-NCMPI.c b/src/aiori-NCMPI.c index a24865a..b1f3fc2 100755 --- a/src/aiori-NCMPI.c +++ b/src/aiori-NCMPI.c @@ -278,24 +278,24 @@ static IOR_offset_t NCMPI_Xfer(int access, void *fd, IOR_size_t * buffer, if (param->collective) { NCMPI_CHECK(ncmpi_put_vara_all (*(int *)fd, var_id, offset, bufSize, - bufferPtr, length, MPI_BYTE), + bufferPtr, length, MPI_SIGNED_CHAR), "cannot write to data set"); } else { NCMPI_CHECK(ncmpi_put_vara (*(int *)fd, var_id, offset, bufSize, - bufferPtr, length, MPI_BYTE), + bufferPtr, length, MPI_SIGNED_CHAR), "cannot write to data set"); } } else { /* READ or CHECK */ if (param->collective == TRUE) { NCMPI_CHECK(ncmpi_get_vara_all (*(int *)fd, var_id, offset, bufSize, - bufferPtr, length, MPI_BYTE), + bufferPtr, length, MPI_SIGNED_CHAR), "cannot read from data set"); } else { NCMPI_CHECK(ncmpi_get_vara (*(int *)fd, var_id, offset, bufSize, - bufferPtr, length, MPI_BYTE), + bufferPtr, length, MPI_SIGNED_CHAR), "cannot read from data set"); } } From d1f9e9aee3c657a1eb577bfc960eee8039fcb316 Mon Sep 17 00:00:00 2001 From: VinsonLeung Date: Wed, 22 Nov 2017 23:20:22 -0600 Subject: [PATCH 2/2] change Pnetcdf IO funtion change Pnetcdf IO function which can avoid incompatible MPI datatype problem --- src/aiori-NCMPI.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/aiori-NCMPI.c b/src/aiori-NCMPI.c index b1f3fc2..98fd6bd 100755 --- a/src/aiori-NCMPI.c +++ b/src/aiori-NCMPI.c @@ -276,26 +276,26 @@ static IOR_offset_t NCMPI_Xfer(int access, void *fd, IOR_size_t * buffer, /* access the file */ if (access == WRITE) { /* WRITE */ if (param->collective) { - NCMPI_CHECK(ncmpi_put_vara_all + NCMPI_CHECK(ncmpi_put_vara_schar_all (*(int *)fd, var_id, offset, bufSize, - bufferPtr, length, MPI_SIGNED_CHAR), + bufferPtr), "cannot write to data set"); } else { - NCMPI_CHECK(ncmpi_put_vara + NCMPI_CHECK(ncmpi_put_vara_schar (*(int *)fd, var_id, offset, bufSize, - bufferPtr, length, MPI_SIGNED_CHAR), + bufferPtr), "cannot write to data set"); } } else { /* READ or CHECK */ if (param->collective == TRUE) { - NCMPI_CHECK(ncmpi_get_vara_all + NCMPI_CHECK(ncmpi_get_vara_schar_all (*(int *)fd, var_id, offset, bufSize, - bufferPtr, length, MPI_SIGNED_CHAR), + bufferPtr), "cannot read from data set"); } else { - NCMPI_CHECK(ncmpi_get_vara + NCMPI_CHECK(ncmpi_get_vara_schar (*(int *)fd, var_id, offset, bufSize, - bufferPtr, length, MPI_SIGNED_CHAR), + bufferPtr), "cannot read from data set"); } }