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#include "arccore/base/Ref.h"
19
20#include "arccore/message_passing/IMessagePassingMng.h"
21#include "arccore/message_passing/Communicator.h"
22
23#include "arccore/trace/TraceGlobal.h"
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33/*!
34 * \brief Implementation of interface IMessagePassingMng.
35 *
36 * This class in internal to Arccore. Uses should use the interface
37 * IMessagePassingMng.
38 */
39class ARCCORE_MESSAGEPASSING_EXPORT MessagePassingMng
41, public IMessagePassingMng
42{
44
45 public:
46
47 MessagePassingMng(Int32 comm_rank, Int32 comm_size, IDispatchers* d);
48 ~MessagePassingMng() override;
49
50 public:
51
52 Int32 commRank() const override { return m_comm_rank; }
53 Int32 commSize() const override { return m_comm_size; }
54 IDispatchers* dispatchers() override;
55 ITimeMetricCollector* timeMetricCollector() const override;
56 Communicator communicator() const override;
57 ITraceMng* traceMng() const override { return m_trace_mng.get(); }
58
59 public:
60
61 void setTimeMetricCollector(ITimeMetricCollector* c);
62 void setCommunicator(Communicator c);
63 void setTraceMng(ITraceMng* tm);
64
65 private:
66
67 Int32 m_comm_rank = A_NULL_RANK;
68 Int32 m_comm_size = A_NULL_RANK;
69 IDispatchers* m_dispatchers = nullptr;
70 ITimeMetricCollector* m_time_metric_collector = nullptr;
71 Communicator m_communicator;
72 Ref<ITraceMng> m_trace_mng;
73};
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77
78} // namespace Arcane::MessagePassing
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83#endif
#define ARCCORE_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS()
Macro to define methods managing counters of references.
Management of references to a C++ class.
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.
ITraceMng * traceMng() const override
Trace manager associated to this instance.
Int32 commRank() const override
Rank of this instance in the communicator.
Reference to an instance.
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.