mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Addressing initial review comments from @paulromano.
This commit is contained in:
parent
9eb53a1af9
commit
6c7c0a6816
9 changed files with 72 additions and 47 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue