Skip to content

Commit

Permalink
Improve error handling: do not call errorQuda if communicator can't b…
Browse files Browse the repository at this point in the history
…e found (which will cause infinite recursion)
  • Loading branch information
maddyscientist committed Aug 16, 2024
1 parent bda829c commit 17c76a7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/communicator_stack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,20 @@ namespace quda
static Communicator &get_default_communicator()
{
auto search = communicator_stack.find(default_comm_key);
if (search == communicator_stack.end()) { errorQuda("Default communicator can't be found."); }
if (search == communicator_stack.end()) {
fprintf(getOutputFile(), "Default communicator can't be found\n");
comm_abort(1);
}
return search->second;
}

Communicator &get_current_communicator()
{
auto search = communicator_stack.find(current_key);
if (search == communicator_stack.end()) { errorQuda("Current communicator can't be found."); }
if (search == communicator_stack.end()) {
fprintf(getOutputFile(), "Current communicator can't be found\n");
comm_abort(1);
}
return search->second;
}

Expand Down

0 comments on commit 17c76a7

Please sign in to comment.