Peano
Loading...
Searching...
No Matches
GeneratedTestObject.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
21
22
23
24#include "tarch/la/Vector.h"
26#include "tarch/mpi/Rank.h"
31
32
33
34
35
36namespace peano4{
37namespace stacks{
38namespace tests{
39
41}
42}
43}
44
45
46
48 public:
49
50
53
54
55 int getId() const;
56 void setId(int value);
59 double getData(int index) const;
60 void setData(int index, double value);
63
64
67
68 #ifdef Parallel
74 static MPI_Datatype getForkDatatype();
75
76 static MPI_Datatype getJoinDatatype();
77
78 static MPI_Datatype getBoundaryExchangeDatatype();
79
80 static MPI_Datatype getMultiscaleDataExchangeDatatype();
81
82 static MPI_Datatype getGlobalCommunciationDatatype();
83
84 static void freeForkDatatype();
85
86 static void freeJoinDatatype();
87
89
91
93
94 int getSenderRank() const;
95
96 static void initDatatype();
97
98 static void shutdownDatatype();
99
100 static void send(const SmartType& buffer, int destination, int tag, MPI_Comm communicator );
101 static void receive(SmartType& buffer, int source, int tag, MPI_Comm communicator );
102
103 static void send(const SmartType& buffer, int destination, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator );
104 static void receive(SmartType& buffer, int source, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator );
105 #endif
106
107 static FlattenedType flatten(const SmartType& copy);
108 static SmartType unflatten(const FlattenedType& copy);
109
110
111
115
118
119#ifdef Parallel
120 static void sendAndPollDanglingMessages(const peano4::stacks::tests::GeneratedTestObject& message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator());
121 static void receiveAndPollDanglingMessages(peano4::stacks::tests::GeneratedTestObject& message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator() );
122#endif
123
124
125 std::string toString() const;
126
127 private:
128 int _id;
130
131
132
133 #ifdef Parallel
134 private:
136 #endif
137
138
139
140
141};
142
143
144
145
static Rank & getInstance()
This operation returns the singleton instance.
static MPI_Datatype getMultiscaleDataExchangeDatatype()
static void send(const SmartType &buffer, int destination, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
GeneratedTestObject(int __id, tarch::la::Vector< 256, double > __data)
static void send(const SmartType &buffer, int destination, int tag, MPI_Comm communicator)
static MPI_Datatype getGlobalCommunciationDatatype()
GeneratedTestObject(const GeneratedTestObject &copy)=default
static MPI_Datatype getBoundaryExchangeDatatype()
tarch::la::SmartPointerVector< 256, double > getDataSmartPointer()
static void sendAndPollDanglingMessages(const peano4::stacks::tests::GeneratedTestObject &message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
void setData(const tarch::la::Vector< 256, double > &value)
void setData(int index, double value)
tarch::la::Vector< 256, double > getData() const
static void receive(SmartType &buffer, int source, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
static MPI_Datatype getForkDatatype()
Hands out MPI datatype if we work without the LLVM MPI extension.
static FlattenedType flatten(const SmartType &copy)
static SmartType unflatten(const FlattenedType &copy)
static void receiveAndPollDanglingMessages(peano4::stacks::tests::GeneratedTestObject &message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
tarch::la::SmartPointerVector< 256, double > _data
static void receive(SmartType &buffer, int source, int tag, MPI_Comm communicator)
Simple SmartPointerVector class.
Simple vector class.
Definition Vector.h:159