mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Add MPI calls to DAGMC external test. (#2948)
This commit is contained in:
parent
256150f567
commit
26280bc9d5
1 changed files with 10 additions and 0 deletions
10
tests/regression_tests/dagmc/external/main.cpp
vendored
10
tests/regression_tests/dagmc/external/main.cpp
vendored
|
|
@ -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>
|
||||
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue