Valgrind Namespace Reference

Functions

bool IsRunning ()
 Returns whether the program is running under Valgrind or not. More...
 
template<class T >
bool CheckDefined (const T &value OPM_UNUSED)
 Make valgrind complain if any of the memory occupied by an object is undefined. More...
 
template<class T >
bool CheckDefined (const T *value OPM_UNUSED, int size OPM_UNUSED)
 Make valgrind complain if any of the the memory occupied by a C-style array objects is undefined. More...
 
template<class T >
void SetUndefined (const T &value OPM_UNUSED)
 Make the memory on which an object resides undefined in valgrind runs. More...
 
template<class T >
void SetUndefined (const T *value OPM_UNUSED, int size OPM_UNUSED)
 Make the memory on which an array of object resides undefined in valgrind runs. More...
 
template<class T >
void SetDefined (const T &value OPM_UNUSED)
 Make the memory on which an object resides defined. More...
 
template<class T >
void SetDefined (const T *value OPM_UNUSED, int n OPM_UNUSED)
 Make the memory on which a C-style array of objects resides defined. More...
 
template<class T >
void SetNoAccess (const T &value OPM_UNUSED)
 Make valgrind complain if an object's memory is accessed. More...
 
template<class T >
void SetNoAccess (const T *value OPM_UNUSED, int size OPM_UNUSED)
 Make valgrind complain if the memory of a C-style array of objects is accessed. More...
 

Function Documentation

template<class T >
bool Valgrind::CheckDefined ( const T &value  OPM_UNUSED)
inline

Make valgrind complain if any of the memory occupied by an object is undefined.

Please note that this does not check whether the destinations of an object's pointers or references are defined. Also, for performance reasons the compiler might insert "padding bytes" between within the objects which leads to false positives.

Example:

int i;
Opm::Valgrind::CheckDefined(i); // Valgrind complains!
Template Parameters
TThe type of the object which ought to be checked
Parameters
valuethe object which valgrind should check
Returns
true iff there are no undefined bytes in the memory occupied by the object.

