Arcane  4.2.3.0
User documentation
Loading...
Searching...
No Matches
MessagePassingMng.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/* MessagePassingMng.h (C) 2000-2026 */
9/* */
10/* Implementation of interface IMessagePassingMng. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_MESSAGEPASSING_MESSAGEPASSINGMNG_H
13#define ARCCORE_MESSAGEPASSING_MESSAGEPASSINGMNG_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19#include "arccore/message_passing/IMessagePassingMng.h"
20#include "arccore/message_passing/Communicator.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30/*!
31 * \brief Implementation of interface IMessagePassingMng.
32 *
33 * This class in internal to Arccore. Uses should use the interface
34 * IMessagePassingMng.
35 */
36class ARCCORE_MESSAGEPASSING_EXPORT MessagePassingMng
38, public IMessagePassingMng
39{
41
42 public:
43
44 MessagePassingMng(Int32 comm_rank, Int32 comm_size, IDispatchers* d);
45 ~MessagePassingMng() override;
46
47 public:
48
49 Int32 commRank() const override { return m_comm_rank; }
50 Int32 commSize() const override { return m_comm_size; }
51 IDispatchers* dispatchers() override;
52 ITimeMetricCollector* timeMetricCollector() const override;
53 Communicator communicator() const override;
54
55 public:
56
57 void setTimeMetricCollector(ITimeMetricCollector* c);
58 void setCommunicator(Communicator c);
59
60 private:
61
62 Int32 m_comm_rank = A_NULL_RANK;
63 Int32 m_comm_size = A_NULL_RANK;
64 IDispatchers* m_dispatchers = nullptr;
65 ITimeMetricCollector* m_time_metric_collector = nullptr;
66 Communicator m_communicator;
67};
68
69/*---------------------------------------------------------------------------*/
70/*---------------------------------------------------------------------------*/
71
72} // namespace Arcane::MessagePassing
73
74/*---------------------------------------------------------------------------*/
75/*---------------------------------------------------------------------------*/
76
77#endif
#define ARCCORE_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS()
Macro to define methods managing counters of references.
Communicator for message exchange.
Interface of the dispatcher container.
Interface of the message passing manager.
Int32 commSize() const override
Number of instances in the communicator.
Int32 commRank() const override
Rank of this instance in the communicator.
Thread-safe implementation of a reference counter.
Declarations of types and methods used by message exchange mechanisms.
std::int32_t Int32
Signed integer type of 32 bits.