Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MpiMessagePassingMng.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* MpiMessagePassingMng.h (C) 2000-2025 */
9/* */
10/* MPI implementation of the message exchange manager. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_MESSAGEPASSINGMPI_MPIMESSAGEPASSINGMNG_H
13#define ARCCORE_MESSAGEPASSINGMPI_MPIMESSAGEPASSINGMNG_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/message_passing_mpi/MessagePassingMpiGlobal.h"
18#include "arccore/message_passing/MessagePassingMng.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane::MessagePassing::Mpi
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
32class ARCCORE_MESSAGEPASSINGMPI_EXPORT MpiMessagePassingMng
33: public MessagePassingMng
34{
35 public:
36
37 class BuildInfo
38 {
39 public:
40
41 BuildInfo(Int32 comm_rank, Int32 comm_size, IDispatchers* dispatchers, MPI_Comm comm)
42 : m_comm_rank(comm_rank)
43 , m_comm_size(comm_size)
44 , m_dispatchers(dispatchers)
45 , m_communicator(comm)
46 {}
47
48 public:
49
50 Int32 commRank() const { return m_comm_rank; }
51 Int32 commSize() const { return m_comm_size; }
52 IDispatchers* dispatchers() const { return m_dispatchers; }
53 MPI_Comm communicator() const { return m_communicator; }
54
55 private:
56
57 Int32 m_comm_rank;
58 Int32 m_comm_size;
59 IDispatchers* m_dispatchers;
60 MPI_Comm m_communicator;
61 };
62
63 public:
64
65 explicit MpiMessagePassingMng(const BuildInfo& bi);
66
67 public:
68
69 const MPI_Comm* getMPIComm() const { return &m_mpi_communicator; }
70
71 private:
72
73 MPI_Comm m_mpi_communicator;
74};
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
78
79} // namespace Arcane::MessagePassing::Mpi
80
81/*---------------------------------------------------------------------------*/
82/*---------------------------------------------------------------------------*/
83
84#endif
Interface of the dispatcher container.
std::int32_t Int32
Signed integer type of 32 bits.