Referenced by Opm::LinearMaterial< TraitsT, ParamsT >::capillaryPressures(), Opm::PengRobinsonParams< Scalar >::checkDefined(), Opm::FluidStateExplicitTemperatureModule< Scalar, FluidSystem::numPhases, NonEquilibriumFluidState< Scalar, FluidSystem, false > >::checkDefined(), Opm::FluidStateExplicitViscosityModule< Scalar, FluidSystem::numPhases, NonEquilibriumFluidState< Scalar, FluidSystem, false > >::checkDefined(), Opm::FluidStateExplicitPressureModule< Scalar, FluidSystem::numPhases, NonEquilibriumFluidState< Scalar, FluidSystem, false > >::checkDefined(), Opm::FluidStateExplicitSaturationModule< Scalar, FluidSystem::numPhases, NonEquilibriumFluidState< Scalar, FluidSystem, false > >::checkDefined(), Opm::FluidStateExplicitEnthalpyModule< Scalar, FluidSystem::numPhases, NonEquilibriumFluidState< Scalar, FluidSystem, true > >::checkDefined(), Opm::FluidStateExplicitFugacityModule< Scalar, FluidSystem::numPhases, FluidSystem::numComponents, CompositionalFluidState< Scalar, FluidSystem, false > >::checkDefined(), Opm::FluidStateExplicitDensityModule< Scalar, FluidSystem::numPhases, NonEquilibriumFluidState< Scalar, FluidSystem, false > >::checkDefined(), Opm::FluidStateEquilibriumTemperatureModule< Scalar, FluidSystem::numPhases, CompositionalFluidState< Scalar, FluidSystem, false > >::checkDefined(), Opm::FluidStateExplicitCompositionModule< Scalar, FluidSystem, CompositionalFluidState< Scalar, FluidSystem, false > >::checkDefined(), Opm::ThreePhaseParkerVanGenuchtenParams< TraitsT >::checkDefined(), Opm::SaturationOverlayFluidState< FluidState >::checkDefined(), Opm::PressureOverlayFluidState< FluidState >::checkDefined(), Opm::TemperatureOverlayFluidState< FluidState >::checkDefined(), Opm::PengRobinsonParamsMixture< Scalar, FluidSystem, gasPhaseIdx, true >::checkDefined(), Opm::PengRobinson< Scalar >::computeMolarVolume(), Opm::LocalAd::Evaluation< ScalarT, VarSetTag, numVars >::createConstant(), Opm::FluidSystems::BrineCO2< Scalar, CO2Tables >::density(), Opm::LiveOilPvt< Scalar >::density(), Opm::FluidSystems::H2ON2LiquidPhase< Scalar, useComplexRelations >::enthalpy(), Opm::FluidSystems::BrineCO2< Scalar, CO2Tables >::enthalpy(), Opm::FluidSystems::H2OAir< Scalar, H2Otype, useComplexRelations >::enthalpy(), Opm::FluidSystems::H2ON2< Scalar, useComplexRelations >::enthalpy(), Opm::UniformXTabulated2DFunction< Scalar >::eval(), Opm::LiveOilPvt< Scalar >::formationVolumeFactor(), Opm::FluidSystems::H2OAirMesitylene< Scalar >::fugacityCoefficient(), Opm::BinaryCoeff::Brine_CO2< Scalar, CO2Tables, verbose >::fugacityCoefficientCO2(), Opm::H2O< Scalar >::gasPressure(), Opm::Somerton< FluidSystem, ScalarT, ParamsT >::heatConductivity(), Opm::NcpFlash< Scalar, FluidSystem >::linearize_(), Opm::LinearMaterial< TraitsT, ParamsT >::pcgn(), Opm::LinearMaterial< TraitsT, ParamsT >::pcnw(), Opm::LinearMaterial< TraitsT, ParamsT >::relativePermeabilities(), Opm::FluidSystems::BlackOil< Scalar >::saturatedOilFormationVolumeFactor(), Opm::FluidStateExplicitCompositionModule< Scalar, FluidSystem, CompositionalFluidState< Scalar, FluidSystem, false > >::setMoleFraction(), Opm::NcpFlash< Scalar, FluidSystem >::setQuantity_(), Opm::NcpFlash< Scalar, FluidSystem >::setQuantityRaw_(), Opm::CompositionFromFugacities< Scalar, FluidSystem, Evaluation >::solve(), Opm::NcpFlash< Scalar, FluidSystem >::solve(), Opm::CompositionFromFugacities< Scalar, FluidSystem, Evaluation >::solveIdealMix_(), Opm::PengRobinsonParamsMixture< Scalar, FluidSystem, gasPhaseIdx, true >::updateMix(), Opm::Spe5ParameterCache< Scalar, FluidSystem >::updateMix_(), Opm::PengRobinsonParamsMixture< Scalar, FluidSystem, gasPhaseIdx, true >::updatePure(), and Opm::FluidSystems::BrineCO2< Scalar, CO2Tables >::viscosity().

template<class T >
bool Valgrind::CheckDefined ( const T *value  OPM_UNUSED,
int size  OPM_UNUSED 
)
inline

Make valgrind complain if any of the the memory occupied by a C-style array objects is undefined.

Please note that this does not check whether the destinations of an object's pointers or references are defined. Also, for performance reasons the compiler might insert "padding bytes" between within the objects which leads to false positives.

Example:

int i[2];
Opm::Valgrind::CheckDefined(i, 2); // Valgrind complains!
Template Parameters
TThe type of the object which ought to be checked
Parameters
valuePointer to the first object of the array.
sizeThe size of the array in number of objects
Returns
true iff there are no undefined bytes in the memory occupied by the array.
bool Valgrind::IsRunning ( )
inline

Returns whether the program is running under Valgrind or not.

template<class T >
void Valgrind::SetDefined ( const T &value  OPM_UNUSED)
inline

Make the memory on which an object resides defined.

Example:

int i;
Opm::Valgrind::CheckDefined(i); // Valgrind does not complain!
Template Parameters
TThe type of the object which valgrind should consider as defined
Parameters
valueThe object which's memory valgrind should consider as defined

Referenced by Opm::FluidStateExplicitCompositionModule< Scalar, FluidSystem, CompositionalFluidState< Scalar, FluidSystem, false > >::FluidStateExplicitCompositionModule().

template<class T >
void Valgrind::SetDefined ( const T *value  OPM_UNUSED,
int n  OPM_UNUSED 
)
inline

Make the memory on which a C-style array of objects resides defined.

Example:

int i[3];
Opm::Valgrind::CheckDefined(i, 3); // Valgrind does not complain!
Template Parameters
TThe type of the object which valgrind should consider as defined
Parameters
valuePointer to the first object of the array.
nThe size of the array in number of objects
template<class T >
void Valgrind::SetNoAccess ( const T &value  OPM_UNUSED)
inline

Make valgrind complain if an object's memory is accessed.

Example:

int i = 1;
int j = i; // Valgrind complains!
Template Parameters
TThe type of the object which valgrind should complain if accessed
Parameters
valueThe object which's memory valgrind should complain if accessed
template<class T >
void Valgrind::SetNoAccess ( const T *value  OPM_UNUSED,
int size  OPM_UNUSED 
)
inline

Make valgrind complain if the memory of a C-style array of objects is accessed.

Example:

int i[3] = {0, 1, 2};
int j = i[1]; // Valgrind complains!
Parameters
valuePointer to the first object of the array.
sizeThe size of the array in number of objects
template<class T >
void Valgrind::SetUndefined ( const T &value  OPM_UNUSED)
inline

Make the memory on which an object resides undefined in valgrind runs.

Example:

int i = 0;
Opm::Valgrind::CheckDefined(i); // Valgrind complains!
Template Parameters
TThe type of the object which ought to be set to undefined
Parameters
valueThe object which's memory valgrind should be told is undefined

Referenced by Opm::BrooksCoreyParams< TraitsT >::BrooksCoreyParams(), Opm::PengRobinson< Scalar >::computeMolarVolume(), Opm::FluidSystems::H2OAir< Scalar, H2Otype, useComplexRelations >::density(), Opm::FluidStateNullEnthalpyModule< Scalar, FluidSystem::numPhases, NonEquilibriumFluidState< Scalar, FluidSystem, false > >::enthalpy(), Opm::FluidStateEquilibriumTemperatureModule< Scalar, FluidSystem::numPhases, CompositionalFluidState< Scalar, FluidSystem, false > >::FluidStateEquilibriumTemperatureModule(), Opm::FluidStateExplicitCompositionModule< Scalar, FluidSystem, CompositionalFluidState< Scalar, FluidSystem, false > >::FluidStateExplicitCompositionModule(), Opm::FluidStateExplicitDensityModule< Scalar, FluidSystem::numPhases, NonEquilibriumFluidState< Scalar, FluidSystem, false > >::FluidStateExplicitDensityModule(), Opm::FluidStateExplicitEnthalpyModule< Scalar, FluidSystem::numPhases, NonEquilibriumFluidState< Scalar, FluidSystem, true > >::FluidStateExplicitEnthalpyModule(), Opm::FluidStateExplicitFugacityModule< Scalar, FluidSystem::numPhases, FluidSystem::numComponents, CompositionalFluidState< Scalar, FluidSystem, false > >::FluidStateExplicitFugacityModule(), Opm::FluidStateExplicitPressureModule< Scalar, FluidSystem::numPhases, NonEquilibriumFluidState< Scalar, FluidSystem, false > >::FluidStateExplicitPressureModule(), Opm::FluidStateExplicitSaturationModule< Scalar, FluidSystem::numPhases, NonEquilibriumFluidState< Scalar, FluidSystem, false > >::FluidStateExplicitSaturationModule(), Opm::FluidStateExplicitTemperatureModule< Scalar, FluidSystem::numPhases, NonEquilibriumFluidState< Scalar, FluidSystem, false > >::FluidStateExplicitTemperatureModule(), Opm::FluidStateExplicitViscosityModule< Scalar, FluidSystem::numPhases, NonEquilibriumFluidState< Scalar, FluidSystem, false > >::FluidStateExplicitViscosityModule(), Opm::FluidStateNullEnthalpyModule< Scalar, FluidSystem::numPhases, NonEquilibriumFluidState< Scalar, FluidSystem, false > >::internalEnergy(), Opm::NcpFlash< Scalar, FluidSystem >::linearize_(), Opm::FluidStateExplicitCompositionModule< Scalar, FluidSystem, CompositionalFluidState< Scalar, FluidSystem, false > >::setMoleFraction(), Opm::NcpFlash< Scalar, FluidSystem >::solve(), and Opm::Spe5ParameterCache< Scalar, FluidSystem >::Spe5ParameterCache().

template<class T >
void Valgrind::SetUndefined ( const T *value  OPM_UNUSED,
int size  OPM_UNUSED 
)
inline

Make the memory on which an array of object resides undefined in valgrind runs.

Example:

int i[3] = {0, 1, 3};
Opm::Valgrind::CheckDefined(i, 3); // Valgrind complains!
Template Parameters
TThe type of the object which ought to be set to undefined
Parameters
valuePointer to the first object of the array.
sizeThe size of the array in number of objects