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

Supervisor of parallelism using MPI and Threads. More...

Inheritance diagram for Arcane::MessagePassing::HybridParallelSuperMng:
Collaboration diagram for Arcane::MessagePassing::HybridParallelSuperMng:

Public Member Functions

 HybridParallelSuperMng (const ServiceBuildInfo &sbi)
void initialize () override
 Initializes the instance.
void build () override
 Constructs the instance members.
IApplicationapplication () const override
 Returns the main manager.
IThreadMngthreadMng () const override
 Thread manager.
bool isParallel () const override
 Returns true if the execution is parallel.
Int32 commRank () const override
 Returns the process number (between 0 and nbProcess()-1).
Int32 commSize () const override
 Returns the total number of processes used.
Int32 traceRank () const override
 Rank of this instance for traces.
void * getMPICommunicator () override
 Address of the MPI communicator associated with this manager.
MP::Communicator communicator () const override
 MPI communicator associated with this manager.
Ref< IParallelMnginternalCreateWorldParallelMng (Int32 local_rank) override
 Creates a parallelism manager for all allocated cores.
void tryAbort () override
 Attempts to abort.
bool isMasterIO () const override
 Returns true if the instance is a master I/O manager.
Integer masterIORank () const override
 Rank of the instance managing input/output (for which isMasterIO() is true).
Integer nbLocalSubDomain () override
 Number of subdomains to create locally.
void barrier () override
 Parallelism manager for all allocated resources.
Public Member Functions inherited from Arcane::ParallelSuperMngDispatcher
virtual void allGather (ByteConstArrayView send_buf, ByteArrayView recv_buf)
virtual void allGather (Int32ConstArrayView send_buf, Int32ArrayView recv_buf)
virtual void allGather (Int64ConstArrayView send_buf, Int64ArrayView recv_buf)
virtual void allGather (RealConstArrayView send_buf, RealArrayView recv_buf)
virtual Int32 reduce (eReduceType rt, Int32 v)
virtual Int64 reduce (eReduceType rt, Int64 v)
virtual Real reduce (eReduceType rt, Real v)
virtual void reduce (eReduceType rt, Int32ArrayView v)
virtual void reduce (eReduceType rt, Int64ArrayView v)
virtual void reduce (eReduceType rt, RealArrayView v)
void broadcast (ByteArrayView send_buf, Integer id) override
 Sends an array of values to all processes This operation synchronizes the value array send_buf across all processes. The array used is that of the process whose identifier (processId()) is process_id. All processes must call this method with the same parameter process_id and have a send_buf array containing the same number of elements.
void broadcast (Int32ArrayView send_buf, Integer id) override
void broadcast (Int64ArrayView send_buf, Integer id) override
void broadcast (RealArrayView send_buf, Integer id) override
virtual void send (ByteConstArrayView values, Integer id)
virtual void send (Int32ConstArrayView values, Integer id)
virtual void send (Int64ConstArrayView values, Integer id)
virtual void send (RealConstArrayView values, Integer id)
virtual void recv (ByteArrayView values, Integer id)
virtual void recv (Int32ArrayView values, Integer id)
virtual void recv (Int64ArrayView values, Integer id)
virtual void recv (RealArrayView values, Integer id)
virtual Request send (ByteConstArrayView values, Integer id, bool is_blocked)
virtual Request send (Int32ConstArrayView values, Integer id, bool is_blocked)
virtual Request send (Int64ConstArrayView values, Integer id, bool is_blocked)
virtual Request send (RealConstArrayView values, Integer id, bool is_blocked)
virtual Request recv (ByteArrayView values, Integer id, bool is_blocked)
virtual Request recv (Int32ArrayView values, Integer id, bool is_blocked)
virtual Request recv (Int64ArrayView values, Integer id, bool is_blocked)
virtual Request recv (RealArrayView values, Integer id, bool is_blocked)
virtual void sendRecv (ByteConstArrayView send_buf, ByteArrayView recv_buf, Integer id)
virtual void sendRecv (Int32ConstArrayView send_buf, Int32ArrayView recv_buf, Integer id)
virtual void sendRecv (Int64ConstArrayView send_buf, Int64ArrayView recv_buf, Integer id)
virtual void sendRecv (RealConstArrayView send_buf, RealArrayView recv_buf, Integer id)
virtual void allToAll (ByteConstArrayView send_buf, ByteArrayView recv_buf, Integer count)
virtual void allToAll (Int32ConstArrayView send_buf, Int32ArrayView recv_buf, Integer count)
virtual void allToAll (Int64ConstArrayView send_buf, Int64ArrayView recv_buf, Integer count)
virtual void allToAll (RealConstArrayView send_buf, RealArrayView recv_buf, Integer count)
virtual Int32 scan (eReduceType rt, Int32 v)
virtual Int64 scan (eReduceType rt, Int64 v)
virtual Real scan (eReduceType rt, Real v)
virtual void scan (eReduceType rt, Int32ArrayView v)
virtual void scan (eReduceType rt, Int64ArrayView v)
virtual void scan (eReduceType rt, RealArrayView v)
Public Member Functions inherited from Arcane::IParallelSuperMng
virtual ~IParallelSuperMng ()
 Frees resources.

