Add MPI calls to DAGMC external test. (#2948)

This commit is contained in:
Patrick Shriwise 2024-04-11 08:10:45 -05:00 committed by GitHub
parent 256150f567
commit 26280bc9d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}