Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sunmpicomm #370

Merged
merged 196 commits into from
Nov 28, 2023
Merged
Changes from all commits
Commits
Show all changes
196 commits
Select commit Hold shift + click to select a range
354e4cb
remove deprecated arkode code
balos1 Oct 26, 2023
4a3a323
remove direct and spils header files
balos1 Oct 26, 2023
c3c4b28
remove kinsol deprecated code
balos1 Oct 26, 2023
9a43a8a
more changes for the removal of spils and direct
balos1 Oct 26, 2023
511f7b9
remove more deprecated code
balos1 Oct 26, 2023
269c00a
realtype --> sunrealtype
balos1 Oct 26, 2023
7557be4
update sunrealtype related macros
balos1 Oct 26, 2023
42bf5a4
add old types into a different header for backwards compatibility
balos1 Oct 26, 2023
f51efc4
booleantype --> sunbooleantype
balos1 Oct 26, 2023
c9de095
changelog note
balos1 Oct 26, 2023
08a4a43
fix redefinition
balos1 Oct 26, 2023
c9db3f5
regen swig
balos1 Oct 26, 2023
e70954d
update swig
balos1 Oct 26, 2023
ec557bc
Merge branch 'develop' into feature/remove-deprecated-code
balos1 Oct 27, 2023
bde3811
Apply suggestions from code review
balos1 Oct 27, 2023
f96e164
Feature: Fortran interface for lapack dense solver (#353)
balos1 Oct 27, 2023
a212472
Feature/new tables (#359)
drreynolds Oct 28, 2023
b548855
remove implementation of SUNLinsSol and SUNNonlinSol printinfo functions
balos1 Oct 30, 2023
e252417
replace use of SetDiagnostics in some arkode examples
balos1 Oct 31, 2023
9939d98
make INFO level the default for logging
balos1 Oct 31, 2023
28e931e
change arkode INFO logging to DEBUG
balos1 Nov 2, 2023
37b4948
add debugging filename
balos1 Nov 2, 2023
ba66c1e
clean up use of removed functions
balos1 Nov 3, 2023
f555583
Merge remote-tracking branch 'origin/develop' into feature/remove-dep…
balos1 Nov 3, 2023
7a6347e
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 3, 2023
d445aa5
remove deprecated arkode code
balos1 Oct 26, 2023
e57f71c
remove direct and spils header files
balos1 Oct 26, 2023
106901b
remove kinsol deprecated code
balos1 Oct 26, 2023
5934bf2
more changes for the removal of spils and direct
balos1 Oct 26, 2023
7091261
remove more deprecated code
balos1 Oct 26, 2023
0388073
update swig
balos1 Oct 26, 2023
b77a568
Apply suggestions from code review
balos1 Oct 27, 2023
bce63fb
Feature: Fortran interface for lapack dense solver (#353)
balos1 Oct 27, 2023
1c76c85
remove implementation of SUNLinsSol and SUNNonlinSol printinfo functions
balos1 Oct 30, 2023
841a6d9
replace use of SetDiagnostics in some arkode examples
balos1 Oct 31, 2023
5179287
make INFO level the default for logging
balos1 Oct 31, 2023
196c32a
change arkode INFO logging to DEBUG
balos1 Nov 2, 2023
e47a8c3
add debugging filename
balos1 Nov 2, 2023
32501fa
clean up use of removed functions
balos1 Nov 3, 2023
3ebc682
clean removed functions in benchmarks
balos1 Nov 3, 2023
1652153
remove _spils and _direct references
balos1 Nov 3, 2023
3841cd5
remove cpodes script
balos1 Nov 3, 2023
b816971
cleanup use of removed PREC_ macro
balos1 Nov 3, 2023
3cd7a85
remove unused flag
balos1 Nov 5, 2023
454203a
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 5, 2023
7764a5b
regen fortran
balos1 Nov 5, 2023
22c9bf3
clean up more use of Diagnostics
balos1 Nov 5, 2023
1af246d
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 5, 2023
31d3115
remove sundials_lapack.h from install list
balos1 Nov 6, 2023
1212aea
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 6, 2023
a10585b
use SUN_RCONST
balos1 Nov 6, 2023
2b39a12
remove KINSetInfofile
balos1 Nov 6, 2023
7f6f328
Merge branch 'develop' into feature/remove-deprecated-code
balos1 Nov 6, 2023
1cbfa1f
remove warnings to stdout
balos1 Nov 6, 2023
447eafa
Merge remote-tracking branch 'origin/develop' into feature/remove-dep…
balos1 Nov 7, 2023
5806bc6
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 7, 2023
752c350
update action to sunrealtype
balos1 Nov 7, 2023
787fd87
rename sundials_generic to sundials_core
balos1 Nov 6, 2023
e72774f
always link to sundials_core rather than include its objects
balos1 Nov 6, 2023
52ac7c6
update N_VGetCommunicator to use SUN_Comm
balos1 Nov 6, 2023
573e35c
update GetCommunicator docs
balos1 Nov 6, 2023
9fd7103
update swig
balos1 Nov 6, 2023
1a8d35e
use SUN_Comm in profiler and logger
balos1 Nov 6, 2023
1c85937
rename sundials_fgeneric to sundials_fcore
balos1 Nov 6, 2023
74a8b60
fix comm use with logger in fortran
balos1 Nov 6, 2023
66571a6
update signatures in docs and recent changes
balos1 Nov 7, 2023
04efe89
fix typo
balos1 Nov 7, 2023
5f02834
update types section to be in the "Using SUNDIALS" section
balos1 Nov 7, 2023
d202111
remove DFID
balos1 Nov 7, 2023
f16bc3c
remove KINInfoHandler
balos1 Nov 7, 2023
820a6f6
Merge remote-tracking branch 'origin/develop' into feature/remove-dep…
balos1 Nov 8, 2023
afbc36f
remove unused variable
balos1 Nov 8, 2023
a2be7dc
Merge branch 'develop' into feature/remove-deprecated-code
balos1 Nov 9, 2023
83f2c7c
remove unused variables
balos1 Nov 9, 2023
6fcb7cb
Update examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp
balos1 Nov 9, 2023
4e1a6ec
doc fixes
balos1 Nov 9, 2023
8d5e784
address more small comments
balos1 Nov 9, 2023
4741472
fix translation of commptr to comm
balos1 Nov 10, 2023
b771e51
SUN_Comm to SUNComm for consistency with other types
balos1 Nov 10, 2023
7e78db8
update vectors I missed before
balos1 Nov 10, 2023
da8d24f
Fixed broken builds due to incorrect usage of SUNLogger_Create
drreynolds Nov 10, 2023
10f3796
change SUNContext_Create to accept SUN_Comm
balos1 Nov 9, 2023
4243820
find and replace SUNContext_Create with NULL to use SUN_COMM_NULL
balos1 Nov 9, 2023
2f43654
find and replace passing of comm pointer to SUNContext_Create with pa…
balos1 Nov 9, 2023
3e0b632
SUN_Comm to SUNComm for consistency with other types
balos1 Nov 10, 2023
7440e5a
post merge fix
balos1 Nov 10, 2023
303ab8e
change comm NULL check
balos1 Nov 10, 2023
aadc4b2
Fix fortran interface to MPI_Comm, address calls to MPI functions bef…
balos1 Nov 10, 2023
86ddddb
fix C++ interface to SUNContext
balos1 Nov 10, 2023
09ff282
fix a call to SUNProfiler_Create
balos1 Nov 10, 2023
b683c61
fix typo
balos1 Nov 10, 2023
4cff0ae
remove delted functions from soruce
balos1 Nov 10, 2023
b601820
remove unused kinsol parts
balos1 Nov 10, 2023
9690f3d
remove use of printfl
balos1 Nov 10, 2023
4a8ad53
change default logging level
balos1 Nov 10, 2023
dbf7f3f
remove more unused stuff in arkode
balos1 Nov 10, 2023
6ebf949
fix some C++ calls to SUNContext_Create
balos1 Nov 10, 2023
89dcad3
remove uses of ark_mem->report
balos1 Nov 10, 2023
a0502e3
build with different logging levels and profiling on/off
balos1 Nov 10, 2023
4e38f35
remove broken line
balos1 Nov 10, 2023
90b0924
rename GitHub actions CI jobs
balos1 Nov 10, 2023
6e17a61
update log levels cycles through
balos1 Nov 10, 2023
1ef6287
dont automatically include sundials_context.hpp
balos1 Nov 10, 2023
c125409
add recent changes
balos1 Nov 10, 2023
aede7e5
fix indentation
balos1 Nov 10, 2023
4d3ed8f
undo removal of include
balos1 Nov 10, 2023
5224893
dont fail fast
balos1 Nov 10, 2023
3d4661d
fix logging statements in arkode_adapt broken in merge
balos1 Nov 11, 2023
40f5135
fix compiler warning
balos1 Nov 11, 2023
97a3fbd
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 11, 2023
07f73cc
post merge fixes
balos1 Nov 11, 2023
2f3773b
post-merge fix: change RCONST to SUN_RCONST
balos1 Nov 11, 2023
004191f
another spot where we need to supress warning of set but unused
balos1 Nov 11, 2023
075105f
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 11, 2023
314e8e0
Merge branch 'feature/remove-deprecated-code-types' into feature/sunm…
balos1 Nov 11, 2023
765e947
regen fortran
balos1 Nov 11, 2023
d42fdd7
Update doc/shared/nvectors/NVector_Description.rst
balos1 Nov 11, 2023
8dd9c82
Merge remote-tracking branch 'origin/develop' into feature/remove-dep…
balos1 Nov 12, 2023
52efca3
Merge branch 'feature/remove-deprecated-code' into feature/remove-dep…
balos1 Nov 12, 2023
953f17e
Merge branch 'feature/remove-deprecated-code-types' into feature/sunm…
balos1 Nov 12, 2023
dbb6994
fix some more SUNContext_Create calls
balos1 Nov 12, 2023
45bec60
remove left over debugging print statements
balos1 Nov 12, 2023
8bd2335
use SUN_COMM_NULL
balos1 Nov 13, 2023
8062c1f
doc grammar
balos1 Nov 13, 2023
b59f074
doc fix
balos1 Nov 13, 2023
e7a6e66
need to use types mode for SUN_COMM_NULL
balos1 Nov 13, 2023
6a74d14
fix MPI linking for sunadaptcontroller
balos1 Nov 13, 2023
4228b22
Merge remote-tracking branch 'origin/develop' into feature/remove-dep…
balos1 Nov 13, 2023
6c32318
Merge branch 'feature/remove-deprecated-code-types' into feature/sunm…
balos1 Nov 13, 2023
0e01058
a bad solution to SUN_COMM_NULL fortran mapping
balos1 Nov 13, 2023
b5f1b52
remove unused variable
balos1 Nov 14, 2023
86ad845
possible workaround for MPI in installed examples
balos1 Nov 14, 2023
826594b
fix references to sundials_core_obj
balos1 Nov 14, 2023
6c6462e
add details about linking libsundials_core in docs
balos1 Nov 14, 2023
29e5178
link to core in templates
balos1 Nov 14, 2023
b7468ef
fix doc build
gardner48 Nov 14, 2023
93132b1
Update CHANGELOG.md
balos1 Nov 14, 2023
b59256e
rename sundials_types_old
balos1 Nov 14, 2023
50a90ed
update recent changes
balos1 Nov 14, 2023
bcfc49a
fix tables
gardner48 Nov 14, 2023
28043ea
fix typo
gardner48 Nov 14, 2023
edb4bb0
install sundials_types_deprecated.h
gardner48 Nov 14, 2023
2b16b8c
Apply suggestions for READMEs
balos1 Nov 14, 2023
a779c70
Apply suggestions from code review
balos1 Nov 14, 2023
7baeafe
Update doc/shared/sunmatrix/SUNMatrix_SLUNRloc.rst
balos1 Nov 14, 2023
4e891f7
Update doc/shared/nvectors/NVector_SYCL.rst
balos1 Nov 14, 2023
f0f6260
Merge remote-tracking branch 'origin/feature/remove-deprecated-code-t…
balos1 Nov 14, 2023
32c827b
add mpi to SUNDIALSConfig
balos1 Nov 14, 2023
32e997e
Merge remote-tracking branch 'origin/develop' into feature/sunmpicomm
balos1 Nov 14, 2023
76ad50e
add core lib to xbraid cmake template
balos1 Nov 14, 2023
b2c07d5
fix install doc includes
gardner48 Nov 14, 2023
41bc80e
fix install guide build
gardner48 Nov 14, 2023
819090b
fix IDAS doc build
gardner48 Nov 14, 2023
7d93083
fix Ginkgo matrix include in KINSOL docs
gardner48 Nov 14, 2023
1b24df2
replace NULL with SUN_COMM_NULL
gardner48 Nov 15, 2023
6dab7f6
link cvode fused ops to core
balos1 Nov 15, 2023
7a15da4
link sunmemory to core
balos1 Nov 15, 2023
b680e30
use MPI_Comm where we can
balos1 Nov 15, 2023
581941a
add sundials_core to makefile templates
balos1 Nov 15, 2023
b3a9c0f
Merge branch 'develop' into feature/sunmpicomm
gardner48 Nov 16, 2023
5642da8
fix cmake templates
balos1 Nov 20, 2023
4b07244
Merge remote-tracking branch 'origin/develop' into feature/sunmpicomm
balos1 Nov 20, 2023
86f163e
move core lib to later in link list
balos1 Nov 20, 2023
882eb6a
add mpi paths to config
balos1 Nov 21, 2023
a7c60e5
try MPIEXEC_EXECUTABLE
balos1 Nov 21, 2023
ea352d8
need core lib in second loop
balos1 Nov 21, 2023
e4efcc9
link header defined libraries to core
balos1 Nov 21, 2023
34afa95
remove unused variable
balos1 Nov 21, 2023
c0c5f5e
update docs with info on sundials_core
balos1 Nov 21, 2023
cfd2d46
Update doc/shared/sundials/Install.rst
balos1 Nov 23, 2023
c6931fa
update changelog according to PR comments
balos1 Nov 27, 2023
edb7894
use MPI_C_COMPILER instead of MPIEXEC_EXECUTABLE for finding MPI in S…
balos1 Nov 27, 2023
426fb40
cmake fixes as per commentd
balos1 Nov 27, 2023
faeb30d
more doc fixes based on comments
balos1 Nov 27, 2023
64dc7ce
move cmake code for setting _EXAMPLES_lang_COMPILER variables to exam…
balos1 Nov 27, 2023
8cbd218
quote MPI variables in example templates
balos1 Nov 27, 2023
7034f3e
dont link to sundials_core in kokkos example
balos1 Nov 27, 2023
d6fee47
fix formatting in f90 examples
balos1 Nov 27, 2023
ea5c1bf
add quotes to @_EXAMPLES_CXX_COMPILER@
balos1 Nov 27, 2023
fe04993
move sundials_core in makefile templates
balos1 Nov 27, 2023
ce32b37
formatting
balos1 Nov 27, 2023
529ccfe
make sundials_fcore_mod library and use it instead of object lib
balos1 Nov 27, 2023
c59520e
Fix c2f fortran case
balos1 Nov 27, 2023
d8ef554
fixes in logger and profiler related to freeing comm
balos1 Nov 27, 2023
5dbf04c
remove duplicate swig code
balos1 Nov 27, 2023
d53aaf9
recent change fixes
balos1 Nov 27, 2023
98de540
insert copyright into sundials_types_mod
balos1 Nov 27, 2023
cf80c3b
make suggested change in manyvector
balos1 Nov 27, 2023
718caaa
use cmake 3.18.6 for testing
gardner48 Nov 27, 2023
21d17a8
fix f2003 example templates
balos1 Nov 27, 2023
69cacf8
fix typo
balos1 Nov 27, 2023
e701e91
Update CHANGELOG.md
balos1 Nov 28, 2023
b4894c7
return success instead of an error when pointer is null in destroy fu…
balos1 Nov 28, 2023
4f1b1a8
update docs as requested
balos1 Nov 28, 2023
d402e85
more doc fixes
balos1 Nov 28, 2023
418c725
Merge remote-tracking branch 'origin/feature/sunmpicomm' into feature…
balos1 Nov 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .gitlab/spack_packages/sundials/package.py
Original file line number Diff line number Diff line change
@@ -751,7 +751,6 @@ def initconfig_package_entries(self):
self.cache_option_from_variant("USE_GENERIC_MATH", "generic-math"),
# Logging
self.cache_string_from_variant("SUNDIALS_LOGGING_LEVEL", "logging-level"),
self.cache_option_from_variant("SUNDIALS_LOGGING_ENABLE_MPI", "logging-mpi"),
balos1 marked this conversation as resolved.
Show resolved Hide resolved
# Monitoring
self.cache_option_from_variant("SUNDIALS_BUILD_WITH_MONITORING", "monitoring"),
# Profiling
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -60,9 +60,43 @@ method `ARKODE_VERNER_16_8_9`.
Changed the `SUNProfiler` so that it does not rely on `MPI_WTime` in any case.
This fixes https://github.com/LLNL/sundials/issues/312.

**Breaking change**
We have replaced the use of a type-erased (i.e., `void*`) pointer to a
communicator in place of `MPI_Comm` throughout the SUNDIALS API with a
`SUNComm`, which is just a typedef to an `int` in builds without MPI
and a typedef to a `MPI_Comm` in builds with MPI. Here is what this means:

balos1 marked this conversation as resolved.
Show resolved Hide resolved
- All users will need to update their codes because the call to
`SUNContext_Create` now takes a `SUNComm` instead
of type-erased pointer to a communicator. For non-MPI codes,
pass `SUN_COMM_NULL` to the `comm` argument instead of
`NULL`. For MPI codes, pass the `MPI_Comm` directly.
The required change should be doable with a find-and-replace.

- The same change must be made for calls to
`SUNLogger_Create` or `SUNProfiler_Create`.

- Some users will need to update their calls to `N_VGetCommunicator`, and
update any custom `N_Vector` implementations tht provide
`N_VGetCommunicator`, since it now returns a `SUNComm`.

The change away from type-erased pointers for `SUNComm` fixes problems like the
one described in [GitHub Issue #275](https://github.com/LLNL/sundials/issues/275).

**Breaking change**
The SUNLogger is now always MPI-aware if MPI is enabled in SUNDIALS and the
`SUNDIALS_LOGGING_ENABLE_MPI` CMake option and macro definition were removed
accordingly.

**Breaking change**
Functions, types and header files that were previously deprecated have been
removed.
removed.

**Breaking change**
Users now need to link to `sundials_core` in addition to the libraries already linked to.
balos1 marked this conversation as resolved.
Show resolved Hide resolved
balos1 marked this conversation as resolved.
Show resolved Hide resolved
This will be picked up automatically in projects that use the SUNDIALS CMake target.
The library `sundials_generic` has been superceded by `sundials_core` and is no longer available.
This fixes some duplicate symbol errors on Windows when linking to multiple SUNDIALS libraries.

## Changes to SUNDIALS in release 6.6.1

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
# Initial setup.
# ===============================================================

cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.18)

# Project SUNDIALS (initially only C supported)
# sets PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR variables.
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
MPI_Init(&argc, &argv);

/* Create SUNDIALS context */
SUNContext_Create((void*) &comm, &ctx);
SUNContext_Create(comm, &ctx);

/* Initialize Kokkos */
Kokkos::initialize(argc, argv);
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ int main(int argc, char *argv[])
MPI_Init(&argc, &argv);

/* Create SUNDIALS context */
SUNContext_Create((void*) &comm, &ctx);
SUNContext_Create(comm, &ctx);

/* Create SUNDIALS memory helper */
#if defined(USE_CUDA)
2 changes: 1 addition & 1 deletion benchmarks/diffusion_2D/main_arkode.cpp
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ int main(int argc, char* argv[])
SUNContext ctx = NULL;
SUNProfiler prof = NULL;

flag = SUNContext_Create((void*) &comm, &ctx);
flag = SUNContext_Create(comm, &ctx);
if (check_flag(&flag, "SUNContextCreate", 1)) return 1;

flag = SUNContext_GetProfiler(ctx, &prof);
2 changes: 1 addition & 1 deletion benchmarks/diffusion_2D/main_cvode.cpp
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ int main(int argc, char* argv[])
SUNContext ctx = NULL;
SUNProfiler prof = NULL;

flag = SUNContext_Create((void*) &comm, &ctx);
flag = SUNContext_Create(comm, &ctx);
if (check_flag(&flag, "SUNContextCreate", 1)) return 1;

flag = SUNContext_GetProfiler(ctx, &prof);
2 changes: 1 addition & 1 deletion benchmarks/diffusion_2D/main_ida.cpp
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ int main(int argc, char* argv[])
SUNContext ctx = NULL;
SUNProfiler prof = NULL;

flag = SUNContext_Create((void*) &comm, &ctx);
flag = SUNContext_Create(comm, &ctx);
if (check_flag(&flag, "SUNContextCreate", 1)) return 1;

flag = SUNContext_GetProfiler(ctx, &prof);
2 changes: 1 addition & 1 deletion benchmarks/nvector/cuda/test_nvector_performance_cuda.cu
Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@ int main(int argc, char *argv[])
printf(" number of tests %d \n", ntests);
printf(" timing on/off %d \n", print_timing);

flag = SUNContext_Create(NULL, &ctx);
flag = SUNContext_Create(SUN_COMM_NULL, &ctx);
if (flag) return flag;

/* Create vectors */
2 changes: 1 addition & 1 deletion benchmarks/nvector/hip/test_nvector_performance_hip.cpp
Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@ int main(int argc, char *argv[])
printf(" number of tests %d \n", ntests);
printf(" timing on/off %d \n", print_timing);

flag = SUNContext_Create(NULL, &ctx);
flag = SUNContext_Create(SUN_COMM_NULL, &ctx);
if (flag) return flag;

/* Create vectors */
2 changes: 1 addition & 1 deletion benchmarks/nvector/kokkos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ foreach(backend ${KOKKOS_EXAMPLES_BACKENDS})

sundials_add_nvector_benchmark(test_nvector_performance_kokkos.${backend}
SOURCES test_nvector_performance_kokkos.cpp
SUNDIALS_TARGETS sundials_generic sundials_nveckokkos
SUNDIALS_TARGETS sundials_core sundials_nveckokkos
INSTALL_SUBDIR nvector/kokkos
)

Original file line number Diff line number Diff line change
@@ -116,7 +116,7 @@ int main(int argc, char *argv[])
printf(" number of MPI procs %d \n", nprocs);
}

flag = SUNContext_Create(&comm, &ctx);
flag = SUNContext_Create(comm, &ctx);
if (flag) return flag;

/* Create vectors */
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@ int main(int argc, char *argv[])
printf(" timing on/off %d \n", print_timing);
printf(" number of threads %d \n", nthreads);

flag = SUNContext_Create(NULL, &ctx);
flag = SUNContext_Create(SUN_COMM_NULL, &ctx);
if (flag) return flag;

/* Create vectors */
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
printf(" number of MPI procs %d \n", nprocs);
}

flag = SUNContext_Create(&comm, &ctx);
flag = SUNContext_Create(comm, &ctx);
if (flag) return flag;

/* Create vectors */
Original file line number Diff line number Diff line change
@@ -115,7 +115,7 @@ int main(int argc, char *argv[])
printf(" number of MPI procs %d \n", nprocs);
}

