GEOSX
initialization.hpp
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 Total, S.A
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
15 #ifndef GEOSX_MANAGERS_INITIALIZATION_HPP_
16 #define GEOSX_MANAGERS_INITIALIZATION_HPP_
17 
18 // Source includes
19 #include "common/DataTypes.hpp"
20 #include "mpiCommunications/MpiWrapper.hpp"
21 
22 // TPL includes
23 #ifdef GEOSX_USE_CALIPER
24 #include <adiak.hpp>
25 #endif
26 
27 namespace geosx
28 {
29 
34 {
37 
39  bool beginFromRestart = false;
40 
43 
46 
49 
52 
55 
59 
64 
67 
70 
73 
76 
79 };
80 
87 void basicSetup( int argc, char * argv[], bool const parseCommandLine=false );
88 
93 
99 
103 void basicCleanup();
104 
108 void setupLogger();
109 
113 void finalizeLogger();
114 
119 void setupCXXUtils();
120 
124 void setupMKL();
125 
129 void setupOpenMP();
130 
136 void setupMPI( int argc, char * argv[] );
137 
141 void finalizeMPI();
142 
150 template< typename T >
151 void pushStatsIntoAdiak( std::string const & name, T const value )
152 {
153 #if defined( GEOSX_USE_CALIPER )
154  T const total = MpiWrapper::Sum( value );
155  adiak::value( name + " sum", total );
156  adiak::value( name + " mean", double( total ) / MpiWrapper::Comm_size() );
157  adiak::value( name + " min", MpiWrapper::Min( value ) );
158  adiak::value( name + " max", MpiWrapper::Max( value ) );
159 #else
160  GEOSX_UNUSED_VAR( name );
161  GEOSX_UNUSED_VAR( value );
162 #endif
163 }
164 
165 } // namespace geosx
166 
167 #endif // GEOSX_MANAGERS_INITIALIZATION_HPP_
std::string timerOutput
The string used to initialize caliper.
void basicSetup(int argc, char *argv[], bool const parseCommandLine=false)
Perform the basic GEOSX initialization and optionally parse the command line input.
void setupCXXUtils()
Setup the LvArray library. This initializes signal handling and the floating point environment...
bool beginFromRestart
True iff restarting from the middle of an existing run.
void setupMPI(int argc, char *argv[])
Setup MPI.
void setupOpenMP()
Setup OpenMP.
CommandLineOptions const & getCommandLineOptions()
void setupLogger()
Initialize the logger.
void finalizeLogger()
Finalize the logger.
void basicCleanup()
Perform the basic GEOSX cleanup.
std::string problemName
The name of the problem being run.
std::string schemaName
The name of the schema.
void overrideInputFileName(std::string const &inputFileName)
Override the input file name, useful only for tests.
integer yPartitionsOverride
The number of partitions in the y direction.
std::string outputDirectory
The directory to put all output.
void finalizeMPI()
Finalize MPI.
integer overridePartitionNumbers
True if using the partition override.
integer zPartitionsOverride
The number of partitions in the z direction.
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122
integer xPartitionsOverride
The number of partitions in the x direction.
void setupMKL()
Setup MKL if in use.
#define GEOSX_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
Definition: GeosxMacros.hpp:78
integer suppressMoveLogging
Suppress logging of host-device data migration.
std::string string
String type.
Definition: DataTypes.hpp:131
std::string inputFileName
The path to the input xml.
void pushStatsIntoAdiak(std::string const &name, T const value)
Compute the sum, mean, min, and max of value across ranks and push them into Adiak using name...
std::string restartFileName
The path to the restart file, if specified.