Skip to content

Commit fc5a947

Browse files
[arcane,impl] Ajoute possibilité de vérifier la cohérence des synchronisations.
1 parent 16f72a4 commit fc5a947

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

arcane/src/arcane/impl/VariableSynchronizer.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "arcane/utils/FatalErrorException.h"
1919
#include "arcane/utils/ITraceMng.h"
2020
#include "arcane/utils/IMemoryRessourceMng.h"
21+
#include "arcane/utils/ValueConvert.h"
2122
#include "arcane/utils/internal/MemoryBuffer.h"
2223

2324
#include "arcane/core/VariableSynchronizerEventArgs.h"
@@ -224,6 +225,10 @@ VariableSynchronizer(IParallelMng* pm, const ItemGroup& group,
224225
m_trace_sync = true;
225226
}
226227

228+
// Indique si on vérifie la cohérence des variables synchronisées
229+
if (auto v = Convert::Type<Int32>::tryParseFromEnvironment("ARCANE_CHECK_SYNCHRONIZE_COHERENCE",true))
230+
m_is_check_coherence = (v.value()!=0);
231+
227232
m_default_message = _buildMessage();
228233
m_partial_message = makeRef<SyncMessage>(_buildMessage(m_partial_sync_info));
229234
}
@@ -424,6 +429,8 @@ _synchronize(IVariable* var, SyncMessage* message)
424429
message->initialize(var);
425430

426431
IParallelMng* pm = m_parallel_mng;
432+
if (m_is_check_coherence)
433+
MessagePassing::namedBarrier(pm,var->name());
427434
debug(Trace::High) << " Proc " << pm->commRank() << " Sync variable " << var->fullName();
428435
if (m_trace_sync) {
429436
info() << " Synchronize variable " << var->fullName()

arcane/src/arcane/impl/internal/VariableSynchronizer.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ class ARCANE_IMPL_EXPORT VariableSynchronizer
7676
void synchronize(IVariable* var) override;
7777

7878
void synchronize(IVariable* var, Int32ConstArrayView local_ids) override;
79-
79+
8080
void synchronize(VariableCollection vars) override;
8181

8282
void synchronize(VariableCollection vars, Int32ConstArrayView local_ids) override;
83-
83+
8484
Int32ConstArrayView communicatingRanks() override;
8585

8686
Int32ConstArrayView sharedItems(Int32 index) override;
@@ -116,7 +116,8 @@ class ARCANE_IMPL_EXPORT VariableSynchronizer
116116
Ref<DataSynchronizeInfo> m_partial_sync_info;
117117
Ref<SyncMessage> m_partial_message;
118118
UniqueArray<Int32> m_partial_local_ids;
119-
119+
bool m_is_check_coherence = false;
120+
120121
private:
121122

122123
void _synchronize(IVariable* var, SyncMessage* message);

0 commit comments

Comments
 (0)