STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Static Public Member Functions | Public Types
stapl::runtime::communicator Class Reference

This class assists with sending messages between processes. More...

Static Public Member Functions

static void initialize (option const &opts)
 Initializes all communicators for this process. More...
 
static void finalize (void)
 Initializes all communicators.
 
static void start (void)
 Starts the communication layer.
 
static void stop (void)
 Stops the communication layer.
 
static int get_id (void) noexcept
 Returns the id of this process.
 
static int size (void) noexcept
 Returns the number of processes.
 
static int get_num_procs_per_node (void) noexcept
 Returns the number of processes per node.
 
static void exit (int exit_code)
 Exits with the given exit code.
 
static void lock (void)
 Locks the communication layer.
 
static void unlock (void)
 Unlocks the communication layer.
 
static void set_default_message_size (const std::size_t size)
 Sets the default message size. More...
 
static message_slist poll (const bool block=false)
 Polls for incoming messages and returns a message_slist of the received messages. More...
 
static void send (const id pid, message_ptr m)
 Sends m to the process pid.
 
static void send_all (process_id_range r, message_ptr m)
 Sends m to the destinations in r.
 
static void forward_and_store (std::vector< id > const &v, message_ptr m)
 Sends m to the destinations in v and keeps a copy.
 
static void forward_and_store (std::vector< id > const &v, const id excluded, message_ptr m)
 Sends m to the destinations in v filtering out excluded and keeps a copy.
 
static void forward_and_store (topology const &t, message_ptr m)
 Sends m to the destination described by t and keeps a copy.
 

Public Types

using id = process_id
 
using size_type = std::size_t
 
using process_id_range = any_range< id >
 

Detailed Description

This class assists with sending messages between processes.

Member Function Documentation

◆ initialize()

void stapl::runtime::communicator::initialize ( option const &  opts)
static

Initializes all communicators for this process.

Parameters
optsoption object to initialize the communicators with.

◆ set_default_message_size()

void stapl::runtime::communicator::set_default_message_size ( const std::size_t  size)
static

Sets the default message size.

Parameters
sizeNew message size.
See also
message

◆ poll()

message_slist stapl::runtime::communicator::poll ( const bool  block = false)
static

Polls for incoming messages and returns a message_slist of the received messages.

Parameters
blockif true, then the communicator will block until it receives a message

The documentation for this class was generated from the following files: