12#ifndef ARCANE_NONBLOCKINGPARTICLEEXCHANGER_H
13#define ARCANE_NONBLOCKINGPARTICLEEXCHANGER_H
17#include "arcane/utils/List.h"
18#include "arcane/utils/ScopedPtr.h"
20#include "arcane/mesh/MeshGlobal.h"
22#include "arcane/core/IParticleExchanger.h"
23#include "arcane/core/BasicService.h"
24#include "arcane/core/VariableCollection.h"
46class NonBlockingParticleExchanger
52 static const Integer MESSAGE_EXCHANGE = 1;
53 static const Integer MESSAGE_NB_FINISH_EXCHANGE = 2;
54 static const Integer MESSAGE_FINISH_EXCHANGE_STATUS = 3;
55 static const Integer MESSAGE_CHANGE_BLOCKING = 4;
60 ~NonBlockingParticleExchanger()
override;
88 ARCANE_UNUSED(nb_particle);
107 Real m_total_time_functor;
108 Real m_total_time_waiting;
121 Int64 m_nb_total_particle_finish_exchange;
122 Int64 m_nb_total_particle;
124 Integer m_nb_original_blocking_size;
128 bool m_exchange_finished;
130 bool m_need_general_receive;
131 bool m_end_message_sended;
132 bool m_can_process_messages;
133 bool m_can_process_non_blocking;
135 bool m_want_process_non_blocking;
136 bool m_want_fast_send_particles;
140 Int64 m_nb_particle_finished_exchange;
149 void _clearMessages();
159 void _processFinishTrackingMessage();
160 void _addFinishExchangeParticle(
Int64 nb_particle_finish_exchange);
161 void _sendFinishExchangeParticle();
166 void _sendPendingMessages();
167 void _checkNeedReceiveMessage();
175 void _checkInitialized();
Interface of an asynchronous particle exchanger.
Interface of an entity family.
Interface of the parallelism manager for a subdomain.
Interface of a particle exchanger.
Interface for a serialization message between IMessagePassingMng.
Exception when a function is not implemented.
Reference to an instance.
Message using a SerializeBuffer.
Structure containing the information to create a service.
1D vector of data with reference semantics.
1D data vector with value semantics (STL style).
void initialize(IItemFamily *item_family) override
Initializes the exchanger for the item_family item_family.
UniqueArray< ISerializeMessage * > m_pending_messages
List of messages pending sending.
bool exchangeItems(Integer nb_particle_finish_exchange, Int32ConstArrayView local_ids, Int32ConstArrayView sub_domains_to_send, ItemGroup item_group, IFunctor *functor) override
Exchanges particles between sub-domains.
IAsyncParticleExchanger * asyncParticleExchanger() override
Asynchronism management (returns nullptr if functionality is not available).
UniqueArray< ISerializeMessage * > m_waiting_messages
List of messages sent but currently being processed.
VariableList m_variables_to_exchange
List of variables to exchange.
void beginNewExchange(Integer nb_particule) override
Starts a new particle exchange.
void sendItems(Integer nb_particle_finish_exchange, Int32ConstArrayView local_ids, Int32ConstArrayView sub_domains_to_send) override
bool waitMessages(Integer nb_pending_particle, Int32Array *new_particle_local_ids, IFunctor *functor) override
void build() override
Build-level construction of the service.
void addNewParticles(Integer nb_particle) override
Adds nb_particle to the current exchange.
Integer verboseLevel() const override
Verbosity level.
Integer m_nb_blocking_size
Number of remaining particles before switching to blocking mode.
IItemFamily * itemFamily() override
Associated family.
void setVerboseLevel(Integer level) override
Sets the verbosity level (0 for no messages).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Array< Int64 > Int64Array
Dynamic one-dimensional array of 64-bit integers.
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
UniqueArray< Int32 > Int32UniqueArray
Dynamic 1D array of 32-bit integers.
double Real
Type representing a real number.
Array< Int32 > Int32Array
Dynamic one-dimensional array of 32-bit integers.
std::int32_t Int32
Signed integer type of 32 bits.