Skip to content

Commit 26280bc

Browse files
authored
Add MPI calls to DAGMC external test. (#2948)
1 parent 256150f commit 26280bc

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • tests/regression_tests/dagmc/external

‎tests/regression_tests/dagmc/external/main.cpp‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "openmc/geometry.h"
66
#include "openmc/geometry_aux.h"
77
#include "openmc/material.h"
8+
#include "openmc/message_passing.h"
89
#include "openmc/nuclide.h"
910
#include <iostream>
1011

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

1617
// Initialise OpenMC
18+
#ifdef OPENMC_MPI
19+
MPI_Comm world = MPI_COMM_WORLD;
20+
openmc_err = openmc_init(argc, argv, &world);
21+
#else
1722
openmc_err = openmc_init(argc, argv, nullptr);
23+
#endif
1824
if (openmc_err == -1) {
1925
// This happens for the -h and -v flags
2026
return EXIT_SUCCESS;
@@ -104,5 +110,9 @@ int main(int argc, char* argv[])
104110
if (openmc_err)
105111
fatal_error(openmc_err_msg);
106112

113+
#ifdef OPENMC_MPI
114+
MPI_Finalize();
115+
#endif
116+
107117
return EXIT_SUCCESS;
108118
}

0 commit comments

Comments
 (0)