Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
PointToPointSerializerMng.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/* PointToPointSerializerMng.h (C) 2000-2025 */
9/* */
10/* Point-to-point communications using 'ISerializer'. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_MESSAGEPASSING_POINTOTPOINTSERIALIZERMNG_H
13#define ARCCORE_MESSAGEPASSING_POINTOTPOINTSERIALIZERMNG_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/message_passing/ISerializeMessage.h"
19
20#include <functional>
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
36/*!
37 * \brief Point-to-point communications using 'ISerializer'.
38 */
39class ARCCORE_MESSAGEPASSING_EXPORT PointToPointSerializerMng
40{
41 class Impl;
42
43 public:
44
45 PointToPointSerializerMng(IMessagePassingMng* mpm);
46 ~PointToPointSerializerMng();
47
48 public:
49
50 PointToPointSerializerMng(const PointToPointSerializerMng&) = delete;
51 PointToPointSerializerMng& operator=(const PointToPointSerializerMng&) = delete;
52
53 public:
54
55 //! Associated message manager
57
58 /*!
59 * \brief Sends the messages from the list that have not yet been processed.
60 *
61 * It is generally not necessary to call this
62 * method because it is done automatically when calling waitMessages().
63 */
65
66 /*!
67 * \brief Waits for the messages to finish execution.
68 *
69 * The wait type is specified by \a wt.
70 *
71 * \return the number of messages completely executed or (-1) if they
72 * all have been.
73 */
74 Integer waitMessages(eWaitType wt, std::function<void(ISerializeMessage*)> functor);
75
76 //! Indicates if there are remaining messages that have not yet finished.
77 bool hasMessages() const;
78
79 /*!
80 * \brief Creates a receiving serialization message
81 *
82 * \a sender_rank is the rank of the sender of the corresponding message.
83 * It is possible to specify a null rank to indicate that one
84 * wishes to receive from anyone.
85 */
87
88 /*!
89 * \brief Creates a receiving serialization message
90 *
91 * \a sender_rank is the rank of the sender of the corresponding message.
92 * It is possible to specify a null rank to indicate that one
93 * wishes to receive from anyone.
94 */
96
97 /*!
98 * \brief Creates a sending serialization message.
99 */
101
102 /*!
103 * \brief Default tag used for messages.
104 *
105 * This method can only be called if there are no messages
106 * currently in progress (hasMessages()==false). All ranks of messagePassingMng()
107 * must use the same tag.
108 */
109 void setDefaultTag(MessageTag default_tag);
110
111 /*!
112 * \brief Strategy used for messages.
113 *
114 * This method can only be called if there are no messages
115 * currently in progress (hasMessages()==false). All ranks of messagePassingMng()
116 * must use the same strategy.
117 */
119
120 private:
121
122 Impl* m_p;
123};
124
125/*---------------------------------------------------------------------------*/
126/*---------------------------------------------------------------------------*/
127
128} // namespace Arcane::MessagePassing
129
130/*---------------------------------------------------------------------------*/
131/*---------------------------------------------------------------------------*/
132
133#endif
Interface of the message passing manager.
IMessagePassingMng * messagePassingMng() const
Associated message manager.
bool hasMessages() const
Indicates if there are remaining messages that have not yet finished.
void setStrategy(ISerializeMessage::eStrategy strategy)
Strategy used for messages.
Integer waitMessages(eWaitType wt, std::function< void(ISerializeMessage *)> functor)
Waits for the messages to finish execution.
Ref< ISerializeMessage > addSendMessage(MessageRank receiver_rank)
Creates a sending serialization message.
void setDefaultTag(MessageTag default_tag)
Default tag used for messages.
Ref< ISerializeMessage > addReceiveMessage(MessageRank sender_rank)
Creates a receiving serialization message.
void processPendingMessages()
Sends the messages from the list that have not yet been processed.
Reference to an instance.
Declarations of types and methods used by message exchange mechanisms.
Int32 Integer
Type representing an integer.