Addressing initial review comments from @paulromano.

This commit is contained in:
Patrick Shriwise 2021-01-05 22:23:19 -06:00
parent 9eb53a1af9
commit 6c7c0a6816
9 changed files with 72 additions and 47 deletions

View file

@ -68,16 +68,17 @@ int openmc_init(int argc, char* argv[], const void* intracomm)
#endif
// initialize libMesh if it hasn't been initialized already
// (if initialized externally, the LMI object needs to be provided also)
if (!settings::LMI && !libMesh::initialized()) {
// (if initialized externally, the libmesh_init object needs to be provided also)
if (!settings::libmesh_init && !libMesh::initialized())
{
#ifdef OPENMC_MPI
// pass command line args, empty MPI communicator, and number of threads.
// Because libMesh was not initialized, we assume that OpenMC is the primary
// application and that its main MPI comm should be used.
settings::LMI = std::make_unique<libMesh::LibMeshInit>(argc, argv, comm, n_threads);
settings::libmesh_init = std::make_unique<libMesh::LibMeshInit>(argc, argv, comm, n_threads);
#else
// pass command line args, empty MPI communicator, and number of threads
settings::LMI = std::make_unique<libMesh::LibMeshInit>(argc, argv, 0, n_threads);
settings::libmesh_init = std::make_unique<libMesh::LibMeshInit>(argc, argv, 0, n_threads);
#endif
}