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#ifdef Parallel
14#include <mpi.h>
15#include <functional>
16#endif
17
18#include "tarch/la/Vector.h"
19#include "tarch/mpi/Rank.h"
24
25
26
27namespace peano4{
28namespace grid{
29 struct GridStatistics;
30}
31}
32
34 public:
36 GridStatistics(int __numberOfLocalUnrefinedCells, int __numberOfRemoteUnrefinedCells, int __numberOfLocalRefinedCells, int __numberOfRemoteRefinedCells, int __stationarySweeps, bool __coarseningHasBeenVetoed, bool __removedEmptySubtree, tarch::la::Vector<Dimensions,double> __minH);
37
47 void setStationarySweeps(int value);
51 void setRemovedEmptySubtree(bool value);
54 double getMinH(int index) const;
55 void setMinH(int index, double value);
56 GridStatistics(const GridStatistics& copy) = default;
57
58
59 #ifdef Parallel
65 [[clang::map_mpi_datatype]]
66 static MPI_Datatype getForkDatatype();
67
68 [[clang::map_mpi_datatype]]
69 static MPI_Datatype getJoinDatatype();
70
71 [[clang::map_mpi_datatype]]
72 static MPI_Datatype getBoundaryExchangeDatatype();
73
74 [[clang::map_mpi_datatype]]
75 static MPI_Datatype getMultiscaleDataExchangeDatatype();
76
77 [[clang::map_mpi_datatype]]
78 static MPI_Datatype getGlobalCommunciationDatatype();
79
80 [[clang::map_mpi_datatype]]
81 static void freeForkDatatype();
82
83 [[clang::map_mpi_datatype]]
84 static void freeJoinDatatype();
85
86 [[clang::map_mpi_datatype]]
88
89 [[clang::map_mpi_datatype]]
91
92 [[clang::map_mpi_datatype]]
94
99 int getSenderRank() const;
100
105 static void initDatatype();
106
110 static void shutdownDatatype();
111
120 static void send(const peano4::grid::GridStatistics& buffer, int destination, int tag, MPI_Comm communicator );
121 static void receive(peano4::grid::GridStatistics& buffer, int source, int tag, MPI_Comm communicator );
122
129 static void send(const peano4::grid::GridStatistics& buffer, int destination, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator );
130 static void receive( peano4::grid::GridStatistics& buffer, int source, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator );
131 #endif
132
133
137
140
141#ifdef Parallel
142 static void sendAndPollDanglingMessages(const peano4::grid::GridStatistics& message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator());
143 static void receiveAndPollDanglingMessages(peano4::grid::GridStatistics& message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator() );
144#endif
145
146
147 std::string toString() const;
148
149 private:
150 [[clang::pack_range(0,std::numeric_limits<int>::max())]] int _numberOfLocalUnrefinedCells;
151 [[clang::pack_range(0,std::numeric_limits<int>::max())]] int _numberOfRemoteUnrefinedCells;
152 [[clang::pack_range(0,std::numeric_limits<int>::max())]] int _numberOfLocalRefinedCells;
153 [[clang::pack_range(0,std::numeric_limits<int>::max())]] int _numberOfRemoteRefinedCells;
154 [[clang::pack_range(0,std::numeric_limits<int>::max())]] int _stationarySweeps;
155 [[clang::pack]] bool _coarseningHasBeenVetoed;
156 [[clang::pack]] bool _removedEmptySubtree;
158
159 #ifdef Parallel
160 private:
162
163 #if !defined(__MPI_ATTRIBUTES_LANGUAGE_EXTENSION__)
170 static MPI_Datatype Datatype;
171 #endif
172 #endif
173};
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())
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()
std::string toString() const
static MPI_Datatype getGlobalCommunciationDatatype()
void setCoarseningHasBeenVetoed(bool value)
void setStationarySweeps(int value)
double getMinH(int index) const
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)
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 setNumberOfRemoteRefinedCells(int value)
int getNumberOfRemoteRefinedCells() const
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.
bool getCoarseningHasBeenVetoed() const
static void sendAndPollDanglingMessages(const peano4::grid::GridStatistics &message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
GridStatistics(int __numberOfLocalUnrefinedCells, int __numberOfRemoteUnrefinedCells, int __numberOfLocalRefinedCells, int __numberOfRemoteRefinedCells, int __stationarySweeps, bool __coarseningHasBeenVetoed, bool __removedEmptySubtree, tarch::la::Vector< Dimensions, double > __minH)
tarch::la::Vector< Dimensions, double > getMinH() const
static void freeMultiscaleDataExchangeDatatype()
void setRemovedEmptySubtree(bool value)
Simple vector class.
Definition Vector.h:159