Peano
Loading...
Searching...
No Matches
IntegerMessage.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#ifdef Parallel
15 #include <mpi.h>
16 #include <functional>
17#endif
18
19#include "tarch/la/Vector.h"
20#include "tarch/mpi/Rank.h"
22
23
24namespace tarch{
25namespace mpi{
26
27 struct IntegerMessage;
28}
29}
30
31
32
34 public:
35
36
38 IntegerMessage(int __value);
39
40
41 int getValue() const;
42 void setValue(int value);
43 IntegerMessage(const IntegerMessage& copy) = default;
44
45
46 #ifdef Parallel
52 [[clang::map_mpi_datatype]]
53 static MPI_Datatype getForkDatatype();
54
55 [[clang::map_mpi_datatype]]
56 static MPI_Datatype getJoinDatatype();
57
58 [[clang::map_mpi_datatype]]
59 static MPI_Datatype getBoundaryExchangeDatatype();
60
61 [[clang::map_mpi_datatype]]
62 static MPI_Datatype getMultiscaleDataExchangeDatatype();
63
64 [[clang::map_mpi_datatype]]
65 static MPI_Datatype getGlobalCommunciationDatatype();
66
67 [[clang::map_mpi_datatype]]
68 static void freeForkDatatype();
69
70 [[clang::map_mpi_datatype]]
71 static void freeJoinDatatype();
72
73 [[clang::map_mpi_datatype]]
75
76 [[clang::map_mpi_datatype]]
78
79 [[clang::map_mpi_datatype]]
81
86 int getSenderRank() const;
87
92 static void initDatatype();
93
97 static void shutdownDatatype();
98
107 static void send(const tarch::mpi::IntegerMessage& buffer, int destination, int tag, MPI_Comm communicator );
108 static void receive(tarch::mpi::IntegerMessage& buffer, int source, int tag, MPI_Comm communicator );
109
116 static void send(const tarch::mpi::IntegerMessage& buffer, int destination, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator );
117 static void receive( tarch::mpi::IntegerMessage& buffer, int source, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator );
118 #endif
119
120
124
127
128#ifdef Parallel
129 static void sendAndPollDanglingMessages(const tarch::mpi::IntegerMessage& message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator());
130 static void receiveAndPollDanglingMessages(tarch::mpi::IntegerMessage& message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator() );
131#endif
132
133
134 std::string toString() const;
135
136 private:
138
139
140
141 #ifdef Parallel
142 private:
144
145 #if !defined(__MPI_ATTRIBUTES_LANGUAGE_EXTENSION__)
152 static MPI_Datatype Datatype;
153 #endif
154 #endif
155
156
157
158};
159
160
161
162
static Rank & getInstance()
This operation returns the singleton instance.
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19
static void freeForkDatatype()
static void freeBoundaryExchangeDatatype()
static MPI_Datatype getForkDatatype()
Hands out MPI datatype if we work without the LLVM MPI extension.
void setValue(int value)
static void shutdownDatatype()
Free the underlying MPI datatype.
static void sendAndPollDanglingMessages(const tarch::mpi::IntegerMessage &message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
static MPI_Datatype getMultiscaleDataExchangeDatatype()
static MPI_Datatype getGlobalCommunciationDatatype()
static void receive(tarch::mpi::IntegerMessage &buffer, int source, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
std::string toString() const
static void send(const tarch::mpi::IntegerMessage &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 send(const tarch::mpi::IntegerMessage &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 freeMultiscaleDataExchangeDatatype()
static void receiveAndPollDanglingMessages(tarch::mpi::IntegerMessage &message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
static MPI_Datatype Datatype
Whenever we use LLVM's MPI extension (DaStGe), we rely on lazy initialisation of the datatype.
IntegerMessage(ObjectConstruction)
static void initDatatype()
Wrapper around getDatatype() to trigger lazy evaluation if we use the lazy initialisation.
static void receive(tarch::mpi::IntegerMessage &buffer, int source, int tag, MPI_Comm communicator)
static MPI_Datatype getJoinDatatype()
static void freeGlobalCommunciationDatatype()
static void freeJoinDatatype()
static MPI_Datatype getBoundaryExchangeDatatype()
IntegerMessage(const IntegerMessage &copy)=default