Skip to content

Commit

Permalink
Fix bugs in MDI_Check_for_communicator
Browse files Browse the repository at this point in the history
  • Loading branch information
taylor-a-barnes committed Jun 26, 2024
1 parent 3a1a0ef commit 81d943f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion MDI_Library/mdi_general.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ int general_check_communicator(int* flag) {
mdi_error("Error in general_check_communicator: get_method failed");
return ret;
}
return selected_method->on_accept_communicator(flag);
return selected_method->on_check_communicator(flag);
}


Expand Down
12 changes: 12 additions & 0 deletions tests/MDI_Test_Codes/driver_cxx/driver_cxx.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ int main(int argc, char **argv) {
throw std::runtime_error("Must run driver_cxx as a DRIVER");
}

// Check for a new communicator
int new_comm_flag = 0;
while ( new_comm_flag != 1 ) {
MDI_Check_for_communicator(&new_comm_flag);
MPI_Bcast(&new_comm_flag, 1, MPI_INT, 0, world_comm);
}
/*
if ( new_comm_flag != 1 ) {
throw std::runtime_error("Couldn't find a new communicator");
}
*/

// Connect to the engine
MDI_Comm comm;
MDI_Accept_communicator(&comm);
Expand Down

0 comments on commit 81d943f

Please sign in to comment.