mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Passing the number of threads in use to libmesh.
This commit is contained in:
parent
cb5952ba38
commit
074f7f7cd3
1 changed files with 18 additions and 5 deletions
|
|
@ -58,7 +58,24 @@ int openmc_init(int argc, char* argv[], const void* intracomm)
|
|||
|
||||
// Parse command-line arguments
|
||||
int err = parse_command_line(argc, argv);
|
||||
//if (err) return err;
|
||||
if (err) return err;
|
||||
|
||||
#ifdef LIBMESH
|
||||
|
||||
#ifdef _OPENMP
|
||||
int n_threads = omp_get_max_threads();
|
||||
#else
|
||||
int n_threads = 1;
|
||||
#endif
|
||||
|
||||
// initialize libmesh
|
||||
#ifdef OPENMC_MPI
|
||||
if (!settings::LMI) settings::LMI = std::make_unique<libMesh::LibMeshInit>(argc, argv, mpi::intracomm, n_threads);
|
||||
#else
|
||||
if (!settings::LMI) settings::LMI = std::make_unique<libMesh::LibMeshInit>(argc, argv, n_threads);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// Start total and initialization timer
|
||||
simulation::time_total.start();
|
||||
|
|
@ -72,10 +89,6 @@ int openmc_init(int argc, char* argv[], const void* intracomm)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef LIBMESH
|
||||
if (!settings::LMI) settings::LMI = std::make_unique<libMesh::LibMeshInit>(argc, argv);
|
||||
#endif
|
||||
|
||||
|
||||
// Initialize random number generator -- if the user specifies a seed, it
|
||||
// will be re-initialized later
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue