Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::IParticleExchanger Class Referenceabstract

Interface of a particle exchanger. More...

#include <arcane/core/IParticleExchanger.h>

Inheritance diagram for Arcane::IParticleExchanger:
Collaboration diagram for Arcane::IParticleExchanger:

Public Member Functions

virtual ~IParticleExchanger ()=default
 Releases resources.
virtual void build ()=0
virtual void initialize (IItemFamily *item_family)=0
 Initializes the exchanger for the item_family item_family.
virtual void beginNewExchange (Integer nb_particle)=0
 Starts a new particle exchange.
virtual ARCANE_DEPRECATED bool exchangeItems (Integer nb_particle_finish_exchange, Int32ConstArrayView local_ids, Int32ConstArrayView sub_domains_to_send, ItemGroup item_group, IFunctor *wait_functor)=0
 Exchanges particles between sub-domains.
virtual bool exchangeItems (Integer nb_particle_finish_exchange, Int32ConstArrayView local_ids, Int32ConstArrayView ranks_to_send, Int32Array *new_particle_local_ids, IFunctor *wait_functor)=0
 Exchanges particles between sub-domains.
virtual void sendItems (Integer nb_particle_finish_exchange, Int32ConstArrayView local_ids, Int32ConstArrayView sub_domains_to_send)=0
virtual bool waitMessages (Integer nb_pending_particle, Int32Array *new_particle_local_ids, IFunctor *functor)=0
virtual void addNewParticles (Integer nb_particle)=0
 Adds nb_particle to the current exchange.
virtual IItemFamilyitemFamily ()=0
 Associated family.
virtual void setVerboseLevel (Integer level)=0
 Sets the verbosity level (0 for no messages).
virtual Integer verboseLevel () const =0
 Verbosity level.
virtual IAsyncParticleExchangerasyncParticleExchanger ()=0
 Asynchronism management (returns nullptr if functionality is not available).

Detailed Description

Interface of a particle exchanger.

This class is used to exchange particles between sub-domains in several steps and is generally used by trajectory codes. If one wishes to perform a single exchange, IItemFamily::exchangeItems() must be used.

First of all, an instance must be initialized with a particle family via initialize().

To proceed with an exchange, you must first initialize the exchange via beginNewExchange() using the number of particles in the sub-domain involved in the exchange as an argument. You must then call exchangeItems() for each phase of particle exchange. For each call to exchangeItems(), you must specify the number of particles that no longer participate in the exchange. When there are no more involved particles, exchangeItems() returns true and the exchange is finished. It is possible to restart the entire process via a new call to beginNewExchange().

Between two phases of an exchange, it is possible to indicate that new particles will participate via addNewParticles()

Definition at line 55 of file IParticleExchanger.h.

Member Function Documentation

◆ addNewParticles()

virtual void Arcane::IParticleExchanger::addNewParticles ( Integer nb_particle)
pure virtual

Adds nb_particle to the current exchange.

This method allows indicating that new particles will participate in the exchange, for example following their creation.

Implemented in Arcane::mesh::AsyncParticleExchanger, Arcane::mesh::BasicParticleExchanger, and Arcane::mesh::NonBlockingParticleExchanger.

◆ asyncParticleExchanger()

virtual IAsyncParticleExchanger * Arcane::IParticleExchanger::asyncParticleExchanger ( )
pure virtual

Asynchronism management (returns nullptr if functionality is not available).

Implemented in Arcane::mesh::AsyncParticleExchanger, Arcane::mesh::BasicParticleExchanger, and Arcane::mesh::NonBlockingParticleExchanger.

◆ beginNewExchange()

virtual void Arcane::IParticleExchanger::beginNewExchange ( Integer nb_particle)
pure virtual

Starts a new particle exchange.

nb_particle is the number of particles in the sub-domain that will take part in a potential exchange.

This method is collective and must be called by all sub-domains.

Implemented in Arcane::mesh::AsyncParticleExchanger, Arcane::mesh::BasicParticleExchanger, and Arcane::mesh::NonBlockingParticleExchanger.

◆ build()

virtual void Arcane::IParticleExchanger::build ( )
pure virtual

◆ exchangeItems() [1/2]

virtual bool Arcane::IParticleExchanger::exchangeItems ( Integer nb_particle_finish_exchange,
Int32ConstArrayView local_ids,
Int32ConstArrayView ranks_to_send,
Int32Array * new_particle_local_ids,
IFunctor * wait_functor )
pure virtual

Exchanges particles between sub-domains.

This operation sends the particles from the item_family item_family whose local indices are given by the list local_ids to the sub-domains specified by sub_domains_to_send, and receives from these same sub-domains those that this sub-domain owns. The sent particles are deleted from the item_family item_family and the received ones are added.

Variables associated with the item_family item_family are transferred at the same time as the particles.

This operation is collective and blocking.

If new_particle_local_ids is not null, it will contain in return the array of local indices of the new entities.

If wait_functor is not null, the functor is called during the sending and receiving of messages. It is then possible to perform operations. Operations must not use particles, nor variables on the particles of the exchanged family.

Return values

a true if all exchange phases are finished

Return values

a false otherwise

Todo
improve the documentation

Implemented in Arcane::mesh::AsyncParticleExchanger, Arcane::mesh::BasicParticleExchanger, and Arcane::mesh::NonBlockingParticleExchanger.

◆ exchangeItems() [2/2]

virtual ARCANE_DEPRECATED bool Arcane::IParticleExchanger::exchangeItems ( Integer nb_particle_finish_exchange,
Int32ConstArrayView local_ids,
Int32ConstArrayView sub_domains_to_send,
ItemGroup item_group,
IFunctor * wait_functor )
pure virtual

Exchanges particles between sub-domains.

This operation sends the particles from the item_family item_family whose local indices are given by the list local_ids to the sub-domains specified by sub_domains_to_send, and receives from these same sub-domains those that this sub-domain owns. The sent particles are deleted from the item_family item_family and the received ones are added.

Variables associated with the item_family item_family are transferred at the same time as the particles.

This operation is collective and blocking.

If item_group is not null, it will contain the list of new entities in return.

If wait_functor is not null, the functor is called during the sending and receiving of messages. It is then possible to perform operations. Operations must not use particles, nor variables on the particles of the exchanged family.

Return values

a true if all exchange phases are finished

Return values

a false otherwise

Todo
improve the documentation

Implemented in Arcane::mesh::AsyncParticleExchanger, Arcane::mesh::BasicParticleExchanger, and Arcane::mesh::NonBlockingParticleExchanger.

◆ initialize()

virtual void Arcane::IParticleExchanger::initialize ( IItemFamily * item_family)
pure virtual

Initializes the exchanger for the item_family item_family.

Implemented in Arcane::mesh::AsyncParticleExchanger, Arcane::mesh::BasicParticleExchanger, and Arcane::mesh::NonBlockingParticleExchanger.

◆ itemFamily()

virtual IItemFamily * Arcane::IParticleExchanger::itemFamily ( )
pure virtual

◆ sendItems()

virtual void Arcane::IParticleExchanger::sendItems ( Integer nb_particle_finish_exchange,
Int32ConstArrayView local_ids,
Int32ConstArrayView sub_domains_to_send )
pure virtual

◆ setVerboseLevel()

virtual void Arcane::IParticleExchanger::setVerboseLevel ( Integer level)
pure virtual

◆ verboseLevel()

virtual Integer Arcane::IParticleExchanger::verboseLevel ( ) const
pure virtual

◆ waitMessages()

virtual bool Arcane::IParticleExchanger::waitMessages ( Integer nb_pending_particle,
Int32Array * new_particle_local_ids,
IFunctor * functor )
pure virtual

The documentation for this class was generated from the following file: