14#include "arcane/impl/DataSynchronizeInfo.h"
16#include "arcane/utils/FatalErrorException.h"
17#include "arcane/utils/PlatformUtils.h"
18#include "arcane/utils/IMemoryRessourceMng.h"
19#include "arcane/utils/MemoryView.h"
20#include "arcane/utils/SmallArray.h"
21#include "arcane/utils/ITraceMng.h"
22#include "arcane/utils/TraceAccessor.h"
23#include "arcane/utils/ValueConvert.h"
25#include "arcane/core/VariableCollection.h"
26#include "arcane/core/ParallelMngUtils.h"
27#include "arcane/core/IParallelExchanger.h"
28#include "arcane/core/ISerializeMessage.h"
29#include "arcane/core/ISerializer.h"
30#include "arcane/core/IParallelMng.h"
31#include "arcane/core/IData.h"
32#include "arcane/core/internal/IParallelMngInternal.h"
33#include "arcane/core/internal/IDataInternal.h"
35#include "arcane/accelerator/core/Runner.h"
37#include "arcane/impl/IDataSynchronizeBuffer.h"
64VariableSyncInfo(Int32ConstArrayView share_ids, Int32ConstArrayView ghost_ids,
69 m_share_ids.copy(share_ids);
70 m_ghost_ids.copy(ghost_ids);
77VariableSyncInfo(
const VariableSyncInfo& rhs)
82 m_target_rank = rhs.m_target_rank;
83 m_share_ids.copy(rhs.m_share_ids);
84 m_ghost_ids.copy(rhs.m_ghost_ids);
90void VariableSyncInfo::
91_changeIds(Array<Int32>& ids, Int32ConstArrayView old_to_new_ids)
93 UniqueArray<Int32> orig_ids(ids);
96 for (Integer z = 0, zs = orig_ids.size(); z < zs; ++z) {
97 Int32 old_id = orig_ids[z];
98 Int32 new_id = old_to_new_ids[old_id];
99 if (new_id != NULL_ITEM_LOCAL_ID)
107void VariableSyncInfo::
120void DataSynchronizeInfo::
123 Integer nb_message = this->size();
125 DataSynchronizeBufferInfoList& receive_info = _receiveInfo();
126 DataSynchronizeBufferInfoList& send_info = _sendInfo();
131 receive_info.m_total_nb_item = 0;
132 send_info.m_total_nb_item = 0;
135 Integer ghost_displacement = 0;
136 Integer share_displacement = 0;
139 Int32 ghost_size = vsi.nbGhost();
141 ghost_displacement += ghost_size;
142 Int32 share_size = vsi.nbShare();
144 share_displacement += share_size;
147 receive_info.m_total_nb_item = ghost_displacement;
148 send_info.m_total_nb_item = share_displacement;
155void DataSynchronizeInfo::
159 vsi.changeLocalIds(old_to_new_ids);
167void DataSynchronizeInfo::
181localIds(
Int32 index)
const
190Int32 DataSynchronizeBufferInfoList::
191nbItem(
Int32 index)
const
void resize(Int64 s)
Changes the number of elements in the array to s.
Constant view of an array of type T.
bool m_is_share
If true, it is the send buffer, otherwise it is the receive buffer.
UniqueArray< Int64 > m_displacements_base
Offsets in the global buffer for each rank.
void recompute()
Notifies the instance that the values have changed.
Information about the list of shared/ghost entities for a given rank for a synchronization.
ConstArrayView< Int32 > ghostIds() const
localIds() of entities to receive from rank targetRank()
ConstArrayView< Int32 > shareIds() const
localIds() of entities to send to rank targetRank()
UniqueArray< Int32 > m_share_ids
localIds() of entities to send to processor m_rank
Int32 nbGhost() const
Number of ghost entities.
Int32 targetRank() const
Target processor rank.
Int32 nbShare() const
Number of shared entities.
UniqueArray< Int32 > m_ghost_ids
localIds() of entities to receive from processor m_rank
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
std::int32_t Int32
Signed integer type of 32 bits.