Commit 699591ef authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Enable MPI execution of np_inclusion

parent 8ae6a69c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -64,8 +64,14 @@ extern void inclusion(const string& config_file, const string& data_file, const
 * \return result: `int` An exit code passed to the OS (0 for succesful execution).
 */
int main(int argc, char **argv) {
#ifdef MPI_VERSION
  int ierr = MPI_Init(&argc, &argv);
  // Create and initialise class with essential MPI data
  mixMPI *mpidata = new mixMPI(MPI_COMM_WORLD);
#else
  // create a the class with dummy data if we are not using MPI at all
  mixMPI *mpidata = new mixMPI();
#endif
  string config_file = "../../test_data/inclusion/DEDFB";
  string data_file = "../../test_data/inclusion/DINCLU";
  string output_path = ".";
@@ -75,6 +81,9 @@ int main(int argc, char **argv) {
    output_path = string(argv[3]);
  }
  inclusion(config_file, data_file, output_path, mpidata);
#ifdef MPI_VERSION
  MPI_Finalize();
#endif
  delete mpidata;
  return 0;
}