Skip to content

Commit

Permalink
Merge branch 'develop' into feature/no-interpolation-2
Browse files Browse the repository at this point in the history
Conflicts:
  CHANGELOG.md
  doc/shared/RecentChanges.rst
  • Loading branch information
gardner48 committed May 20, 2024
2 parents 8f67284 + 48bbc24 commit 3087d86
Show file tree
Hide file tree
Showing 28 changed files with 179 additions and 445 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/extended-precision.yml

This file was deleted.

52 changes: 0 additions & 52 deletions .github/workflows/single-precision.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
name: Build and Test - Ubuntu/gcc double precision (TPLs, no GPUs)
name: Build and Test - Ubuntu/gcc (TPLs, no GPUs)

on:
push:
Expand All @@ -24,8 +24,21 @@ jobs:
max-parallel: 2
matrix:
indexsize: [32, 64]
precision: ['double']
buildtype: ['Debug', 'Release']
# Disable extended tests until compiler warnings are addressed
precision: ['single', 'double']
buildtype: ['Debug', 'Release', 'RelWithDebInfo']
exclude:
- buildtype: Debug
precision: single
# - buildtype: Debug
# precision: extended
- buildtype: Release
precision: single
# - buildtype: Release
# precision: extended
- buildtype: RelWithDebInfo
precision: double

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down
37 changes: 28 additions & 9 deletions .github/workflows/windows-latest-mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,46 @@ env:
BUILD_TYPE: Release

jobs:
buil_and_test:
build_and_test:
runs-on: windows-latest

defaults:
run:
# Use MSYS2 as default shell
shell: msys2 {0}

steps:
- uses: actions/checkout@v3

- uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
release: false
install: >-
base-devel
mingw-w64-x86_64-cmake
mingw-w64-x86_64-cc
mingw-w64-x86_64-openblas
mingw-w64-x86_64-suitesparse
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -G "MinGW Makefiles" -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSUNDIALS_BUILD_WITH_PROFILING=ON -DSUNDIALS_LOGGING_LEVEL=2 -DSUNDIALS_TEST_UNITTESTS=OFF -DEXAMPLES_ENABLE_CXX=ON
# Configure CMake in a 'build' subdirectory
run: |
cmake \
-B ${GITHUB_WORKSPACE}/build \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DSUNDIALS_BUILD_WITH_PROFILING=ON \
-DSUNDIALS_LOGGING_LEVEL=2 \
-DSUNDIALS_TEST_UNITTESTS=OFF \
-DEXAMPLES_ENABLE_CXX=ON \
-DENABLE_KLU=ON
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
# Build your program
run: cmake --build ${GITHUB_WORKSPACE}/build

- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}
# Execute tests
run: ctest
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

## Changes to SUNDIALS in release X.Y.Z

### Major Features

Created shared user interface functions for ARKODE to allow more uniform control
over time-stepping algorithms, improved extensibility, and simplified code
maintenance. The corresponding stepper-specific user-callable functions are now
Expand Down Expand Up @@ -64,6 +62,17 @@ 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).

Fixed the runtime library installation path for windows systems. This fix
changes the default library installation path from
`CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR` to
`CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_BINDIR`.

Fixed conflicting `.lib` files between shared and static libs when using `MSVC`
on Windows.

Fixed invalid `SUNDIALS_EXPORT` generated macro when building both shared and
static libs.

Fixed a bug in some Fortran examples where `c_null_ptr` was passed as an
argument to a function pointer instead of `c_null_funptr`. This caused
compilation issues with the Cray Fortran compiler.
Expand Down
21 changes: 14 additions & 7 deletions cmake/macros/SundialsAddLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ macro(sundials_add_library target)

# add compile definitions to object library for SUNDIALS_EXPORT
if(${_libtype} MATCHES "STATIC")
target_compile_definitions(${obj_target} PRIVATE SUNDIALS_STATIC_DEFINE)
target_compile_definitions(${obj_target} PUBLIC SUNDIALS_STATIC_DEFINE)
else()
target_compile_definitions(${obj_target} PRIVATE sundials_core_EXPORTS)
endif()
Expand Down Expand Up @@ -296,7 +296,7 @@ macro(sundials_add_library target)

# add compile definitions for SUNDIALS_EXPORT
if(${_libtype} MATCHES "STATIC")
target_compile_definitions(${_actual_target_name} PRIVATE SUNDIALS_STATIC_DEFINE)
target_compile_definitions(${_actual_target_name} PUBLIC SUNDIALS_STATIC_DEFINE)
else()
target_compile_definitions(${obj_target} PRIVATE sundials_core_EXPORTS)
endif()
Expand Down Expand Up @@ -325,10 +325,17 @@ macro(sundials_add_library target)

# set the correct output name
if(sundials_add_library_OUTPUT_NAME)
set_target_properties(${_actual_target_name} PROPERTIES
OUTPUT_NAME ${sundials_add_library_OUTPUT_NAME}
CLEAN_DIRECT_OUTPUT 1
)
if((MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) AND ${_libtype} MATCHES "STATIC")
set_target_properties(${_actual_target_name} PROPERTIES
OUTPUT_NAME "${sundials_add_library_OUTPUT_NAME}_static"
CLEAN_DIRECT_OUTPUT 1
)
else()
set_target_properties(${_actual_target_name} PROPERTIES
OUTPUT_NAME ${sundials_add_library_OUTPUT_NAME}
CLEAN_DIRECT_OUTPUT 1
)
endif()
else()
set_target_properties(${_actual_target_name} PROPERTIES
OUTPUT_NAME ${target}
Expand All @@ -355,7 +362,7 @@ macro(sundials_add_library target)
endif()

# install phase
install(TARGETS ${_actual_target_name} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT sundials-targets)
install(TARGETS ${_actual_target_name} EXPORT sundials-targets)

endif()

Expand Down
13 changes: 12 additions & 1 deletion doc/shared/RecentChanges.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ 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>`_.

Fixed the runtime library installation path for windows systems. This fix
changes the default library installation path from
``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR`` to
``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_BINDIR``.

Fixed conflicting ``.lib`` files between shared and static libs when using
``MSVC`` on Windows

Fixed invalid ``SUNDIALS_EXPORT`` generated macro when building both shared and
static libs.

Fixed a bug in some Fortran examples where ``c_null_ptr`` was passed as an
argument to a function pointer instead of ``c_null_funptr``. This caused
compilation issues with the Cray Fortran compiler.
Expand Down Expand Up @@ -94,4 +105,4 @@ ARKODE-wide functions.

Deprecated ``ARKStepSetOptimalParams`` function. This functions does not have an
ARKODE-wide equivalent, instructions have been added to the user guide for how
to retain the current functionality using other user-callable functions.
to retain the current functionality using other user-callable functions.
17 changes: 17 additions & 0 deletions doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,23 @@ implementation, however some may be required based on the implementation's
:c:type:`SUNAdaptController_Type` (see Section :numref:`SUNAdaptController.Description.controllerTypes`). We
note these requirements below. Additionally, we note the behavior of the base SUNAdaptController methods when they perform an action other than only a successful return.
.. c:function:: void SUNAdaptController_DestroyEmpty(SUNAdaptController C)
This routine frees the generic ``SUNAdaptController`` object, under the
assumption that any implementation-specific data that was allocated within the
underlying content structure has already been freed. It will additionally test
whether the ops pointer is ``NULL``, and, if it is not, it will free it as
well.
:param C: the :c:type:`SUNAdaptController` object.
:return: :c:type:`SUNErrCode` indicating success or failure.
Usage:
.. code-block:: c
retval = SUNAdaptController_DestroyEmpty(C);
.. c:function:: SUNAdaptController_Type SUNAdaptController_GetType(SUNAdaptController C)
Returns the type identifier for the controller *C*. Returned values
Expand Down
4 changes: 2 additions & 2 deletions examples/arkode/C_serial/ark_damped_harmonic_symplectic.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ int main(int argc, char* argv[])
return 0;
}

sunrealtype omega(sunrealtype t) { return cos(t / SUN_RCONST(2.0)); }
static sunrealtype omega(sunrealtype t) { return cos(t / SUN_RCONST(2.0)); }

sunrealtype F(sunrealtype t) { return SUN_RCONST(0.018) * sin(t / PI); }
static sunrealtype F(sunrealtype t) { return SUN_RCONST(0.018) * sin(t / PI); }

sunrealtype Hamiltonian(N_Vector yvec, sunrealtype t)
{
Expand Down
6 changes: 3 additions & 3 deletions examples/arkode/C_serial/ark_harmonic_symplectic.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ typedef struct
sunrealtype dt;
} ProgramArgs;

void PrintHelp(void)
static void PrintHelp(void)
{
fprintf(stderr, "ark_harmonic_symplectic: an ARKODE example demonstrating "
"the SPRKStep time-stepping module solving a simple harmonic "
Expand All @@ -48,7 +48,7 @@ void PrintHelp(void)
/* clang-format on */
}

int ParseArgs(int argc, char* argv[], ProgramArgs* args)
static int ParseArgs(int argc, char* argv[], ProgramArgs* args)
{
int argi = 0;

Expand Down Expand Up @@ -110,7 +110,7 @@ int ParseArgs(int argc, char* argv[], ProgramArgs* args)
opt == 2 means function allocates memory so check if returned
NULL pointer
*/
int check_retval(void* returnvalue, const char* funcname, int opt)
static int check_retval(void* returnvalue, const char* funcname, int opt)
{
int* retval;

Expand Down
11 changes: 6 additions & 5 deletions examples/arkode/C_serial/ark_kepler.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ typedef struct
const char* method_name;
} ProgramArgs;

int ComputeConvergence(int num_dt, sunrealtype* orders,
sunrealtype expected_order, sunrealtype a11,
sunrealtype a12, sunrealtype a21, sunrealtype a22,
sunrealtype b1, sunrealtype b2, sunrealtype* ord_avg,
sunrealtype* ord_max, sunrealtype* ord_est)
static int ComputeConvergence(int num_dt, sunrealtype* orders,
sunrealtype expected_order, sunrealtype a11,
sunrealtype a12, sunrealtype a21, sunrealtype a22,
sunrealtype b1, sunrealtype b2,
sunrealtype* ord_avg, sunrealtype* ord_max,
sunrealtype* ord_est)
{
/* Compute/print overall estimated convergence rate */
int i = 0;
Expand Down
4 changes: 4 additions & 0 deletions include/sundials/sundials_adaptcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ struct _generic_SUNAdaptController
SUNDIALS_EXPORT
SUNAdaptController SUNAdaptController_NewEmpty(SUNContext sunctx);

/* Function to free a generic SUNAdaptController (assumes content is already empty) */
SUNDIALS_EXPORT
void SUNAdaptController_DestroyEmpty(SUNAdaptController C);

/* Function to report the type of a SUNAdaptController object. */
SUNDIALS_EXPORT
SUNAdaptController_Type SUNAdaptController_GetType(SUNAdaptController C);
Expand Down
Loading

0 comments on commit 3087d86

Please sign in to comment.