ADOL-C: Automatic Differentiation in C/C++ 2.7.3
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
ValueTape Class Reference

Owns one recorded function and the state required to evaluate it. More...

#include <valuetape.h>

Classes

struct  AllTypes
 Compile-time list used to prepare tape buffers for forward and reverse sweeps. More...
 
struct  Forward
 Selects forward-order tape traversal. More...
 
struct  Mode
 Base tag for the direction selected by init_sweep(). More...
 
struct  Reverse
 Selects reverse-order tape traversal. More...
 

Public Types

using AllInfoTypes = AllTypes< EvalOpInfoT, EvalLocInfoT, EvalValInfoT >
 

Public Member Functions

 ~ValueTape ()
 
 ValueTape ()=delete
 
 ValueTape (short tapeId)
 
 ValueTape (const ValueTape &other)=delete
 
ValueTape & operator= (const ValueTape &other)=delete
 
 ValueTape (ValueTape &&other) noexcept
 
ValueTape & operator= (ValueTape &&other) noexcept
 
bool isExclusiveNonLocking ()
 
bool isExclusiveLocking ()
 
void registerExtDiff ()
 
bool containsExtDiff () const
 
void setSharedMode ()
 Enables concurrent no-keep evaluations of this tape.
 
void setExclusiveMode ()
 Restores the default single-evaluation mode with reusable owned buffers.
 
void statsNeedReload ()
 
std::shared_mutex & accessMutex () noexcept
 
bool isRecording () const noexcept
 
void beginRecording ()
 
void endRecording ()
 
void tapeBaseNames (size_t loc, const std::string &baseName)
 
void skipFileCleanup (int skipFileCleanup)
 
int skipFileCleanup () const
 
char * tay_fileName () const
 
char * op_fileName () const
 
char * loc_fileName () const
 
char * val_fileName () const
 
void tay_fileName (char *name)
 
void op_fileName (char *name)
 
void loc_fileName (char *name)
 
void val_fileName (char *name)
 
int keepTape () const
 
void keepTape (int flag)
 
int jacSolv_nax () const
 
int * jacSolv_ci () const
 
int * jacSolv_ri () const
 
double * jacSolv_xold () const
 
double ** jacSolv_I () const
 
double ** jacSolv_J () const
 
int jacSolv_modeold () const
 
void jacSolv_nax (int nax)
 
void jacSolv_I (double **I)
 
void jacSolv_J (double **J)
 
void jacSolv_xold (double *xold)
 
void jacSolv_modeold (int mode)
 
void jacSolv_ci (int *ci)
 
void jacSolv_ri (int *ri)
 
int forodec_nax () const
 
int forodec_dax () const
 
double * forodec_y () const
 
double * forodec_z () const
 
double ** forodec_Z () const
 
void forodec_nax (int nax)
 
void forodec_dax (int dax)
 
void forodec_y (double *y)
 
void forodec_z (double *z)
 
void forodec_Z (double **Z)
 
void readParams (double *&targetStore)
 
void compare_adolc_ids (const ADOLC_ID &id1, const ADOLC_ID &id2)
 
void read_tape_stats ()
 
void tapestats (std::array< size_t, TapeInfos::STAT_SIZE > stats)
 
void tapestats (size_t *stats)
 
size_t tapestats (size_t stat) const
 
void tapestats (size_t stat, size_t val)
 
std::array< size_t, TapeInfos::STAT_SIZE > tapestats () const
 
void deg_save (int val)
 
int deg_save () const
 
int keepTaylors () const
 
void keepTaylors (int val)
 
size_t numparam () const
 
void increment_numTays_Tape ()
 
void add_numTays_Tape (size_t val)
 
void lastTayBlockInCore (char val)
 
char lastTayBlockInCore () const
 
void decrement_numTays_Tape ()
 
size_t num_eq_prod () const
 
void num_eq_prod (size_t num)
 
void increment_num_eq_prod ()
 
void add_num_eq_prod (size_t val)
 
void increment_numInds ()
 
size_t numInds () const
 
void increment_numDeps ()
 
size_t numDeps () const
 
void tay_numInds (size_t val)
 
size_t tay_numInds () const
 
void tay_numDeps (size_t val)
 
