Skip to content
Snippets Groups Projects
Commit 2c903e7f authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Force no output for non rank 0 mpi processes

parent 15c82f70
No related branches found
No related tags found
1 merge request!11Feature/mpi
......@@ -19,6 +19,18 @@ std::string initialize(int& argc, char* argv[])
{
MPI_Init(&argc, &argv);
{
const int mpi_rank
=[](){
int mpi_rank;
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
return mpi_rank;
}();
if (mpi_rank != 0) {
pout.setOutput(null_stream);
}
}
long unsigned number = 10;
std::string filename;
......@@ -118,11 +130,10 @@ void finalize()
return mpi_size;
}();
std::cout << rang::fgB::green << "Terminating process " << rang::fg::reset
pout() << rang::fgB::green << "Terminating process " << rang::fg::reset
<< rang::fgB::yellow << mpi_rank << rang::fg::reset << " of "
<< rang::style::bold << mpi_size << rang::style::reset << '\n';;
Kokkos::finalize();
MPI_Finalize();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment