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

MPI-based parallelism supervisor. More...

Inheritance diagram for Arcane::MpiParallelSuperMng:
Collaboration diagram for Arcane::MpiParallelSuperMng:

Public Member Functions

 MpiParallelSuperMng (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.
Parallel::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.

Static Public Member Functions

static void initMPI (IApplication *app)

Public Attributes

IApplicationm_application
 Main manager.
IThreadMngm_thread_mng
Parallel::IStatm_stat
bool m_is_parallel
 Statistics.
Int32 m_rank
 MPI rank in the global communicator of this process.
Int32 m_nb_rank
 Number of MPI processes in the global communicator.
Int32 m_nb_local_sub_domain
 Number of local sub-domains.
MPI_Comm m_mpi_main_communicator
 MPI Communicator.
MP::Communicator m_main_communicator
 MPI Communicator.
MP::Communicator m_machine_communicator
 MPI Machine Communicator.
MpiErrorHandler m_error_handler
MpiAdapterm_adapter
MpiDatatypeListm_datatype_list

Static Private Member Functions

static void _ErrorHandler (MPI_Comm *, int *,...)

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

MPI-based parallelism supervisor.

Definition at line 49 of file MpiParallelSuperMng.cc.

Constructor & Destructor Documentation

◆ MpiParallelSuperMng()

Arcane::MpiParallelSuperMng::MpiParallelSuperMng ( const ServiceBuildInfo & sbi)
explicit

Definition at line 104 of file MpiParallelSuperMng.cc.

◆ ~MpiParallelSuperMng()

Arcane::MpiParallelSuperMng::~MpiParallelSuperMng ( )
override

Definition at line 126 of file MpiParallelSuperMng.cc.

Member Function Documentation

◆ _ErrorHandler()

void Arcane::MpiParallelSuperMng::_ErrorHandler ( MPI_Comm * comm,
int * error_code,
... )
staticprivate

Definition at line 203 of file MpiParallelSuperMng.cc.

◆ application()

IApplication * Arcane::MpiParallelSuperMng::application ( ) const
inlineoverridevirtual

Returns the main manager.

Implements Arcane::IParallelSuperMng.

Definition at line 60 of file MpiParallelSuperMng.cc.

References m_application.

◆ barrier()

void Arcane::MpiParallelSuperMng::barrier ( )
overridevirtual

Parallelism manager for all allocated resources.

Performs a barrier

Implements Arcane::IParallelSuperMng.

Definition at line 321 of file MpiParallelSuperMng.cc.

References m_main_communicator.

◆ build()

void Arcane::MpiParallelSuperMng::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 224 of file MpiParallelSuperMng.cc.

References Arcane::arcaneIsAcceleratorAwareMPI(), Arcane::platform::getRealTime(), Arcane::ITraceMng::info(), m_application, m_is_parallel, m_machine_communicator, m_main_communicator, m_mpi_main_communicator, m_nb_rank, and m_rank.

Here is the call graph for this function:

◆ commRank()

Int32 Arcane::MpiParallelSuperMng::commRank ( ) const
inlineoverridevirtual

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

Implements Arcane::IParallelSuperMng.

Definition at line 63 of file MpiParallelSuperMng.cc.

References m_rank.

Referenced by isMasterIO().

Here is the caller graph for this function:

◆ commSize()

Int32 Arcane::MpiParallelSuperMng::commSize ( ) const
inlineoverridevirtual

Returns the total number of processes used.

Implements Arcane::IParallelSuperMng.

Definition at line 64 of file MpiParallelSuperMng.cc.

References m_nb_rank.

◆ communicator()

Parallel::Communicator Arcane::MpiParallelSuperMng::communicator ( ) const
inlineoverridevirtual

MPI communicator associated with this manager.

See also
IParallelMng::communicator()

Implements Arcane::IParallelSuperMng.

Definition at line 67 of file MpiParallelSuperMng.cc.

References m_main_communicator.

◆ getMPICommunicator()

void * Arcane::MpiParallelSuperMng::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 66 of file MpiParallelSuperMng.cc.

References m_mpi_main_communicator.

◆ initialize()

void Arcane::MpiParallelSuperMng::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 156 of file MpiParallelSuperMng.cc.

◆ initMPI()

void Arcane::MpiParallelSuperMng::initMPI ( IApplication * app)
static

Definition at line 164 of file MpiParallelSuperMng.cc.

◆ internalCreateWorldParallelMng()

Ref< IParallelMng > Arcane::MpiParallelSuperMng::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 272 of file MpiParallelSuperMng.cc.

References ARCANE_THROW, Arcane::createRef(), Arcane::ITraceMng::debug(), m_application, m_machine_communicator, and m_main_communicator.

Here is the call graph for this function:

◆ isMasterIO()

bool Arcane::MpiParallelSuperMng::isMasterIO ( ) const
inlineoverridevirtual

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

Implements Arcane::IParallelSuperMng.

Definition at line 70 of file MpiParallelSuperMng.cc.

References commRank().

Here is the call graph for this function:

◆ isParallel()

bool Arcane::MpiParallelSuperMng::isParallel ( ) const
inlineoverridevirtual

Returns true if the execution is parallel.

Implements Arcane::IParallelSuperMng.

Definition at line 62 of file MpiParallelSuperMng.cc.

References m_is_parallel.

◆ masterIORank()

Integer Arcane::MpiParallelSuperMng::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 71 of file MpiParallelSuperMng.cc.

◆ nbLocalSubDomain()

Integer Arcane::MpiParallelSuperMng::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 72 of file MpiParallelSuperMng.cc.

References m_nb_local_sub_domain.

◆ threadMng()

IThreadMng * Arcane::MpiParallelSuperMng::threadMng ( ) const
inlineoverridevirtual

Thread manager.

Implements Arcane::IParallelSuperMng.

Definition at line 61 of file MpiParallelSuperMng.cc.

◆ traceRank()

Int32 Arcane::MpiParallelSuperMng::traceRank ( ) const
inlineoverridevirtual

Rank of this instance for traces.

Implements Arcane::IParallelSuperMng.

Definition at line 65 of file MpiParallelSuperMng.cc.

References m_rank.

◆ tryAbort()

void Arcane::MpiParallelSuperMng::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 310 of file MpiParallelSuperMng.cc.

References m_application, m_main_communicator, and m_rank.

Member Data Documentation

◆ m_adapter

MpiAdapter* Arcane::MpiParallelSuperMng::m_adapter

Definition at line 92 of file MpiParallelSuperMng.cc.

◆ m_application

IApplication* Arcane::MpiParallelSuperMng::m_application

Main manager.

Definition at line 81 of file MpiParallelSuperMng.cc.

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

◆ m_datatype_list

MpiDatatypeList* Arcane::MpiParallelSuperMng::m_datatype_list

Definition at line 93 of file MpiParallelSuperMng.cc.

◆ m_error_handler

MpiErrorHandler Arcane::MpiParallelSuperMng::m_error_handler

Definition at line 91 of file MpiParallelSuperMng.cc.

◆ m_is_parallel

bool Arcane::MpiParallelSuperMng::m_is_parallel

Statistics.

true if running in parallel mode

Definition at line 84 of file MpiParallelSuperMng.cc.

Referenced by build(), and isParallel().

◆ m_machine_communicator

MP::Communicator Arcane::MpiParallelSuperMng::m_machine_communicator

MPI Machine Communicator.

Definition at line 90 of file MpiParallelSuperMng.cc.

Referenced by build(), and internalCreateWorldParallelMng().

◆ m_main_communicator

MP::Communicator Arcane::MpiParallelSuperMng::m_main_communicator

◆ m_mpi_main_communicator

MPI_Comm Arcane::MpiParallelSuperMng::m_mpi_main_communicator

MPI Communicator.

Definition at line 88 of file MpiParallelSuperMng.cc.

Referenced by build(), and getMPICommunicator().

◆ m_nb_local_sub_domain

Int32 Arcane::MpiParallelSuperMng::m_nb_local_sub_domain

Number of local sub-domains.

Definition at line 87 of file MpiParallelSuperMng.cc.

Referenced by nbLocalSubDomain().

◆ m_nb_rank

Int32 Arcane::MpiParallelSuperMng::m_nb_rank

Number of MPI processes in the global communicator.

Definition at line 86 of file MpiParallelSuperMng.cc.

Referenced by build(), and commSize().

◆ m_rank

Int32 Arcane::MpiParallelSuperMng::m_rank

MPI rank in the global communicator of this process.

Definition at line 85 of file MpiParallelSuperMng.cc.

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

◆ m_stat

Parallel::IStat* Arcane::MpiParallelSuperMng::m_stat

Definition at line 83 of file MpiParallelSuperMng.cc.

◆ m_thread_mng

IThreadMng* Arcane::MpiParallelSuperMng::m_thread_mng

Definition at line 82 of file MpiParallelSuperMng.cc.


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