size_t tay_numDeps () const
 
void numSwitches (size_t num)
 
size_t numSwitches () const
 
void increment_numSwitches ()
 
short tapeId () const
 
size_t no_min_max ()
 
size_t ext_diff_fct_index () const
 
void ext_diff_fct_index (size_t index)
 
void nextBufferNumber (size_t num)
 
size_t nextBufferNumber () const
 
void decrement_nextBufferNumber ()
 
void put_op (OPCODES op, size_t reserveExtraLocations=0)
 
void put_loc (size_t loc)
 
void put_val (const double val)
 
void put_vals_writeBlock (double *reals, size_t numReals)
 
void put_vals_notWriteBlock (double *reals, size_t numReals)
 
size_t get_val_space ()
 
int upd_resloc (size_t temp, size_t lhs)
 
int upd_resloc_check (size_t temp)
 
int upd_resloc_inc_prod (size_t temp, size_t newlhs, unsigned char newop)
 
size_t get_num_param ()
 
void nestedReverseEval (bool flag)
 
bool nestedReverseEval () const
 
double * signature () const
 
void signature (double *buffer)
 
void initTapeInfos_keep ()
 
template<ADOLC::detail::EvalOrRecordContextType Context>
void initTapeBuffers (Context &ctx)
 
void initTapeBuffers ()
 
size_t operationBufferSize () const
 
void operationBufferSize (size_t size)
 
size_t locationBufferSize () const
 
void locationBufferSize (size_t size)
 
size_t valueBufferSize () const
 
void valueBufferSize (size_t size)
 
size_t taylorBufferSize () const
 
void taylorBufferSize (size_t size)
 
size_t initalStoreSize () const
 
void initialStoreSize (size_t size)
 
void checkInitialStoreSize ()
 
unsigned int nominmaxFlag () const
 
void enableBranchSwitchWarnings ()
 
void disableBranchSwitchWarnings ()
 
void enableMinMaxUsingAbs ()
 
void disableMinMaxUsingAbs ()
 
void ensureContiguousLocations (size_t n)
 
size_t ensureContiguousLocations_ (size_t n)
 
void setStoreManagerControl (double gcTriggerRatio, size_t gcTriggerMaxSize)
 
void setStoreManagerType (unsigned char type)
 
size_t next_loc ()
 
size_t p_next_loc ()
 
void free_loc (size_t loc) const
 
void p_free_loc (size_t loc) const
 
double get_ad_value (size_t loc) const
 
void set_ad_value (size_t loc, double coval)
 
double get_pd_value (size_t loc) const
 
void set_pd_value (size_t loc, double coval)
 
size_t numLives () const
 
size_t storeSize () const
 
double * store () const
 
void store (double *buffer)
 
double * pStore () const
 
void pStore (double *buffer)
 
double store (size_t idx)
 
char branchSwitchWarning () const
 
void branchSwitchWarning (char val)
 
char inParallelRegion () const
 
ADOLC::CP::detail::Infos * cp_append ()
 
ADOLC::CP::detail::Infos * cp_getElement (size_t index)
 
ext_diff_fct * ext_diff_append ()
 
ext_diff_fct * ext_diff_getElement (size_t index)
 
ext_diff_fct_v2 * ext_diff_v2_append ()
 
ext_diff_fct_v2 * ext_diff_v2_getElement (size_t index)
 
std::array< std::string, 4 > readConfigFile ()
 
void taylor_begin (int degreeSave)
 Initialize Taylor-stack recording for the current tape.
 
void finish_tay_file ()
 
void taylor_close ()
 
void write_scaylor (double val)
 
void delete_scaylor (size_t loc)
 
template<typename Info >
const char * fileName () const
 Return the tape file name associated with the given Info adapter.
 
template<InfoType< TapeEvaluationContext, ErrorType > Info>
void prepare_for (TapeEvaluationContext &evalCtx)
 Prepare for a forward sweep.
 
template<InfoType< TapeEvaluationContext, ErrorType > Info>
void setFilePosition (TapeEvaluationContext &evalCtx)
 Position the tape file at the beginning of the last on-disk block.
 
template<InfoType< TapeEvaluationContext, ErrorType > Info>
void prepare_rev (TapeEvaluationContext &evalCtx)
 Prepare for reverse sweep.
 
template<InfoType< TapeEvaluationContext, ErrorType >... Infos>
requires (requires { Infos::fileAccess; } && ...)
void prepare_for_all (TapeEvaluationContext &evalCtx, AllTypes< Infos... >)
 Run prepare_for() for all tape types listed in AllTypes.
 
template<InfoType< TapeEvaluationContext, ErrorType >... Infos>
requires (requires { Infos::fileAccess; } && ...)
void prepare_rev_all (TapeEvaluationContext &evalCtx, AllTypes< Infos... >)
 Run prepare_for() for all tape types listed in AllTypes.
 
template<typename Mode >
TapeEvaluationContext init_sweep (int keep=0)
 Initialize a tape sweep.
 
void end_sweep (TapeEvaluationContext &evalCtx)
 
void end_sweep (TapeEvaluationContext &&evalCtx)
 
void start_trace ()
 
void take_stock ()
 
size_t keep_stock ()
 
void stop_trace (int flag)
 
int initNewTape ()
 
void openTape ()
 
std::shared_ptr< ValueTape > getTapeInfos (short tapeId)
 
void close_tape (int flag)
 
void setParamVec (std::span< const double > paramvec)
 Update parameter values used by subsequent evaluations.
 
void save_params ()
 
void free_all_taping_params ()
 
ADOLC::CP::detail::Infos * get_cp_fct (size_t index) const
 

Static Public Member Functions

static constexpr size_t maxLocsPerOp ()
 
static double make_nan ()
 
static double make_inf ()
 

Detailed Description

Owns one recorded function and the state required to evaluate it.

A ValueTape is the central object behind a tape ID. During recording, active adouble operations register opcodes, locations, values, and optional Taylor values to the TapeRecordingContext of the tape. During a sweep, init_sweep() creates a TapeEvaluationContext whose cursors read the recorded data in forward or reverse order.

Each tape owns value stores, location allocators, statistics, file names, driver scratch data, external-function descriptors, checkpointing state, and sparse recovery data.

Use createNewTape() to allocate a tape, findTape() to look it up, and currentTape() to access the thread's selected tape.

Exclusive mode is the default and reuses the tape's owned buffers for one evaluation at a time. setSharedMode() permits concurrent no-keep sweeps; each sweep initially views the immutable recorded buffers and allocates private storage lazily if it must load or modify a block.

Member Typedef Documentation

◆ AllInfoTypes

Constructor & Destructor Documentation

◆ ~ValueTape()

ValueTape::~ValueTape ( )

◆ ValueTape() [1/4]

ValueTape::ValueTape ( )
delete

◆ ValueTape() [2/4]

ValueTape::ValueTape ( short  tapeId)
inlineexplicit

◆ ValueTape() [3/4]

ValueTape::ValueTape ( const ValueTape &  other)
delete

◆ ValueTape() [4/4]

ValueTape::ValueTape ( ValueTape &&  other)
inlinenoexcept

Member Function Documentation

◆ accessMutex()

std::shared_mutex & ValueTape::accessMutex ( )
inlinenoexcept

◆ add_num_eq_prod()

void ValueTape::add_num_eq_prod ( size_t  val)
inline

◆ add_numTays_Tape()

void ValueTape::add_numTays_Tape ( size_t  val)
inline

◆ beginRecording()

void ValueTape::beginRecording ( )

◆ branchSwitchWarning() [1/2]

char ValueTape::branchSwitchWarning ( ) const
inline

◆ branchSwitchWarning() [2/2]

void ValueTape::branchSwitchWarning ( char  val)
inline

◆ checkInitialStoreSize()

void ValueTape::checkInitialStoreSize ( )
inline

◆ close_tape()

void ValueTape::close_tape ( int  flag)

◆ compare_adolc_ids()

void ValueTape::compare_adolc_ids ( const ADOLC_ID &  id1,
const ADOLC_ID &  id2 
)

◆ containsExtDiff()

bool ValueTape::containsExtDiff ( ) const
inline

◆ cp_append()

ADOLC::CP::detail::Infos * ValueTape::cp_append ( )
inline

◆ cp_getElement()

ADOLC::CP::detail::Infos * ValueTape::cp_getElement ( size_t  index)
inline

◆ decrement_nextBufferNumber()

void ValueTape::decrement_nextBufferNumber ( )
inline

◆ decrement_numTays_Tape()

void ValueTape::decrement_numTays_Tape ( )
inline

◆ deg_save() [1/2]

int ValueTape::deg_save ( ) const
inline

◆ deg_save() [2/2]

void ValueTape::deg_save ( int  val)
inline

◆ delete_scaylor()

void ValueTape::delete_scaylor ( size_t  loc)
inline

◆ disableBranchSwitchWarnings()

void ValueTape::disableBranchSwitchWarnings ( )
inline

◆ disableMinMaxUsingAbs()

void ValueTape::disableMinMaxUsingAbs ( )
inline

◆ enableBranchSwitchWarnings()

void ValueTape::enableBranchSwitchWarnings ( )
inline

◆ enableMinMaxUsingAbs()

void ValueTape::enableMinMaxUsingAbs ( )
inline

◆ end_sweep() [1/2]

void ValueTape::end_sweep ( TapeEvaluationContext &&  evalCtx)

◆ end_sweep() [2/2]

void ValueTape::end_sweep ( TapeEvaluationContext &  evalCtx)

◆ endRecording()

void ValueTape::endRecording ( )

◆ ensureContiguousLocations()

void ValueTape::ensureContiguousLocations ( size_t  n)
inline

◆ ensureContiguousLocations_()

size_t ValueTape::ensureContiguousLocations_ ( size_t  n)
inline

◆ ext_diff_append()

ext_diff_fct * ValueTape::ext_diff_append ( )
inline

◆ ext_diff_fct_index() [1/2]

size_t ValueTape::ext_diff_fct_index ( ) const
inline

◆ ext_diff_fct_index() [2/2]

void ValueTape::ext_diff_fct_index ( size_t  index)
inline

◆ ext_diff_getElement()

ext_diff_fct * ValueTape::ext_diff_getElement ( size_t  index)
inline

◆ ext_diff_v2_append()

ext_diff_fct_v2 * ValueTape::ext_diff_v2_append ( )
inline

◆ ext_diff_v2_getElement()

ext_diff_fct_v2 * ValueTape::ext_diff_v2_getElement ( size_t  index)
inline

◆ fileName()

template<typename Info >
const char * ValueTape::fileName ( ) const
inline

Return the tape file name associated with the given Info adapter.

The index is supplied by the Info adapter so the caller does not branch on concrete tape kinds.

◆ finish_tay_file()

void ValueTape::finish_tay_file ( )

◆ forodec_dax() [1/2]

int ValueTape::forodec_dax ( ) const
inline

◆ forodec_dax() [2/2]

void ValueTape::forodec_dax ( int  dax)
inline

◆ forodec_nax() [1/2]

int ValueTape::forodec_nax ( ) const
inline

◆ forodec_nax() [2/2]

void ValueTape::forodec_nax ( int  nax)
inline

◆ forodec_y() [1/2]

double * ValueTape::forodec_y ( ) const
inline

◆ forodec_y() [2/2]

void ValueTape::forodec_y ( double *  y)
inline

◆ forodec_z() [1/2]

double * ValueTape::forodec_z ( ) const
inline

◆ forodec_Z() [1/2]

double ** ValueTape::forodec_Z ( ) const
inline

◆ forodec_Z() [2/2]

void ValueTape::forodec_Z ( double **  Z)
inline

◆ forodec_z() [2/2]

void ValueTape::forodec_z ( double *  z)
inline

◆ free_all_taping_params()

void ValueTape::free_all_taping_params ( )
inline

◆ free_loc()

void ValueTape::free_loc ( size_t  loc) const
inline

◆ get_ad_value()

double ValueTape::get_ad_value ( size_t  loc) const
inline

◆ get_cp_fct()

ADOLC::CP::detail::Infos * ValueTape::get_cp_fct ( size_t  index) const
inline

◆ get_num_param()

size_t ValueTape::get_num_param ( )
inline

◆ get_pd_value()

double ValueTape::get_pd_value ( size_t  loc) const
inline

◆ get_val_space()

size_t ValueTape::get_val_space ( )
inline

◆ getTapeInfos()

std::shared_ptr< ValueTape > ValueTape::getTapeInfos ( short  tapeId)

◆ increment_num_eq_prod()

void ValueTape::increment_num_eq_prod ( )
inline

◆ increment_numDeps()

void ValueTape::increment_numDeps ( )
inline

◆ increment_numInds()

void ValueTape::increment_numInds ( )
inline

◆ increment_numSwitches()

void ValueTape::increment_numSwitches ( )
inline

◆ increment_numTays_Tape()

void ValueTape::increment_numTays_Tape ( )
inline

◆ init_sweep()

template<typename Mode >
TapeEvaluationContext ValueTape::init_sweep ( int  keep = 0)
inline

Initialize a tape sweep.

Performs the common setup required before starting either a forward or reverse sweep.

Actions performed:

  • Reads or refreshes tape statistics.
  • Allocates and initializes in-memory tape buffers.
  • Prepares all tape types depending on the sweep direction:
    • Forward: open files and preload initial data blocks.
    • Reverse: seek to last on-disk block and preload final data.
  • If ADOLC_AMPI_SUPPORT is enabled, resets the AMPI stack bounds (bottom for forward, top for reverse).
Template Parameters
ModeSweep direction selector. Must be either Forward or Reverse.

◆ initalStoreSize()

size_t ValueTape::initalStoreSize ( ) const
inline

◆ initialStoreSize()

void ValueTape::initialStoreSize ( size_t  size)
inline

◆ initNewTape()

int ValueTape::initNewTape ( )

◆ initTapeBuffers() [1/2]

void ValueTape::initTapeBuffers ( )
inline

◆ initTapeBuffers() [2/2]

void ValueTape::initTapeBuffers ( Context &  ctx)
inline

◆ initTapeInfos_keep()

void ValueTape::initTapeInfos_keep ( )

◆ inParallelRegion()

char ValueTape::inParallelRegion ( ) const
inline

◆ isExclusiveLocking()

bool ValueTape::isExclusiveLocking ( )
inline

◆ isExclusiveNonLocking()

bool ValueTape::isExclusiveNonLocking ( )
inline

◆ isRecording()

bool ValueTape::isRecording ( ) const
inlinenoexcept

◆ jacSolv_ci() [1/2]

int * ValueTape::jacSolv_ci ( ) const
inline

◆ jacSolv_ci() [2/2]

void ValueTape::jacSolv_ci ( int *  ci)
inline

◆ jacSolv_I() [1/2]

double ** ValueTape::jacSolv_I ( ) const
inline

◆ jacSolv_I() [2/2]

void ValueTape::jacSolv_I ( double **  I)
inline

◆ jacSolv_J() [1/2]

double ** ValueTape::jacSolv_J ( ) const
inline

◆ jacSolv_J() [2/2]

void ValueTape::jacSolv_J ( double **  J)
inline

◆ jacSolv_modeold() [1/2]

int ValueTape::jacSolv_modeold ( ) const
inline

◆ jacSolv_modeold() [2/2]

void ValueTape::jacSolv_modeold ( int  mode)
inline

◆ jacSolv_nax() [1/2]

int ValueTape::jacSolv_nax ( ) const
inline

◆ jacSolv_nax() [2/2]

void ValueTape::jacSolv_nax ( int  nax)
inline

◆ jacSolv_ri() [1/2]

int * ValueTape::jacSolv_ri ( ) const
inline

◆ jacSolv_ri() [2/2]

void ValueTape::jacSolv_ri ( int *  ri)
inline

◆ jacSolv_xold() [1/2]

double * ValueTape::jacSolv_xold ( ) const
inline

◆ jacSolv_xold() [2/2]

void ValueTape::jacSolv_xold ( double *  xold)
inline

◆ keep_stock()

size_t ValueTape::keep_stock ( )

◆ keepTape() [1/2]

int ValueTape::keepTape ( ) const
inline

◆ keepTape() [2/2]

void ValueTape::keepTape ( int  flag)
inline

◆ keepTaylors() [1/2]

int ValueTape::keepTaylors ( ) const
inline

◆ keepTaylors() [2/2]

void ValueTape::keepTaylors ( int  val)
inline

◆ lastTayBlockInCore() [1/2]

char ValueTape::lastTayBlockInCore ( ) const
inline

◆ lastTayBlockInCore() [2/2]

void ValueTape::lastTayBlockInCore ( char  val)
inline

◆ loc_fileName() [1/2]

char * ValueTape::loc_fileName ( ) const
inline

◆ loc_fileName() [2/2]

void ValueTape::loc_fileName ( char *  name)
inline

◆ locationBufferSize() [1/2]

size_t ValueTape::locationBufferSize ( ) const
inline

◆ locationBufferSize() [2/2]

void ValueTape::locationBufferSize ( size_t  size)
inline

◆ make_inf()

static double ValueTape::make_inf ( )
inlinestatic

◆ make_nan()

static double ValueTape::make_nan ( )
inlinestatic

◆ maxLocsPerOp()

static constexpr size_t ValueTape::maxLocsPerOp ( )
inlinestaticconstexpr

◆ nestedReverseEval() [1/2]

bool ValueTape::nestedReverseEval ( ) const
inline

◆ nestedReverseEval() [2/2]

void ValueTape::nestedReverseEval ( bool  flag)
inline

◆ next_loc()

size_t ValueTape::next_loc ( )
inline

◆ nextBufferNumber() [1/2]

size_t ValueTape::nextBufferNumber ( ) const
inline

◆ nextBufferNumber() [2/2]

void ValueTape::nextBufferNumber ( size_t  num)
inline

◆ no_min_max()

size_t ValueTape::no_min_max ( )
inline

◆ nominmaxFlag()

unsigned int ValueTape::nominmaxFlag ( ) const
inline

◆ num_eq_prod() [1/2]

size_t ValueTape::num_eq_prod ( ) const
inline

◆ num_eq_prod() [2/2]

void ValueTape::num_eq_prod ( size_t  num)
inline

◆ numDeps()

size_t ValueTape::numDeps ( ) const
inline

◆ numInds()

size_t ValueTape::numInds ( ) const
inline

◆ numLives()

size_t ValueTape::numLives ( ) const
inline

◆ numparam()

size_t ValueTape::numparam ( ) const
inline

◆ numSwitches() [1/2]

size_t ValueTape::numSwitches ( ) const
inline

◆ numSwitches() [2/2]

void ValueTape::numSwitches ( size_t  num)
inline

◆ op_fileName() [1/2]

char * ValueTape::op_fileName ( ) const
inline

◆ op_fileName() [2/2]

void ValueTape::op_fileName ( char *  name)
inline

◆ openTape()

void ValueTape::openTape ( )

◆ operationBufferSize() [1/2]

size_t ValueTape::operationBufferSize ( ) const
inline

◆ operationBufferSize() [2/2]

void ValueTape::operationBufferSize ( size_t  size)
inline

◆ operator=() [1/2]

ValueTape & ValueTape::operator= ( const ValueTape &  other)
delete

◆ operator=() [2/2]

ValueTape & ValueTape::operator= ( ValueTape &&  other)
inlinenoexcept

◆ p_free_loc()

void ValueTape::p_free_loc ( size_t  loc) const
inline

◆ p_next_loc()

size_t ValueTape::p_next_loc ( )
inline

◆ prepare_for()

template<InfoType< TapeEvaluationContext, ErrorType > Info>
void ValueTape::prepare_for ( TapeEvaluationContext &  evalCtx)
inline

Prepare for a forward sweep.

If something is stored on disk (tapestats(Info::fileAccess)!=0), this function opens the tape file, preloads up to one block of data into the in-memory buffer, and sets the internal counters/pointers so subsequent reads can continue from the correct position.

The logic is:

  • optionally read a block into buffer (up to bufferSize)
  • set the remaining element count on the selected buffer to what is still left on disk after the preload
  • initialize the current buffer position

If nothing was written to disk, we assume all data is already in memory and only initialize the counters/pointers accordingly.

Special case:

  • Loc tape adjusts the current pointer based on statSpace and may trigger get_loc_block_f() to align buffer state with statistics bookkeeping.

◆ prepare_for_all()

template<InfoType< TapeEvaluationContext, ErrorType >... Infos>
requires (requires { Infos::fileAccess; } && ...)
void ValueTape::prepare_for_all ( TapeEvaluationContext &  evalCtx,
AllTypes< Infos... >   
)
inline

Run prepare_for() for all tape types listed in AllTypes.

This is just a compile-time loop (fold expression) over the Info types.

◆ prepare_rev()

template<InfoType< TapeEvaluationContext, ErrorType > Info>
void ValueTape::prepare_rev ( TapeEvaluationContext &  evalCtx)
inline

Prepare for reverse sweep.

Reverse sweeps start at the end of the tape. If data was written to disk, this function seeks to the last on-disk block and preloads the (possibly partial) final block into the in-memory buffer.

After the preload:

  • the selected buffer stores the number of elements still remaining on disk before the loaded block
  • the selected buffer position is moved to the logical end of the loaded region so reverse logic can walk backwards

If nothing was written to disk, we assume all data is already in memory and only initialize the counters/pointers accordingly.

◆ prepare_rev_all()

template<InfoType< TapeEvaluationContext, ErrorType >... Infos>
requires (requires { Infos::fileAccess; } && ...)
void ValueTape::prepare_rev_all ( TapeEvaluationContext &  evalCtx,
AllTypes< Infos... >   
)
inline

Run prepare_for() for all tape types listed in AllTypes.

This is just a compile-time loop (fold expression) over the Info types.

◆ pStore() [1/2]

double * ValueTape::pStore ( ) const
inline

◆ pStore() [2/2]

void ValueTape::pStore ( double *  buffer)
inline

◆ put_loc()

void ValueTape::put_loc ( size_t  loc)
inline

◆ put_op()

void ValueTape::put_op ( OPCODES  op,
size_t  reserveExtraLocations = 0 
)
inline

◆ put_val()

void ValueTape::put_val ( const double  val)
inline

◆ put_vals_notWriteBlock()

void ValueTape::put_vals_notWriteBlock ( double *  reals,
size_t  numReals 
)
inline

◆ put_vals_writeBlock()

void ValueTape::put_vals_writeBlock ( double *  reals,
size_t  numReals 
)
inline

◆ read_tape_stats()

void ValueTape::read_tape_stats ( )

◆ readConfigFile()

std::array< std::string, 4 > ValueTape::readConfigFile ( )

◆ readParams()

void ValueTape::readParams ( double *&  targetStore)

◆ registerExtDiff()

void ValueTape::registerExtDiff ( )
inline

◆ save_params()

void ValueTape::save_params ( )

◆ set_ad_value()

void ValueTape::set_ad_value ( size_t  loc,
double  coval 
)
inline

◆ set_pd_value()

void ValueTape::set_pd_value ( size_t  loc,
double  coval 
)
inline

◆ setExclusiveMode()

void ValueTape::setExclusiveMode ( )
inline

Restores the default single-evaluation mode with reusable owned buffers.

◆ setFilePosition()

template<InfoType< TapeEvaluationContext, ErrorType > Info>
void ValueTape::setFilePosition ( TapeEvaluationContext &  evalCtx)
inline

Position the tape file at the beginning of the last on-disk block.

Computes the offset of the last full block boundary: floor(num / bufferSize) * bufferSize and seeks the file to that position (in bytes).

Used by reverse sweeps to read the final block of the tape first.

Preconditions:

  • tapestats(Info::num) and tapestats(Info::bufferSize) are initialized.

◆ setParamVec()

void ValueTape::setParamVec ( std::span< const double >  paramvec)

Update parameter values used by subsequent evaluations.

Replaces the values stored for all pdouble parameters on this tape. The number of supplied values must match the number of parameters recorded on the tape.

Parameters
paramvecNew parameter values in tape-location order.
Note
This invalidates saved Taylor coefficients. Any reverse sweep after this call must be preceded by a forward sweep with keep >= 1, for example zos_forward(..., 1, ...).
Exceptions
ADOLCError::ADOLCErrorif the tape is currently being written or if the number of supplied values does not match the tape.

◆ setSharedMode()

void ValueTape::setSharedMode ( )
inline

