Skip to content

Commit

Permalink
Throw MPI_Abort if the number of tasks is not at least 2
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewcarbone committed Jan 19, 2024
1 parent 6d09a0b commit f725383
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ int main(int argc, char *argv[])
auto_determine_dynamics_(&p);
save_and_log_config(p);
}

// Ensure we are running with at least 2 mpi ranks
int mpi_world_size;
MPI_Comm_size(MPI_COMM_WORLD, &mpi_world_size);
if (mpi_world_size < 2){
std::cerr << "MPI WORLD SIZE must be greater than or equal to 2" << std::endl;
MPI_Abort(MPI_COMM_WORLD, 1);
}

initialize_grids_and_directories(p);

Expand Down

0 comments on commit f725383

Please sign in to comment.