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

Add simple MPI init/finalize and "hello world"-like test

parent 8cd9cd77
No related branches found
No related tags found
1 merge request!11Feature/mpi
......@@ -11,9 +11,12 @@
#include <ConsoleManager.hpp>
#include <CLI/CLI.hpp>
#include <mpi.h>
std::string initialize(int& argc, char* argv[])
{
MPI_Init(&argc, &argv);
long unsigned number = 10;
std::string filename;
......@@ -98,5 +101,26 @@ std::string initialize(int& argc, char* argv[])
void finalize()
{
MPI_Barrier(MPI_COMM_WORLD);
const int mpi_rank
=[](){
int mpi_rank;
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
return mpi_rank;
}();
const int mpi_size
=[](){
int mpi_size;
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
return mpi_size;
}();
std::cout << 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