Peano
Loading...
Searching...
No Matches
StringMessage.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#include "tarch/la/Vector.h"
14#include "tarch/mpi/Rank.h"
15
16#ifdef Parallel
17 #include <mpi.h>
18 #include <functional>
19#endif
20
21namespace tarch{
22namespace mpi{
23 struct StringMessage;
24}
25}
26
35 public:
37 StringMessage(const std::string & value);
38
39 std::string getData() const;
40 void setData(const std::string& value);
41
42
43
44#ifdef Parallel
45 static void sendAndPollDanglingMessages(const tarch::mpi::StringMessage& message, int destination, int tag );
46 static void receiveAndPollDanglingMessages(tarch::mpi::StringMessage& message, int source, int tag );
47#endif
48
49
50 #ifdef Parallel
55 int getSenderRank() const;
56
65 static void send(const tarch::mpi::StringMessage& buffer, int destination, int tag, MPI_Comm communicator );
66 static void receive(tarch::mpi::StringMessage& buffer, int source, int tag, MPI_Comm communicator );
67
74 static void send(
75 const tarch::mpi::StringMessage& buffer,
76 int destination,
77 int tag,
78 std::function<void()> startCommunicationFunctor,
79 std::function<void()> waitFunctor,
80 MPI_Comm communicator
81 );
82 static void receive(
84 int source,
85 int tag,
86 std::function<void()> startCommunicationFunctor,
87 std::function<void()> waitFunctor,
88 MPI_Comm communicator
89 );
90
99 static bool isMessageInQueue(int tag, MPI_Comm communicator);
100 #endif
101
102
103 std::string toString() const;
104
105 private:
106 std::string _data;
107
109};
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19
The string message looks like the other messages which I generate through DaStGen 2,...
static void receiveAndPollDanglingMessages(tarch::mpi::StringMessage &message, int source, int tag)
static void send(const tarch::mpi::StringMessage &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 ...
void setData(const std::string &value)
static void send(const tarch::mpi::StringMessage &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 receive(tarch::mpi::StringMessage &buffer, int source, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
std::string toString() const
static void receive(tarch::mpi::StringMessage &buffer, int source, int tag, MPI_Comm communicator)
static void sendAndPollDanglingMessages(const tarch::mpi::StringMessage &message, int destination, int tag)
static bool isMessageInQueue(int tag, MPI_Comm communicator)
In older DaStGen version, I tried to find out whether a particular message type is in the MPI queue.
std::string getData() const
StringMessage(const std::string &value)