Public Attributes

HybridParallelMngContainerm_container = nullptr
Ref< IParallelMngContainerFactorym_builder_factory
Ref< IParallelMngContainerm_main_builder
IApplicationm_application
 Main manager.
Parallel::IStatm_stat
Int32 m_mpi_comm_rank = -1
 Statistics.
Int32 m_mpi_comm_size = -1
 Number of processors.
MPI_Comm m_mpi_communicator
MP::Communicator m_communicator
MP::Communicator m_machine_communicator
Int32 m_local_nb_rank = A_NULL_RANK
MpiLockm_mpi_lock
MpiAdapterm_mpi_adapter
MpiDatatypeListm_datatype_list
MpiErrorHandler m_error_handler

Additional Inherited Members

Public Types inherited from Arcane::IParallelSuperMng
typedef Parallel::Request Request
typedef Parallel::eReduceType eReduceType
Protected Member Functions inherited from Arcane::ParallelSuperMngDispatcher
void _setDispatchers (IParallelDispatchT< Byte > *b, IParallelDispatchT< Int32 > *i32, IParallelDispatchT< Int64 > *i64, IParallelDispatchT< Real > *r)
void _finalize ()

Detailed Description

Supervisor of parallelism using MPI and Threads.

Definition at line 302 of file HybridParallelSuperMng.cc.

Constructor & Destructor Documentation

◆ HybridParallelSuperMng()

Arcane::MessagePassing::HybridParallelSuperMng::HybridParallelSuperMng ( const ServiceBuildInfo & sbi)
explicit

Definition at line 351 of file HybridParallelSuperMng.cc.

◆ ~HybridParallelSuperMng()

Arcane::MessagePassing::HybridParallelSuperMng::~HybridParallelSuperMng ( )
override

Definition at line 368 of file HybridParallelSuperMng.cc.

Member Function Documentation

◆ application()

IApplication * Arcane::MessagePassing::HybridParallelSuperMng::application ( ) const
inlineoverridevirtual

Returns the main manager.

Implements Arcane::IParallelSuperMng.

Definition at line 313 of file HybridParallelSuperMng.cc.

References m_application.

◆ barrier()

void Arcane::MessagePassing::HybridParallelSuperMng::barrier ( )
overridevirtual

Parallelism manager for all allocated resources.

Performs a barrier

Implements Arcane::IParallelSuperMng.

Definition at line 550 of file HybridParallelSuperMng.cc.

◆ build()

void Arcane::MessagePassing::HybridParallelSuperMng::build ( )
overridevirtual

Constructs the instance members.

The instance is not usable until this method has been called. This method must be called before initialize().

Warning
This method must only be called once.

Implements Arcane::IParallelSuperMng.

Definition at line 396 of file HybridParallelSuperMng.cc.

References Arcane::IApplication::applicationBuildInfo(), ARCANE_CHECK_POINTER, ARCANE_FATAL, Arcane::arcaneHasThread(), Arcane::arcaneInitializeMPI(), Arcane::arcaneIsCudaAwareMPI(), Arcane::ApplicationInfo::commandLineArguments(), Arcane::ServiceBuilder< InterfaceType >::createReference(), Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::get(), Arcane::platform::getRealTime(), Arcane::ITraceMng::info(), m_application, m_mpi_comm_rank, m_mpi_comm_size, and Arcane::IBase::traceMng().

