Arcane  4.1.12.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-2025 */
9/* */
10/* Message passing manager. */
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/*!
32 * \brief Message passing manager.
33 *
34 * Instances of these classes must be destroyed via the mpDelete() method.
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 // TODO: Rendre obsolète fin 2022: [[deprecated("Use mpDelete() instead")]]
46 ~MessagePassingMng() override;
47
48 public:
49
50 Int32 commRank() const override { return m_comm_rank; }
51 Int32 commSize() const override { return m_comm_size; }
52 IDispatchers* dispatchers() override;
53 ITimeMetricCollector* timeMetricCollector() const override;
54 Communicator communicator() const override;
55
56 public:
57
58 void setTimeMetricCollector(ITimeMetricCollector* c);
59 void setCommunicator(Communicator c);
60
61 private:
62
63 Int32 m_comm_rank = A_NULL_RANK;
64 Int32 m_comm_size = A_NULL_RANK;
65 IDispatchers* m_dispatchers = nullptr;
66 ITimeMetricCollector* m_time_metric_collector = nullptr;
67 Communicator m_communicator;
68};
69
70/*---------------------------------------------------------------------------*/
71/*---------------------------------------------------------------------------*/
72
73} // namespace Arcane::MessagePassing
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77
78#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.