64 #if !defined(Parallel)
92 int getId(
int rank,
int localTreeId)
const;
246 static std::string
toString(
const std::set< PeriodicBoundaryStackIdentifier >& data );
Node is Peano's abstraction for the hybrid of MPI/threads.
static void shutdownMPIDatatypes()
static std::bitset< 2 *Dimensions > getPeriodicBoundaryNumber(const tarch::la::Vector< TwoPowerD, int > &flags)
Analyse to which of the 2d faces it is adjacent.
static int getOutputStackForPeriodicBoundaryExchange(int faceNumber)
Identify output stack for periodic boundary data written by face.
Node()
The standard constructor assigns the attributes default values and checks whether the program is comp...
void shutdown()
The shutdown is invoked by peano4::shutdownSingletons()
static int getTreeNumberTiedToExchangeStackNumber(int number)
Gives you back the id of a communication partner, i.e.
static tarch::logging::Log _log
Logging device.
std::map< int, TreeEntry > _treeEntries
static bool isPeriodicBoundaryExchangeOutputStackNumber(int number)
static constexpr int MaxSpacetreesPerRank
bool continueToRun()
You should call this operation only on the ranks >0 to find out whether you should do more iteration/...
int reserveId(int rank, int forTreeId)
This operation is not const as it does some internal bookkeeping.
static bool isHorizontalDataExchangeInputStackNumber(int number)
static int getOutputStackNumberForHorizontalDataExchange(int id)
Hand in a spacetree id and get back the number that we should use to send something to this tree.
tarch::multicore::BooleanSemaphore _semaphore
int getLocalTreeId(int treeId) const
static int mapPeriodicBoundaryExchangeOutputStackOntoInputStack(int outputStack)
int getRank(int treeId) const
You hand in a tree number and the node tells you on which rank such a tree is hosted.
static int getInputStackNumberForHorizontalDataExchange(int id)
Counterpart of getOutputStackNumberOfBoundaryExchange(int)
static constexpr int Terminate
int _rankOrchestrationTag
int getCurrentProgramStep() const
void deregisterId(int id)
Only the SpacetreeSet should call this operation.
void registerId(int id, int masterId)
The operation is not thread-safe as we call it only internally, i.e.
static void initMPIDatatypes()
I originally wanted to embed these guys into the singleton's constructor.
std::pair< int, int > PeriodicBoundaryStackIdentifier
A periodic boundary stack is basically a stack (an integer), but I do augment it by a bitset which id...
int getGlobalTreeId(int treeId) const
static bool isVerticalDataExchangeOutputStackNumber(int number)
@ VerticalData
Vertical data is data running from the master to the worker and the other way round.
static bool isHorizontalDataExchangeOutputStackNumber(int number)
See getOutputStackNumberOfBoundaryExchange().
std::pair< int, MPI_Comm > GridDataExchangeMetaInformation
Node(const Node &node)=delete
The copy constructor is private.
static std::string toString(const std::set< PeriodicBoundaryStackIdentifier > &data)
void setNextProgramStep(int number)
The user tells the set which program step to use, i.e.
static int getOutputStackNumberForVerticalDataExchange(int id)
MPI_Comm _dataExchangeCommunicators[MaxSpacetreesPerRank]
int getNumberOfRegisteredTrees() const
virtual ~Node()
The standard destructor calls MPI_Finalize().
static std::set< PeriodicBoundaryStackIdentifier > getOutputStacksForPeriodicBoundaryExchange(const tarch::la::Vector< TwoPowerD, int > &flags)
You hand in a the flags of a vertex and you get the boundary stack identifiers including their direct...
static constexpr int StacksPerCommunicationPartner
We need one stack for outgoing data, one for incoming data, and we distinguish horizontal and vertica...
static int getPeriodicBoundaryExchangeInputStackNumberForOutputStack(int outputStackNumber)
Hand in an output stack number of a face and you get back the input stack number.
static bool isVerticalDataExchangeInputStackNumber(int number)
static std::string getSemanticsForTag(int tag)
I use this for debugging.
static bool isGlobalMaster(int treeId)
Is this the global master?
static bool isStorageStackNumber(int number)
There are communication stacks and storage stacks.
GridDataExchangeMetaInformation getGridDataExchangeMetaInformation(int sendingTreeId, int receivingTreeId, ExchangeMode exchange) const
I use two tags per spacetree per rank: one for boundary data (horizontal) and one for up-down and syn...
static int getInputStackNumberForVerticalDataExchange(int id)
Get the input stack where a tree writes all of its vertical data to/from when it exchanges informatio...
static constexpr int UndefProgramStep
Value for _currentProgramStep.
int getId(int rank, int localTreeId) const
Peano maps grid instance threads + mpi ranks onto global IDs through this routine.
static Node & getInstance()
This operation returns the singleton instance.
I test the mapping of vertex adjacency data onto stack numbers here.
The parallel namespace is Peano's core abstracts from both MPI and multicore parallelisation.