Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::ParallelExchanger Class Reference

Information exchange between processors. More...

#include <arcane/impl/ParallelExchanger.h>

Inheritance diagram for Arcane::ParallelExchanger:
Collaboration diagram for Arcane::ParallelExchanger:

Public Member Functions

 ParallelExchanger (IParallelMng *pm)
bool initializeCommunicationsMessages () override
 Calculates communications.
void initializeCommunicationsMessages (Int32ConstArrayView recv_ranks) override
 Calculates communications.
void processExchange () override
 Performs the exchange using the default options of ParallelExchangerOptions.
void processExchange (const ParallelExchangerOptions &options) override
 Performs the exchange using the options options.
IParallelMngparallelMng () const override
Integer nbSender () const override
 Number of processors to which we send.
Int32ConstArrayView senderRanks () const override
 List of ranks of processors to which we send.
void addSender (Int32 rank) override
 Adds a processor to send to.
ISerializeMessagemessageToSend (Integer i) override
 Message intended for the i-th processor.
Integer nbReceiver () const override
 Number of processors from which we will receive messages.
Int32ConstArrayView receiverRanks () override
 List of ranks of processors from which we will receive messages.
ISerializeMessagemessageToReceive (Integer i) override
 Message received from the i-th processor.
void setExchangeMode (eExchangeMode mode) override
 Sets the exchange mode.
eExchangeMode exchangeMode () const override
 Specified exchange mode.
void setVerbosityLevel (Int32 v) override
 Sets the verbosity level.
Int32 verbosityLevel () const override
 Verbosity level.
void setName (const String &name) override
 Sets the instance name. This name is used during prints.
String name () const override
 Instance name.
Public Member Functions inherited from Arcane::TraceAccessor
 TraceAccessor (ITraceMng *m)
 Constructs an accessor via the trace manager m.
 TraceAccessor (const TraceAccessor &rhs)
 Copy constructor.
TraceAccessoroperator= (const TraceAccessor &rhs)
 Copy assignment operator.
virtual ~TraceAccessor ()
 Frees resources.
ITraceMngtraceMng () const
 Trace manager.
TraceMessage info () const
 Flow for an information message.
TraceMessage pinfo () const
 Flow for a parallel information message.
TraceMessage info (char category) const
 Flow for an information message of a given category.
TraceMessage pinfo (char category) const
 Flow for a parallel information message of a given category.
TraceMessage info (bool v) const
 Flow for an information message.
TraceMessage warning () const
 Flow for a warning message.
TraceMessage pwarning () const
TraceMessage error () const
 Flow for an error message.
TraceMessage perror () const
TraceMessage log () const
 Flow for a log message.
TraceMessage plog () const
 Flow for a log message.
TraceMessage logdate () const
 Flow for a log message preceded by the date.
TraceMessage fatal () const
 Flow for a fatal error message.
TraceMessage pfatal () const
 Flow for a parallel fatal error message.
TraceMessageDbg debug (Trace::eDebugLevel=Trace::Medium) const
 Flow for a debug message.
Trace::eDebugLevel configDbgLevel () const
 Debug level of the configuration file.
TraceMessage info (Int32 verbose_level) const
 Flow for an information message of a given level.
TraceMessage linfo () const
 Flow for an information message with the local information level of this instance.
TraceMessage linfo (Int32 relative_level) const
 Flow for an information message with the local information level of this instance.
void fatalMessage (const StandaloneTraceMessage &o) const

Private Member Functions

 ParallelExchanger (Ref< IParallelMng > pm)
void _initializeCommunicationsMessages ()
void _processExchangeCollective ()
void _processExchangeWithControl (Int32 max_pending_message)
 Exchange with control over the maximum number of messages in flight.
void _processExchange (const ParallelExchangerOptions &options)

Private Attributes

Ref< IParallelMngm_parallel_mng
Int32UniqueArray m_send_ranks
 List of subdomains to send.
Int32UniqueArray m_recv_ranks
 List of subdomains to receive.
UniqueArray< ISerializeMessage * > m_comms_buf
 List of messages to send and receive.
UniqueArray< SerializeMessage * > m_recv_serialize_infos
 List of messages to receive.
UniqueArray< SerializeMessage * > m_send_serialize_infos
 List of messages to receive.
SerializeMessagem_own_send_message = nullptr
 Message sent to self.
SerializeMessagem_own_recv_message = nullptr
 Message received by self.
eExchangeMode m_exchange_mode = EM_Independant
 Exchange mode.
Int32 m_verbosity_level = 0
 Verbosity level.
String m_name
 Instance name used for display.
Timer m_timer
 Timer to measure time spent in exchanges.

Friends

Ref< IParallelExchangercreateParallelExchangerImpl (Ref< IParallelMng > pm)

Additional Inherited Members

Public Types inherited from Arcane::IParallelExchanger
enum  eExchangeMode { EM_Independant = ParallelExchangerOptions::EM_Independant , EM_Collective = ParallelExchangerOptions::EM_Collective , EM_Auto = ParallelExchangerOptions::EM_Auto }
Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const

Detailed Description

Information exchange between processors.

See also
IParallelExchanger

Definition at line 44 of file ParallelExchanger.h.

Constructor & Destructor Documentation

◆ ParallelExchanger() [1/2]

Arcane::ParallelExchanger::ParallelExchanger ( IParallelMng * pm)

Definition at line 38 of file ParallelExchanger.cc.

◆ ~ParallelExchanger()

Arcane::ParallelExchanger::~ParallelExchanger ( )
override

Definition at line 61 of file ParallelExchanger.cc.

◆ ParallelExchanger() [2/2]

Arcane::ParallelExchanger::ParallelExchanger ( Ref< IParallelMng > pm)
private

Definition at line 47 of file ParallelExchanger.cc.

Member Function Documentation

◆ _initializeCommunicationsMessages()

void Arcane::ParallelExchanger::_initializeCommunicationsMessages ( )
private

Definition at line 137 of file ParallelExchanger.cc.

◆ _processExchange()

void Arcane::ParallelExchanger::_processExchange ( const ParallelExchangerOptions & options)
private

Definition at line 197 of file ParallelExchanger.cc.

◆ _processExchangeCollective()

void Arcane::ParallelExchanger::_processExchangeCollective ( )
private

Definition at line 253 of file ParallelExchanger.cc.

◆ _processExchangeWithControl()

void Arcane::ParallelExchanger::_processExchangeWithControl ( Int32 max_pending_message)
private

Exchange with control over the maximum number of messages in flight.

Definition at line 431 of file ParallelExchanger.cc.

References Arcane::Array< T >::begin(), Arcane::MessagePassing::ISerializeMessage::destination(), Arcane::Array< T >::end(), Arcane::TraceAccessor::info(), Arcane::MessagePassing::ISerializeMessage::isSend(), m_comms_buf, m_name, m_verbosity_level, Arcane::math::max(), Arcane::AbstractArray< T >::size(), Arcane::MessagePassing::ISerializeMessage::source(), and Arcane::MessagePassing::WaitSome.

Here is the call graph for this function:

◆ addSender()

void Arcane::ParallelExchanger::addSender ( Int32 rank)
inlineoverridevirtual

Adds a processor to send to.

Implements Arcane::IParallelExchanger.

Definition at line 72 of file ParallelExchanger.h.

References m_send_ranks.

◆ exchangeMode()

eExchangeMode Arcane::ParallelExchanger::exchangeMode ( ) const
inlineoverridevirtual

Specified exchange mode.

Implements Arcane::IParallelExchanger.

Definition at line 79 of file ParallelExchanger.h.

References m_exchange_mode.

◆ initializeCommunicationsMessages() [1/2]

bool Arcane::ParallelExchanger::initializeCommunicationsMessages ( )
overridevirtual

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.

Implements Arcane::IParallelExchanger.

Definition at line 83 of file ParallelExchanger.cc.

References m_recv_ranks, and m_send_ranks.

◆ initializeCommunicationsMessages() [2/2]

void Arcane::ParallelExchanger::initializeCommunicationsMessages ( Int32ConstArrayView recv_ranks)
overridevirtual

Calculates communications.

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

Implements Arcane::IParallelExchanger.

Definition at line 126 of file ParallelExchanger.cc.

References m_recv_ranks, and Arcane::ConstArrayView< T >::size().

Here is the call graph for this function:

◆ messageToReceive()

ISerializeMessage * Arcane::ParallelExchanger::messageToReceive ( Integer i)
overridevirtual

Message received from the i-th processor.

Implements Arcane::IParallelExchanger.

Definition at line 364 of file ParallelExchanger.cc.

References m_recv_serialize_infos.

◆ messageToSend()

ISerializeMessage * Arcane::ParallelExchanger::messageToSend ( Integer i)
overridevirtual

Message intended for the i-th processor.

Implements Arcane::IParallelExchanger.

Definition at line 355 of file ParallelExchanger.cc.

References m_send_serialize_infos.

◆ name()

String Arcane::ParallelExchanger::name ( ) const
inlineoverridevirtual

Instance name.

Implements Arcane::IParallelExchanger.

Definition at line 85 of file ParallelExchanger.h.

References m_name.

Referenced by setName().

Here is the caller graph for this function:

◆ nbReceiver()

Integer Arcane::ParallelExchanger::nbReceiver ( ) const
inlineoverridevirtual

Number of processors from which we will receive messages.

Implements Arcane::IParallelExchanger.

Definition at line 74 of file ParallelExchanger.h.

References m_recv_ranks.

◆ nbSender()

Integer Arcane::ParallelExchanger::nbSender ( ) const
inlineoverridevirtual

Number of processors to which we send.

Implements Arcane::IParallelExchanger.

Definition at line 70 of file ParallelExchanger.h.

References m_send_ranks.

◆ parallelMng()

IParallelMng * Arcane::ParallelExchanger::parallelMng ( ) const
overridevirtual

Implements Arcane::IParallelExchanger.

Definition at line 74 of file ParallelExchanger.cc.

◆ processExchange() [1/2]

void Arcane::ParallelExchanger::processExchange ( )
overridevirtual

Performs the exchange using the default options of ParallelExchangerOptions.

Implements Arcane::IParallelExchanger.

Definition at line 166 of file ParallelExchanger.cc.

References m_exchange_mode, processExchange(), and Arcane::ParallelExchangerOptions::setExchangeMode().

Referenced by processExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processExchange() [2/2]

void Arcane::ParallelExchanger::processExchange ( const ParallelExchangerOptions & options)
overridevirtual

Performs the exchange using the options options.

Implements Arcane::IParallelExchanger.

Definition at line 177 of file ParallelExchanger.cc.

References Arcane::platform::getCurrentDateTime(), Arcane::TraceAccessor::info(), m_name, m_timer, and m_verbosity_level.

Here is the call graph for this function:

◆ receiverRanks()

Int32ConstArrayView Arcane::ParallelExchanger::receiverRanks ( )
inlineoverridevirtual

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

Implements Arcane::IParallelExchanger.

Definition at line 75 of file ParallelExchanger.h.

References m_recv_ranks.

◆ senderRanks()

Int32ConstArrayView Arcane::ParallelExchanger::senderRanks ( ) const
inlineoverridevirtual

List of ranks of processors to which we send.

Implements Arcane::IParallelExchanger.

Definition at line 71 of file ParallelExchanger.h.

References m_send_ranks.

◆ setExchangeMode()

void Arcane::ParallelExchanger::setExchangeMode ( eExchangeMode mode)
inlineoverridevirtual

Sets the exchange mode.

Implements Arcane::IParallelExchanger.

Definition at line 78 of file ParallelExchanger.h.

References m_exchange_mode.

◆ setName()

