Skip to content

Commit

Permalink
Add MPI calls to DAGMC external test. (#2948)
Browse files Browse the repository at this point in the history
  • Loading branch information
pshriwise committed Apr 11, 2024
1 parent 256150f commit 26280bc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/regression_tests/dagmc/external/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "openmc/geometry.h"
#include "openmc/geometry_aux.h"
#include "openmc/material.h"
#include "openmc/message_passing.h"
#include "openmc/nuclide.h"
#include <iostream>

Expand All @@ -14,7 +15,12 @@ int main(int argc, char* argv[])
int openmc_err;

// Initialise OpenMC
#ifdef OPENMC_MPI
MPI_Comm world = MPI_COMM_WORLD;
openmc_err = openmc_init(argc, argv, &world);
#else
openmc_err = openmc_init(argc, argv, nullptr);
#endif
if (openmc_err == -1) {
// This happens for the -h and -v flags
return EXIT_SUCCESS;
Expand Down Expand Up @@ -104,5 +110,9 @@ int main(int argc, char* argv[])
if (openmc_err)
fatal_error(openmc_err_msg);

#ifdef OPENMC_MPI
MPI_Finalize();
#endif

return EXIT_SUCCESS;
}

0 comments on commit 26280bc

Please sign in to comment.