Here is the call graph for this function:

◆ commRank()

Int32 Arcane::MessagePassing::HybridParallelSuperMng::commRank ( ) const
inlineoverridevirtual

Returns the process number (between 0 and nbProcess()-1).

Implements Arcane::IParallelSuperMng.

Definition at line 316 of file HybridParallelSuperMng.cc.

References m_mpi_comm_rank.

Referenced by internalCreateWorldParallelMng(), and isMasterIO().

Here is the caller graph for this function:

◆ commSize()

Int32 Arcane::MessagePassing::HybridParallelSuperMng::commSize ( ) const
inlineoverridevirtual

Returns the total number of processes used.

Implements Arcane::IParallelSuperMng.

Definition at line 317 of file HybridParallelSuperMng.cc.

References m_mpi_comm_size.

◆ communicator()

MP::Communicator Arcane::MessagePassing::HybridParallelSuperMng::communicator ( ) const
inlineoverridevirtual

MPI communicator associated with this manager.

See also
IParallelMng::communicator()

Implements Arcane::IParallelSuperMng.

Definition at line 320 of file HybridParallelSuperMng.cc.

◆ getMPICommunicator()

void * Arcane::MessagePassing::HybridParallelSuperMng::getMPICommunicator ( )
inlineoverridevirtual

Address of the MPI communicator associated with this manager.

The communicator is only valid if MPI is used. Otherwise, the returned address is 0. The returned value is of type (MPI_Comm*).

Implements Arcane::IParallelSuperMng.

Definition at line 319 of file HybridParallelSuperMng.cc.

◆ initialize()

void Arcane::MessagePassing::HybridParallelSuperMng::initialize ( )
overridevirtual

Initializes the instance.

The instance is not usable until this method has been called.

Warning
This method must only be called once.

Implements Arcane::IParallelSuperMng.

Definition at line 388 of file HybridParallelSuperMng.cc.

◆ internalCreateWorldParallelMng()

Ref< IParallelMng > Arcane::MessagePassing::HybridParallelSuperMng::internalCreateWorldParallelMng ( Int32 local_rank)
overridevirtual

Creates a parallelism manager for all allocated cores.

This operation is collective.

This method must only be called once during initialization.

local_rank is the local rank of the caller in the list of ranks. In pure MPI mode, this rank is always 0 because there is only one thread. In Thread or Thread/MPI mode, it is the rank of the thread used during creation.

The returned manager remains the property of this instance and must not be destroyed.

For internal use only.

Implements Arcane::IParallelSuperMng.

Definition at line 514 of file HybridParallelSuperMng.cc.

References commRank(), Arcane::ITraceMng::info(), and m_application.

Here is the call graph for this function:

◆ isMasterIO()

bool Arcane::MessagePassing::HybridParallelSuperMng::isMasterIO ( ) const
inlineoverridevirtual

Returns true if the instance is a master I/O manager.

Implements Arcane::IParallelSuperMng.

Definition at line 323 of file HybridParallelSuperMng.cc.

References commRank().

Here is the call graph for this function:

◆ isParallel()

bool Arcane::MessagePassing::HybridParallelSuperMng::isParallel ( ) const
inlineoverridevirtual

Returns true if the execution is parallel.

Implements Arcane::IParallelSuperMng.

Definition at line 315 of file HybridParallelSuperMng.cc.

◆ masterIORank()

Integer Arcane::MessagePassing::HybridParallelSuperMng::masterIORank ( ) const
inlineoverridevirtual

Rank of the instance managing input/output (for which isMasterIO() is true).

In the current implementation, this is always the rank 0 processor.

Implements Arcane::IParallelSuperMng.

Definition at line 324 of file HybridParallelSuperMng.cc.

◆ nbLocalSubDomain()

Integer Arcane::MessagePassing::HybridParallelSuperMng::nbLocalSubDomain ( )
inlineoverridevirtual

Number of subdomains to create locally.

  • 1 if sequential.
  • 1 if pure MPI
  • n if THREAD or THREAD/MPI

Implements Arcane::IParallelSuperMng.

Definition at line 325 of file HybridParallelSuperMng.cc.

