Peano
Loading...
Searching...
No Matches
GeneratedTestObject_Flattened.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 stacks{
36namespace tests{
37
38 struct GeneratedTestObject_Flattened;
39}
40}
41}
42
43
44
46 public:
47
48
51
52
53 int getId() const;
54 void setId(int value);
57 double getData(int index) const;
58 void setData(int index, double value);
60
61
62 #ifdef Parallel
68 [[clang::map_mpi_datatype]]
69 static MPI_Datatype getForkDatatype();
70
71 [[clang::map_mpi_datatype]]
72 static MPI_Datatype getJoinDatatype();
73
74 [[clang::map_mpi_datatype]]
75 static MPI_Datatype getBoundaryExchangeDatatype();
76
77 [[clang::map_mpi_datatype]]
78 static MPI_Datatype getMultiscaleDataExchangeDatatype();
79
80 [[clang::map_mpi_datatype]]
81 static MPI_Datatype getGlobalCommunciationDatatype();
82
83 [[clang::map_mpi_datatype]]
84 static void freeForkDatatype();
85
86 [[clang::map_mpi_datatype]]
87 static void freeJoinDatatype();
88
89 [[clang::map_mpi_datatype]]
91
92 [[clang::map_mpi_datatype]]
94
95 [[clang::map_mpi_datatype]]
97
102 int getSenderRank() const;
103
108 static void initDatatype();
109
113 static void shutdownDatatype();
114
123 static void send(const peano4::stacks::tests::GeneratedTestObject_Flattened& buffer, int destination, int tag, MPI_Comm communicator );
124 static void receive(peano4::stacks::tests::GeneratedTestObject_Flattened& buffer, int source, int tag, MPI_Comm communicator );
125
132 static void send(const peano4::stacks::tests::GeneratedTestObject_Flattened& buffer, int destination, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator );
133 static void receive( peano4::stacks::tests::GeneratedTestObject_Flattened& buffer, int source, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator );
134 #endif
135
136
137
141
144
145#ifdef Parallel
146 static void sendAndPollDanglingMessages(const peano4::stacks::tests::GeneratedTestObject_Flattened& message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator());
147 static void receiveAndPollDanglingMessages(peano4::stacks::tests::GeneratedTestObject_Flattened& message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator() );
148#endif
149
150
151 std::string toString() const;
152
153 private:
154 int _id;
156
157
158
159 #ifdef Parallel
160 private:
162
163 #if !defined(__MPI_ATTRIBUTES_LANGUAGE_EXTENSION__)
170 static MPI_Datatype Datatype;
171 #endif
172 #endif
173
174
175
176
177};
178
179
180
181
static Rank & getInstance()
This operation returns the singleton instance.
GeneratedTestObject_Flattened(int __id, tarch::la::Vector< 256, double > __data)
static void sendAndPollDanglingMessages(const peano4::stacks::tests::GeneratedTestObject_Flattened &message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
static MPI_Datatype getForkDatatype()
Hands out MPI datatype if we work without the LLVM MPI extension.
static void receiveAndPollDanglingMessages(peano4::stacks::tests::GeneratedTestObject_Flattened &message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
static void initDatatype()
Wrapper around getDatatype() to trigger lazy evaluation if we use the lazy initialisation.
static void shutdownDatatype()
Free the underlying MPI datatype.
static MPI_Datatype Datatype
Whenever we use LLVM's MPI extension (DaStGe), we rely on lazy initialisation of the datatype.
void setData(const tarch::la::Vector< 256, double > &value)
static void send(const peano4::stacks::tests::GeneratedTestObject_Flattened &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.
tarch::la::Vector< 256, double > getData() const
static void send(const peano4::stacks::tests::GeneratedTestObject_Flattened &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 ...
static void receive(peano4::stacks::tests::GeneratedTestObject_Flattened &buffer, int source, int tag, MPI_Comm communicator)
GeneratedTestObject_Flattened(const GeneratedTestObject_Flattened &copy)=default
static void receive(peano4::stacks::tests::GeneratedTestObject_Flattened &buffer, int source, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
Simple vector class.
Definition Vector.h:159