12#ifndef ARCANE_CORE_VARIABLECOMPARER_H
13#define ARCANE_CORE_VARIABLECOMPARER_H
17#include "arcane/utils/TraceAccessor.h"
71 Int32 maxPrint()
const {
return m_max_print; }
83 bool isCompareGhost()
const {
return m_is_compare_ghost; }
85 void setDataReader(IDataReader* v) { m_data_reader = v; }
86 IDataReader* dataReader()
const {
return m_data_reader; }
88 void setCompareMode(eVariableComparerCompareMode v) { m_compare_mode = v; }
91 void setComputeDifferenceMethod(eVariableComparerComputeDifferenceMethod v) { m_compute_difference_method = v; }
96 Int32 m_max_print = 0;
97 bool m_is_compare_ghost =
false;
98 IDataReader* m_data_reader =
nullptr;
109class ARCANE_CORE_EXPORT VariableComparerResults
113 VariableComparerResults() =
default;
114 explicit VariableComparerResults(
Int32 nb_diff)
120 void setNbDifference(
Int32 v) { m_nb_diff = v; }
121 Int32 nbDifference()
const {
return m_nb_diff; }
144class ARCANE_CORE_EXPORT VariableComparer
148 VariableComparer() =
default;
Declarations of Arcane's general types.
Interface for reading variable data.
Arguments for VariableComparer methods.
void setMaxPrint(Int32 v)
Sets the number of errors to display in the listing.
void setCompareGhost(bool v)
Indicates on which entities the comparison is performed.
Results of a comparison operation.
VariableComparerArgs buildForCheckIfSameOnAllReplica()
Creates a comparison to verify that a variable is identical on all replicas.
VariableComparerResults apply(IVariable *var, const VariableComparerArgs &compare_args)
Applies the comparison compare_args to the variable var.
VariableComparerArgs buildForCheckIfSame(IDataReader *data_reader)
Creates a comparison to verify that a variable is identical to a reference value.
VariableComparerArgs buildForCheckIfSync()
Creates a comparison to verify that a variable is synchronized.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
eVariableComparerComputeDifferenceMethod
Method used to calculate the difference between two values v1 and v2.
@ Relative
Uses (v1-v2) / v1.
@ LocalNormMax
Uses (v1-v2) / local_norm_max.
eVariableComparerCompareMode
Comparison method to use.
@ SameOnAllReplica
Checks that the variable values are the same on all replicas.
@ Same
Compares with a reference.
@ Sync
Checks that the variable is synchronized.
std::int32_t Int32
Signed integer type of 32 bits.