Skip to content

Commit

Permalink
Merge pull request #2905 from boutproject/adios2-name
Browse files Browse the repository at this point in the history
Prefer ADIOS2 over ADIOS in more cases
  • Loading branch information
ZedThree committed Apr 24, 2024
2 parents 1d52b38 + 0589919 commit 1de2dfb
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
is_cron:
- ${{ github.event_name == 'cron' }}
config:
- name: "CMake, PETSc unreleased, ADIOS"
- name: "CMake, PETSc unreleased, ADIOS2"
os: ubuntu-20.04
cmake_options: "-DBUILD_SHARED_LIBS=ON
-DBOUT_ENABLE_METRIC_3D=ON
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ message("
SUNDIALS support : ${BOUT_HAS_SUNDIALS}
HYPRE support : ${BOUT_HAS_HYPRE}
NetCDF support : ${BOUT_HAS_NETCDF}
ADIOS support : ${BOUT_HAS_ADIOS}
ADIOS2 support : ${BOUT_HAS_ADIOS2}
FFTW support : ${BOUT_HAS_FFTW}
LAPACK support : ${BOUT_HAS_LAPACK}
OpenMP support : ${BOUT_USE_OPENMP}
Expand Down
24 changes: 12 additions & 12 deletions bin/bout-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ idlpath="@IDLCONFIGPATH@"
pythonpath="@PYTHONCONFIGPATH@"

has_netcdf="@BOUT_HAS_NETCDF@"
has_adios="@BOUT_HAS_ADIOS@"
has_adios2="@BOUT_HAS_ADIOS2@"
has_legacy_netcdf="@BOUT_HAS_LEGACY_NETCDF@"
has_pnetcdf="@BOUT_HAS_PNETCDF@"
has_pvode="@BOUT_HAS_PVODE@"
Expand Down Expand Up @@ -71,18 +71,18 @@ Available values for OPTION include:
--idl IDL path
--python Python path
--has-netcdf NetCDF file support
--has-adios ADIOS file support
--has-netcdf NetCDF file support
--has-adios2 ADIOS2 file support
--has-legacy-netcdf Legacy NetCDF file support
--has-pnetcdf Parallel NetCDF file support
--has-pvode PVODE solver support
--has-cvode SUNDIALS CVODE solver support
--has-ida SUNDIALS IDA solver support
--has-lapack LAPACK support
--has-petsc PETSc support
--has-hypre Hypre support
--has-slepc SLEPc support
--has-nls Natural Language Support
--has-pnetcdf Parallel NetCDF file support
--has-pvode PVODE solver support
--has-cvode SUNDIALS CVODE solver support
--has-ida SUNDIALS IDA solver support
--has-lapack LAPACK support
--has-petsc PETSc support
--has-hypre Hypre support
--has-slepc SLEPc support
--has-nls Natural Language Support
--petsc-has-sundials
Expand Down
2 changes: 1 addition & 1 deletion bout++Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set(BOUT_USE_METRIC_3D @BOUT_USE_METRIC_3D@)

set(BOUT_HAS_PVODE @BOUT_HAS_PVODE@)
set(BOUT_HAS_NETCDF @BOUT_HAS_NETCDF@)
set(BOUT_HAS_ADIOS @BOUT_HAS_ADIOS@)
set(BOUT_HAS_ADIOS2 @BOUT_HAS_ADIOS2@)
set(BOUT_HAS_FFTW @BOUT_HAS_FFTW@)
set(BOUT_HAS_LAPACK @BOUT_HAS_LAPACK@)
set(BOUT_HAS_PETSC @BOUT_HAS_PETSC@)
Expand Down
14 changes: 7 additions & 7 deletions cmake/SetupBOUTThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ endif()
message(STATUS "NetCDF support: ${BOUT_USE_NETCDF}")
set(BOUT_HAS_NETCDF ${BOUT_USE_NETCDF})

option(BOUT_USE_ADIOS "Enable support for ADIOS output" ON)
option(BOUT_DOWNLOAD_ADIOS "Download and build ADIOS2" OFF)
if (BOUT_USE_ADIOS)
if (BOUT_DOWNLOAD_ADIOS)
option(BOUT_USE_ADIOS2 "Enable support for ADIOS output" ON)
option(BOUT_DOWNLOAD_ADIOS2 "Download and build ADIOS2" OFF)
if (BOUT_USE_ADIOS2)
if (BOUT_DOWNLOAD_ADIOS2)
message(STATUS "Downloading and configuring ADIOS2")
include(FetchContent)
FetchContent_Declare(
Expand All @@ -220,12 +220,12 @@ if (BOUT_USE_ADIOS)
find_package(MPI REQUIRED COMPONENTS C)
target_link_libraries(bout++ PUBLIC adios2::cxx11_mpi MPI::MPI_C)
else()
set(BOUT_USE_ADIOS OFF)
set(BOUT_USE_ADIOS2 OFF)
endif()
endif()
endif()
message(STATUS "ADIOS support: ${BOUT_USE_ADIOS}")
set(BOUT_HAS_ADIOS ${BOUT_USE_ADIOS})
message(STATUS "ADIOS2 support: ${BOUT_USE_ADIOS2}")
set(BOUT_HAS_ADIOS2 ${BOUT_USE_ADIOS2})


option(BOUT_USE_FFTW "Enable support for FFTW" ON)
Expand Down
2 changes: 1 addition & 1 deletion cmake_build_defines.hxx.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#cmakedefine01 BOUT_HAS_IDA
#cmakedefine01 BOUT_HAS_LAPACK
#cmakedefine01 BOUT_HAS_NETCDF
#cmakedefine01 BOUT_HAS_ADIOS
#cmakedefine01 BOUT_HAS_ADIOS2
#cmakedefine01 BOUT_HAS_PETSC
#cmakedefine01 BOUT_HAS_PRETTY_FUNCTION
#cmakedefine01 BOUT_HAS_PVODE
Expand Down
4 changes: 2 additions & 2 deletions include/bout/adios_object.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "bout/build_config.hxx"

#if BOUT_HAS_ADIOS
#if BOUT_HAS_ADIOS2

#include <adios2.h>
#include <memory>
Expand Down Expand Up @@ -79,5 +79,5 @@ void ADIOSSetParameters(const std::string& input, const char delimKeyValue,

} // namespace bout

#endif //BOUT_HAS_ADIOS
#endif //BOUT_HAS_ADIOS2
#endif //ADIOS_OBJECT_HXX
2 changes: 1 addition & 1 deletion include/bout/build_config.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ constexpr auto has_gettext = static_cast<bool>(BOUT_HAS_GETTEXT);
constexpr auto has_lapack = static_cast<bool>(BOUT_HAS_LAPACK);
constexpr auto has_legacy_netcdf = static_cast<bool>(BOUT_HAS_LEGACY_NETCDF);
constexpr auto has_netcdf = static_cast<bool>(BOUT_HAS_NETCDF);
constexpr auto has_adios = static_cast<bool>(BOUT_HAS_ADIOS);
constexpr auto has_adios2 = static_cast<bool>(BOUT_HAS_ADIOS2);
constexpr auto has_petsc = static_cast<bool>(BOUT_HAS_PETSC);
constexpr auto has_hypre = static_cast<bool>(BOUT_HAS_HYPRE);
constexpr auto has_umpire = static_cast<bool>(BOUT_HAS_UMPIRE);
Expand Down
2 changes: 1 addition & 1 deletion include/bout/options_io.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public:
static constexpr auto default_type =
#if BOUT_HAS_NETCDF
"netcdf";
#elif BOUT_HAS_ADIOS
#elif BOUT_HAS_ADIOS2
"adios";
#else
"invalid";
Expand Down
6 changes: 3 additions & 3 deletions manual/sphinx/user_docs/adios2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ Installation
The easiest way to configure BOUT++ with ADIOS2 is to tell CMake to download and build it
with this flag::

-DBOUT_DOWNLOAD_ADIOS=ON
-DBOUT_DOWNLOAD_ADIOS2=ON

The ``master`` branch will be downloaded from `Github <https://github.com/ornladios/ADIOS2>`_,
configured and built with BOUT++.

Alternatively, if ADIOS is already installed then the following flags can be used::
Alternatively, if ADIOS2 is already installed then the following flags can be used::

-DBOUT_USE_ADIOS=ON -DADIOS2_ROOT=/path/to/adios2
-DBOUT_USE_ADIOS2=ON -DADIOS2_ROOT=/path/to/adios2

Output files
------------
Expand Down
2 changes: 1 addition & 1 deletion manual/sphinx/user_docs/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ For SUNDIALS, use ``-DBOUT_DOWNLOAD_SUNDIALS=ON``. If using ``ccmake`` this opti
may not appear initially. This automatically sets ``BOUT_USE_SUNDIALS=ON``, and
configures SUNDIALS to use MPI.

For ADIOS2, use ``-DBOUT_DOWNLOAD_ADIOS=ON``. This will download and
For ADIOS2, use ``-DBOUT_DOWNLOAD_ADIOS2=ON``. This will download and
configure `ADIOS2 <https://adios2.readthedocs.io/>`_, enabling BOUT++
to read and write this high-performance parallel file format.

Expand Down
10 changes: 5 additions & 5 deletions src/bout++.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const char DEFAULT_DIR[] = "data";
#include "bout/bout.hxx"
#undef BOUT_NO_USING_NAMESPACE_BOUTGLOBALS

#if BOUT_HAS_ADIOS
#if BOUT_HAS_ADIOS2
#include "bout/adios_object.hxx"
#endif

Expand Down Expand Up @@ -165,7 +165,7 @@ int BoutInitialise(int& argc, char**& argv) {

savePIDtoFile(args.data_dir, MYPE);

#if BOUT_HAS_ADIOS
#if BOUT_HAS_ADIOS2
bout::ADIOSInit(BoutComm::get());
#endif

Expand Down Expand Up @@ -572,7 +572,7 @@ void printCompileTimeOptions() {
constexpr auto netcdf_flavour =
has_netcdf ? (has_legacy_netcdf ? " (Legacy)" : " (NetCDF4)") : "";
output_info.write(_("\tNetCDF support {}{}\n"), is_enabled(has_netcdf), netcdf_flavour);
output_info.write(_("\tADIOS support {}\n"), is_enabled(has_adios));
output_info.write(_("\tADIOS2 support {}\n"), is_enabled(has_adios2));
output_info.write(_("\tPETSc support {}\n"), is_enabled(has_petsc));
output_info.write(_("\tPretty function name support {}\n"),
is_enabled(has_pretty_function));
Expand Down Expand Up @@ -698,7 +698,7 @@ void addBuildFlagsToOptions(Options& options) {
options["has_gettext"].force(bout::build::has_gettext);
options["has_lapack"].force(bout::build::has_lapack);
options["has_netcdf"].force(bout::build::has_netcdf);
options["has_adios"].force(bout::build::has_adios);
options["has_adios2"].force(bout::build::has_adios2);
options["has_petsc"].force(bout::build::has_petsc);
options["has_hypre"].force(bout::build::has_hypre);
options["has_umpire"].force(bout::build::has_umpire);
Expand Down Expand Up @@ -795,7 +795,7 @@ int BoutFinalise(bool write_settings) {
// Call HYPER_Finalize if not already called
bout::HypreLib::cleanup();

#if BOUT_HAS_ADIOS
#if BOUT_HAS_ADIOS2
bout::ADIOSFinalize();
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/sys/adios_object.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "bout/build_config.hxx"

#if BOUT_HAS_ADIOS
#if BOUT_HAS_ADIOS2

#include "bout/adios_object.hxx"
#include "bout/boutexception.hxx"
Expand Down Expand Up @@ -95,4 +95,4 @@ void ADIOSSetParameters(const std::string& input, const char delimKeyValue,
}

} // namespace bout
#endif //BOUT_HAS_ADIOS
#endif //BOUT_HAS_ADIOS2
4 changes: 2 additions & 2 deletions src/sys/options/options_adios.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "bout/build_config.hxx"

#if BOUT_HAS_ADIOS
#if BOUT_HAS_ADIOS2

#include "options_adios.hxx"
#include "bout/adios_object.hxx"
Expand Down Expand Up @@ -628,4 +628,4 @@ void OptionsADIOS::write(const Options& options, const std::string& time_dim) {

} // namespace bout

#endif // BOUT_HAS_ADIOS
#endif // BOUT_HAS_ADIOS2
4 changes: 2 additions & 2 deletions src/sys/options/options_adios.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "bout/options.hxx"
#include "bout/options_io.hxx"

#if !BOUT_HAS_ADIOS
#if !BOUT_HAS_ADIOS2

namespace {
bout::RegisterUnavailableOptionsIO
Expand Down Expand Up @@ -79,5 +79,5 @@ RegisterOptionsIO<OptionsADIOS> registeroptionsadios("adios");

} // namespace bout

#endif // BOUT_HAS_ADIOS
#endif // BOUT_HAS_ADIOS2
#endif // OPTIONS_ADIOS_H
2 changes: 1 addition & 1 deletion tests/integrated/test-options-adios/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ bout_add_integrated_test(test-options-adios
SOURCES test-options-adios.cxx
USE_RUNTEST
USE_DATA_BOUT_INP
REQUIRES BOUT_HAS_ADIOS
REQUIRES BOUT_HAS_ADIOS2
)
2 changes: 1 addition & 1 deletion tests/integrated/test-options-adios/runtest
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ assert result["int"] == 42
assert math.isclose(result["real"], 3.1415)
assert result["string"] == "hello"

print("Checking saved ADIOS test-out file -- Not implemented")
print("Checking saved ADIOS2 test-out file -- Not implemented")

# Check the output NetCDF file
# with DataFile("test-out.nc") as f:
Expand Down

0 comments on commit 1de2dfb

Please sign in to comment.