flag = SUNContext_Create(&comm, &ctx);
flag = SUNContext_Create(comm, &ctx);
if (flag) return flag;

/* set partitioning */
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
ierr = PetscInitializeNoArguments();
CHKERRQ(ierr);

if (SUNContext_Create(&comm, &sunctx)) {
if (SUNContext_Create(comm, &sunctx)) {
printf("ERROR: SUNContext_Create returned nonzero\n");
return(-1);
}
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ int main(int argc, char *argv[])
printf(" timing on/off %d \n", print_timing);
printf(" number of threads %d \n", nthreads);

flag = SUNContext_Create(NULL, &ctx);
flag = SUNContext_Create(SUN_COMM_NULL, &ctx);
if (flag) return flag;

/* Create vectors */
Original file line number Diff line number Diff line change
@@ -99,7 +99,7 @@ int main(int argc, char *argv[])
printf(" number of tests %d \n", ntests);
printf(" timing on/off %d \n", print_timing);

flag = SUNContext_Create(NULL, &ctx);
flag = SUNContext_Create(SUN_COMM_NULL, &ctx);
if (flag) return flag;

/* Create vectors */
5 changes: 5 additions & 0 deletions cmake/SUNDIALSConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -55,6 +55,11 @@ endforeach()

### ------- Create TPL imported targets

if("@ENABLE_MPI@" AND NOT TARGET MPI::MPI_C)
set(MPI_C_COMPILER "@MPI_C_COMPILER@")
find_dependency(MPI)
endif()

if("@ENABLE_OPENMP@" AND NOT TARGET OpenMP::OpenMP_C)
find_dependency(OpenMP)
endif()
4 changes: 0 additions & 4 deletions cmake/SundialsBuildOptionsPre.cmake
Original file line number Diff line number Diff line change
@@ -84,10 +84,6 @@ if(SUNDIALS_LOGGING_LEVEL GREATER_EQUAL 3)
message(WARNING "SUNDIALS built with additional logging turned on, performance may be affected.")
endif()

set(DOCSTR "Build SUNDIALS logging with MPI support")
sundials_option(SUNDIALS_LOGGING_ENABLE_MPI BOOL "${DOCSTR}" "OFF"
DEPENDS_ON ENABLE_MPI)

# ---------------------------------------------------------------
# Option to use the generic math libraries
# ---------------------------------------------------------------
2 changes: 1 addition & 1 deletion cmake/SundialsSetupCompilers.cmake
Original file line number Diff line number Diff line change
@@ -414,7 +414,7 @@ endforeach()
# ===============================================================

foreach(lang ${_SUNDIALS_ENABLED_LANGS})
if((SUNDIALS_BUILD_WITH_PROFILING OR SUNDIALS_LOGGING_ENABLE_MPI) AND ENABLE_MPI)
if(ENABLE_MPI)
if(DEFINED MPI_${lang}_COMPILER)
set(_EXAMPLES_${lang}_COMPILER "${MPI_${lang}_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples")
endif()
2 changes: 1 addition & 1 deletion cmake/SundialsSetupCuda.cmake
Original file line number Diff line number Diff line change
@@ -99,7 +99,7 @@ message(STATUS "CUDA Separable Compilation: ${CMAKE_CUDA_SEPARABLE_COMPILATION}"
# Configure compiler for installed examples
# ===============================================================

if((SUNDIALS_BUILD_WITH_PROFILING OR SUNDIALS_LOGGING_ENABLE_MPI) AND ENABLE_MPI)
if(ENABLE_MPI)
set(_EXAMPLES_CUDA_HOST_COMPILER "${MPI_CXX_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples")
else()
set(_EXAMPLES_CUDA_HOST_COMPILER "${CMAKE_CUDA_HOST_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples")
14 changes: 2 additions & 12 deletions cmake/macros/SundialsAddLibrary.cmake
Original file line number Diff line number Diff line change
@@ -201,7 +201,7 @@ macro(sundials_add_library target)
if(${_libtype} MATCHES "STATIC")
target_compile_definitions(${obj_target} PRIVATE SUNDIALS_STATIC_DEFINE)
else()
target_compile_definitions(${obj_target} PRIVATE sundials_generic_EXPORTS)
target_compile_definitions(${obj_target} PRIVATE sundials_core_EXPORTS)
endif()

# add all other compile definitions to object library
@@ -268,16 +268,6 @@ macro(sundials_add_library target)
target_link_libraries(${_actual_target_name} ${sundials_add_library_LINK_LIBRARIES})
endif()

if(SUNDIALS_BUILD_WITH_PROFILING OR SUNDIALS_LOGGING_ENABLE_MPI)
if(ENABLE_MPI AND MPI_C_FOUND)
# Workaround issues with sundials_generic object library dependency on
# MPI not getting propagated when building examples.
# Workaround bug in CMake < 3.17.3 when using MPI::MPI_C and CUDA
target_include_directories(${_actual_target_name} PUBLIC ${MPI_C_INCLUDE_DIRS})
target_link_libraries(${_actual_target_name} PUBLIC ${MPI_C_LIBRARIES})
endif()
endif()

if(SUNDIALS_BUILD_WITH_PROFILING)
balos1 marked this conversation as resolved.
Show resolved Hide resolved
if(ENABLE_CALIPER)
target_link_libraries(${_actual_target_name} PUBLIC caliper)
@@ -306,7 +296,7 @@ macro(sundials_add_library target)
if(${_libtype} MATCHES "STATIC")
target_compile_definitions(${_actual_target_name} PRIVATE SUNDIALS_STATIC_DEFINE)
else()
target_compile_definitions(${obj_target} PRIVATE sundials_generic_EXPORTS)
target_compile_definitions(${obj_target} PRIVATE sundials_core_EXPORTS)
endif()

# add all other compile definitions
35 changes: 34 additions & 1 deletion doc/arkode/guide/source/Introduction.rst
balos1 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -188,9 +188,42 @@ This fixes `GitHub Issue #312 <https://github.com/LLNL/sundials/issues/312>`_.

Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation.

**Breaking change**
We have replaced the use of a type-erased (i.e., ``void*``) pointer to a
communicator in place of ``MPI_Comm`` throughout the SUNDIALS API with a
:c:type:`SUNComm`, which is just a typedef to an ``int`` in builds without MPI
and a typedef to a ``MPI_Comm`` in builds with MPI. Here is what this means:

- All users will need to update their codes because the call to
:c:func:`SUNContext_Create` now takes a :c:type:`SUNComm` instead
of type-erased pointer to a communicator. For non-MPI codes,
pass :c:type:`SUN_COMM_NULL` to the ``comm`` argument instead of
``NULL``. For MPI codes, pass the ``MPI_Comm`` directly.
The required change should be doable with a find-and-replace.

- The same change must be made for calls to
:c:func:`SUNLogger_Create` or :c:func:`SUNProfiler_Create`.

- Some users will need to update their calls to ``N_VGetCommunicator``, and
update any custom ``N_Vector`` implementations tht provide
``N_VGetCommunicator``, since it now returns a ``SUNComm``.

The change away from type-erased pointers for :c:type:`SUNComm` fixes problems like the
one described in `GitHub Issue #275 <https://github.com/LLNL/sundials/issues/275>_`.

**Breaking change**
The SUNLogger is now always MPI-aware if MPI is enabled in SUNDIALS and the
``SUNDIALS_LOGGING_ENABLE_MPI`` CMake option and macro definition were removed
accordingly.

**Breaking change**
Functions, types and header files that were previously deprecated have been
removed.
removed.

**Breaking change**
Users now need to link to ``sundials_core`` in addition to the libraries already linked to.
This will be picked up automatically in projects that use the SUNDIALS CMake target. The library ``sundials_generic`` has been superceded by ``sundials_core`` and is no longer available.
This fixes some duplicate symbol errors on Windows when linking to multiple SUNDIALS libraries.


Changes in v5.6.1
1 change: 0 additions & 1 deletion doc/arkode/guide/source/Usage/General.rst
Original file line number Diff line number Diff line change
@@ -207,4 +207,3 @@ linear solver were performed using the ARKBBDPRE module, the header
initialization routines.


.. include:: ../../../../shared/Types.rst
2 changes: 1 addition & 1 deletion doc/arkode/guide/source/index.rst
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ with support by the `US Department of Energy <http://www.doe.gov>`_,
sunnonlinsol/index.rst
sunadaptcontroller/index.rst
sunmemory/index.rst
Install_link.rst
sundials/Install_link.rst
Constants
Butcher
History_link.rst
13 changes: 13 additions & 0 deletions doc/arkode/guide/source/sundials/Install_link.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. ----------------------------------------------------------------
SUNDIALS Copyright Start
Copyright (c) 2002-2023, Lawrence Livermore National Security
and Southern Methodist University.
All rights reserved.

See the top-level LICENSE and NOTICE files for details.

SPDX-License-Identifier: BSD-3-Clause
SUNDIALS Copyright End
----------------------------------------------------------------

.. include:: ../../../../shared/sundials/Install.rst
Original file line number Diff line number Diff line change
@@ -10,4 +10,4 @@
SUNDIALS Copyright End
----------------------------------------------------------------

.. include:: ../../../shared/Install.rst
.. include:: ../../../../shared/sundials/Types.rst
1 change: 1 addition & 0 deletions doc/arkode/guide/source/sundials/index.rst
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ six packages all leverage some other common infrastructure, which we discuss
in this section.

.. toctree::
Types_link
SUNContext_link
Logging_link
Profiling_link
Loading