Peano
Loading...
Searching...
No Matches
GridControlEvent.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
30 struct GridControlEvent;
31}
32}
33
35 public:
36 enum class RefinementControl: int {
37 Refine=0, Erase=1
38 };
39
42
47 double getOffset(int index) const;
48 void setOffset(int index, double value);
51 double getWidth(int index) const;
52 void setWidth(int index, double value);
55 double getH(int index) const;
56 void setH(int index, double value);
57 GridControlEvent(const GridControlEvent& copy) = default;
58
59
60 #ifdef Parallel
66 [[clang::map_mpi_datatype]]
67 static MPI_Datatype getForkDatatype();
68
69 [[clang::map_mpi_datatype]]
70 static MPI_Datatype getJoinDatatype();
71
72 [[clang::map_mpi_datatype]]
73 static MPI_Datatype getBoundaryExchangeDatatype();
74
75 [[clang::map_mpi_datatype]]
76 static MPI_Datatype getMultiscaleDataExchangeDatatype();
77
78 [[clang::map_mpi_datatype]]
79 static MPI_Datatype getGlobalCommunciationDatatype();
80
81 [[clang::map_mpi_datatype]]
82 static void freeForkDatatype();
83
84 [[clang::map_mpi_datatype]]
85 static void freeJoinDatatype();
86
87 [[clang::map_mpi_datatype]]
88 static void freeBoundaryExchangeDatatype();
89
90 [[clang::map_mpi_datatype]]
92
93 [[clang::map_mpi_datatype]]
95
100 int getSenderRank() const;
101
106 static void initDatatype();
107
111 static void shutdownDatatype();
112
121 static void send(const peano4::grid::GridControlEvent& buffer, int destination, int tag, MPI_Comm communicator );
122 static void receive(peano4::grid::GridControlEvent& buffer, int source, int tag, MPI_Comm communicator );
123
130 static void send(const peano4::grid::GridControlEvent& buffer, int destination, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator );
131 static void receive( peano4::grid::GridControlEvent& buffer, int source, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator );
132 #endif
133
134
138
141
142#ifdef Parallel
143 static void sendAndPollDanglingMessages(const peano4::grid::GridControlEvent& message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator());
144 static void receiveAndPollDanglingMessages(peano4::grid::GridControlEvent& message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator() );
145#endif
146
147
148 std::string toString() const;
149
150 private:
155
156 #ifdef Parallel
157 private:
159
160 #if !defined(__MPI_ATTRIBUTES_LANGUAGE_EXTENSION__)
167 static MPI_Datatype Datatype;
168 #endif
169 #endif
170
171
172
173};
static Rank & getInstance()
This operation returns the singleton instance.
Definition Rank.cpp:539
tarch::la::Vector< Dimensions, double > _offset
static MPI_Datatype getBoundaryExchangeDatatype()
GridControlEvent(ObjectConstruction)
static void send(const peano4::grid::GridControlEvent &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.
static void sendAndPollDanglingMessages(const peano4::grid::GridControlEvent &message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
static MPI_Datatype getJoinDatatype()
void setOffset(const tarch::la::Vector< Dimensions, double > &value)
static void initDatatype()
Wrapper around getDatatype() to trigger lazy evaluation if we use the lazy initialisation.
static void shutdownDatatype()
Free the underlying MPI datatype.
void setH(const tarch::la::Vector< Dimensions, double > &value)
tarch::la::Vector< Dimensions, double > _width
tarch::la::Vector< Dimensions, double > getWidth() const
peano4::grid::GridControlEvent::RefinementControl getRefinementControl() const
tarch::la::Vector< Dimensions, double > _h
static void receive(peano4::grid::GridControlEvent &buffer, int source, int tag, MPI_Comm communicator)
static MPI_Datatype Datatype
Whenever we use LLVM's MPI extension (DaStGe), we rely on lazy initialisation of the datatype.
static MPI_Datatype getForkDatatype()
Hands out MPI datatype if we work without the LLVM MPI extension.
static MPI_Datatype getGlobalCommunciationDatatype()
void setRefinementControl(RefinementControl value)
static MPI_Datatype getMultiscaleDataExchangeDatatype()
tarch::la::Vector< Dimensions, double > getOffset() const
GridControlEvent(const GridControlEvent &copy)=default
tarch::la::Vector< Dimensions, double > getH() const
void setWidth(const tarch::la::Vector< Dimensions, double > &value)
static void receiveAndPollDanglingMessages(peano4::grid::GridControlEvent &message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
Simple vector class.
Definition Vector.h:134