Public checkpointing setup and execution context.
More...
#include <checkpointing.h>
|
| | Context ()=delete |
| |
| | Context (short tapeId, short tapeIdCheck, TimeStepFunction timeStepFunction) |
| | Create a checkpointing context for one time-stepping routine.
|
| |
| | ~Context ()=default |
| |
| void | setDoubleFct (TimeStepFunctionDouble timeStepFunction) |
| | Register the passive one-step function used for untaped replay.
|
| |
| void | setSaveFct (SaveFunction saveState) |
| | Register an optional callback that saves extra non-adouble state at each checkpoint.
|
| |
| void | setRestoreFct (RestoreFunction restoreState) |
| | Register an optional callback that restores extra non-adouble state from a checkpoint.
|
| |
| void | setNumberOfSteps (int number) |
| | Set the total number of time steps in the checkpointed loop.
|
| |
| void | setNumberOfCheckpoints (int number) |
| | Set the number of checkpoints available to revolve.
|
| |
| void | setDimensionXY (int dim) |
| | Set the dimension of the in-place state vector.
|
| |
| void | setInput (adouble *x) |
| | Set the active input state of the checkpointed loop.
|
| |
| void | setOutput (adouble *y) |
| | Set the active output state of the checkpointed loop.
|
| |
| void | setAlwaysRetaping (bool state) |
| | Control whether the one-step tape is rebuilt before every step.
|
| |
| int | checkpointing (short tapeId) |
| | Replace the explicit time loop by a checkpointed external function call during taping.
|
| |
Public checkpointing setup and execution context.
A Context ties one active time-step function to an outer tape and to a second tape that stores the one-step checkpoint tape used during replay.
◆ Context() [1/2]
| ADOLC::CP::Context::Context |
( |
| ) |
|
|
delete |
◆ Context() [2/2]
| ADOLC::CP::Context::Context |
( |
short |
tapeId, |
|
|
short |
tapeIdCheck, |
|
|
TimeStepFunction |
timeStepFunction |
|
) |
| |
|
inline |
Create a checkpointing context for one time-stepping routine.
- Parameters
-
| tapeId | Outer tape that records the full computation. |
| tapeIdCheck | Tape used for the one-step checkpoint tape. |
| timeStepFunction | Active one-step function. |
◆ ~Context()
| ADOLC::CP::Context::~Context |
( |
| ) |
|
|
default |
◆ checkpointing()
| int ADOLC::CP::Context::checkpointing |
( |
short |
tapeId | ) |
|
Replace the explicit time loop by a checkpointed external function call during taping.
This runs the primal time stepping once and records the information needed for checkpoint-aware forward and reverse drivers on the outer tape.
- Parameters
-
| tapeId | Outer tape id used for the surrounding trace. |
- Returns
- Zero on success.
◆ setAlwaysRetaping()
| void ADOLC::CP::Context::setAlwaysRetaping |
( |
bool |
state | ) |
|
|
inline |
Control whether the one-step tape is rebuilt before every step.
- Parameters
-
| state | If true, always retape. If false, reuse the step tape until a branch change forces retaping. |
◆ setDimensionXY()
| void ADOLC::CP::Context::setDimensionXY |
( |
int |
dim | ) |
|
|
inline |
Set the dimension of the in-place state vector.
- Parameters
-
| dim | Number of input and output variables per time step. |
◆ setDoubleFct()
Register the passive one-step function used for untaped replay.
- Parameters
-
| timeStepFunction | Passive one-step function. |
◆ setInput()
| void ADOLC::CP::Context::setInput |
( |
adouble * |
x | ) |
|
|
inline |
Set the active input state of the checkpointed loop.
- Parameters
-
| x | Pointer to the first active state entry before the loop. |
◆ setNumberOfCheckpoints()
| void ADOLC::CP::Context::setNumberOfCheckpoints |
( |
int |
number | ) |
|
|
inline |
Set the number of checkpoints available to revolve.
- Parameters
-
| number | Number of stored checkpoints. |
◆ setNumberOfSteps()
| void ADOLC::CP::Context::setNumberOfSteps |
( |
int |
number | ) |
|
|
inline |
Set the total number of time steps in the checkpointed loop.
- Parameters
-
| number | Number of time steps. |
◆ setOutput()
| void ADOLC::CP::Context::setOutput |
( |
adouble * |
y | ) |
|
|
inline |
Set the active output state of the checkpointed loop.
- Parameters
-
| y | Pointer to the first active state entry after the loop. |
◆ setRestoreFct()
Register an optional callback that restores extra non-adouble state from a checkpoint.
- Parameters
-
| restoreState | Restore callback. |
◆ setSaveFct()
| void ADOLC::CP::Context::setSaveFct |
( |
SaveFunction |
saveState | ) |
|
|
inline |
Register an optional callback that saves extra non-adouble state at each checkpoint.
- Parameters
-
The documentation for this class was generated from the following file: