26 int unitTestsErrors = 0;
31 unitTestsErrors +=
tests->getNumberOfErrors();
36 unitTestsErrors +=
tests->getNumberOfErrors();
39 if (unitTestsErrors != 0) {
40 logError(
"main()",
"unit tests failed. Quit.");
78 emptyObserver.beginTraversalOnRank(
false);
80 spacetree.traverse( emptyObserver );
82 emptyObserver.endTraversalOnRank(
false);
85 logInfo(
"runSerial(...)",
"grid statistics = " << spacetree.getGridStatistics().toString() );
90 spacetree.traverse( plotterObserver );
102 const int spacetreeOfInterest = 0;
112 logInfo(
"updateDomainDecomposition()",
"split rank 0 into 1 and 2 -> success" );
123 const int spacetreeOfInterest = 1;
127 logInfo(
"updateDomainDecomposition()",
"split rank 1 -> failed" );
131 logInfo(
"updateDomainDecomposition()",
"split rank 1 -> success" );
141 const int spacetreeOfInterest =
periodicBC==0 ? 1 : 0;
157 const int spacetreeOfInterest = 2;
170 const int spacetreeOfInterest = 2;
183 const int spacetreeOfInterest = 1;
213 emptyObserver.beginTraversalOnRank(
true);
217 emptyObserver.endTraversalOnRank(
true);
225 logInfo(
"runParallel(...)",
"terminated successfully" );
234 emptyObserver.beginTraversalOnRank(
true);
238 emptyObserver.endTraversalOnRank(
true);
247int main(
int argc,
char** argv) {
248 const int ExitCodeSuccess = 0;
249 const int ExitCodeUnitTestsFailed = 1;
284 for (
int i=0; i<Dimensions; i++) {
287 logInfo(
"main(...)",
"use a random periodic boundary condition choice: " <<
periodicBC );
290 #if defined(Parallel) or defined(SharedMemoryParallelisation)
#define assertionEquals(lhs, rhs)
#define logError(methodName, logMacroMessageStream)
Wrapper macro around tarch::tarch::logging::Log to improve logging.
#define logInfo(methodName, logMacroMessageStream)
Wrapper macro around tarch::tarch::logging::Log to improve logging.
std::bitset< Dimensions > periodicBC
tarch::logging::Log _log("examples::grid")
void updateDomainDecomposition()
static constexpr int GridRefinementIterations
static constexpr int StationaryIterations
Observer which pipes the automaton transitions into a VTK file.
void setNextProgramStep(int number)
The user tells the set which program step to use, i.e.
static Node & getInstance()
This operation returns the singleton instance.
bool split(int treeId, const peano4::SplitInstruction &instruction, int targetRank)
Split a local tree.
peano4::grid::GridStatistics getGridStatistics() const
Return statistics object for primary spacetree.
static SpacetreeSet & getInstance()
bool isLocalSpacetree(int treeId) const
Codes hold one spacetree set per rank.
void traverse(peano4::grid::TraversalObserver &observer)
Invoke traverse on all spacetrees in parallel.
void closeOutputStreamAndReopenNewOne()
The command line logger can pipe debug data into an output file instead of piping everything to the t...
static CommandLineLogger & getInstance()
void setOutputFile(const std::string &outputLogFileName)
Is redundant, as you could use setLogFormat() instead.
void addFilterListEntry(const FilterListEntry &entry)
Add one filter list entry.
static LogFilter & getInstance()
int getNumberOfRanks() const
static Rank & getInstance()
This operation returns the singleton instance.
static void abort(int errorCode)
A proper abort in an MPI context has to use MPI_Abort.
static Core & getInstance()
void configure(int numberOfThreads=UseDefaultNumberOfThreads)
Configure the whole node, i.e.
Represents one test case.
std::string toString(Filter filter)
tarch::tests::TestCase * getUnitTests()
Please destroy after usage.
void shutdownSingletons()
The very first thing I have to do is to shut down Node.
void fillLookupTables()
Fill Lookup Tables.
int initParallelEnvironment(int *argc, char ***argv)
Init Parallel Environment.
void initSingletons(const tarch::la::Vector< Dimensions, double > &offset, const tarch::la::Vector< Dimensions, double > &width, const std::bitset< Dimensions > &periodicBC=0)
Fire up all the singletons.
void shutdownParallelEnvironment()
Shutdown all the parallel environment, i.e.
tarch::tests::TestCase * getUnitTests()
Please destroy after usage.
int getNumberOfLocalUnrefinedCells() const
Represents one entry of the filter list.
static const std::string TargetTrace
static const std::string TargetDebug
static const std::string TargetInfo