Skip to content

Commit

Permalink
refactor: added MPI inclusion and init/finalize to fromfile example
Browse files Browse the repository at this point in the history
  • Loading branch information
wiltonloch committed Aug 26, 2024
1 parent e2fdf19 commit 527fa13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/fromfile/src/main_fromfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <iostream>
#include <stdexcept>
#include <string_view>
#include "mpi.h"

#include "cartesiandomain/cartesianmaps.hpp"
#include "cartesiandomain/cartesianmotion.hpp"
Expand Down Expand Up @@ -142,6 +143,8 @@ int main(int argc, char *argv[]) {
throw std::invalid_argument("configuration file(s) not specified");
}

MPI_Init(&argc, &argv);

Kokkos::Timer kokkostimer;

/* Read input parameters from configuration file(s) */
Expand Down Expand Up @@ -178,5 +181,7 @@ int main(int argc, char *argv[]) {
const auto ttot = double{kokkostimer.seconds()};
std::cout << "-----\n Total Program Duration: " << ttot << "s \n-----\n";

MPI_Finalize();

return 0;
}

0 comments on commit 527fa13

Please sign in to comment.