Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::IParallelExchanger Class Referenceabstract

Information exchange between processors. More...

#include <arcane/core/IParallelExchanger.h>

Public Types

enum  eExchangeMode { EM_Independant = ParallelExchangerOptions::EM_Independant , EM_Collective = ParallelExchangerOptions::EM_Collective , EM_Auto = ParallelExchangerOptions::EM_Auto }

Public Member Functions

virtual bool initializeCommunicationsMessages ()=0
 Calculates communications.
virtual void initializeCommunicationsMessages (Int32ConstArrayView recv_ranks)=0
 Calculates communications.
virtual void processExchange ()=0
 Performs the exchange using the default options of ParallelExchangerOptions.
virtual void processExchange (const ParallelExchangerOptions &options)=0
 Performs the exchange using the options options.
virtual IParallelMngparallelMng () const =0
virtual Integer nbSender () const =0
 Number of processors to which we send.
virtual Int32ConstArrayView senderRanks () const =0
 List of ranks of processors to which we send.
virtual void addSender (Int32 rank)=0
 Adds a processor to send to.
virtual ISerializeMessagemessageToSend (Integer i)=0
 Message intended for the i-th processor.
virtual Integer nbReceiver () const =0
 Number of processors from which we will receive messages.
virtual Int32ConstArrayView receiverRanks ()=0
 List of ranks of processors from which we will receive messages.
virtual ISerializeMessagemessageToReceive (Integer i)=0
 Message received from the i-th processor.
virtual void setExchangeMode (eExchangeMode mode)=0
 Sets the exchange mode.
virtual eExchangeMode exchangeMode () const =0
 Specified exchange mode.
virtual void setVerbosityLevel (Int32 v)=0
 Sets the verbosity level.
virtual Int32 verbosityLevel () const =0
 Verbosity level.
virtual void setName (const String &name)=0
 Sets the instance name. This name is used during prints.
virtual String name () const =0
 Instance name.

Detailed Description

Information exchange between processors.

This class allows sending and receiving arbitrary messages from any number of other processors.

The operation is as follows.

  1. indicate the other PEs you wish to communicate with by calling addSender(), possibly multiple times.
  2. call initializeCommunicationsMessages() to determine the list of PEs from which we must receive information. There are two overloads for this method depending on whether we know the number of ranks for which we must receive information.
  3. for each outgoing message, serialize the information you wish to send.
  4. perform the sends and receives by calling processExchange()
  5. retrieve the received messages (via messageToReceive()) and deserialize their information.

It is possible to specify, before calling processExchange(), how the messages will be sent via setExchangeMode(). By default, the mechanism used is that of point-to-point communications (EM_Independant) but it is possible to use a collective mode (EM_Collective) which uses 'all to all' type messages.

Definition at line 56 of file IParallelExchanger.h.

Member Enumeration Documentation

◆ eExchangeMode

Enumerator
EM_Independant 

Uses point-to-point exchanges (send/recv).

EM_Collective 

Uses collective operations (allToAll).

EM_Auto 

Automatically chooses between point-to-point or collective.

Definition at line 60 of file IParallelExchanger.h.

Member Function Documentation

◆ initializeCommunicationsMessages() [1/2]

virtual bool Arcane::IParallelExchanger::initializeCommunicationsMessages ( )
pure virtual

Calculates communications.

Based on m_send_ranks provided by each processor, determines the list of processors to which a message must be sent.

To know the processors from which information is expected, it is necessary to perform a communication (allGatherVariable()). If we know these processors beforehand, we must use one of the overloaded versions of this method.

Return values
trueif there is nothing to exchange
falseotherwise.

◆ initializeCommunicationsMessages() [2/2]

virtual void Arcane::IParallelExchanger::initializeCommunicationsMessages ( Int32ConstArrayView recv_ranks)
pure virtual

Calculates communications.

Assumes that the list of processors from which information is desired is in recv_ranks.


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