diff --git a/src/external/SMIOL/smiol.c b/src/external/SMIOL/smiol.c index 8a34ed23bb..4f5ee9d9c8 100644 --- a/src/external/SMIOL/smiol.c +++ b/src/external/SMIOL/smiol.c @@ -12,6 +12,7 @@ #define PNETCDF_DEFINE_MODE 0 #define PNETCDF_DATA_MODE 1 #define MAX_REQS 256 +#define PNETCDF_HEADER_ALIGN_SIZE_STR "131072" #endif #define START_COUNT_READ 0 @@ -243,6 +244,7 @@ int SMIOL_open_file(struct SMIOL_context *context, const char *filename, int io_group; MPI_Comm io_file_comm; MPI_Comm io_group_comm; + MPI_Info info = MPI_INFO_NULL; int ierr; @@ -336,11 +338,13 @@ int SMIOL_open_file(struct SMIOL_context *context, const char *filename, MPI_Comm_free(&io_group_comm); return SMIOL_INVALID_FORMAT; } - + MPI_Info_create(&info); + MPI_Info_set(info, "nc_header_align_size", PNETCDF_HEADER_ALIGN_SIZE_STR); ierr = ncmpi_create(io_file_comm, filename, (filecmode | NC_CLOBBER), - MPI_INFO_NULL, + info, &((*file)->ncidp)); + MPI_Info_free(&info); } (*file)->state = PNETCDF_DEFINE_MODE; #endif @@ -348,7 +352,7 @@ int SMIOL_open_file(struct SMIOL_context *context, const char *filename, #ifdef SMIOL_PNETCDF if ((*file)->io_task) { ierr = ncmpi_open(io_file_comm, filename, - NC_WRITE, MPI_INFO_NULL, + NC_WRITE, info, &((*file)->ncidp)); } (*file)->state = PNETCDF_DATA_MODE; @@ -357,7 +361,7 @@ int SMIOL_open_file(struct SMIOL_context *context, const char *filename, #ifdef SMIOL_PNETCDF if ((*file)->io_task) { ierr = ncmpi_open(io_file_comm, filename, - NC_NOWRITE, MPI_INFO_NULL, + NC_NOWRITE, info, &((*file)->ncidp)); } (*file)->state = PNETCDF_DATA_MODE;