Skip to content

Commit 5845ab6

Browse files
committed
Support handling of invalid indices withinin range of MPI_T_cvar_get_info(). This issue showed up in nightly testing on OpenMPI platforms.
1 parent 1506816 commit 5845ab6

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/Infrastructure/VM/src/ESMCI_VMKernel.C

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3134,6 +3134,8 @@ void VMK::log(std::string prefix, ESMC_LogMsgType_Flag msgType)const{
31343134

31353135

31363136
void VMK::logSystem(std::string prefix, ESMC_LogMsgType_Flag msgType){
3137+
#undef ESMC_METHOD
3138+
#define ESMC_METHOD "ESMCI::VMK::logSystem()"
31373139
std::stringstream msg;
31383140
msg << prefix << "--- VMK::logSystem() start -------------------------------";
31393141
ESMC_LogDefault.Write(msg.str(), msgType);
@@ -3245,17 +3247,18 @@ void VMK::logSystem(std::string prefix, ESMC_LogMsgType_Flag msgType){
32453247
descLen = sizeof(desc);
32463248
mpi_rc = MPI_T_cvar_get_info(i, name, &nameLen, &verbosity, &datatype,
32473249
&enumtype, desc, &descLen, &binding, &scope);
3248-
if (mpi_rc != MPI_SUCCESS){
3250+
if (mpi_rc == MPI_SUCCESS){
3251+
msg.str(""); // clear
3252+
msg << prefix << "index=" << std::setw(4) << i << std::setw(60) << name
3253+
<< " : " << desc;
3254+
ESMC_LogDefault.Write(msg.str(), msgType);
3255+
}else if (mpi_rc != MPI_T_ERR_INVALID_INDEX){
32493256
int localrc;
32503257
ESMC_LogDefault.MsgFoundError(ESMC_RC_INTNRL_BAD,
3251-
"MPI_T_cvar_get_info() did not return MPI_SUCCESS.",
3258+
"Call to MPI_T_cvar_get_info() failed in unsupported way.",
32523259
ESMC_CONTEXT, &localrc);
32533260
throw localrc; // bail out with exception
32543261
}
3255-
msg.str(""); // clear
3256-
msg << prefix << "index=" << std::setw(4) << i << std::setw(60) << name
3257-
<< " : " << desc;
3258-
ESMC_LogDefault.Write(msg.str(), msgType);
32593262
}
32603263
#if 0
32613264
// testing to change the MPICH EAGER limit for the shared memory channel

0 commit comments

Comments
 (0)