Skip to content

Commit

Permalink
Only override the rank if suspect it's wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
khuck committed Apr 13, 2021
1 parent 33f8e87 commit 1824658
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/apex/apex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,12 @@ uint64_t init(const char * thread_name, uint64_t comm_rank,
// FIRST! make sure APEX thinks this is a worker thread (the main thread
// is always a worker thread)
thread_instance::instance(true);
comm_rank = test_for_MPI_comm_rank(comm_rank);
comm_size = test_for_MPI_comm_size(comm_size);
// Just in case, if we got initialized without the correct rank and size,
// Check the environment if there are MPI settings.
if (comm_rank == 0 && comm_size == 1) {
comm_rank = test_for_MPI_comm_rank(comm_rank);
comm_size = test_for_MPI_comm_size(comm_size);
}
// protect against multiple initializations
if (_registered || _initialized) {
if (apex_options::use_jupyter_support()) {
Expand Down

0 comments on commit 1824658

Please sign in to comment.