diff --git a/src/clib/pio_darray.c b/src/clib/pio_darray.c index e8a989783c8..8b5fc55afd2 100644 --- a/src/clib/pio_darray.c +++ b/src/clib/pio_darray.c @@ -217,13 +217,13 @@ int PIOc_write_darray_multi(int ncid, const int *varids, int ioid, int nvars, /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); /* Share results known only on computation tasks with IO tasks. */ if ((mpierr = MPI_Bcast(&fndims, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((3, "shared fndims = %d", fndims)); } @@ -738,7 +738,7 @@ int PIOc_write_darray(int ncid, int varid, int ioid, PIO_Offset arraylen, void * * to flush data. */ if ((mpierr = MPI_Allreduce(MPI_IN_PLACE, &needsflush, 1, MPI_INT, MPI_MAX, ios->comp_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((2, "needsflush = %d", needsflush)); /* Flush data if needed. */ diff --git a/src/clib/pio_darray_int.c b/src/clib/pio_darray_int.c index 15ddf335be2..3e30aa45029 100644 --- a/src/clib/pio_darray_int.c +++ b/src/clib/pio_darray_int.c @@ -232,10 +232,10 @@ int get_vard_mpidatatype(io_desc_t *iodesc, MPI_Offset gdim0, PIO_Offset unlimdi if((mpierr = MPI_Type_create_subarray(sa_ndims, gdims, sacount, sastart,MPI_ORDER_C ,iodesc->mpitype, subarray + true_rrcnt))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if((mpierr = MPI_Type_commit(subarray + true_rrcnt))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } #if PIO_ENABLE_LOGGING @@ -247,15 +247,15 @@ int get_vard_mpidatatype(io_desc_t *iodesc, MPI_Offset gdim0, PIO_Offset unlimdi /* concatenate all MPI datatypes into filetype */ if((mpierr = MPI_Type_create_struct(true_rrcnt, blocklengths, displacements, subarray, filetype))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if((mpierr = MPI_Type_commit(filetype))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); for( int rc=0; rcmpitype && (mpierr = MPI_Type_free(subarray + rc))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -593,19 +593,19 @@ int write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int * if (j > 0) { /* at least one vartypes[] is not NULL */ /* concatenate non-NULL vartypes */ if((mpierr = MPI_Type_create_struct(j, blocklens, var_offsets, vartypes, &filetype))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if((mpierr = MPI_Type_commit(&filetype))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); /* free vartypes */ for (i=j-1; i>0; i--) { if (vartypes[i] == vartypes[i-1]) continue; if((mpierr = MPI_Type_free(&vartypes[i]))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } if((mpierr = MPI_Type_free(&vartypes[0]))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } else /* all vartypes[] are NULL */ filetype = MPI_DATATYPE_NULL; @@ -619,7 +619,7 @@ int write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int * if(filetype != MPI_DATATYPE_NULL) { if((mpierr = MPI_Type_free(&filetype))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } vard_llen = 0; /* reset request size to 0 */ numReqs = 0; @@ -785,12 +785,12 @@ int send_all_start_count(iosystem_desc_t *ios, io_desc_t *iodesc, PIO_Offset lle /* Do a handshake. */ if ((mpierr = MPI_Recv(&ierr, 1, MPI_INT, 0, 0, ios->io_comm, &status))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Send local length of iobuffer for each field (all * fields are the same length). */ if ((mpierr = MPI_Send((void *)&llen, 1, MPI_OFFSET, 0, ios->io_rank, ios->io_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((3, "sent llen = %d", llen)); /* Send the number of data regions, the start/count for @@ -799,16 +799,16 @@ int send_all_start_count(iosystem_desc_t *ios, io_desc_t *iodesc, PIO_Offset lle { if ((mpierr = MPI_Send((void *)&maxregions, 1, MPI_INT, 0, ios->io_rank + ios->num_iotasks, ios->io_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Send(tmp_start, maxregions * fndims, MPI_OFFSET, 0, ios->io_rank + 2 * ios->num_iotasks, ios->io_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Send(tmp_count, maxregions * fndims, MPI_OFFSET, 0, ios->io_rank + 3 * ios->num_iotasks, ios->io_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Send(iobuf, nvars * llen, iodesc->mpitype, 0, ios->io_rank + 4 * ios->num_iotasks, ios->io_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((3, "sent data for maxregions = %d", maxregions)); } @@ -885,13 +885,13 @@ int recv_and_write_data(file_desc_t *file, const int *varids, const int *frame, { /* handshake - tell the sending task I'm ready */ if ((mpierr = MPI_Send(&ierr, 1, MPI_INT, rtask, 0, ios->io_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Get length of iobuffer for each field on this * task (all fields are the same length). */ if ((mpierr = MPI_Recv(&rlen, 1, MPI_OFFSET, rtask, rtask, ios->io_comm, &status))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((3, "received rlen = %d", rlen)); /* Get the number of regions, the start/count @@ -900,16 +900,16 @@ int recv_and_write_data(file_desc_t *file, const int *varids, const int *frame, { if ((mpierr = MPI_Recv(&rregions, 1, MPI_INT, rtask, rtask + ios->num_iotasks, ios->io_comm, &status))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Recv(tmp_start, rregions * fndims, MPI_OFFSET, rtask, rtask + 2 * ios->num_iotasks, ios->io_comm, &status))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Recv(tmp_count, rregions * fndims, MPI_OFFSET, rtask, rtask + 3 * ios->num_iotasks, ios->io_comm, &status))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Recv(iobuf, nvars * rlen, iodesc->mpitype, rtask, rtask + 4 * ios->num_iotasks, ios->io_comm, &status))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((3, "received data rregions = %d fndims = %d", rregions, fndims)); } } @@ -1314,7 +1314,7 @@ int pio_read_darray_nc(file_desc_t *file, io_desc_t *iodesc, int vid, void *iobu vdesc->record, startlist, countlist, &filetype); ierr = ncmpi_get_vard_all(file->fh, vid, filetype, iobuf, iodesc->llen, iodesc->mpitype); if(filetype != MPI_DATATYPE_NULL && (mpierr = MPI_Type_free(&filetype))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); #else /* Read a list of subarrays. */ @@ -1497,25 +1497,25 @@ int pio_read_darray_nc_serial(file_desc_t *file, io_desc_t *iodesc, int vid, if (ios->io_rank > 0) { if ((mpierr = MPI_Send(&iodesc->llen, 1, MPI_OFFSET, 0, ios->io_rank, ios->io_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((3, "sent iodesc->llen = %d", iodesc->llen)); if (iodesc->llen > 0) { if ((mpierr = MPI_Send(&(iodesc->maxregions), 1, MPI_INT, 0, ios->num_iotasks + ios->io_rank, ios->io_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Send(tmp_count, iodesc->maxregions * fndims, MPI_OFFSET, 0, 2 * ios->num_iotasks + ios->io_rank, ios->io_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Send(tmp_start, iodesc->maxregions * fndims, MPI_OFFSET, 0, 3 * ios->num_iotasks + ios->io_rank, ios->io_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((3, "sent iodesc->maxregions = %d tmp_count and tmp_start arrays", iodesc->maxregions)); if ((mpierr = MPI_Recv(iobuf, iodesc->llen, iodesc->mpitype, 0, 4 * ios->num_iotasks + ios->io_rank, ios->io_comm, &status))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((3, "received %d elements of data", iodesc->llen)); } } @@ -1533,20 +1533,20 @@ int pio_read_darray_nc_serial(file_desc_t *file, io_desc_t *iodesc, int vid, if (rtask < ios->num_iotasks) { if ((mpierr = MPI_Recv(&tmp_bufsize, 1, MPI_OFFSET, rtask, rtask, ios->io_comm, &status))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((3, "received tmp_bufsize = %d", tmp_bufsize)); if (tmp_bufsize > 0) { if ((mpierr = MPI_Recv(&maxregions, 1, MPI_INT, rtask, ios->num_iotasks + rtask, ios->io_comm, &status))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Recv(this_count, maxregions * fndims, MPI_OFFSET, rtask, 2 * ios->num_iotasks + rtask, ios->io_comm, &status))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Recv(this_start, maxregions * fndims, MPI_OFFSET, rtask, 3 * ios->num_iotasks + rtask, ios->io_comm, &status))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((3, "received maxregions = %d this_count, this_start arrays ", maxregions)); } } @@ -1644,7 +1644,7 @@ int pio_read_darray_nc_serial(file_desc_t *file, io_desc_t *iodesc, int vid, if (rtask < ios->num_iotasks && tmp_bufsize > 0) if ((mpierr = MPI_Send(iobuf, tmp_bufsize, iodesc->mpitype, rtask, 4 * ios->num_iotasks + rtask, ios->io_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } } } @@ -1694,7 +1694,7 @@ int flush_output_buffer(file_desc_t *file, bool force, PIO_Offset addsize) usage += addsize; if ((mpierr = MPI_Allreduce(MPI_IN_PLACE, &usage, 1, MPI_OFFSET, MPI_MAX, file->iosystem->io_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* Keep track of the maximum usage. */ @@ -1806,10 +1806,10 @@ void cn_buffer_report(iosystem_desc_t *ios, bool collective) { LOG((3, "cn_buffer_report calling MPI_Reduce ios->comp_comm = %d", ios->comp_comm)); if ((mpierr = MPI_Reduce(bget_stats, bget_maxs, 5, MPI_LONG, MPI_MAX, 0, ios->comp_comm))) - check_mpi(NULL, mpierr, __FILE__, __LINE__); + check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); LOG((3, "cn_buffer_report calling MPI_Reduce")); if ((mpierr = MPI_Reduce(bget_stats, bget_mins, 5, MPI_LONG, MPI_MIN, 0, ios->comp_comm))) - check_mpi(NULL, mpierr, __FILE__, __LINE__); + check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (ios->compmaster == MPI_ROOT) { LOG((1, "Currently allocated buffer space %ld %ld", bget_mins[0], bget_maxs[0])); @@ -2193,7 +2193,7 @@ int compute_maxaggregate_bytes(iosystem_desc_t *ios, io_desc_t *iodesc) LOG((3, "before allreaduce maxbytes = %d", maxbytes)); if ((mpierr = MPI_Allreduce(MPI_IN_PLACE, &maxbytes, 1, MPI_INT, MPI_MIN, ios->union_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); LOG((3, "after allreaduce maxbytes = %d", maxbytes)); /* Remember the result. */ diff --git a/src/clib/pio_file.c b/src/clib/pio_file.c index 2e772427c0f..e37c1bf36de 100644 --- a/src/clib/pio_file.c +++ b/src/clib/pio_file.c @@ -235,9 +235,9 @@ int PIOc_closefile(int ncid) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -269,7 +269,7 @@ int PIOc_closefile(int ncid) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -321,9 +321,9 @@ int PIOc_deletefile(int iosysid, const char *filename) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr2, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((3, "done hanlding errors mpierr = %d", mpierr)); } @@ -345,7 +345,7 @@ int PIOc_deletefile(int iosysid, const char *filename) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr2, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr2, __FILE__, __LINE__); if (ierr) return check_netcdf2(ios, NULL, ierr, __FILE__, __LINE__); @@ -416,9 +416,9 @@ int PIOc_sync(int ncid) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* Call the sync function on IO tasks. */ @@ -452,7 +452,7 @@ int PIOc_sync(int ncid) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf2(ios, NULL, ierr, __FILE__, __LINE__); diff --git a/src/clib/pio_getput_int.c b/src/clib/pio_getput_int.c index 0920ace33fd..dcf36168dd9 100644 --- a/src/clib/pio_getput_int.c +++ b/src/clib/pio_getput_int.c @@ -109,15 +109,15 @@ int PIOc_put_att_tc(int ncid, int varid, const char *name, nc_type atttype, /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); /* Broadcast values currently only known on computation tasks to IO tasks. */ if ((mpierr = MPI_Bcast(&atttype_len, 1, MPI_OFFSET, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&memtype_len, 1, MPI_OFFSET, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((2, "PIOc_put_att bcast from comproot = %d atttype_len = %d", ios->comproot, atttype_len, memtype_len)); } @@ -211,7 +211,7 @@ int PIOc_put_att_tc(int ncid, int varid, const char *name, nc_type atttype, /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -326,19 +326,19 @@ int PIOc_get_att_tc(int ncid, int varid, const char *name, nc_type memtype, void /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((2, "mpi errors handled")); /* Broadcast values currently only known on computation tasks to IO tasks. */ LOG((2, "PIOc_get_att_tc bcast from comproot = %d attlen = %d atttype_len = %d", ios->comproot, attlen, atttype_len)); if ((mpierr = MPI_Bcast(&attlen, 1, MPI_OFFSET, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&atttype_len, 1, MPI_OFFSET, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&memtype_len, 1, MPI_OFFSET, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((2, "PIOc_get_att_tc bcast complete attlen = %d atttype_len = %d memtype_len = %d", attlen, atttype_len, memtype_len)); } @@ -434,7 +434,7 @@ int PIOc_get_att_tc(int ncid, int varid, const char *name, nc_type memtype, void /* Broadcast and check the return code. */ LOG((2, "ierr = %d", ierr)); if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -442,7 +442,7 @@ int PIOc_get_att_tc(int ncid, int varid, const char *name, nc_type memtype, void LOG((2, "bcasting att values attlen = %d memtype_len = %d", attlen, memtype_len)); if ((mpierr = MPI_Bcast(ip, (int)attlen * memtype_len, MPI_BYTE, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((2, "get_att_tc data bcast complete")); return PIO_NOERR; @@ -592,19 +592,19 @@ int PIOc_get_vars_tc(int ncid, int varid, const PIO_Offset *start, const PIO_Off /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); /* Broadcast values currently only known on computation tasks to IO tasks. */ if ((mpierr = MPI_Bcast(&num_elem, 1, MPI_OFFSET, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&typelen, 1, MPI_OFFSET, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&xtype, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&ndims, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } if (ndims) @@ -758,7 +758,7 @@ int PIOc_get_vars_tc(int ncid, int varid, const PIO_Offset *start, const PIO_Off /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -766,7 +766,7 @@ int PIOc_get_vars_tc(int ncid, int varid, const PIO_Offset *start, const PIO_Off LOG((2, "PIOc_get_vars_tc bcasting data num_elem = %d typelen = %d ios->ioroot = %d", num_elem, typelen, ios->ioroot)); if ((mpierr = MPI_Bcast(buf, num_elem * typelen, MPI_BYTE, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((2, "PIOc_get_vars_tc bcasting data complete")); return PIO_NOERR; @@ -1044,17 +1044,17 @@ int PIOc_put_vars_tc(int ncid, int varid, const PIO_Offset *start, const PIO_Off /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((2, "PIOc_put_vars_tc checked mpierr = %d", mpierr)); /* Broadcast values currently only known on computation tasks to IO tasks. */ LOG((2, "PIOc_put_vars_tc bcast from comproot")); if ((mpierr = MPI_Bcast(&ndims, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&xtype, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((2, "PIOc_put_vars_tc complete bcast from comproot ndims = %d", ndims)); } @@ -1258,7 +1258,7 @@ int PIOc_put_vars_tc(int ncid, int varid, const PIO_Offset *start, const PIO_Off /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); LOG((2, "PIOc_put_vars_tc bcast netcdf return code %d complete", ierr)); diff --git a/src/clib/pio_internal.h b/src/clib/pio_internal.h index f087b0083d3..340dd14eb97 100644 --- a/src/clib/pio_internal.h +++ b/src/clib/pio_internal.h @@ -110,11 +110,8 @@ extern "C" { void pioassert(bool exp, const char *msg, const char *fname, int line); /* Check the return code from an MPI function call. */ - int check_mpi(file_desc_t *file, int mpierr, const char *filename, int line); - - /* Check the return code from an MPI function call. */ - int check_mpi2(iosystem_desc_t *ios, file_desc_t *file, int mpierr, const char *filename, - int line); + int check_mpi(iosystem_desc_t *ios, file_desc_t *file, int mpierr, const char *filename, + int line); /* Check the return code from a netCDF call. */ int check_netcdf(file_desc_t *file, int status, const char *fname, int line); diff --git a/src/clib/pio_msg.c b/src/clib/pio_msg.c index 798cbce942f..4edeecfa7d4 100644 --- a/src/clib/pio_msg.c +++ b/src/clib/pio_msg.c @@ -47,13 +47,13 @@ int inq_type_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&xtype, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&name_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&size_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Handle null pointer issues. */ if (name_present) @@ -91,9 +91,9 @@ int inq_format_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&format_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "inq_format_handler got parameters ncid = %d format_present = %d", ncid, format_present)); @@ -131,11 +131,11 @@ int set_fill_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&fillmode, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&old_modep_present, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "set_fill_handler got parameters ncid = %d fillmode = %d old_modep_present = %d", ncid, fillmode, old_modep_present)); @@ -174,17 +174,17 @@ int create_file_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&len, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Get space for the filename. */ char filename[len + 1]; if ((mpierr = MPI_Bcast(filename, len + 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&iotype, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&mode, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "create_file_handler got parameters len = %d filename = %s iotype = %d mode = %d", len, filename, iotype, mode)); @@ -217,7 +217,7 @@ int close_file_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "close_file_handler got parameter ncid = %d", ncid)); /* Call the close file function. */ @@ -251,15 +251,15 @@ int inq_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&ndims_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&nvars_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&ngatts_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&unlimdimid_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "inq_handler ndims_present = %d nvars_present = %d ngatts_present = %d unlimdimid_present = %d", ndims_present, nvars_present, ngatts_present, unlimdimid_present)); @@ -306,11 +306,11 @@ int inq_unlimdims_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&nunlimdimsp_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&unlimdimidsp_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "inq_unlimdims_handler nunlimdimsp_present = %d unlimdimidsp_present = %d", nunlimdimsp_present, unlimdimidsp_present)); @@ -355,13 +355,13 @@ int inq_dim_handler(iosystem_desc_t *ios, int msg) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&dimid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&name_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&len_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "inq_handler name_present = %d len_present = %d", name_present, len_present)); @@ -401,13 +401,13 @@ int inq_dimid_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&namelen, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(name, namelen + 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&id_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "inq_dimid_handler ncid = %d namelen = %d name = %s id_present = %d", ncid, namelen, name, id_present)); @@ -448,18 +448,18 @@ int inq_att_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&namelen, 1, MPI_INT, ios->compmaster, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(name, namelen + 1, MPI_CHAR, ios->compmaster, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&xtype_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&len_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Match NULLs in collective function call. */ if (xtype_present) @@ -498,13 +498,13 @@ int inq_attname_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&attnum, 1, MPI_INT, ios->compmaster, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&name_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "inq_attname_handler got ncid = %d varid = %d attnum = %d name_present = %d", ncid, varid, attnum, name_present)); @@ -544,15 +544,15 @@ int inq_attid_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&namelen, 1, MPI_INT, ios->compmaster, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(name, namelen + 1, MPI_CHAR, ios->compmaster, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&id_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "inq_attid_handler got ncid = %d varid = %d id_present = %d", ncid, varid, id_present)); @@ -595,23 +595,23 @@ int att_put_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&namelen, 1, MPI_INT, ios->compmaster, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(name, namelen + 1, MPI_CHAR, ios->compmaster, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&atttype, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&attlen, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&atttype_len, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&memtype, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&memtype_len, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Allocate memory for the attribute data. */ if (!(op = malloc(attlen * memtype_len))) @@ -619,7 +619,7 @@ int att_put_handler(iosystem_desc_t *ios) if ((mpierr = MPI_Bcast(op, attlen * memtype_len, MPI_BYTE, 0, ios->intercomm))) { free(op); - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } LOG((1, "att_put_handler ncid = %d varid = %d namelen = %d name = %s" "atttype = %d attlen = %d atttype_len = %d memtype = %d memtype_len = 5d", @@ -665,25 +665,25 @@ int att_get_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&namelen, 1, MPI_INT, ios->compmaster, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(name, namelen + 1, MPI_CHAR, ios->compmaster, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&iotype, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&atttype, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&attlen, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&atttype_len, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&memtype, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&memtype_len, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "att_get_handler ncid = %d varid = %d namelen = %d name = %s iotype = %d" " atttype = %d attlen = %d atttype_len = %d memtype = %d memtype_len = %d", ncid, varid, namelen, name, iotype, atttype, attlen, atttype_len, memtype, memtype_len)); @@ -732,37 +732,37 @@ int put_vars_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&ndims, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Now we know how big to make these arrays. */ PIO_Offset start[ndims], count[ndims], stride[ndims]; if ((mpierr = MPI_Bcast(&start_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (start_present) if ((mpierr = MPI_Bcast(start, ndims, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "put_vars_handler getting start[0] = %d ndims = %d", start[0], ndims)); if ((mpierr = MPI_Bcast(&count_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (count_present) if ((mpierr = MPI_Bcast(count, ndims, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&stride_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (stride_present) if ((mpierr = MPI_Bcast(stride, ndims, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&xtype, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&num_elem, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&typelen, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "put_vars_handler ncid = %d varid = %d ndims = %d " "start_present = %d count_present = %d stride_present = %d xtype = %d " "num_elem = %d typelen = %d", ncid, varid, ndims, start_present, count_present, @@ -774,7 +774,7 @@ int put_vars_handler(iosystem_desc_t *ios) /* Get the data. */ if ((mpierr = MPI_Bcast(buf, num_elem * typelen, MPI_BYTE, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Set the non-NULL pointers. */ if (start_present) @@ -873,44 +873,44 @@ int get_vars_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&ndims, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&start_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (start_present) { if (!(start = malloc(ndims * sizeof(PIO_Offset)))) return pio_err(ios, NULL, PIO_ENOMEM, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(start, ndims, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } if ((mpierr = MPI_Bcast(&count_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (count_present) { if (!(count = malloc(ndims * sizeof(PIO_Offset)))) return pio_err(ios, NULL, PIO_ENOMEM, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(count, ndims, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } if ((mpierr = MPI_Bcast(&stride_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (stride_present) { if (!(stride = malloc(ndims * sizeof(PIO_Offset)))) return pio_err(ios, NULL, PIO_ENOMEM, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(stride, ndims, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } if ((mpierr = MPI_Bcast(&xtype, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&num_elem, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&typelen, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "get_vars_handler ncid = %d varid = %d ndims = %d " "stride_present = %d xtype = %d num_elem = %d typelen = %d", ncid, varid, ndims, stride_present, xtype, num_elem, typelen)); @@ -1018,19 +1018,19 @@ int inq_var_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&name_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&xtype_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&ndims_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&dimids_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&natts_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2,"inq_var_handler ncid = %d varid = %d name_present = %d xtype_present = %d ndims_present = %d " "dimids_present = %d natts_present = %d", ncid, varid, name_present, xtype_present, ndims_present, dimids_present, natts_present)); @@ -1079,15 +1079,15 @@ int inq_var_chunking_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&storage_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&ndims, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&chunksizes_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2,"inq_var_handler ncid = %d varid = %d storage_present = %d chunksizes_present = %d", ncid, varid, storage_present, chunksizes_present)); @@ -1130,15 +1130,15 @@ int inq_var_fill_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&type_size, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&fill_mode_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&fill_value_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2,"inq_var_fill_handler ncid = %d varid = %d type_size = %lld, fill_mode_present = %d fill_value_present = %d", ncid, varid, type_size, fill_mode_present, fill_value_present)); @@ -1193,11 +1193,11 @@ int inq_var_endian_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&endian_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2,"inq_var_endian_handler ncid = %d varid = %d endian_present = %d", ncid, varid, endian_present)); @@ -1236,24 +1236,24 @@ int inq_var_deflate_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&shuffle_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (shuffle_present && !mpierr) if ((mpierr = MPI_Bcast(&shuffle, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&deflate_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (deflate_present && !mpierr) if ((mpierr = MPI_Bcast(&deflate, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&deflate_level_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (deflate_level_present && !mpierr) if ((mpierr = MPI_Bcast(&deflate_level, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "inq_var_handler ncid = %d varid = %d shuffle_present = %d deflate_present = %d " "deflate_level_present = %d", ncid, varid, shuffle_present, deflate_present, deflate_level_present)); @@ -1294,11 +1294,11 @@ int inq_varid_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&namelen, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(name, namelen + 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Call the inq_dimid function. */ PIOc_inq_varid(ncid, name, &varid); @@ -1326,7 +1326,7 @@ int sync_file_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "sync_file_handler got parameter ncid = %d", ncid)); /* Call the sync file function. */ @@ -1359,11 +1359,11 @@ int setframe_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&frame, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "setframe_handler got parameter ncid = %d varid = %d frame = %d", ncid, varid, frame)); @@ -1396,9 +1396,9 @@ int advanceframe_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "advanceframe_handler got parameter ncid = %d varid = %d", ncid, varid)); @@ -1429,7 +1429,7 @@ int change_def_file_handler(iosystem_desc_t *ios, int msg) /* Get the parameters for this function that the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Call the function. */ if (msg == PIO_MSG_ENDDEF) @@ -1468,21 +1468,21 @@ int def_var_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&namelen, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(name, namelen + 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&xtype, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&ndims, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (!(dimids = malloc(ndims * sizeof(int)))) return pio_err(ios, NULL, PIO_ENOMEM, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(dimids, ndims, MPI_INT, 0, ios->intercomm))) { free(dimids); - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } LOG((1, "def_var_handler got parameters namelen = %d " "name = %s ncid = %d", namelen, name, ncid)); @@ -1520,20 +1520,20 @@ int def_var_chunking_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&storage, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&ndims, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&chunksizes_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (chunksizes_present){ if (!(chunksizesp = malloc(ndims* sizeof(PIO_Offset)))) return pio_err(ios, NULL, PIO_ENOMEM, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(chunksizesp, ndims, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } LOG((1, "def_var_chunking_handler got parameters ncid = %d varid = %d storage = %d " "ndims = %d chunksizes_present = %d", ncid, varid, storage, ndims, chunksizes_present)); @@ -1571,15 +1571,15 @@ int def_var_fill_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&fill_mode, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&type_size, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&fill_value_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (fill_value_present) { if (!(fill_valuep = malloc(type_size))) @@ -1587,7 +1587,7 @@ int def_var_fill_handler(iosystem_desc_t *ios) if ((mpierr = MPI_Bcast(fill_valuep, type_size, MPI_CHAR, 0, ios->intercomm))) { free(fill_valuep); - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } } LOG((1, "def_var_fill_handler got parameters ncid = %d varid = %d fill_mode = %d " @@ -1624,11 +1624,11 @@ int def_var_endian_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&endian, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "def_var_endian_handler got parameters ncid = %d varid = %d endain = %d ", ncid, varid, endian)); @@ -1661,15 +1661,15 @@ int def_var_deflate_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&shuffle, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&deflate, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&deflate_level, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "def_var_deflate_handler got parameters ncid = %d varid = %d shuffle = %d ", "deflate = %d deflate_level = %d", ncid, varid, shuffle, deflate, deflate_level)); @@ -1702,15 +1702,15 @@ int set_var_chunk_cache_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&size, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&nelems, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&preemption, 1, MPI_FLOAT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "set_var_chunk_cache_handler got params ncid = %d varid = %d size = %d " "nelems = %d preemption = %g", ncid, varid, size, nelems, preemption)); @@ -1745,13 +1745,13 @@ int def_dim_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&namelen, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(name, namelen + 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&len, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "def_dim_handler got parameters namelen = %d " "name = %s len = %d ncid = %d", namelen, name, len, ncid)); @@ -1786,13 +1786,13 @@ int rename_dim_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&dimid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&namelen, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(name, namelen + 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "rename_dim_handler got parameters namelen = %d " "name = %s ncid = %d dimid = %d", namelen, name, ncid, dimid)); @@ -1827,13 +1827,13 @@ int rename_var_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&namelen, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(name, namelen + 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "rename_var_handler got parameters namelen = %d " "name = %s ncid = %d varid = %d", namelen, name, ncid, varid)); @@ -1868,17 +1868,17 @@ int rename_att_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&namelen, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(name, namelen + 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&newnamelen, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(newname, newnamelen + 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "rename_att_handler got parameters namelen = %d name = %s ncid = %d varid = %d " "newnamelen = %d newname = %s", namelen, name, ncid, varid, newnamelen, newname)); @@ -1913,13 +1913,13 @@ int delete_att_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&namelen, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(name, namelen + 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "delete_att_handler namelen = %d name = %s ncid = %d varid = %d ", namelen, name, ncid, varid)); @@ -1954,18 +1954,18 @@ int open_file_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&len, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "open_file_handler got parameter len = %d", len)); /* Get space for the filename. */ char filename[len + 1]; if ((mpierr = MPI_Bcast(filename, len + 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&iotype, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&mode, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "open_file_handler got parameters len = %d filename = %s iotype = %d mode = %d", len, filename, iotype, mode)); @@ -1998,13 +1998,13 @@ int delete_file_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&len, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Get space for the filename. */ char filename[len + 1]; if ((mpierr = MPI_Bcast(filename, len + 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "delete_file_handler got parameters len = %d filename = %s", len, filename)); @@ -2044,11 +2044,11 @@ int initdecomp_dof_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&iosysid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&pio_type, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&ndims, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Now we know the size of these arrays. */ int dims[ndims]; @@ -2056,37 +2056,37 @@ int initdecomp_dof_handler(iosystem_desc_t *ios) PIO_Offset iocount[ndims]; if ((mpierr = MPI_Bcast(dims, ndims, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&maplen, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); PIO_Offset *compmap; if (!(compmap = malloc(maplen * sizeof(PIO_Offset)))) return pio_err(NULL, NULL, PIO_ENOMEM, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(compmap, maplen, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&rearranger_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (rearranger_present) if ((mpierr = MPI_Bcast(&rearranger, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&iostart_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (iostart_present) if ((mpierr = MPI_Bcast(iostart, ndims, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&iocount_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (iocount_present) if ((mpierr = MPI_Bcast(iocount, ndims, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "initdecomp_dof_handler iosysid = %d pio_type = %d ndims = %d maplen = %d " "rearranger_present = %d iostart_present = %d iocount_present = %d ", @@ -2144,46 +2144,46 @@ int write_darray_multi_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&nvars, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); int varids[nvars]; if ((mpierr = MPI_Bcast(varids, nvars, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&ioid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Get decomposition information. */ if (!(iodesc = pio_get_iodesc_from_id(ioid))) return pio_err(ios, NULL, PIO_EBADID, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&arraylen, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (!(array = malloc(arraylen * iodesc->piotype_size))) return pio_err(NULL, NULL, PIO_ENOMEM, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(array, arraylen * iodesc->piotype_size, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&frame_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (frame_present) { if (!(frame = malloc(nvars * sizeof(int)))) return pio_err(ios, NULL, PIO_ENOMEM, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(frame, nvars, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } if ((mpierr = MPI_Bcast(&fillvalue_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (fillvalue_present) { if (!(fillvalue = malloc(nvars * iodesc->piotype_size))) return pio_err(ios, NULL, PIO_ENOMEM, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(fillvalue, nvars * iodesc->piotype_size, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } if ((mpierr = MPI_Bcast(&flushtodisk, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "write_darray_multi_handler ncid = %d nvars = %d ioid = %d arraylen = %d " "frame_present = %d fillvalue_present flushtodisk = %d", ncid, nvars, ioid, arraylen, frame_present, fillvalue_present, flushtodisk)); @@ -2261,9 +2261,9 @@ int seterrorhandling_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the he comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&method, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&old_method_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "seterrorhandling_handler got parameters method = %d old_method_present = %d", method, old_method_present)); @@ -2302,15 +2302,15 @@ int set_chunk_cache_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&iosysid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&iotype, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&size, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&nelems, 1, MPI_OFFSET, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&preemption, 1, MPI_FLOAT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "set_chunk_cache_handler got params iosysid = %d iotype = %d size = %d " "nelems = %d preemption = %g", iosysid, iotype, size, nelems, preemption)); @@ -2346,15 +2346,15 @@ int get_chunk_cache_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&iosysid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&iotype, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&size_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&nelems_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&preemption_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "get_chunk_cache_handler got params iosysid = %d iotype = %d size_present = %d " "nelems_present = %d preemption_present = %g", iosysid, iotype, size_present, nelems_present, preemption_present)); @@ -2399,15 +2399,15 @@ int get_var_chunk_cache_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&size_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&nelems_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&preemption_present, 1, MPI_CHAR, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "get_var_chunk_cache_handler got params ncid = %d varid = %d size_present = %d " "nelems_present = %d preemption_present = %g", ncid, varid, size_present, nelems_present, preemption_present)); @@ -2447,9 +2447,9 @@ int freedecomp_handler(iosystem_desc_t *ios) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&iosysid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&ioid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "freedecomp_handler iosysid = %d ioid = %d", iosysid, ioid)); /* Call the function. */ @@ -2480,7 +2480,7 @@ int finalize_handler(iosystem_desc_t *ios, int index) /* Get the parameters for this function that the the comp master * task is broadcasting. */ if ((mpierr = MPI_Bcast(&iosysid, 1, MPI_INT, 0, ios->intercomm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((1, "finalize_handler got parameter iosysid = %d", iosysid)); /* Call the function. */ @@ -2527,7 +2527,7 @@ int pio_msg_handler2(int io_rank, int component_count, iosystem_desc_t **iosys, LOG((1, "about to call MPI_Irecv union_comm = %d", my_iosys->union_comm)); if ((mpierr = MPI_Irecv(&(messages[cmp]), 1, MPI_INT, my_iosys->comproot, MPI_ANY_TAG, my_iosys->union_comm, &req[cmp]))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); LOG((1, "MPI_Irecv req[%d] = %d", cmp, req[cmp])); } } @@ -2547,7 +2547,7 @@ int pio_msg_handler2(int io_rank, int component_count, iosystem_desc_t **iosys, for (int c = 0; c < component_count; c++) LOG((3, "req[%d] = %d", c, req[c])); if ((mpierr = MPI_Waitany(component_count, req, &index, &status))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); LOG((3, "Waitany returned index = %d req[%d] = %d", index, index, req[index])); msg = messages[index]; for (int c = 0; c < component_count; c++) @@ -2558,7 +2558,7 @@ int pio_msg_handler2(int io_rank, int component_count, iosystem_desc_t **iosys, * originated the request to the rest of the IO tasks. */ LOG((3, "About to do Bcast of index = %d io_comm = %d", index, io_comm)); if ((mpierr = MPI_Bcast(&index, 1, MPI_INT, 0, io_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); LOG((3, "index MPI_Bcast complete index = %d", index)); /* Set the correct iosys depending on the index. */ @@ -2567,7 +2567,7 @@ int pio_msg_handler2(int io_rank, int component_count, iosystem_desc_t **iosys, /* Broadcast the msg value to the rest of the IO tasks. */ LOG((3, "about to call msg MPI_Bcast io_comm = %d", io_comm)); if ((mpierr = MPI_Bcast(&msg, 1, MPI_INT, 0, io_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); LOG((1, "pio_msg_handler2 msg MPI_Bcast complete msg = %d", msg)); /* Handle the message. This code is run on all IO tasks. */ @@ -2738,7 +2738,7 @@ int pio_msg_handler2(int io_rank, int component_count, iosystem_desc_t **iosys, index, my_iosys->comproot, my_iosys->union_comm)); if ((mpierr = MPI_Irecv(&(messages[index]), 1, MPI_INT, my_iosys->comproot, MPI_ANY_TAG, my_iosys->union_comm, &req[index]))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); LOG((3, "pio_msg_handler2 called MPI_Irecv req[%d] = %d", index, req[index])); } diff --git a/src/clib/pio_nc.c b/src/clib/pio_nc.c index bca31c07597..f747320e721 100644 --- a/src/clib/pio_nc.c +++ b/src/clib/pio_nc.c @@ -79,9 +79,9 @@ int PIOc_inq(int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdimidp) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -129,26 +129,26 @@ int PIOc_inq(int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdimidp) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); /* Broadcast results to all tasks. Ignore NULL parameters. */ if (ndimsp) if ((mpierr = MPI_Bcast(ndimsp, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (nvarsp) if ((mpierr = MPI_Bcast(nvarsp, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ngattsp) if ((mpierr = MPI_Bcast(ngattsp, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (unlimdimidp) if ((mpierr = MPI_Bcast(unlimdimidp, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -264,9 +264,9 @@ int PIOc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } LOG((2, "file->iotype = %d", file->iotype)); @@ -331,21 +331,21 @@ int PIOc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); /* Broadcast results to all tasks. Ignore NULL parameters. */ if ((mpierr = MPI_Bcast(&tmp_nunlimdims, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (nunlimdimsp) if ((mpierr = MPI_Bcast(nunlimdimsp, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (unlimdimidsp) if ((mpierr = MPI_Bcast(unlimdimidsp, tmp_nunlimdims, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -399,9 +399,9 @@ int PIOc_inq_type(int ncid, nc_type xtype, char *name, PIO_Offset *sizep) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -419,7 +419,7 @@ int PIOc_inq_type(int ncid, nc_type xtype, char *name, PIO_Offset *sizep) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -430,14 +430,14 @@ int PIOc_inq_type(int ncid, nc_type xtype, char *name, PIO_Offset *sizep) if (ios->iomaster == MPI_ROOT) slen = strlen(name); if ((mpierr = MPI_Bcast(&slen, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (!mpierr) if ((mpierr = MPI_Bcast((void *)name, slen + 1, MPI_CHAR, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } if (sizep) if ((mpierr = MPI_Bcast(sizep , 1, MPI_OFFSET, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -484,9 +484,9 @@ int PIOc_inq_format(int ncid, int *formatp) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -504,14 +504,14 @@ int PIOc_inq_format(int ncid, int *formatp) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); /* Broadcast results to all tasks. Ignore NULL parameters. */ if (formatp) if ((mpierr = MPI_Bcast(formatp , 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -571,9 +571,9 @@ int PIOc_inq_dim(int ncid, int dimid, char *name, PIO_Offset *lenp) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -597,7 +597,7 @@ int PIOc_inq_dim(int ncid, int dimid, char *name, PIO_Offset *lenp) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -609,14 +609,14 @@ int PIOc_inq_dim(int ncid, int dimid, char *name, PIO_Offset *lenp) if (ios->iomaster == MPI_ROOT) slen = strlen(name); if ((mpierr = MPI_Bcast(&slen, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast((void *)name, slen + 1, MPI_CHAR, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } if (lenp) if ((mpierr = MPI_Bcast(lenp , 1, MPI_OFFSET, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((2, "done with PIOc_inq_dim")); return PIO_NOERR; @@ -713,9 +713,9 @@ int PIOc_inq_dimid(int ncid, const char *name, int *idp) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* IO tasks call the netCDF functions. */ @@ -733,14 +733,14 @@ int PIOc_inq_dimid(int ncid, const char *name, int *idp) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); /* Broadcast results. */ if (idp) if ((mpierr = MPI_Bcast(idp, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -814,9 +814,9 @@ int PIOc_inq_var(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* Call the netCDF layer. */ @@ -868,7 +868,7 @@ int PIOc_inq_var(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -879,32 +879,32 @@ int PIOc_inq_var(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, if (ios->iomaster == MPI_ROOT) slen = strlen(name); if ((mpierr = MPI_Bcast(&slen, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast((void *)name, slen + 1, MPI_CHAR, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } if (xtypep) if ((mpierr = MPI_Bcast(xtypep, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ndimsp) { LOG((2, "PIOc_inq_var about to Bcast ndims = %d ios->ioroot = %d ios->my_comm = %d", *ndimsp, ios->ioroot, ios->my_comm)); if ((mpierr = MPI_Bcast(ndimsp, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((2, "PIOc_inq_var Bcast ndims = %d", *ndimsp)); } if (dimidsp) { if ((mpierr = MPI_Bcast(&ndims, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(dimidsp, ndims, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } if (nattsp) if ((mpierr = MPI_Bcast(nattsp, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -1043,9 +1043,9 @@ int PIOc_inq_varid(int ncid, const char *name, int *varidp) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -1062,14 +1062,14 @@ int PIOc_inq_varid(int ncid, const char *name, int *varidp) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); /* Broadcast results to all tasks. Ignore NULL parameters. */ if (varidp) if ((mpierr = MPI_Bcast(varidp, 1, MPI_INT, ios->ioroot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -1142,9 +1142,9 @@ int PIOc_inq_att_eh(int ncid, int varid, const char *name, int eh, /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -1162,7 +1162,7 @@ int PIOc_inq_att_eh(int ncid, int varid, const char *name, int eh, /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (eh && ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -1171,10 +1171,10 @@ int PIOc_inq_att_eh(int ncid, int varid, const char *name, int eh, { if (xtypep) if ((mpierr = MPI_Bcast(xtypep, 1, MPI_INT, ios->ioroot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (lenp) if ((mpierr = MPI_Bcast(lenp, 1, MPI_OFFSET, ios->ioroot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } return ierr; @@ -1293,9 +1293,9 @@ int PIOc_inq_attname(int ncid, int varid, int attnum, char *name) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -1313,7 +1313,7 @@ int PIOc_inq_attname(int ncid, int varid, int attnum, char *name) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -1322,10 +1322,10 @@ int PIOc_inq_attname(int ncid, int varid, int attnum, char *name) { int namelen = strlen(name); if ((mpierr = MPI_Bcast(&namelen, 1, MPI_INT, ios->ioroot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); /* Casting to void to avoid warnings on some compilers. */ if ((mpierr = MPI_Bcast((void *)name, namelen + 1, MPI_CHAR, ios->ioroot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } return PIO_NOERR; @@ -1391,9 +1391,9 @@ int PIOc_inq_attid(int ncid, int varid, const char *name, int *idp) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -1411,14 +1411,14 @@ int PIOc_inq_attid(int ncid, int varid, const char *name, int *idp) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); /* Broadcast results. */ if (idp) if ((mpierr = MPI_Bcast(idp, 1, MPI_INT, ios->ioroot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -1480,9 +1480,9 @@ int PIOc_rename_dim(int ncid, int dimid, const char *name) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } @@ -1501,7 +1501,7 @@ int PIOc_rename_dim(int ncid, int dimid, const char *name) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -1566,9 +1566,9 @@ int PIOc_rename_var(int ncid, int varid, const char *name) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } @@ -1587,7 +1587,7 @@ int PIOc_rename_var(int ncid, int varid, const char *name) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -1659,9 +1659,9 @@ int PIOc_rename_att(int ncid, int varid, const char *name, /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -1678,7 +1678,7 @@ int PIOc_rename_att(int ncid, int varid, const char *name, /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -1743,9 +1743,9 @@ int PIOc_del_att(int ncid, int varid, const char *name) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -1762,7 +1762,7 @@ int PIOc_del_att(int ncid, int varid, const char *name) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -1823,9 +1823,9 @@ int PIOc_set_fill(int ncid, int fillmode, int *old_modep) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -1845,7 +1845,7 @@ int PIOc_set_fill(int ncid, int fillmode, int *old_modep) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -1854,7 +1854,7 @@ int PIOc_set_fill(int ncid, int fillmode, int *old_modep) { LOG((2, "old_mode = %d", *old_modep)); if ((mpierr = MPI_Bcast(old_modep, 1, MPI_INT, ios->ioroot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } LOG((2, "PIOc_set_fill succeeded")); @@ -1957,9 +1957,9 @@ int PIOc_def_dim(int ncid, const char *name, PIO_Offset len, int *idp) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -1976,14 +1976,14 @@ int PIOc_def_dim(int ncid, const char *name, PIO_Offset len, int *idp) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); /* Broadcast results to all tasks. Ignore NULL parameters. */ if (idp) if ((mpierr = MPI_Bcast(idp , 1, MPI_INT, ios->ioroot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((2, "def_dim ierr = %d", ierr)); return PIO_NOERR; @@ -2051,7 +2051,7 @@ int PIOc_def_var(int ncid, const char *name, nc_type xtype, int ndims, mpi_type_size = 0; else if ((mpierr = MPI_Type_size(mpi_type, &mpi_type_size))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* How many unlimited dims are present in the file? */ if ((ierr = PIOc_inq_unlimdims(ncid, &nunlimdims, NULL))) @@ -2120,21 +2120,21 @@ int PIOc_def_var(int ncid, const char *name, nc_type xtype, int ndims, /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); /* Broadcast values currently only known on computation tasks to IO tasks. */ if ((mpierr = MPI_Bcast(&rec_var, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&invalid_unlim_dim, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&pio_type_size, 1, MPI_OFFSET, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&mpi_type, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&mpi_type_size, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* Check that only one unlimited dim is specified, and that it is @@ -2165,13 +2165,13 @@ int PIOc_def_var(int ncid, const char *name, nc_type xtype, int ndims, /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); /* Broadcast results. */ if ((mpierr = MPI_Bcast(&varid, 1, MPI_INT, ios->ioroot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (varidp) *varidp = varid; @@ -2275,15 +2275,15 @@ int PIOc_def_var_fill(int ncid, int varid, int fill_mode, const void *fill_value /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); /* Broadcast values currently only known on computation tasks to IO tasks. */ if ((mpierr = MPI_Bcast(&xtype, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&type_size, 1, MPI_OFFSET, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } if (ios->ioproc) @@ -2316,7 +2316,7 @@ int PIOc_def_var_fill(int ncid, int varid, int fill_mode, const void *fill_value /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -2401,15 +2401,15 @@ int PIOc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); /* Broadcast values currently only known on computation tasks to IO tasks. */ if ((mpierr = MPI_Bcast(&xtype, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&type_size, 1, MPI_OFFSET, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -2493,17 +2493,17 @@ int PIOc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); /* Broadcast results to all tasks. Ignore NULL parameters. */ if (no_fill) if ((mpierr = MPI_Bcast(no_fill, 1, MPI_INT, ios->ioroot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (fill_valuep) if ((mpierr = MPI_Bcast(fill_valuep, type_size, MPI_CHAR, ios->ioroot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); return PIO_NOERR; } diff --git a/src/clib/pio_nc4.c b/src/clib/pio_nc4.c index 7d3ddf0898f..f48c9fa5577 100644 --- a/src/clib/pio_nc4.c +++ b/src/clib/pio_nc4.c @@ -72,9 +72,9 @@ int PIOc_def_var_deflate(int ncid, int varid, int shuffle, int deflate, /* Handle MPI errors from computation tasks. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } if (ios->ioproc) @@ -90,7 +90,7 @@ int PIOc_def_var_deflate(int ncid, int varid, int shuffle, int deflate, /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -174,9 +174,9 @@ int PIOc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep, /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } if (ios->ioproc) @@ -189,20 +189,20 @@ int PIOc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep, /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); /* Broadcast results to all tasks. */ if (shufflep) if ((mpierr = MPI_Bcast(shufflep, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (deflatep) if ((mpierr = MPI_Bcast(deflatep, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (deflate_levelp) if ((mpierr = MPI_Bcast(deflate_levelp, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -289,13 +289,13 @@ int PIOc_def_var_chunking(int ncid, int varid, int storage, const PIO_Offset *ch /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); /* Broadcast values currently only known on computation tasks to IO tasks. */ if ((mpierr = MPI_Bcast(&ndims, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } LOG((2, "PIOc_def_var_chunking ndims = %d", ndims)); @@ -324,7 +324,7 @@ int PIOc_def_var_chunking(int ncid, int varid, int storage, const PIO_Offset *ch /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -410,13 +410,13 @@ int PIOc_inq_var_chunking(int ncid, int varid, int *storagep, PIO_Offset *chunks /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); /* Broadcast values currently only known on computation tasks to IO tasks. */ if ((mpierr = MPI_Bcast(&ndims, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -444,19 +444,19 @@ int PIOc_inq_var_chunking(int ncid, int varid, int *storagep, PIO_Offset *chunks /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); /* Broadcast results to all tasks. */ if ((mpierr = MPI_Bcast(&ndims, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (storagep) if ((mpierr = MPI_Bcast(storagep, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (chunksizesp) if ((mpierr = MPI_Bcast(chunksizesp, ndims, MPI_OFFSET, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -520,9 +520,9 @@ int PIOc_def_var_endian(int ncid, int varid, int endian) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } if (ios->ioproc) @@ -535,7 +535,7 @@ int PIOc_def_var_endian(int ncid, int varid, int endian) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -600,9 +600,9 @@ int PIOc_inq_var_endian(int ncid, int varid, int *endianp) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -616,14 +616,14 @@ int PIOc_inq_var_endian(int ncid, int varid, int *endianp) /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); /* Broadcast results to all tasks. */ if (endianp) if ((mpierr = MPI_Bcast(endianp, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -695,9 +695,9 @@ int PIOc_set_chunk_cache(int iosysid, int iotype, PIO_Offset size, PIO_Offset ne /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr2, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -715,7 +715,7 @@ int PIOc_set_chunk_cache(int iosysid, int iotype, PIO_Offset size, PIO_Offset ne /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if (ierr) check_netcdf2(ios, NULL, ierr, __FILE__, __LINE__); @@ -800,9 +800,9 @@ int PIOc_get_chunk_cache(int iosysid, int iotype, PIO_Offset *sizep, PIO_Offset /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr2, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -820,7 +820,7 @@ int PIOc_get_chunk_cache(int iosysid, int iotype, PIO_Offset *sizep, PIO_Offset /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "bcast complete ierr = %d sizep = %d", ierr, sizep)); if (ierr) return check_netcdf(NULL, ierr, __FILE__, __LINE__); @@ -829,19 +829,19 @@ int PIOc_get_chunk_cache(int iosysid, int iotype, PIO_Offset *sizep, PIO_Offset { LOG((2, "bcasting size = %d ios->ioroot = %d", *sizep, ios->ioroot)); if ((mpierr = MPI_Bcast(sizep, 1, MPI_OFFSET, ios->ioroot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "bcast size = %d", *sizep)); } if (nelemsp) { if ((mpierr = MPI_Bcast(nelemsp, 1, MPI_OFFSET, ios->ioroot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "bcast complete nelems = %d", *nelemsp)); } if (preemptionp) { if ((mpierr = MPI_Bcast(preemptionp, 1, MPI_FLOAT, ios->ioroot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "bcast complete preemption = %d", *preemptionp)); } @@ -913,9 +913,9 @@ int PIOc_set_var_chunk_cache(int ncid, int varid, PIO_Offset size, PIO_Offset ne /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } if (ios->ioproc) @@ -928,7 +928,7 @@ int PIOc_set_var_chunk_cache(int ncid, int varid, PIO_Offset size, PIO_Offset ne /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); @@ -1007,9 +1007,9 @@ int PIOc_get_var_chunk_cache(int ncid, int varid, PIO_Offset *sizep, PIO_Offset /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr2, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -1024,20 +1024,20 @@ int PIOc_get_var_chunk_cache(int ncid, int varid, PIO_Offset *sizep, PIO_Offset /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); /* Broadcast results to all tasks. */ if (sizep && !ierr) if ((mpierr = MPI_Bcast(sizep, 1, MPI_OFFSET, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (nelemsp && !ierr) if ((mpierr = MPI_Bcast(nelemsp, 1, MPI_OFFSET, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (preemptionp && !ierr) if ((mpierr = MPI_Bcast(preemptionp, 1, MPI_FLOAT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); return PIO_NOERR; } diff --git a/src/clib/pio_rearrange.c b/src/clib/pio_rearrange.c index da5e0906a27..fe449774358 100644 --- a/src/clib/pio_rearrange.c +++ b/src/clib/pio_rearrange.c @@ -249,7 +249,7 @@ int compute_maxIObuffersize(MPI_Comm io_comm, io_desc_t *iodesc) /* Share the max io buffer size with all io tasks. */ if ((mpierr = MPI_Allreduce(MPI_IN_PLACE, &totiosize, 1, MPI_OFFSET, MPI_MAX, io_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); pioassert(totiosize > 0, "totiosize <= 0", __FILE__, __LINE__); LOG((2, "after allreduce compute_maxIObuffersize got totiosize = %lld", totiosize)); @@ -391,7 +391,7 @@ int create_mpi_datatypes(MPI_Datatype mpitype, int msgcnt, free(displace); if (mpierr) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (mtype[i] == PIO_DATATYPE_NULL) return pio_err(NULL, NULL, PIO_EINVAL, __FILE__, __LINE__); @@ -399,7 +399,7 @@ int create_mpi_datatypes(MPI_Datatype mpitype, int msgcnt, /* Commit the MPI data type. */ LOG((3, "about to commit type")); if ((mpierr = MPI_Type_commit(&mtype[i]))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); pos += mcount[i]; } } @@ -835,7 +835,7 @@ int rearrange_comp2io(iosystem_desc_t *ios, io_desc_t *iodesc, void *sbuf, /* Get the number of tasks. */ if ((mpierr = MPI_Comm_size(mycomm, &ntasks))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); /* These are parameters to pio_swapm to send data from compute to * IO tasks. */ @@ -886,12 +886,12 @@ int rearrange_comp2io(iosystem_desc_t *ios, io_desc_t *iodesc, void *sbuf, * collected array (llen). */ if ((mpierr = MPI_Type_create_hvector(nvars, 1, (MPI_Aint)iodesc->llen * iodesc->mpitype_size, iodesc->rtype[i], &recvtypes[i]))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); pioassert(recvtypes[i] != PIO_DATATYPE_NULL, "bad mpi type", __FILE__, __LINE__); if ((mpierr = MPI_Type_commit(&recvtypes[i]))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } else { @@ -902,13 +902,13 @@ int rearrange_comp2io(iosystem_desc_t *ios, io_desc_t *iodesc, void *sbuf, if ((mpierr = MPI_Type_create_hvector(nvars, 1, (MPI_Aint)iodesc->llen * iodesc->mpitype_size, iodesc->rtype[i], &recvtypes[iodesc->rfrom[i]]))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); pioassert(recvtypes[iodesc->rfrom[i]] != PIO_DATATYPE_NULL, "bad mpi type", __FILE__, __LINE__); if ((mpierr = MPI_Type_commit(&recvtypes[iodesc->rfrom[i]]))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); rdispls[iodesc->rfrom[i]] = 0; } @@ -934,11 +934,11 @@ int rearrange_comp2io(iosystem_desc_t *ios, io_desc_t *iodesc, void *sbuf, sendcounts[io_comprank] = 1; if ((mpierr = MPI_Type_create_hvector(nvars, 1, (MPI_Aint)iodesc->ndof * iodesc->mpitype_size, iodesc->stype[i], &sendtypes[io_comprank]))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); pioassert(sendtypes[io_comprank] != PIO_DATATYPE_NULL, "bad mpi type", __FILE__, __LINE__); if ((mpierr = MPI_Type_commit(&sendtypes[io_comprank]))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } else { @@ -960,11 +960,11 @@ int rearrange_comp2io(iosystem_desc_t *ios, io_desc_t *iodesc, void *sbuf, LOG((3, "freeing MPI types for task %d", i)); if (sendtypes[i] != PIO_DATATYPE_NULL) if ((mpierr = MPI_Type_free(&sendtypes[i]))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (recvtypes[i] != PIO_DATATYPE_NULL) if ((mpierr = MPI_Type_free(&recvtypes[i]))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } #ifdef TIMING @@ -1017,7 +1017,7 @@ int rearrange_io2comp(iosystem_desc_t *ios, io_desc_t *iodesc, void *sbuf, /* Get the size of this communicator. */ if ((mpierr = MPI_Comm_size(mycomm, &ntasks))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Define the MPI data types that will be used for this * io_desc_t. */ @@ -1141,7 +1141,7 @@ int determine_fill(iosystem_desc_t *ios, io_desc_t *iodesc, const int *gdimlen, totalllen, totalgridsize)); if ((mpierr = MPI_Allreduce(MPI_IN_PLACE, &totalllen, 1, PIO_OFFSET, MPI_SUM, ios->union_comm))) - check_mpi(NULL, mpierr, __FILE__, __LINE__); + check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); LOG((2, "after allreduce totalllen = %d", totalllen)); /* If the total size of the data provided to be written is < the @@ -1907,7 +1907,7 @@ int default_subset_partition(iosystem_desc_t *ios, io_desc_t *iodesc) /* Create new communicators. */ if ((mpierr = MPI_Comm_split(ios->comp_comm, color, key, &iodesc->subset_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -1991,9 +1991,9 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma /* Get size of this subset communicator and rank of this task in it. */ if ((mpierr = MPI_Comm_rank(iodesc->subset_comm, &rank))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Comm_size(iodesc->subset_comm, &ntasks))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Check rank for correctness. */ if (ios->ioproc) @@ -2052,7 +2052,7 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma * to its associated IO task. */ if ((mpierr = MPI_Gather(iodesc->scount, 1, MPI_INT, iodesc->rcount, rcnt, MPI_INT, 0, iodesc->subset_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); iodesc->llen = 0; @@ -2097,7 +2097,7 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma if ((mpierr = MPI_Gatherv(iodesc->sindex, iodesc->scount[0], PIO_OFFSET, srcindex, recvcounts, rdispls, PIO_OFFSET, 0, iodesc->subset_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); /* On IO tasks which need it, allocate memory for the map and the * iomap. */ @@ -2131,7 +2131,7 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma * put gathered results into iomap. */ if ((mpierr = MPI_Gatherv(shrtmap, iodesc->scount[0], PIO_OFFSET, iomap, recvcounts, rdispls, PIO_OFFSET, 0, iodesc->subset_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (shrtmap != compmap) free(shrtmap); @@ -2227,7 +2227,7 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma /* Gather cnt from all tasks in the IO communicator into array gcnt. */ if ((mpierr = MPI_Gather(&cnt, 1, MPI_INT, gcnt, 1, MPI_INT, nio, ios->io_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (nio == ios->io_rank) { @@ -2246,7 +2246,7 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma if ((mpierr = MPI_Gatherv(&iomap[imin], cnt, PIO_OFFSET, myusegrid, gcnt, displs, PIO_OFFSET, nio, ios->io_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } /* Allocate and initialize a grid to fill in missing values. ??? */ @@ -2314,7 +2314,7 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma * the IO communicator. */ if ((mpierr = MPI_Allreduce(MPI_IN_PLACE, &maxregions, 1, MPI_INT, MPI_MAX, ios->io_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); iodesc->maxfillregions = maxregions; /* Get the max maxholegridsize, and distribute it to all tasks @@ -2322,14 +2322,14 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma iodesc->maxholegridsize = iodesc->holegridsize; if ((mpierr = MPI_Allreduce(MPI_IN_PLACE, &(iodesc->maxholegridsize), 1, MPI_INT, MPI_MAX, ios->io_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } /* Scatter values of srcindex to subset communicator. ??? */ if ((mpierr = MPI_Scatterv((void *)srcindex, recvcounts, rdispls, PIO_OFFSET, (void *)iodesc->sindex, iodesc->scount[0], PIO_OFFSET, 0, iodesc->subset_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (ios->ioproc) { @@ -2342,7 +2342,7 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma /* Get the max maxregions, and distribute it to all tasks in * the IO communicator. */ if ((mpierr = MPI_Allreduce(MPI_IN_PLACE, &maxregions, 1, MPI_INT, MPI_MAX, ios->io_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); iodesc->maxregions = maxregions; /* Free resources. */ @@ -2388,7 +2388,7 @@ void performance_tune_rearranger(iosystem_desc_t *ios, io_desc_t *iodesc) tsize = 0; else if ((mpierr = MPI_Type_size(iodesc->mpitype, &tsize))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); cbuf = NULL; ibuf = NULL; if (iodesc->ndof > 0) @@ -2405,9 +2405,9 @@ void performance_tune_rearranger(iosystem_desc_t *ios, io_desc_t *iodesc) mycomm = iodesc->subset_comm; if ((mpierr = MPI_Comm_size(mycomm, &nprocs))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Comm_rank(mycomm, &myrank))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); int log2 = log(nprocs) / log(2) + 1; if (!(wall = bget(2 * 4 * log2 * sizeof(double)))) @@ -2415,14 +2415,14 @@ void performance_tune_rearranger(iosystem_desc_t *ios, io_desc_t *iodesc) double mintime; if ((mpierr = MPI_Barrier(mycomm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); GPTLstamp(&wall[0], &usr[0], &sys[0]); rearrange_comp2io(ios, iodesc, cbuf, ibuf, 1); rearrange_io2comp(ios, iodesc, ibuf, cbuf); GPTLstamp(&wall[1], &usr[1], &sys[1]); mintime = wall[1]-wall[0]; if ((mpierr = MPI_Allreduce(MPI_IN_PLACE, &mintime, 1, MPI_DOUBLE, MPI_MAX, mycomm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); handshake = iodesc->rearr_opts.comp2io.hs; isend = iodesc->isend; @@ -2448,7 +2448,7 @@ void performance_tune_rearranger(iosystem_desc_t *ios, io_desc_t *iodesc) { iodesc->max_requests = nreqs; if ((mpierr = MPI_Barrier(mycomm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); GPTLstamp(wall, usr, sys); rearrange_comp2io(ios, iodesc, cbuf, ibuf, 1); rearrange_io2comp(ios, iodesc, ibuf, cbuf); @@ -2456,7 +2456,7 @@ void performance_tune_rearranger(iosystem_desc_t *ios, io_desc_t *iodesc) wall[1] -= wall[0]; if ((mpierr = MPI_Allreduce(MPI_IN_PLACE, wall + 1, 1, MPI_DOUBLE, MPI_MAX, mycomm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (wall[1] < mintime * 0.95) { diff --git a/src/clib/pio_spmd.c b/src/clib/pio_spmd.c index 515cdd7da8e..59ccce7fc61 100644 --- a/src/clib/pio_spmd.c +++ b/src/clib/pio_spmd.c @@ -97,9 +97,9 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty /* Get my rank and size of communicator. */ if ((mpierr = MPI_Comm_size(comm, &ntasks))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Comm_rank(comm, &my_rank))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); LOG((2, "ntasks = %d my_rank = %d", ntasks, my_rank)); @@ -127,7 +127,7 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty LOG((3, "Calling MPI_Alltoallw without flow control.")); if ((mpierr = MPI_Alltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -155,17 +155,17 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty if ((mpierr = MPI_Sendrecv(sptr, sendcounts[my_rank],sendtypes[my_rank], my_rank, tag, rptr, recvcounts[my_rank], recvtypes[my_rank], my_rank, tag, comm, &status))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); #else if ((mpierr = MPI_Irecv(rptr, recvcounts[my_rank], recvtypes[my_rank], my_rank, tag, comm, rcvids))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Send(sptr, sendcounts[my_rank], sendtypes[my_rank], my_rank, tag, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Wait(rcvids, &status))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); #endif } @@ -246,7 +246,7 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty { tag = my_rank + offset_t; if ((mpierr = MPI_Irecv(&hs, 1, MPI_INT, p, tag, comm, hs_rcvids + istep))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } } } @@ -262,11 +262,11 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty if ((mpierr = MPI_Irecv(ptr, recvcounts[p], recvtypes[p], p, tag, comm, rcvids + istep))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (fc->hs) if ((mpierr = MPI_Send(&hs, 1, MPI_INT, p, tag, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } } @@ -283,7 +283,7 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty if (fc->hs) { if ((mpierr = MPI_Wait(hs_rcvids + istep, &status))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); hs_rcvids[istep] = MPI_REQUEST_NULL; } ptr = (char *)sendbuf + sdispls[p]; @@ -301,23 +301,23 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty #ifdef USE_MPI_ISEND_FOR_FC if ((mpierr = MPI_Isend(ptr, sendcounts[p], sendtypes[p], p, tag, comm, sndids + istep))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); #else if ((mpierr = MPI_Irsend(ptr, sendcounts[p], sendtypes[p], p, tag, comm, sndids + istep))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); #endif } else if (fc->isend) { if ((mpierr = MPI_Isend(ptr, sendcounts[p], sendtypes[p], p, tag, comm, sndids + istep))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } else { if ((mpierr = MPI_Send(ptr, sendcounts[p], sendtypes[p], p, tag, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } } @@ -329,7 +329,7 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty if (rcvids[p] != MPI_REQUEST_NULL) { if ((mpierr = MPI_Wait(rcvids + p, &status))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); rcvids[p] = MPI_REQUEST_NULL; } if (rstep < steps) @@ -339,7 +339,7 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty { tag = my_rank + offset_t; if ((mpierr = MPI_Irecv(&hs, 1, MPI_INT, p, tag, comm, hs_rcvids+rstep))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } if (recvcounts[p] > 0) { @@ -347,10 +347,10 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty ptr = (char *)recvbuf + rdispls[p]; if ((mpierr = MPI_Irecv(ptr, recvcounts[p], recvtypes[p], p, tag, comm, rcvids + rstep))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (fc->hs) if ((mpierr = MPI_Send(&hs, 1, MPI_INT, p, tag, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } rstep++; } @@ -363,10 +363,10 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty { LOG((2, "Waiting for outstanding msgs")); if ((mpierr = MPI_Waitall(steps, rcvids, MPI_STATUSES_IGNORE))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (fc->isend) if ((mpierr = MPI_Waitall(steps, sndids, MPI_STATUSES_IGNORE))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } return PIO_NOERR; @@ -421,9 +421,9 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty /* if (fc_gather) */ /* { */ /* if ((mpierr = MPI_Comm_rank(comm, &mytask))) */ -/* return check_mpi(NULL, mpierr, __FILE__, __LINE__); */ +/* return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); */ /* if ((mpierr = MPI_Comm_size(comm, &nprocs))) */ -/* return check_mpi(NULL, mpierr, __FILE__, __LINE__); */ +/* return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); */ /* mtag = 2 * nprocs; */ /* hs = 1; */ @@ -437,7 +437,7 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty /* MPI_Request rcvid[gather_block_size]; */ /* if ((mpierr = MPI_Type_size(recvtype, &dsize))) */ -/* return check_mpi(NULL, mpierr, __FILE__, __LINE__); */ +/* return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); */ /* for (int p = 0; p < nprocs; p++) */ /* { */ @@ -449,41 +449,41 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty /* if (count > preposts) */ /* { */ /* if ((mpierr = MPI_Wait(rcvid + tail, &status))) */ -/* return check_mpi(NULL, mpierr, __FILE__, __LINE__); */ +/* return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); */ /* tail = (tail + 1) % preposts; */ /* } */ /* void *ptr = (void *)((char *)recvbuf + dsize * displs[p]); */ /* if ((mpierr = MPI_Irecv(ptr, recvcnts[p], recvtype, p, mtag, comm, rcvid + head))) */ -/* return check_mpi(NULL, mpierr, __FILE__, __LINE__); */ +/* return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); */ /* head = (head + 1) % preposts; */ /* if ((mpierr = MPI_Send(&hs, 1, MPI_INT, p, mtag, comm))) */ -/* return check_mpi(NULL, mpierr, __FILE__, __LINE__); */ +/* return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); */ /* } */ /* } */ /* } */ /* /\* copy local data *\/ */ /* if ((mpierr = MPI_Type_size(sendtype, &dsize))) */ -/* return check_mpi(NULL, mpierr, __FILE__, __LINE__); */ +/* return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); */ /* if ((mpierr = MPI_Sendrecv(sendbuf, sendcnt, sendtype, mytask, 102, recvbuf, recvcnts[mytask], */ /* recvtype, mytask, 102, comm, &status))) */ -/* return check_mpi(NULL, mpierr, __FILE__, __LINE__); */ +/* return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); */ /* count = min(count, preposts); */ /* if (count > 0) */ /* if ((mpierr = MPI_Waitall(count, rcvid, MPI_STATUSES_IGNORE))) */ -/* return check_mpi(NULL, mpierr, __FILE__, __LINE__); */ +/* return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); */ /* } */ /* else */ /* { */ /* if (sendcnt > 0) */ /* { */ /* if ((mpierr = MPI_Recv(&hs, 1, MPI_INT, root, mtag, comm, &status))) */ -/* return check_mpi(NULL, mpierr, __FILE__, __LINE__); */ +/* return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); */ /* if ((mpierr = MPI_Send(sendbuf, sendcnt, sendtype, root, mtag, comm))) */ -/* return check_mpi(NULL, mpierr, __FILE__, __LINE__); */ +/* return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); */ /* } */ /* } */ /* } */ @@ -491,7 +491,7 @@ int pio_swapm(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendty /* { */ /* if ((mpierr = MPI_Gatherv(sendbuf, sendcnt, sendtype, recvbuf, recvcnts, */ /* displs, recvtype, root, comm))) */ -/* return check_mpi(NULL, mpierr, __FILE__, __LINE__); */ +/* return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); */ /* } */ /* return PIO_NOERR; */ diff --git a/src/clib/pioc.c b/src/clib/pioc.c index f9db2c1d8c9..3f05065e3cc 100644 --- a/src/clib/pioc.c +++ b/src/clib/pioc.c @@ -156,9 +156,9 @@ int PIOc_advanceframe(int ncid, int varid) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi2(ios, NULL, mpierr2, __FILE__, __LINE__); + check_mpi(ios, NULL, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } /* Increment the record number. */ @@ -219,9 +219,9 @@ int PIOc_setframe(int ncid, int varid, int frame) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi2(ios, NULL, mpierr2, __FILE__, __LINE__); + check_mpi(ios, NULL, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } /* Set the record dimension value for this variable. This will be @@ -350,9 +350,9 @@ int PIOc_set_iosystem_error_handling(int iosysid, int method, int *old_method) /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi2(ios, NULL, mpierr2, __FILE__, __LINE__); + check_mpi(ios, NULL, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } /* Return the current handler. */ @@ -497,9 +497,9 @@ int PIOc_InitDecomp(int iosysid, int pio_type, int ndims, const int *gdimlen, in /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr2, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } /* Allocate space for the iodesc info. This also allocates the @@ -617,7 +617,7 @@ int PIOc_InitDecomp(int iosysid, int pio_type, int ndims, const int *gdimlen, in * of io tasks used may vary. */ if ((mpierr = MPI_Bcast(&(iodesc->num_aiotasks), 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((3, "iodesc->num_aiotasks = %d", iodesc->num_aiotasks)); /* Compute the communications pattern for this decomposition. */ @@ -631,7 +631,7 @@ int PIOc_InitDecomp(int iosysid, int pio_type, int ndims, const int *gdimlen, in { LOG((3, "createfile bcasting pio_next_ioid %d", pio_next_ioid)); if ((mpierr = MPI_Bcast(&pio_next_ioid, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((3, "createfile bcast pio_next_ioid %d", pio_next_ioid)); } @@ -860,7 +860,7 @@ int PIOc_Init_Intracomm(MPI_Comm comp_comm, int num_iotasks, int stride, int bas /* Find the number of computation tasks. */ if ((mpierr = MPI_Comm_size(comp_comm, &num_comptasks))) - return check_mpi2(NULL, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); /* Check the inputs. */ if (!iosysidp || num_iotasks < 1 || num_iotasks * stride > num_comptasks) @@ -889,11 +889,11 @@ int PIOc_Init_Intracomm(MPI_Comm comp_comm, int num_iotasks, int stride, int bas /* Copy the computation communicator into union_comm. */ if ((mpierr = MPI_Comm_dup(comp_comm, &ios->union_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Copy the computation communicator into comp_comm. */ if ((mpierr = MPI_Comm_dup(comp_comm, &ios->comp_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "union_comm = %d comp_comm = %d", ios->union_comm, ios->comp_comm)); ios->my_comm = ios->comp_comm; @@ -901,7 +901,7 @@ int PIOc_Init_Intracomm(MPI_Comm comp_comm, int num_iotasks, int stride, int bas /* Find MPI rank in comp_comm communicator. */ if ((mpierr = MPI_Comm_rank(ios->comp_comm, &ios->comp_rank))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* With non-async, all tasks are part of computation component. */ ios->compproc = true; @@ -940,16 +940,16 @@ int PIOc_Init_Intracomm(MPI_Comm comp_comm, int num_iotasks, int stride, int bas /* Create a group for the computation tasks. */ if ((mpierr = MPI_Comm_group(ios->comp_comm, &compgroup))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Create a group for the IO tasks. */ if ((mpierr = MPI_Group_incl(compgroup, ios->num_iotasks, ios->ioranks, &iogroup))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Create an MPI communicator for the IO tasks. */ if ((mpierr = MPI_Comm_create(ios->comp_comm, iogroup, &ios->io_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Free the MPI groups. */ if (compgroup != MPI_GROUP_NULL) @@ -964,7 +964,7 @@ int PIOc_Init_Intracomm(MPI_Comm comp_comm, int num_iotasks, int stride, int bas if (ios->ioproc) { if ((mpierr = MPI_Comm_rank(ios->io_comm, &ios->io_rank))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); } else ios->io_rank = -1; @@ -1055,12 +1055,12 @@ int PIOc_set_hint(int iosysid, const char *hint, const char *hintval) /* Make sure we have an info object. */ if (ios->info == MPI_INFO_NULL) if ((mpierr = MPI_Info_create(&ios->info))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Set the MPI hint. */ if (ios->ioproc) if ((mpierr = MPI_Info_set(ios->info, (char *)hint, (char *)hintval))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); return PIO_NOERR; } @@ -1115,9 +1115,9 @@ int PIOc_finalize(int iosysid) /* Handle MPI errors. */ LOG((3, "handling async errors mpierr = %d my_comm = %d", mpierr, ios->my_comm)); if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi2(ios, NULL, mpierr2, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((3, "async errors bcast")); } @@ -1361,7 +1361,7 @@ int PIOc_init_async(MPI_Comm world, int num_io_procs, int *io_proc_list, /* Get rank of this task in world. */ if ((ret = MPI_Comm_rank(world, &my_rank))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); /* Is this process in the IO component? */ int pidx; @@ -1380,7 +1380,7 @@ int PIOc_init_async(MPI_Comm world, int num_io_procs, int *io_proc_list, /* Create group for world. */ MPI_Group world_group; if ((ret = MPI_Comm_group(world, &world_group))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); LOG((3, "world group created")); /* We will create a group for the IO component. */ @@ -1398,12 +1398,12 @@ int PIOc_init_async(MPI_Comm world, int num_io_procs, int *io_proc_list, /* Create a group for the IO component. */ if ((ret = MPI_Group_incl(world_group, num_io_procs, my_io_proc_list, &io_group))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); LOG((3, "created IO group - io_group = %d MPI_GROUP_EMPTY = %d", io_group, MPI_GROUP_EMPTY)); /* There is one shared IO comm. Create it. */ if ((ret = MPI_Comm_create(world, io_group, &io_comm))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); LOG((3, "created io comm io_comm = %d", io_comm)); /* Does the user want a copy of the IO communicator? */ @@ -1412,7 +1412,7 @@ int PIOc_init_async(MPI_Comm world, int num_io_procs, int *io_proc_list, *user_io_comm = MPI_COMM_NULL; if (in_io) if ((mpierr = MPI_Comm_dup(io_comm, user_io_comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } /* For processes in the IO component, get their rank within the IO @@ -1421,7 +1421,7 @@ int PIOc_init_async(MPI_Comm world, int num_io_procs, int *io_proc_list, { LOG((3, "about to get io rank")); if ((ret = MPI_Comm_rank(io_comm, &io_rank))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); iomaster = !io_rank ? MPI_ROOT : MPI_PROC_NULL; LOG((3, "intracomm created for io_comm = %d io_rank = %d IO %s", io_comm, io_rank, iomaster == MPI_ROOT ? "MASTER" : "SERVANT")); @@ -1470,7 +1470,7 @@ int PIOc_init_async(MPI_Comm world, int num_io_procs, int *io_proc_list, /* Create a group for this component. */ if ((ret = MPI_Group_incl(world_group, num_procs_per_comp[cmp], my_proc_list[cmp], &group[cmp]))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); LOG((3, "created component MPI group - group[%d] = %d", cmp, group[cmp])); /* For all the computation components create a union group @@ -1523,7 +1523,7 @@ int PIOc_init_async(MPI_Comm world, int num_io_procs, int *io_proc_list, /* Create the union group. */ if ((ret = MPI_Group_incl(world_group, nprocs_union, proc_list_union, &union_group[cmp]))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); LOG((3, "created union MPI_group - union_group[%d] = %d with %d procs", cmp, union_group[cmp], nprocs_union)); @@ -1532,18 +1532,18 @@ int PIOc_init_async(MPI_Comm world, int num_io_procs, int *io_proc_list, * call. */ LOG((3, "creating intracomm cmp = %d from group[%d] = %d", cmp, cmp, group[cmp])); if ((ret = MPI_Comm_create(world, group[cmp], &my_iosys->comp_comm))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); if (in_cmp) { /* Does the user want a copy? */ if (user_comp_comm) if ((mpierr = MPI_Comm_dup(my_iosys->comp_comm, &user_comp_comm[cmp]))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); /* Get the rank in this comp comm. */ if ((ret = MPI_Comm_rank(my_iosys->comp_comm, &my_iosys->comp_rank))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); /* Set comp_rank 0 to be the compmaster. It will have a * setting of MPI_ROOT, all other tasks will have a @@ -1561,7 +1561,7 @@ int PIOc_init_async(MPI_Comm world, int num_io_procs, int *io_proc_list, { LOG((3, "making a dup of io_comm = %d io_rank = %d", io_comm, io_rank)); if ((ret = MPI_Comm_dup(io_comm, &my_iosys->io_comm))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); LOG((3, "dup of io_comm = %d io_rank = %d", my_iosys->io_comm, io_rank)); my_iosys->iomaster = iomaster; my_iosys->io_rank = io_rank; @@ -1581,13 +1581,13 @@ int PIOc_init_async(MPI_Comm world, int num_io_procs, int *io_proc_list, * are part of the union_comm. */ LOG((3, "before creating union_comm my_iosys->io_comm = %d group = %d", my_iosys->io_comm, union_group[cmp])); if ((ret = MPI_Comm_create(world, union_group[cmp], &my_iosys->union_comm))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); LOG((3, "created union comm for cmp %d my_iosys->union_comm %d", cmp, my_iosys->union_comm)); if (in_io || in_cmp) { if ((ret = MPI_Comm_rank(my_iosys->union_comm, &my_iosys->union_rank))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); LOG((3, "my_iosys->union_rank %d", my_iosys->union_rank)); /* Set my_comm to union_comm for async. */ @@ -1603,7 +1603,7 @@ int PIOc_init_async(MPI_Comm world, int num_io_procs, int *io_proc_list, "my_iosys->io_comm = %d", cmp, my_iosys->io_comm)); if ((ret = MPI_Intercomm_create(my_iosys->io_comm, 0, my_iosys->union_comm, my_iosys->num_iotasks, cmp, &my_iosys->intercomm))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); } else { @@ -1612,7 +1612,7 @@ int PIOc_init_async(MPI_Comm world, int num_io_procs, int *io_proc_list, my_iosys->comp_comm)); if ((ret = MPI_Intercomm_create(my_iosys->comp_comm, 0, my_iosys->union_comm, 0, cmp, &my_iosys->intercomm))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); } LOG((3, "intercomm created for cmp = %d", cmp)); } @@ -1637,7 +1637,7 @@ int PIOc_init_async(MPI_Comm world, int num_io_procs, int *io_proc_list, /* Free resources if needed. */ if (in_io) if ((mpierr = MPI_Comm_free(&io_comm))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); /* Free the arrays of processor numbers. */ for (int cmp = 0; cmp < component_count; cmp++) @@ -1647,18 +1647,18 @@ int PIOc_init_async(MPI_Comm world, int num_io_procs, int *io_proc_list, /* Free MPI groups. */ if ((ret = MPI_Group_free(&io_group))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); for (int cmp = 0; cmp < component_count; cmp++) { if ((ret = MPI_Group_free(&group[cmp]))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); if ((ret = MPI_Group_free(&union_group[cmp]))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); } if ((ret = MPI_Group_free(&world_group))) - return check_mpi(NULL, ret, __FILE__, __LINE__); + return check_mpi(NULL, NULL, ret, __FILE__, __LINE__); LOG((2, "successfully done with PIO_Init_Async")); return PIO_NOERR; diff --git a/src/clib/pioc_sc.c b/src/clib/pioc_sc.c index 9fe9b783094..f1d365db981 100644 --- a/src/clib/pioc_sc.c +++ b/src/clib/pioc_sc.c @@ -13,8 +13,8 @@ * rearranger is used. */ #define DEFAULT_BLOCKSIZE 1024 -/** The target blocksize for each io task when the box rearranger is - * used. */ +/** The target blocksize in bytes for each io task when the box + * rearranger is used. */ int blocksize = DEFAULT_BLOCKSIZE; /** @@ -37,7 +37,7 @@ int gcd(int a, int b ) * * @param a * @param b - * @returns greates common divisor. + * @returns greatest common divisor. */ long long lgcd(long long a, long long b) { diff --git a/src/clib/pioc_support.c b/src/clib/pioc_support.c index 1d4b1d9c681..c771e584c2d 100644 --- a/src/clib/pioc_support.c +++ b/src/clib/pioc_support.c @@ -340,33 +340,16 @@ void pioassert(_Bool expression, const char *msg, const char *fname, int line) * Handle MPI errors. An error message is sent to stderr, then the * check_netcdf() function is called with PIO_EIO. * - * @param file pointer to the file_desc_t info. Ignored if NULL. - * @param mpierr the MPI return code to handle - * @param filename the name of the code file where error occured. - * @param line the line of code where error occured. - * @return PIO_NOERR for no error, otherwise PIO_EIO. - */ -int check_mpi(file_desc_t *file, int mpierr, const char *filename, - int line) -{ - return check_mpi2(NULL, file, mpierr, filename, line); -} - -/** - * Handle MPI errors. An error message is sent to stderr, then the - * check_netcdf() function is called with PIO_EIO. This version of the - * function accepts an ios parameter, for the (rare) occasions where - * we have an ios but not a file. - * * @param ios pointer to the iosystem_info_t. May be NULL. - * @param file pointer to the file_desc_t info. May be NULL. + * @param file pointer to the file_desc_t info. Ignored if NULL. * @param mpierr the MPI return code to handle * @param filename the name of the code file where error occured. * @param line the line of code where error occured. * @return PIO_NOERR for no error, otherwise PIO_EIO. + * @author Ed Hartnett */ -int check_mpi2(iosystem_desc_t *ios, file_desc_t *file, int mpierr, - const char *filename, int line) +int check_mpi(iosystem_desc_t *ios, file_desc_t *file, int mpierr, + const char *filename, int line) { if (mpierr) { @@ -695,7 +678,7 @@ int malloc_iodesc(iosystem_desc_t *ios, int piotype, int ndims, (*iodesc)->mpitype_size = 0; else if ((mpierr = MPI_Type_size((*iodesc)->mpitype, &(*iodesc)->mpitype_size))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Initialize some values in the struct. */ (*iodesc)->maxregions = 1; @@ -776,10 +759,10 @@ int PIOc_freedecomp(int iosysid, int ioid) /* Handle MPI errors. */ LOG((3, "handline error mpierr %d ios->comproot %d", mpierr, ios->comproot)); if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(NULL, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr2, __FILE__, __LINE__); LOG((3, "handline error mpierr2 %d", mpierr2)); if (mpierr) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); } LOG((3, "freeing map, dimlen")); @@ -801,7 +784,7 @@ int PIOc_freedecomp(int iosysid, int ioid) for (int i = 0; i < iodesc->nrecvs; i++) if (iodesc->rtype[i] != PIO_DATATYPE_NULL) if ((mpierr = MPI_Type_free(&iodesc->rtype[i]))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); free(iodesc->rtype); } @@ -812,7 +795,7 @@ int PIOc_freedecomp(int iosysid, int ioid) for (int i = 0; i < iodesc->num_stypes; i++) if (iodesc->stype[i] != PIO_DATATYPE_NULL) if ((mpierr = MPI_Type_free(iodesc->stype + i))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); iodesc->num_stypes = 0; free(iodesc->stype); @@ -839,7 +822,7 @@ int PIOc_freedecomp(int iosysid, int ioid) if (iodesc->rearranger == PIO_REARR_SUBSET) if ((mpierr = MPI_Comm_free(&iodesc->subset_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); return pio_delete_iodesc_from_list(ioid); } @@ -873,9 +856,9 @@ int PIOc_readmap(const char *file, int *ndims, int **gdims, PIO_Offset *fmaplen, return pio_err(NULL, NULL, PIO_EINVAL, __FILE__, __LINE__); if ((mpierr = MPI_Comm_size(comm, &npes))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Comm_rank(comm, &myrank))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (myrank == 0) { @@ -892,9 +875,9 @@ int PIOc_readmap(const char *file, int *ndims, int **gdims, PIO_Offset *fmaplen, return pio_err(NULL, NULL, PIO_EINVAL, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&rnpes, 1, MPI_INT, 0, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(ndims, 1, MPI_INT, 0, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (!(tdims = calloc(*ndims, sizeof(int)))) return pio_err(NULL, NULL, PIO_ENOMEM, __FILE__, __LINE__); for (int i = 0; i < *ndims; i++) @@ -902,7 +885,7 @@ int PIOc_readmap(const char *file, int *ndims, int **gdims, PIO_Offset *fmaplen, pio_err(NULL, NULL, PIO_EINVAL, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(tdims, *ndims, MPI_INT, 0, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); for (int i = 0; i < rnpes; i++) { @@ -919,9 +902,9 @@ int PIOc_readmap(const char *file, int *ndims, int **gdims, PIO_Offset *fmaplen, if (i > 0) { if ((mpierr = MPI_Send(&maplen, 1, PIO_OFFSET, i, i + npes, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Send(tmap, maplen, PIO_OFFSET, i, i, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); free(tmap); } else @@ -935,22 +918,22 @@ int PIOc_readmap(const char *file, int *ndims, int **gdims, PIO_Offset *fmaplen, else { if ((mpierr = MPI_Bcast(&rnpes, 1, MPI_INT, 0, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(ndims, 1, MPI_INT, 0, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (!(tdims = calloc(*ndims, sizeof(int)))) return pio_err(NULL, NULL, PIO_ENOMEM, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(tdims, *ndims, MPI_INT, 0, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (myrank < rnpes) { if ((mpierr = MPI_Recv(&maplen, 1, PIO_OFFSET, 0, myrank + npes, comm, &status))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if (!(tmap = malloc(maplen * sizeof(PIO_Offset)))) return pio_err(NULL, NULL, PIO_ENOMEM, __FILE__, __LINE__); if ((mpierr = MPI_Recv(tmap, maplen, PIO_OFFSET, 0, myrank, comm, &status))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); *map = tmap; } else @@ -1038,12 +1021,12 @@ int PIOc_write_nc_decomp(int iosysid, const char *filename, int cmode, int ioid, * task_maplen array on all tasks. */ if ((mpierr = MPI_Allgather(&iodesc->maplen, 1, MPI_INT, task_maplen, 1, MPI_INT, ios->comp_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); /* Find the max maplen. */ if ((mpierr = MPI_Allreduce(&iodesc->maplen, &max_maplen, 1, MPI_INT, MPI_MAX, ios->comp_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((3, "max_maplen = %d", max_maplen)); if (!(full_map = malloc(sizeof(int) * ios->num_comptasks * max_maplen))) @@ -1064,7 +1047,7 @@ int PIOc_write_nc_decomp(int iosysid, const char *filename, int cmode, int ioid, /* Gather my_map from all computation tasks and fill the full_map array. */ if ((mpierr = MPI_Allgather(my_map, max_maplen, MPI_INT, full_map, max_maplen, MPI_INT, ios->comp_comm))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); free(my_map); @@ -1132,9 +1115,9 @@ int PIOc_read_nc_decomp(int iosysid, const char *filename, int *ioidp, MPI_Comm /* Get the communicator size and task rank. */ if ((mpierr = MPI_Comm_size(comm, &size))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Comm_rank(comm, &my_rank))) - return check_mpi2(ios, NULL, mpierr, __FILE__, __LINE__); + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); LOG((2, "size = %d my_rank = %d", size, my_rank)); /* Read the file. This allocates three arrays that we have to @@ -1628,9 +1611,9 @@ int PIOc_writemap(const char *file, int ndims, const int *gdims, PIO_Offset mapl LOG((1, "PIOc_writemap file = %s ndims = %d maplen = %d", file, ndims, maplen)); if ((mpierr = MPI_Comm_size(comm, &npes))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Comm_rank(comm, &myrank))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); LOG((2, "npes = %d myrank = %d", npes, myrank)); /* Allocate memory for the nmaplen. */ @@ -1639,7 +1622,7 @@ int PIOc_writemap(const char *file, int ndims, const int *gdims, PIO_Offset mapl return pio_err(NULL, NULL, PIO_ENOMEM, __FILE__, __LINE__); if ((mpierr = MPI_Gather(&maplen, 1, PIO_OFFSET, nmaplen, 1, PIO_OFFSET, 0, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); /* Only rank 0 writes the file. */ if (myrank == 0) @@ -1668,9 +1651,9 @@ int PIOc_writemap(const char *file, int ndims, const int *gdims, PIO_Offset mapl nmap = (PIO_Offset *)malloc(nmaplen[i] * sizeof(PIO_Offset)); if ((mpierr = MPI_Send(&i, 1, MPI_INT, i, npes + i, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Recv(nmap, nmaplen[i], PIO_OFFSET, i, i, comm, &status))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); LOG((2,"MPI_Recv map complete")); fprintf(fp, "%d %lld\n", i, nmaplen[i]); @@ -1693,10 +1676,10 @@ int PIOc_writemap(const char *file, int ndims, const int *gdims, PIO_Offset mapl { LOG((2,"ready to MPI_Recv...")); if ((mpierr = MPI_Recv(&i, 1, MPI_INT, 0, npes+myrank, comm, &status))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); LOG((2,"MPI_Recv got %d", i)); if ((mpierr = MPI_Send(map, maplen, PIO_OFFSET, 0, myrank, comm))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, NULL, mpierr, __FILE__, __LINE__); LOG((2,"MPI_Send map complete")); } @@ -1810,9 +1793,9 @@ int PIOc_createfile_int(int iosysid, int *ncidp, int *iotype, const char *filena /* Handle MPI errors. */ LOG((2, "handling mpi errors mpierr = %d", mpierr)); if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this task is in the IO component, do the IO. */ @@ -1851,7 +1834,7 @@ int PIOc_createfile_int(int iosysid, int *ncidp, int *iotype, const char *filena /* Broadcast and check the return code. */ if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); /* If there was an error, free the memory we allocated and handle error. */ if (ierr) @@ -1862,7 +1845,7 @@ int PIOc_createfile_int(int iosysid, int *ncidp, int *iotype, const char *filena /* Broadcast writablility to all tasks. */ if ((mpierr = MPI_Bcast(&file->writable, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); /* Broadcast next ncid to all tasks from io root, necessary * because files may be opened on mutilple iosystems, causing the @@ -1872,7 +1855,7 @@ int PIOc_createfile_int(int iosysid, int *ncidp, int *iotype, const char *filena { LOG((3, "createfile bcasting pio_next_ncid %d", pio_next_ncid)); if ((mpierr = MPI_Bcast(&pio_next_ncid, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((3, "createfile bcast pio_next_ncid %d", pio_next_ncid)); } @@ -2095,7 +2078,7 @@ int inq_file_metadata(file_desc_t *file, int ncid, int iotype, int *nvars, int * (*mpi_type_size)[v] = 0; else if ((mpierr = MPI_Type_size((*mpi_type)[v], &(*mpi_type_size)[v]))) - return check_mpi2(NULL, file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); /* What are the dimids associated with this var? */ if (var_ndims) @@ -2247,9 +2230,9 @@ int PIOc_openfile_retry(int iosysid, int *ncidp, int *iotype, const char *filena /* Handle MPI errors. */ if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - return check_mpi(file, mpierr2, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -2364,7 +2347,7 @@ int PIOc_openfile_retry(int iosysid, int *ncidp, int *iotype, const char *filena LOG((2, "Bcasting error code ierr %d ios->ioroot %d ios->my_comm %d", ierr, ios->ioroot, ios->my_comm)); if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); LOG((2, "Bcast openfile_retry error code ierr = %d", ierr)); /* If there was an error, free allocated memory and deal with the error. */ @@ -2376,18 +2359,18 @@ int PIOc_openfile_retry(int iosysid, int *ncidp, int *iotype, const char *filena /* Broadcast writability to all tasks. */ if ((mpierr = MPI_Bcast(&file->writable, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); /* Broadcast some values to all tasks from io root. */ if (ios->async) { LOG((3, "open bcasting pio_next_ncid %d ios->ioroot %d", pio_next_ncid, ios->ioroot)); if ((mpierr = MPI_Bcast(&pio_next_ncid, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } if ((mpierr = MPI_Bcast(&nvars, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); /* Non io tasks need to allocate to store info about variables. */ if (nvars && !rec_var) @@ -2406,15 +2389,15 @@ int PIOc_openfile_retry(int iosysid, int *ncidp, int *iotype, const char *filena if (nvars) { if ((mpierr = MPI_Bcast(rec_var, nvars, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(pio_type, nvars, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(pio_type_size, nvars, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(mpi_type, nvars*(int)(sizeof(MPI_Datatype)/sizeof(int)), MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(mpi_type_size, nvars, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* Create the ncid that the user will see. This is necessary @@ -2544,9 +2527,9 @@ int pioc_change_def(int ncid, int is_enddef) /* Handle MPI errors. */ LOG((3, "pioc_change_def handling MPI errors")); if ((mpierr2 = MPI_Bcast(&mpierr, 1, MPI_INT, ios->comproot, ios->my_comm))) - check_mpi(file, mpierr2, __FILE__, __LINE__); + check_mpi(NULL, file, mpierr2, __FILE__, __LINE__); if (mpierr) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); } /* If this is an IO task, then call the netCDF function. */ @@ -2579,7 +2562,7 @@ int pioc_change_def(int ncid, int is_enddef) /* Broadcast and check the return code. */ LOG((3, "pioc_change_def bcasting return code ierr = %d", ierr)); if ((mpierr = MPI_Bcast(&ierr, 1, MPI_INT, ios->ioroot, ios->my_comm))) - return check_mpi(file, mpierr, __FILE__, __LINE__); + return check_mpi(NULL, file, mpierr, __FILE__, __LINE__); if (ierr) return check_netcdf(file, ierr, __FILE__, __LINE__); LOG((3, "pioc_change_def succeeded")); diff --git a/tests/cunit/test_pioc.c b/tests/cunit/test_pioc.c index 4e44e31fcd5..2c4819de3f4 100644 --- a/tests/cunit/test_pioc.c +++ b/tests/cunit/test_pioc.c @@ -550,9 +550,7 @@ int check_strerror_netcdf(int my_rank) /* When called with a code of 0, these functions should do nothing * and return 0. */ - if (check_mpi(NULL, 0, __FILE__, __LINE__)) - ERR(ERR_WRONG); - if (check_mpi2(NULL, NULL, 0, __FILE__, __LINE__)) + if (check_mpi(NULL, NULL, 0, __FILE__, __LINE__)) ERR(ERR_WRONG); if (pio_err(NULL, NULL, 0, __FILE__, __LINE__)) ERR(ERR_WRONG); @@ -561,15 +559,6 @@ int check_strerror_netcdf(int my_rank) if (check_netcdf2(NULL, NULL, 0, __FILE__, __LINE__)) ERR(ERR_WRONG); - /* When called with other error messages, these functions should - * return PIO_EIO. */ - /* if (check_mpi(NULL, MPI_ERR_OTHER, __FILE__, __LINE__) != PIO_EIO) */ - /* ERR(ERR_WRONG); */ - /* This returns the correct result, but prints a confusing error - * message during the test run, so I'll leave it commented out. */ - /* if (check_mpi(NULL, MPI_ERR_UNKNOWN, __FILE__, __LINE__) != PIO_EIO) */ - /* ERR(ERR_WRONG); */ - return PIO_NOERR; } diff --git a/tests/cunit/test_rearr.c b/tests/cunit/test_rearr.c index a6c73620f85..06e18474d6f 100644 --- a/tests/cunit/test_rearr.c +++ b/tests/cunit/test_rearr.c @@ -872,7 +872,7 @@ int test_box_rearrange_create_2(MPI_Comm test_comm, int my_rank) /* Check some results. */ if (iodesc->rearranger != PIO_REARR_BOX || iodesc->ndof != maplen || - (iodesc->llen != my_rank ? 0 : 8) || !iodesc->needsfill) + (iodesc->llen != (my_rank ? 0 : 8)) || !iodesc->needsfill) return ERR_WRONG; for (int i = 0; i < ios->num_iotasks; i++) diff --git a/tests/cunit/test_spmd.c b/tests/cunit/test_spmd.c index 726509db763..176f010ec58 100644 --- a/tests/cunit/test_spmd.c +++ b/tests/cunit/test_spmd.c @@ -61,7 +61,7 @@ int run_spmd_tests(MPI_Comm test_comm) /* Get the size of the int type for MPI. (Should always be 4.) */ if ((mpierr = MPI_Type_size(MPI_INT, &type_size))) - return check_mpi(NULL, mpierr, __FILE__, __LINE__); + MPIERR(mpierr); assert(type_size == sizeof(int)); /* Initialize the arrays. */