www.mooseframework.org
MooseInit.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "MooseInit.h"
16 #include "ParallelUniqueId.h"
17 #include "Factory.h"
18 #include "ActionFactory.h"
19 #include "Executioner.h"
20 #include "MooseRandom.h"
21 
22 // PETSc
23 #ifdef LIBMESH_HAVE_PETSC
24 #include "petscsys.h"
25 #endif
26 
27 #ifdef LIBMESH_HAVE_OPENMP
28 #include <omp.h>
29 #endif
30 
31 MooseInit::MooseInit(int argc, char * argv[], MPI_Comm COMM_WORLD_IN)
32  : LibMeshInit(argc, argv, COMM_WORLD_IN)
33 {
34 #ifdef LIBMESH_HAVE_PETSC
35  PetscPopSignalHandler(); // get rid of Petsc error handler
36 #endif
37 
38 // Set the number of OpenMP threads to the same as the number of threads libMesh is going to use
39 #ifdef LIBMESH_HAVE_OPENMP
40  omp_set_num_threads(libMesh::n_threads());
41 #endif
42 
44 
45  // Make sure that any calls to the global random number generator are consistent among processes
47 }
static void initialize()
Must be called by main thread before any threaded computation! Do NOT call in a worker thread! ...
MooseInit(int argc, char *argv[], MPI_Comm COMM_WORLD_IN=MPI_COMM_WORLD)
Definition: MooseInit.C:31
static void seed(unsigned int seed)
The method seeds the random number generator.
Definition: MooseRandom.h:49