Enables concurrent no-keep evaluations of this tape.

Existing evaluations and recordings must finish before the mode changes. External differentiated functions are currently unsupported in this mode.

◆ setStoreManagerControl()

void ValueTape::setStoreManagerControl ( double  gcTriggerRatio,
size_t  gcTriggerMaxSize 
)
inline

◆ setStoreManagerType()

void ValueTape::setStoreManagerType ( unsigned char  type)
inline

◆ signature() [1/2]

double * ValueTape::signature ( ) const
inline

◆ signature() [2/2]

void ValueTape::signature ( double *  buffer)
inline

◆ skipFileCleanup() [1/2]

int ValueTape::skipFileCleanup ( ) const
inline

◆ skipFileCleanup() [2/2]

void ValueTape::skipFileCleanup ( int  skipFileCleanup)
inline

◆ start_trace()

void ValueTape::start_trace ( )

◆ statsNeedReload()

void ValueTape::statsNeedReload ( )
inline

◆ stop_trace()

void ValueTape::stop_trace ( int  flag)

◆ store() [1/3]

double * ValueTape::store ( ) const
inline

◆ store() [2/3]

void ValueTape::store ( double *  buffer)
inline

◆ store() [3/3]

double ValueTape::store ( size_t  idx)
inline

◆ storeSize()

size_t ValueTape::storeSize ( ) const
inline

◆ take_stock()

void ValueTape::take_stock ( )

◆ tapeBaseNames()

void ValueTape::tapeBaseNames ( size_t  loc,
const std::string &  baseName 
)
inline

◆ tapeId()

short ValueTape::tapeId ( ) const
inline

◆ tapestats() [1/5]

std::array< size_t, TapeInfos::STAT_SIZE > ValueTape::tapestats ( ) const
inline

◆ tapestats() [2/5]

void ValueTape::tapestats ( size_t *  stats)
inline

◆ tapestats() [3/5]

size_t ValueTape::tapestats ( size_t  stat) const
inline

◆ tapestats() [4/5]

void ValueTape::tapestats ( size_t  stat,
size_t  val 
)
inline

◆ tapestats() [5/5]

void ValueTape::tapestats ( std::array< size_t, TapeInfos::STAT_SIZE >  stats)
inline

◆ tay_fileName() [1/2]

char * ValueTape::tay_fileName ( ) const
inline

◆ tay_fileName() [2/2]

void ValueTape::tay_fileName ( char *  name)
inline

◆ tay_numDeps() [1/2]

size_t ValueTape::tay_numDeps ( ) const
inline

◆ tay_numDeps() [2/2]

void ValueTape::tay_numDeps ( size_t  val)
inline

◆ tay_numInds() [1/2]

size_t ValueTape::tay_numInds ( ) const
inline

◆ tay_numInds() [2/2]

void ValueTape::tay_numInds ( size_t  val)
inline

◆ taylor_begin()

void ValueTape::taylor_begin ( int  degreeSave)

Initialize Taylor-stack recording for the current tape.

◆ taylor_close()

void ValueTape::taylor_close ( )

◆ taylorBufferSize() [1/2]

size_t ValueTape::taylorBufferSize ( ) const
inline

◆ taylorBufferSize() [2/2]

void ValueTape::taylorBufferSize ( size_t  size)
inline

◆ upd_resloc()

int ValueTape::upd_resloc ( size_t  temp,
size_t  lhs 
)
inline

◆ upd_resloc_check()

int ValueTape::upd_resloc_check ( size_t  temp)
inline

◆ upd_resloc_inc_prod()

int ValueTape::upd_resloc_inc_prod ( size_t  temp,
size_t  newlhs,
unsigned char  newop 
)
inline

◆ val_fileName() [1/2]

char * ValueTape::val_fileName ( ) const
inline

◆ val_fileName() [2/2]

void ValueTape::val_fileName ( char *  name)
inline

◆ valueBufferSize() [1/2]

size_t ValueTape::valueBufferSize ( ) const
inline

◆ valueBufferSize() [2/2]

void ValueTape::valueBufferSize ( size_t  size)
inline

◆ write_scaylor()

void ValueTape::write_scaylor ( double  val)
inline

The documentation for this class was generated from the following file: