Interface that is exposed to the user for interaction with the FMI system.
More...
#include <Communicator.h>
|
| Communicator (FMI::Utils::peer_num peer_id, FMI::Utils::peer_num num_peers, std::string config_path, std::string comm_name, unsigned int faas_memory=128) |
|
| ~Communicator () |
| Finalizes all active channels. More...
|
|
template<typename T > |
void | send (Comm::Data< T > &buf, FMI::Utils::peer_num dest) |
| Send buf to peer dest. More...
|
|
template<typename T > |
void | recv (Comm::Data< T > &buf, FMI::Utils::peer_num src) |
| Receive data from src and store data into the provided buf. More...
|
|
template<typename T > |
void | bcast (Comm::Data< T > &buf, FMI::Utils::peer_num root) |
| Broadcast the data that is in the provided buf of the root peer. Result is stored in buf for all peers. More...
|
|
void | barrier () |
| Barrier synchronization collective. More...
|
|
template<typename T > |
void | gather (Comm::Data< T > &sendbuf, Comm::Data< T > &recvbuf, FMI::Utils::peer_num root) |
| Gather the data of the individuals peers (in sendbuf) into the recvbuf of root. More...
|
|
template<typename T > |
void | scatter (Comm::Data< T > &sendbuf, Comm::Data< T > &recvbuf, FMI::Utils::peer_num root) |
| Scatter the data from root's sendbuf to the recvbuf of all peers. More...
|
|
template<typename T > |
void | reduce (Comm::Data< T > &sendbuf, Comm::Data< T > &recvbuf, FMI::Utils::peer_num root, FMI::Utils::Function< T > f) |
| Perform a reduction with the reduction function f. More...
|
|
template<typename T > |
void | allreduce (Comm::Data< T > &sendbuf, Comm::Data< T > &recvbuf, FMI::Utils::Function< T > f) |
| Perform a reduction with the reduction function f and make the result available to all peers. More...
|
|
template<typename T > |
void | scan (Comm::Data< T > &sendbuf, Comm::Data< T > &recvbuf, FMI::Utils::Function< T > f) |
| Inclusive prefix scan. More...
|
|
void | register_channel (std::string name, std::shared_ptr< FMI::Comm::Channel >) |
| Add a new channel to the communicator with the given name by providing a pointer to it. More...
|
|
void | set_channel_policy (std::shared_ptr< FMI::Utils::ChannelPolicy > policy) |
| Change the channel policy the communicator is using. More...
|
|
void | hint (FMI::Utils::Hint hint) |
| Set the hint (optimization objective) of the channel selection procedure. More...
|
|
Interface that is exposed to the user for interaction with the FMI system.
◆ Communicator()
- Parameters
-
peer_id | ID of the peer in the range [0 .. num_peers - 1] |
num_peers | Number of peers participating in the communicator |
config_path | Path to the FMI JSON configuration file |
comm_name | Name of the communicator, needs to be unique when multiple communicators are used concurrently |
faas_memory | Amount of memory (in MiB) that is allocated to the function, used for performance model calculations. |
◆ ~Communicator()
FMI::Communicator::~Communicator |
( |
| ) |
|
Finalizes all active channels.
◆ allreduce()
Perform a reduction with the reduction function f and make the result available to all peers.
Depending on the associativity / commutativity of f, a different implementation for the reduction may be used. However, in the same topology, the evaluation order should always be the same, irrespectively of the associativity / commutativitiy.
- Parameters
-
sendbuf | Data to send, relevant for all peers. |
recvbuf | Receive buffer that contains the final result, relevant for all peers. Needs to have the same size as the sendbuf. |
◆ barrier()
void FMI::Communicator::barrier |
( |
| ) |
|
|
inline |
Barrier synchronization collective.
◆ bcast()
Broadcast the data that is in the provided buf of the root peer. Result is stored in buf for all peers.
◆ gather()
Gather the data of the individuals peers (in sendbuf) into the recvbuf of root.
- Parameters
-
sendbuf | Data to send to root, needs to be the same size for all peers. |
recvbuf | Receive buffer, only relevant for the root process. Size needs to be num_peers * sendbuf.size |
◆ hint()
Set the hint (optimization objective) of the channel selection procedure.
◆ recv()
Receive data from src and store data into the provided buf.
◆ reduce()
Perform a reduction with the reduction function f.
Depending on the associativity / commutativity of f, a different implementation for the reduction may be used. However, in the same topology, the evaluation order should always be the same, irrespectively of the associativity / commutativitiy.
- Parameters
-
sendbuf | Data to send, relevant for all peers. |
recvbuf | Receive buffer that contains the final result, only relevant for root. Needs to have the same size as the sendbuf. |
◆ register_channel()
void FMI::Communicator::register_channel |
( |
std::string |
name, |
|
|
std::shared_ptr< FMI::Comm::Channel > |
c |
|
) |
| |
Add a new channel to the communicator with the given name by providing a pointer to it.
◆ scan()
Inclusive prefix scan.
Depending on the associativity / commutativity of f, a different implementation for the reduction may be used. However, in the same topology, the evaluation order should always be the same, irrespectively of the associativity / commutativitiy.
- Parameters
-
sendbuf | Data to send, relevant for all peers. |
recvbuf | Receive buffer that contains the final result, relevant for all peers. Needs to have the same size as the sendbuf. |
◆ scatter()
Scatter the data from root's sendbuf to the recvbuf of all peers.
- Parameters
-
sendbuf | The data to scatter, size needs to be recvbuf.size * num_peers (i.e., divisible by the number of peers). Only relevant for the root peer. |
recvbuf | Buffer to receive the data, relevant for all peers. |
◆ send()
◆ set_channel_policy()
Change the channel policy the communicator is using.
The documentation for this class was generated from the following files: