Skip to content

Commit

Permalink
address some of david's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
balos1 committed Feb 4, 2025
1 parent c7ecaab commit 32d69d1
Show file tree
Hide file tree
Showing 14 changed files with 7,014 additions and 6,674 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,7 @@ instead of `SameMajorVersion`. This fixes the issue seen
[here](https://github.com/AMReX-Codes/amrex/pull/3835).

Fixed a CMake bug that caused an MPI linking error for our C++ examples in some
instances. Fixes [GitHub Issue
# 464](https://github.com/LLNL/sundials/issues/464).
instances. Fixes [GitHub Issue #464](https://github.com/LLNL/sundials/issues/464).

Fixed the runtime library installation path for windows systems. This fix
changes the default library installation path from
Expand Down
26 changes: 13 additions & 13 deletions doc/shared/sunadjoint/SUNAdjointCheckpointScheme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ of the adjoint model.

.. c:enum:: SUNDataIOMode
.. c:enumerator:: SUNDATAIOMODE_INMEM
.. c:enumerator:: SUNDATAIOMODE_INMEM
The IO mode for data that is stored in addressable random access memory.
The location of the memory (e.g., CPU or GPU) is not specified by this mode.
The IO mode for data that is stored in addressable random access memory.
The location of the memory (e.g., CPU or GPU) is not specified by this mode.


A :c:type:`SUNAdjointCheckpointScheme` is a pointer to the
Expand All @@ -49,24 +49,26 @@ A :c:type:`SUNAdjointCheckpointScheme` is a pointer to the
The SUNDIALS simulation context.


The virtual table structure is defined as

.. c:type:: struct SUNAdjointCheckpointScheme_Ops_ *SUNAdjointCheckpointScheme_Ops
.. c:struct:: SUNAdjointCheckpointScheme_Ops_
.. c:member:: SUNErrCode (*needsSaving)(SUNAdjointCheckpointScheme cs, int64_t step_num, int64_t stage_num, sunrealtype t, sunbooleantype* yes_or_no)
.. c:member:: SUNErrCode (*needssaving)(SUNAdjointCheckpointScheme cs, int64_t step_num, int64_t stage_num, sunrealtype t, sunbooleantype* yes_or_no)
Function pointer to determine if a checkpoint should be saved at the current timestep.

.. c:member:: SUNErrCode (*needsDeleting)(SUNAdjointCheckpointScheme cs, int64_t step_num, int64_t stage_num, sunbooleantype* yes_or_no)
.. c:member:: SUNErrCode (*needsdeleting)(SUNAdjointCheckpointScheme cs, int64_t step_num, int64_t stage_num, sunrealtype t, sunbooleantype* yes_or_no)
Function pointer to determine if a checkpoint should be deleted at the current timestep.

.. c:member:: SUNErrCode (*insertVector)(SUNAdjointCheckpointScheme cs, int64_t step_num, int64_t stage_num, sunrealtype t, N_Vector y)
.. c:member:: SUNErrCode (*insertvector)(SUNAdjointCheckpointScheme cs, int64_t step_num, int64_t stage_num, sunrealtype t, N_Vector y)
Function pointer to insert a checkpoint state represented as a :c:type:`N_Vector`.

.. c:member:: SUNErrCode (*loadVector)(SUNAdjointCheckpointScheme cs, int64_t step_num, int64_t stage_num, sunbooleantype peek, N_Vector* yout, sunrealtype* tout)
.. c:member:: SUNErrCode (*loadvector)(SUNAdjointCheckpointScheme cs, int64_t step_num, int64_t stage_num, sunrealtype t, sunbooleantype peek, N_Vector* yout, sunrealtype* tout)
Function pointer to load a checkpoint state represented as a :c:type:`N_Vector`.

Expand All @@ -86,14 +88,12 @@ A :c:type:`SUNAdjointCheckpointScheme` is a pointer to the
.. c:function:: SUNErrCode SUNAdjointCheckpointScheme_NewEmpty(SUNContext sunctx, \
SUNAdjointCheckpointScheme* cs_ptr)
Allocates a new object but without any content.
:param sunctx: The SUNDIALS simulation context
:param cs_ptr: on output, the pointer to the new :c:type:`SUNAdjointCheckpointScheme` object
:return: A :c:type:`SUNErrCode` indicating failure or success.
.. c:function:: SUNErrCode SUNAdjointCheckpointScheme_ShouldWeSave(SUNAdjointCheckpointScheme cs, \
.. c:function:: SUNErrCode SUNAdjointCheckpointScheme_NeedsSaving(SUNAdjointCheckpointScheme cs, \
int64_t step_num, int64_t stage_num, sunrealtype t, sunbooleantype* yes_or_no)
Determines if the (step_num, stage_num) should be checkpointed or not.
Expand All @@ -106,7 +106,7 @@ A :c:type:`SUNAdjointCheckpointScheme` is a pointer to the
:return: A :c:type:`SUNErrCode` indicating failure or success.
.. c:function:: SUNErrCode SUNAdjointCheckpointScheme_ShouldWeDelete(SUNAdjointCheckpointScheme cs, \
.. c:function:: SUNErrCode SUNAdjointCheckpointScheme_NeedsDeleting(SUNAdjointCheckpointScheme cs, \
int64_t step_num, int64_t stage_num, sunbooleantype* yes_or_no)
Determines if the (step_num, stage_num) checkpoint should be deleted or not.
Expand Down Expand Up @@ -201,9 +201,9 @@ Base-class Method Overrides
The ``SUNAdjointCheckpointScheme_Fixed`` module implements the following :c:type:`SUNAdjointCheckpointScheme` functions:
* :c:func:`SUNAdjointCheckpointScheme_ShouldWeSave`
* :c:func:`SUNAdjointCheckpointScheme_NeedsSaving`
* :c:func:`SUNAdjointCheckpointScheme_InsertVector`
* :c:func:`SUNAdjointCheckpointScheme_ShouldWeDelete`
* :c:func:`SUNAdjointCheckpointScheme_NeedsDeleting`
* :c:func:`SUNAdjointCheckpointScheme_RemoveVector`
* :c:func:`SUNAdjointCheckpointScheme_LoadVector`
* :c:func:`SUNAdjointCheckpointScheme_Destroy`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* SUNAdjointCheckpointScheme_Fixed class declaration.
* ----------------------------------------------------------------*/

#ifndef _sunadjointcheckpointscheme_fixed_H
#define _sunadjointcheckpointscheme_fixed_H
#ifndef _SUNADJOINTCHECKPOINTSCHEME_FIXED_H
#define _SUNADJOINTCHECKPOINTSCHEME_FIXED_H

#include <sundials/sundials_adjointcheckpointscheme.h>
#include <sundials/sundials_core.h>
Expand All @@ -31,7 +31,7 @@ SUNErrCode SUNAdjointCheckpointScheme_Create_Fixed(
SUNContext sunctx, SUNAdjointCheckpointScheme* check_scheme_ptr);

SUNDIALS_EXPORT
SUNErrCode SUNAdjointCheckpointScheme_ShouldWeSave_Fixed(
SUNErrCode SUNAdjointCheckpointScheme_NeedsSaving_Fixed(
SUNAdjointCheckpointScheme check_scheme, int64_t step_num, int64_t stage_num,
sunrealtype t, sunbooleantype* yes_or_no);

Expand All @@ -41,9 +41,9 @@ SUNErrCode SUNAdjointCheckpointScheme_InsertVector_Fixed(
sunrealtype t, N_Vector state);

SUNDIALS_EXPORT
SUNErrCode SUNAdjointCheckpointScheme_ShouldWeDelete_Fixed(
SUNErrCode SUNAdjointCheckpointScheme_NeedsDeleting_Fixed(
SUNAdjointCheckpointScheme check_scheme, int64_t step_num, int64_t stage_num,
sunbooleantype* yes_or_no);
sunrealtype t, sunbooleantype* yes_or_no);

SUNDIALS_EXPORT
SUNErrCode SUNAdjointCheckpointScheme_RemoveVector_Fixed(
Expand Down
29 changes: 15 additions & 14 deletions include/sundials/sundials_adjointcheckpointscheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,18 @@ typedef _SUNDIALS_STRUCT_ SUNAdjointCheckpointScheme_* SUNAdjointCheckpointSchem

struct SUNAdjointCheckpointScheme_Ops_
{
SUNErrCode (*needsSaving)(SUNAdjointCheckpointScheme, int64_t step_num,
SUNErrCode (*needssaving)(SUNAdjointCheckpointScheme, int64_t step_num,
int64_t stage_num, sunrealtype t,
sunbooleantype* yes_or_no);

SUNErrCode (*needsDeleting)(SUNAdjointCheckpointScheme, int64_t step_num,
int64_t stage_num, sunbooleantype* yes_or_no);
SUNErrCode (*needsdeleting)(SUNAdjointCheckpointScheme, int64_t step_num,
int64_t stage_num, sunrealtype t,
sunbooleantype* yes_or_no);

SUNErrCode (*insertVector)(SUNAdjointCheckpointScheme, int64_t step_num,
SUNErrCode (*insertvector)(SUNAdjointCheckpointScheme, int64_t step_num,
int64_t stage_num, sunrealtype t, N_Vector y);

SUNErrCode (*loadVector)(SUNAdjointCheckpointScheme, int64_t step_num,
SUNErrCode (*loadvector)(SUNAdjointCheckpointScheme, int64_t step_num,
int64_t stage_num, sunbooleantype peek,
N_Vector* yout, sunrealtype* tout);

Expand All @@ -61,17 +62,17 @@ SUNErrCode SUNAdjointCheckpointScheme_NewEmpty(SUNContext sunctx,
SUNAdjointCheckpointScheme*);

SUNDIALS_EXPORT
SUNErrCode SUNAdjointCheckpointScheme_ShouldWeSave(SUNAdjointCheckpointScheme,
int64_t step_num,
int64_t stage_num,
sunrealtype t,
sunbooleantype* yes_or_no);
SUNErrCode SUNAdjointCheckpointScheme_NeedsSaving(SUNAdjointCheckpointScheme,
int64_t step_num,
int64_t stage_num,
sunrealtype t,
sunbooleantype* yes_or_no);

SUNDIALS_EXPORT
SUNErrCode SUNAdjointCheckpointScheme_ShouldWeDelete(SUNAdjointCheckpointScheme,
int64_t step_num,
int64_t stage_num,
sunbooleantype* yes_or_no);
SUNErrCode SUNAdjointCheckpointScheme_NeedsDeleting(SUNAdjointCheckpointScheme,
int64_t step_num,
int64_t stage_num,
sunbooleantype* yes_or_no);

SUNDIALS_EXPORT
SUNErrCode SUNAdjointCheckpointScheme_InsertVector(SUNAdjointCheckpointScheme,
Expand Down
Loading

0 comments on commit 32d69d1

Please sign in to comment.