Peano
Loading...
Searching...
No Matches
GridStatistics.h
Go to the documentation of this file.
1
2//
3// Generated by DaStGen2 (C) 2020 Tobias Weinzierl
4//
5// For DaStGen's copyright, visit www.peano-framework.org. These generated files
6// however are not subject of copyright, i.e. feel free to add your copyright in
7// here
8//
9#pragma once
10
11#include <string>
12
13
14
15#ifdef Parallel
16 #include <mpi.h>
17 #include <functional>
18#endif
19
20
21
22#include "tarch/la/Vector.h"
24#include "tarch/mpi/Rank.h"
29
30
31
32
33
34namespace peano4{
35namespace grid{
36
37 struct GridStatistics;
38}
39}
40
41
42
44 public:
45
46
48 GridStatistics(int __numberOfLocalUnrefinedCells, int __numberOfRemoteUnrefinedCells, int __numberOfLocalRefinedCells, int __numberOfRemoteRefinedCells, int __numberOfRefiningVertices, int __numberOfErasingVertices, int __numberOfRefinementTriggeredVertices, int __numberOfEraseTriggeredVertices, bool __eraseCommandHasBeenVetoed, bool __removedEmptySubtree, tarch::la::Vector<Dimensions,double> __minH);
49
50
70 void setRemovedEmptySubtree(bool value);
73 double getMinH(int index) const;
74 void setMinH(int index, double value);
75 GridStatistics(const GridStatistics& copy) = default;
76
77
78 #ifdef Parallel
84 [[clang::map_mpi_datatype]]
85 static MPI_Datatype getForkDatatype();
86
87 [[clang::map_mpi_datatype]]
88 static MPI_Datatype getJoinDatatype();
89
90 [[clang::map_mpi_datatype]]
91 static MPI_Datatype getBoundaryExchangeDatatype();
92
93 [[clang::map_mpi_datatype]]
94 static MPI_Datatype getMultiscaleDataExchangeDatatype();
95
96 [[clang::map_mpi_datatype]]
97 static MPI_Datatype getGlobalCommunciationDatatype();
98
99 [[clang::map_mpi_datatype]]
100 static void freeForkDatatype();
101
102 [[clang::map_mpi_datatype]]
103 static void freeJoinDatatype();
104
105 [[clang::map_mpi_datatype]]
107
108 [[clang::map_mpi_datatype]]
110
111 [[clang::map_mpi_datatype]]
113
118 int getSenderRank() const;
119
124 static void initDatatype();
125
129 static void shutdownDatatype();
130
139 static void send(const peano4::grid::GridStatistics& buffer, int destination, int tag, MPI_Comm communicator );
140 static void receive(peano4::grid::GridStatistics& buffer, int source, int tag, MPI_Comm communicator );
141
148 static void send(const peano4::grid::GridStatistics& buffer, int destination, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator );
149 static void receive( peano4::grid::GridStatistics& buffer, int source, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator );
150 #endif
151
152
153
157
160
161#ifdef Parallel
162 static void sendAndPollDanglingMessages(const peano4::grid::GridStatistics& message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator());
163 static void receiveAndPollDanglingMessages(peano4::grid::GridStatistics& message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator() );
164#endif
165
166
167 std::string toString() const;
168
169 private:
170 [[clang::pack_range(0,std::numeric_limits<int>::max())]] int _numberOfLocalUnrefinedCells;
171 [[clang::pack_range(0,std::numeric_limits<int>::max())]] int _numberOfRemoteUnrefinedCells;
172 [[clang::pack_range(0,std::numeric_limits<int>::max())]] int _numberOfLocalRefinedCells;
173 [[clang::pack_range(0,std::numeric_limits<int>::max())]] int _numberOfRemoteRefinedCells;
174 [[clang::pack_range(0,std::numeric_limits<int>::max())]] int _numberOfRefiningVertices;
175 [[clang::pack_range(0,std::numeric_limits<int>::max())]] int _numberOfErasingVertices;
176 [[clang::pack_range(0,std::numeric_limits<int>::max())]] int _numberOfRefinementTriggeredVertices;
177 [[clang::pack_range(0,std::numeric_limits<int>::max())]] int _numberOfEraseTriggeredVertices;
178 [[clang::pack]] bool _eraseCommandHasBeenVetoed;
179 [[clang::pack]] bool _removedEmptySubtree;
181
182
183
184 #ifdef Parallel
185 private:
187
188 #if !defined(__MPI_ATTRIBUTES_LANGUAGE_EXTENSION__)
195 static MPI_Datatype Datatype;
196 #endif
197 #endif
198
199
200
201
202};
203
204
205
206
static Rank & getInstance()
This operation returns the singleton instance.
void setNumberOfLocalRefinedCells(int value)
static void receive(peano4::grid::GridStatistics &buffer, int source, int tag, MPI_Comm communicator)
static MPI_Datatype getJoinDatatype()
static void receiveAndPollDanglingMessages(peano4::grid::GridStatistics &message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
void setNumberOfErasingVertices(int value)
tarch::la::Vector< Dimensions, double > _minH
int getNumberOfLocalRefinedCells() const
void setNumberOfRemoteUnrefinedCells(int value)
void setMinH(const tarch::la::Vector< Dimensions, double > &value)
static void initDatatype()
Wrapper around getDatatype() to trigger lazy evaluation if we use the lazy initialisation.
int getNumberOfLocalUnrefinedCells() const
static MPI_Datatype getBoundaryExchangeDatatype()
int getNumberOfErasingVertices() const
void setNumberOfEraseTriggeredVertices(int value)
int getNumberOfRefiningVertices() const
std::string toString() const
static MPI_Datatype getGlobalCommunciationDatatype()
double getMinH(int index) const
GridStatistics(int __numberOfLocalUnrefinedCells, int __numberOfRemoteUnrefinedCells, int __numberOfLocalRefinedCells, int __numberOfRemoteRefinedCells, int __numberOfRefiningVertices, int __numberOfErasingVertices, int __numberOfRefinementTriggeredVertices, int __numberOfEraseTriggeredVertices, bool __eraseCommandHasBeenVetoed, bool __removedEmptySubtree, tarch::la::Vector< Dimensions, double > __minH)
void setNumberOfRefiningVertices(int value)
static void receive(peano4::grid::GridStatistics &buffer, int source, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
GridStatistics(const GridStatistics &copy)=default
static MPI_Datatype Datatype
Whenever we use LLVM's MPI extension (DaStGe), we rely on lazy initialisation of the datatype.
static void freeBoundaryExchangeDatatype()
static void freeGlobalCommunciationDatatype()
void setMinH(int index, double value)
bool getEraseCommandHasBeenVetoed() const
int getNumberOfEraseTriggeredVertices() const
static void send(const peano4::grid::GridStatistics &buffer, int destination, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
Alternative to the other send() where I trigger a non-blocking send an then invoke the functor until ...
bool getRemovedEmptySubtree() const
void setNumberOfLocalUnrefinedCells(int value)
static void send(const peano4::grid::GridStatistics &buffer, int destination, int tag, MPI_Comm communicator)
In DaStGen (the first version), I had a non-static version of the send as well as the receive.
void setNumberOfRefinementTriggeredVertices(int value)
void setNumberOfRemoteRefinedCells(int value)
int getNumberOfRemoteRefinedCells() const
void setEraseCommandHasBeenVetoed(bool value)
static MPI_Datatype getForkDatatype()
Hands out MPI datatype if we work without the LLVM MPI extension.
static MPI_Datatype getMultiscaleDataExchangeDatatype()
GridStatistics(ObjectConstruction)
int getNumberOfRemoteUnrefinedCells() const
static void shutdownDatatype()
Free the underlying MPI datatype.
static void sendAndPollDanglingMessages(const peano4::grid::GridStatistics &message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
tarch::la::Vector< Dimensions, double > getMinH() const
static void freeMultiscaleDataExchangeDatatype()
int getNumberOfRefinementTriggeredVertices() const
void setRemovedEmptySubtree(bool value)
Simple vector class.
Definition Vector.h:159