template<typename T>
vt::runtime::component::detail::DiagnosticValueWrapper struct

Wrapper for the actual diagnostic value, required so reductions do not have to operate over the virtual DiagnosticBase hierarchy.

Public types

struct ReduceTag
Tag for creating a value wrapper that will participate in the reduction.

Constructors, destructors, conversion operators

DiagnosticValueWrapper() defaulted
DiagnosticValueWrapper(T in_value) explicit
Construct a regular value with a initial value.
DiagnosticValueWrapper(ReduceTag, T in_value, bool updated, std::size_t in_N)
Construct a wrapper value for the reduction.

Public functions

auto getRef() -> T&
Get reference to the underlying value.
auto getConstRef() const -> T const &
Get const reference to the underlying value.
auto max() const -> T
Get max value (use after reduction)
auto sum() const -> T
Get sum of values (use after reduction)
auto min() const -> T
Get min of value (use after reduction)
auto avg() const -> double
Get the arithmetic mean value (use after reduction)
auto var() const -> double
Get the variance (use after reduction)
auto I() const -> double
Get I—imbalance metric (use after reduction)
auto stdv() const -> double
Get the standard deviation (use after reduction)
void incrementN()
Increment the cardinality.
auto getN() const -> std::size_t
Get N_ the cardinality of the value.
auto getRawValue() const -> T
Get raw underlying value.
auto getComputedValue() const -> T
Get the computed value (based on update type)
void update(T new_val)
Update the value.
template<typename SerializerT>
void serialize(SerializerT& s)
Serialize this class.
auto getHistogram() const -> adt::HistogramApprox<double, int64_t> const &
Get the histogram after reducing.
auto isUpdated() const -> bool
Return if the value was ever updated.

Friends

auto operator+(DiagnosticValueWrapper<T> d1, DiagnosticValueWrapper<T> const& d2) -> DiagnosticValueWrapper<T>
Operator for reducing over the value.

Function documentation

template<typename T>
vt::runtime::component::detail::DiagnosticValueWrapper<T>::DiagnosticValueWrapper(T in_value) explicit

Construct a regular value with a initial value.

Parameters
in_value in the initial value

template<typename T>
vt::runtime::component::detail::DiagnosticValueWrapper<T>::DiagnosticValueWrapper(ReduceTag, T in_value, bool updated, std::size_t in_N)

Construct a wrapper value for the reduction.

Parameters
in_value in the starting value for the reduction
updated
in_N

template<typename T>
T& vt::runtime::component::detail::DiagnosticValueWrapper<T>::getRef()

Get reference to the underlying value.

Returns the value

template<typename T>
T const & vt::runtime::component::detail::DiagnosticValueWrapper<T>::getConstRef() const

Get const reference to the underlying value.

Returns const ref to value

template<typename T>
T vt::runtime::component::detail::DiagnosticValueWrapper<T>::max() const

Get max value (use after reduction)

Returns the max value

template<typename T>
T vt::runtime::component::detail::DiagnosticValueWrapper<T>::sum() const

Get sum of values (use after reduction)

Returns the sum of values

template<typename T>
T vt::runtime::component::detail::DiagnosticValueWrapper<T>::min() const

Get min of value (use after reduction)

Returns the min value

template<typename T>
double vt::runtime::component::detail::DiagnosticValueWrapper<T>::avg() const

Get the arithmetic mean value (use after reduction)

Returns the mean value

template<typename T>
double vt::runtime::component::detail::DiagnosticValueWrapper<T>::var() const

Get the variance (use after reduction)

Returns the variance

template<typename T>
double vt::runtime::component::detail::DiagnosticValueWrapper<T>::I() const

Get I—imbalance metric (use after reduction)

Returns I

template<typename T>
double vt::runtime::component::detail::DiagnosticValueWrapper<T>::stdv() const

Get the standard deviation (use after reduction)

Returns the standard deviation

template<typename T>
std::size_t vt::runtime::component::detail::DiagnosticValueWrapper<T>::getN() const

Get N_ the cardinality of the value.

Returns N_

template<typename T>
T vt::runtime::component::detail::DiagnosticValueWrapper<T>::getComputedValue() const

Get the computed value (based on update type)

template<typename T>
void vt::runtime::component::detail::DiagnosticValueWrapper<T>::update(T new_val)

Update the value.

Parameters
new_val in the new value

template<typename T> template<typename SerializerT>
void vt::runtime::component::detail::DiagnosticValueWrapper<T>::serialize(SerializerT& s)

Serialize this class.

Parameters
in the serializer

template<typename T>
adt::HistogramApprox<double, int64_t> const & vt::runtime::component::detail::DiagnosticValueWrapper<T>::getHistogram() const

Get the histogram after reducing.

Returns the histogram over nodes

template<typename T>
bool vt::runtime::component::detail::DiagnosticValueWrapper<T>::isUpdated() const

Return if the value was ever updated.

Returns if it was updated

template<typename T>
DiagnosticValueWrapper<T> operator+(DiagnosticValueWrapper<T> d1, DiagnosticValueWrapper<T> const& d2)

Operator for reducing over the value.

Parameters
d1 in first operand
d2 in second operand
Returns value after reducer applied