void Arcane::ParallelExchanger::setName ( const String & name)
overridevirtual

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

Implements Arcane::IParallelExchanger.

Definition at line 384 of file ParallelExchanger.cc.

References m_name, and name().

Here is the call graph for this function:

◆ setVerbosityLevel()

void Arcane::ParallelExchanger::setVerbosityLevel ( Int32 v)
overridevirtual

Sets the verbosity level.

Implements Arcane::IParallelExchanger.

Definition at line 373 of file ParallelExchanger.cc.

References m_verbosity_level.

◆ verbosityLevel()

Int32 Arcane::ParallelExchanger::verbosityLevel ( ) const
inlineoverridevirtual

Verbosity level.

Implements Arcane::IParallelExchanger.

Definition at line 82 of file ParallelExchanger.h.

References m_verbosity_level.

◆ createParallelExchangerImpl

Ref< IParallelExchanger > createParallelExchangerImpl ( Ref< IParallelMng > pm)
friend

Definition at line 489 of file ParallelExchanger.cc.

Member Data Documentation

◆ m_comms_buf

UniqueArray<ISerializeMessage*> Arcane::ParallelExchanger::m_comms_buf
private

List of messages to send and receive.

Definition at line 98 of file ParallelExchanger.h.

Referenced by _processExchangeWithControl().

◆ m_exchange_mode

eExchangeMode Arcane::ParallelExchanger::m_exchange_mode = EM_Independant
private

Exchange mode.

Definition at line 113 of file ParallelExchanger.h.

Referenced by exchangeMode(), processExchange(), and setExchangeMode().

◆ m_name

String Arcane::ParallelExchanger::m_name
private

Instance name used for display.

Definition at line 119 of file ParallelExchanger.h.

Referenced by _processExchangeWithControl(), name(), processExchange(), and setName().

◆ m_own_recv_message

SerializeMessage* Arcane::ParallelExchanger::m_own_recv_message = nullptr
private

Message received by self.

Definition at line 110 of file ParallelExchanger.h.

◆ m_own_send_message

SerializeMessage* Arcane::ParallelExchanger::m_own_send_message = nullptr
private

Message sent to self.

Definition at line 107 of file ParallelExchanger.h.

◆ m_parallel_mng

Ref<IParallelMng> Arcane::ParallelExchanger::m_parallel_mng
private

Definition at line 89 of file ParallelExchanger.h.

◆ m_recv_ranks

Int32UniqueArray Arcane::ParallelExchanger::m_recv_ranks
private

List of subdomains to receive.

Definition at line 95 of file ParallelExchanger.h.

Referenced by initializeCommunicationsMessages(), initializeCommunicationsMessages(), nbReceiver(), and receiverRanks().

◆ m_recv_serialize_infos

UniqueArray<SerializeMessage*> Arcane::ParallelExchanger::m_recv_serialize_infos
private

List of messages to receive.

Definition at line 101 of file ParallelExchanger.h.

Referenced by messageToReceive().

◆ m_send_ranks

Int32UniqueArray Arcane::ParallelExchanger::m_send_ranks
private

List of subdomains to send.

Definition at line 92 of file ParallelExchanger.h.

Referenced by addSender(), initializeCommunicationsMessages(), nbSender(), and senderRanks().

◆ m_send_serialize_infos

UniqueArray<SerializeMessage*> Arcane::ParallelExchanger::m_send_serialize_infos
private

List of messages to receive.

Definition at line 104 of file ParallelExchanger.h.

Referenced by messageToSend().

◆ m_timer

Timer Arcane::ParallelExchanger::m_timer
private

Timer to measure time spent in exchanges.

Definition at line 122 of file ParallelExchanger.h.

Referenced by processExchange().

◆ m_verbosity_level

Int32 Arcane::ParallelExchanger::m_verbosity_level = 0
private

Verbosity level.

Definition at line 116 of file ParallelExchanger.h.

Referenced by _processExchangeWithControl(), processExchange(), setVerbosityLevel(), and verbosityLevel().


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