35#if defined(MAIA_GCC_COMPILER) && defined(MAIA_PSTL)
36#define TBB_USE_EXCEPTIONS 0
37#include <tbb/parallel_for.h>
44int main(
int argc,
char* argv[]) {
49 const int exitCode =
maia.run();
74 MPI_Init_thread(&
m_argc, &
m_argv, MPI_THREAD_FUNNELED, &provided);
86 int domainId, noDomains;
90 MPI_Comm_rank(MPI_COMM_WORLD, &domainId);
91 MPI_Comm_size(MPI_COMM_WORLD, &noDomains);
95 MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
99 cerr0.rdbuf(cerr.rdbuf());
107 static_assert(CHAR_BIT == 8,
"Unexpected type size: char has " XSTRINGIFY(CHAR_BIT)
" bits (expected: 8)");
108 static_assert(
sizeof(
MChar) == 1,
"MChar has unexpected type size");
110 static_assert(
sizeof(
MBool) == 1,
"MBool has unexpected type size");
112 static_assert(
sizeof(
MInt) == 4,
"MInt has unexpected type size");
113 static_assert(
sizeof(
MInt) == 4,
"MInt has unexpected type size");
114 static_assert(
sizeof(
MLong) == 8,
"MLong has unexpected type size");
115 static_assert(
sizeof(
MFloat) == 8,
"MFloat has unexpected type size");
122#if(MAIA_INFOOUT_FILE_TYPE == 1 && MAIA_INFOOUT_ROOT_ONLY == false)
123 m_log.
open(
"m_log_" + to_string(
globalDomainId()), MAIA_INFOOUT_PROJECT_NAME, MAIA_INFOOUT_FILE_TYPE, MPI_COMM_WORLD,
124 MAIA_INFOOUT_ROOT_ONLY);
126 m_log.
open(
"m_log", MAIA_INFOOUT_PROJECT_NAME, MAIA_INFOOUT_FILE_TYPE, MPI_COMM_WORLD, MAIA_INFOOUT_ROOT_ONLY);
147 LIKWID_MARKER_THREADINIT;
151 DEBUG(
"main:: reset timer", MAIA_DEBUG_LEVEL1);
154 NEW_TIMER_GROUP(tg,
"MAIA");
157 NEW_TIMER(timertotal,
"Total", tg);
158 RECORD_TIMER_START(timertotal);
161 NEW_SUB_TIMER(timer1,
"New Environment", timertotal);
162 RECORD_TIMER_START(timer1);
164 DEBUG(
"main:: new Environment", MAIA_DEBUG_LEVEL1);
166 RECORD_TIMER_STOP(timer1);
169 DEBUG(
"main:: mEnvironment->run", MAIA_DEBUG_LEVEL1);
170 NEW_SUB_TIMER(timer2,
"Run Environment", timertotal);
171 RECORD_TIMER_START(timer2);
173 RECORD_TIMER_STOP(timer2);
176 NEW_SUB_TIMER(timer3,
"End Environment", timertotal);
177 DEBUG(
"main:: mEnvironment->end", MAIA_DEBUG_LEVEL1);
178 RECORD_TIMER_START(timer3);
180 RECORD_TIMER_STOP(timer3);
188 DEBUG(
"main:: delete environment", MAIA_DEBUG_LEVEL1);
195 RECORD_TIMER_STOP(timertotal);
198 DEBUG(
"main:: display all timers", MAIA_DEBUG_LEVEL1);
199 STOP_ALL_RECORD_TIMERS();
200 DISPLAY_ALL_TIMERS();
206 DEBUG(
"main:: mDealloc", MAIA_DEBUG_LEVEL1);
210 DEBUG(
"main:: close streams", MAIA_DEBUG_LEVEL1);
void mDealloc()
Deallocates all memory allocated previously by mAlloc(...)
Environment for the program.
MInt run()
Runs the Environment, makes the Application run.
MInt end()
Ends the Environment.
static MInt m_argc
Reads the name of the property-file and creates a new Application.
void open(const MString &filename, const MString &projectName, MInt fileType=0, MPI_Comm mpiComm=MPI_COMM_WORLD, MBool rootOnlyHardwired=false)
Opens a file by passing the parameters to InfoOut_<xyz>FileBuffer::open(...).
void close(MBool forceClose=false)
Pass the close call to the respective internal buffer.
MBool setRootOnly(MBool rootOnly=true)
Sets interal state of whether only the root domain (rank 0) should write to file.
MInt setMinFlushSize(MInt minFlushSize)
Sets the minimum buffer length that has to be reached before the buffer is flushed.
int run()
Main controlling method for MAIA. Calls everything else.
static MString printSelfReport()
Returns a shortened string summing up the scratch space state information.
GlobalMpiInformation g_mpiInformation
MInt globalNoDomains()
Return global number of domains.
MInt globalDomainId()
Return global domain id.
int main(int argc, char *argv[])
Environment * mEnvironment
Namespace for auxiliary functions/classes.