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

Information exchange between processors. More...

#include <arcane/core/IParallelExchanger.h>

Inheritance diagram for Arcane::IParallelExchanger:
Collaboration diagram for Arcane::IParallelExchanger:

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

◆ addSender()

virtual void Arcane::IParallelExchanger::addSender ( Int32 rank)
pure virtual

Adds a processor to send to.

Implemented in Arcane::ParallelExchanger.

Referenced by Arcane::mesh::FaceUniqueIdBuilder::_exchangeData(), and Arcane::mesh::Parallel3EdgeUniqueIdBuilder::_exchangeData().

Here is the caller graph for this function:

◆ exchangeMode()

virtual eExchangeMode Arcane::IParallelExchanger::exchangeMode ( ) const
pure virtual

Specified exchange mode.

Implemented in Arcane::ParallelExchanger.

◆ 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.

Implemented in Arcane::ParallelExchanger.

Referenced by Arcane::mesh::FaceUniqueIdBuilder::_exchangeData(), and Arcane::mesh::Parallel3EdgeUniqueIdBuilder::_exchangeData().

Here is the caller graph for this function:

◆ 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.

Implemented in Arcane::ParallelExchanger.

◆ messageToReceive()

virtual ISerializeMessage * Arcane::IParallelExchanger::messageToReceive ( Integer i)
pure virtual

Message received from the i-th processor.

Implemented in Arcane::ParallelExchanger.

Referenced by Arcane::mesh::GhostLayerBuilder::addGhostChildFromParent().

Here is the caller graph for this function:

◆ messageToSend()

virtual ISerializeMessage * Arcane::IParallelExchanger::messageToSend ( Integer i)
pure virtual

Message intended for the i-th processor.

Implemented in Arcane::ParallelExchanger.

Referenced by Arcane::mesh::FaceUniqueIdBuilder::_exchangeData(), and Arcane::mesh::Parallel3EdgeUniqueIdBuilder::_exchangeData().

Here is the caller graph for this function:

◆ name()

virtual String Arcane::IParallelExchanger::name ( ) const
pure virtual

Instance name.

Implemented in Arcane::ParallelExchanger.

Referenced by setName().

Here is the caller graph for this function:

◆ nbReceiver()

virtual Integer Arcane::IParallelExchanger::nbReceiver ( ) const
pure virtual

Number of processors from which we will receive messages.

Implemented in Arcane::ParallelExchanger.

Referenced by Arcane::mesh::FaceUniqueIdBuilder::_exchangeData(), and Arcane::mesh::GhostLayerBuilder::addGhostChildFromParent().

Here is the caller graph for this function:

◆ nbSender()

virtual Integer Arcane::IParallelExchanger::nbSender ( ) const
pure virtual

Number of processors to which we send.

Implemented in Arcane::ParallelExchanger.

Referenced by Arcane::mesh::FaceUniqueIdBuilder::_exchangeData(), and Arcane::mesh::Parallel3EdgeUniqueIdBuilder::_exchangeData().

Here is the caller graph for this function:

◆ processExchange() [1/2]

virtual void Arcane::IParallelExchanger::processExchange ( )
pure virtual

Performs the exchange using the default options of ParallelExchangerOptions.

Implemented in Arcane::ParallelExchanger.

Referenced by Arcane::mesh::FaceUniqueIdBuilder::_exchangeData(), and Arcane::mesh::Parallel3EdgeUniqueIdBuilder::_exchangeData().

Here is the caller graph for this function:

◆ processExchange() [2/2]

virtual void Arcane::IParallelExchanger::processExchange ( const ParallelExchangerOptions & options)
pure virtual

Performs the exchange using the options options.

Implemented in Arcane::ParallelExchanger.

◆ receiverRanks()

virtual Int32ConstArrayView Arcane::IParallelExchanger::receiverRanks ( )
pure virtual

List of ranks of processors from which we will receive messages.

Implemented in Arcane::ParallelExchanger.

◆ senderRanks()

virtual Int32ConstArrayView Arcane::IParallelExchanger::senderRanks ( ) const
pure virtual

List of ranks of processors to which we send.

Implemented in Arcane::ParallelExchanger.

◆ setExchangeMode()

virtual void Arcane::IParallelExchanger::setExchangeMode ( eExchangeMode mode)
pure virtual

Sets the exchange mode.

Implemented in Arcane::ParallelExchanger.

◆ setName()

virtual void Arcane::IParallelExchanger::setName ( const String & name)
pure virtual

Sets the instance name. This name is used during prints.

Implemented in Arcane::ParallelExchanger.

References name().

Here is the call graph for this function:

◆ setVerbosityLevel()

virtual void Arcane::IParallelExchanger::setVerbosityLevel ( Int32 v)
pure virtual

Sets the verbosity level.

Implemented in Arcane::ParallelExchanger.

◆ verbosityLevel()

virtual Int32 Arcane::IParallelExchanger::verbosityLevel ( ) const
pure virtual

Verbosity level.

Implemented in Arcane::ParallelExchanger.


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