◆ threadMng()

IThreadMng * Arcane::MessagePassing::HybridParallelSuperMng::threadMng ( ) const
inlineoverridevirtual

Thread manager.

Implements Arcane::IParallelSuperMng.

Definition at line 314 of file HybridParallelSuperMng.cc.

◆ traceRank()

Int32 Arcane::MessagePassing::HybridParallelSuperMng::traceRank ( ) const
inlineoverridevirtual

Rank of this instance for traces.

Implements Arcane::IParallelSuperMng.

Definition at line 318 of file HybridParallelSuperMng.cc.

References m_mpi_comm_rank.

◆ tryAbort()

void Arcane::MessagePassing::HybridParallelSuperMng::tryAbort ( )
overridevirtual

Attempts to abort.

This method is called when an exception has been generated and the current execution case must stop. It allows performing cleanup operations on the manager if necessary.

Implements Arcane::IParallelSuperMng.

Definition at line 540 of file HybridParallelSuperMng.cc.

References m_application.

Member Data Documentation

◆ m_application

IApplication* Arcane::MessagePassing::HybridParallelSuperMng::m_application

Main manager.

Definition at line 334 of file HybridParallelSuperMng.cc.

Referenced by application(), build(), internalCreateWorldParallelMng(), and tryAbort().

◆ m_builder_factory

Ref<IParallelMngContainerFactory> Arcane::MessagePassing::HybridParallelSuperMng::m_builder_factory

Definition at line 331 of file HybridParallelSuperMng.cc.

◆ m_communicator

MP::Communicator Arcane::MessagePassing::HybridParallelSuperMng::m_communicator

Definition at line 339 of file HybridParallelSuperMng.cc.

◆ m_container

HybridParallelMngContainer* Arcane::MessagePassing::HybridParallelSuperMng::m_container = nullptr

Definition at line 330 of file HybridParallelSuperMng.cc.

◆ m_datatype_list

MpiDatatypeList* Arcane::MessagePassing::HybridParallelSuperMng::m_datatype_list

Definition at line 344 of file HybridParallelSuperMng.cc.

◆ m_error_handler

MpiErrorHandler Arcane::MessagePassing::HybridParallelSuperMng::m_error_handler

Definition at line 345 of file HybridParallelSuperMng.cc.

◆ m_local_nb_rank

Int32 Arcane::MessagePassing::HybridParallelSuperMng::m_local_nb_rank = A_NULL_RANK

Definition at line 341 of file HybridParallelSuperMng.cc.

◆ m_machine_communicator

MP::Communicator Arcane::MessagePassing::HybridParallelSuperMng::m_machine_communicator

Definition at line 340 of file HybridParallelSuperMng.cc.

◆ m_main_builder

Ref<IParallelMngContainer> Arcane::MessagePassing::HybridParallelSuperMng::m_main_builder

Definition at line 332 of file HybridParallelSuperMng.cc.

◆ m_mpi_adapter

MpiAdapter* Arcane::MessagePassing::HybridParallelSuperMng::m_mpi_adapter

Definition at line 343 of file HybridParallelSuperMng.cc.

◆ m_mpi_comm_rank

Int32 Arcane::MessagePassing::HybridParallelSuperMng::m_mpi_comm_rank = -1

Statistics.

Current processor number

Definition at line 336 of file HybridParallelSuperMng.cc.

Referenced by build(), commRank(), and traceRank().

◆ m_mpi_comm_size

Int32 Arcane::MessagePassing::HybridParallelSuperMng::m_mpi_comm_size = -1

Number of processors.

Definition at line 337 of file HybridParallelSuperMng.cc.

Referenced by build(), and commSize().

◆ m_mpi_communicator

MPI_Comm Arcane::MessagePassing::HybridParallelSuperMng::m_mpi_communicator

Definition at line 338 of file HybridParallelSuperMng.cc.

◆ m_mpi_lock

MpiLock* Arcane::MessagePassing::HybridParallelSuperMng::m_mpi_lock

Definition at line 342 of file HybridParallelSuperMng.cc.

◆ m_stat

Parallel::IStat* Arcane::MessagePassing::HybridParallelSuperMng::m_stat

Definition at line 335 of file HybridParallelSuperMng.cc.


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