From 4cb0b2dbfda6ef183802ea812abae26900784892 Mon Sep 17 00:00:00 2001 From: wkliao Date: Fri, 30 Aug 2024 13:39:35 -0500 Subject: [PATCH] use MPI independent write when nprocs == 1 --- src/drivers/ncmpio/ncmpio_enddef.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/drivers/ncmpio/ncmpio_enddef.c b/src/drivers/ncmpio/ncmpio_enddef.c index 1bab732ee..510df9910 100644 --- a/src/drivers/ncmpio/ncmpio_enddef.c +++ b/src/drivers/ncmpio/ncmpio_enddef.c @@ -163,7 +163,12 @@ move_file_block(NC *ncp, */ memset(&mpistatus, 0, sizeof(MPI_Status)); - TRACE_IO(MPI_File_write_at_all)(fh, to+nbytes+rank*chunk_size, + if (ncp->nprocs > 1) + TRACE_IO(MPI_File_write_at_all)(fh, to+nbytes+rank*chunk_size, + buf, get_size /* NOT bufcount */, + MPI_BYTE, &mpistatus); + else + TRACE_IO(MPI_File_write_at)(fh, to+nbytes+rank*chunk_size, buf, get_size /* NOT bufcount */, MPI_BYTE, &mpistatus); if (mpireturn != MPI_SUCCESS) {