From 55c081d6745a22f013f6ae1540ebe6db9eb0a2f2 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Sun, 26 Mar 2023 00:16:23 -0700 Subject: [PATCH 1/2] CI: ADIOS1 Ensure symbol exports are properly set. --- .github/workflows/macos.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d1ab637f3e..9f6616fa9c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -43,16 +43,24 @@ jobs: cmake --build build --parallel 2 ctest --test-dir build --verbose - appleclang12_py: + appleclang12_py_ad1: runs-on: macos-10.15 # next: macOS-11 if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v3 - name: Install + env: {MACOSX_DEPLOYMENT_TARGET: 10.14} run: | set +e python3 -m pip install -U numpy pandas + + curl -Lo adios-1.13.1.tar.gz http://users.nccs.gov/~pnorbert/adios-1.13.1.tar.gz + tar -xzf adios-1.13.1.tar.gz + cd adios-1.13.1/ + CFLAGS="-fPIC" ./configure --enable-static --enable-shared --prefix=/usr/local --without-mpi --disable-fortran + make -j 2 + make install set -e - name: Build env: {CXXFLAGS: -Werror -DTOML11_DISABLE_STD_FILESYSTEM, MACOSX_DEPLOYMENT_TARGET: 10.14} @@ -65,6 +73,7 @@ jobs: -DopenPMD_USE_PYTHON=ON \ -DopenPMD_USE_MPI=OFF \ -DopenPMD_USE_HDF5=OFF \ + -DopenPMD_USE_ADIOS1=ON \ -DopenPMD_USE_ADIOS2=OFF \ -DopenPMD_USE_INVASIVE_TESTS=ON cmake --build build --parallel 2 From 032ebfc3260cb3e85e04d4428c4a480781a07d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Mon, 27 Mar 2023 11:50:02 +0200 Subject: [PATCH 2/2] Include error symbols into ADIOS1 ... but don't rely on catching - Add missing .cpp files to ADIOS1 - Avoid global variables in JSON.cpp --- CMakeLists.txt | 11 ++++++++--- include/openPMD/Error.hpp | 4 ---- include/openPMD/auxiliary/JSON_internal.hpp | 2 +- src/IO/ADIOS/CommonADIOS1IOHandler.cpp | 2 +- src/IO/IOTask.cpp | 2 +- src/auxiliary/JSON.cpp | 7 +++++-- test/SerialIOTest.cpp | 13 +++++++++---- 7 files changed, 25 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b51461005..4567c7c18b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -543,13 +543,21 @@ set(IO_SOURCE src/IO/InvalidatableFile.cpp) set(IO_ADIOS1_SEQUENTIAL_SOURCE src/auxiliary/Filesystem.cpp + src/auxiliary/JSON.cpp + src/IO/AbstractIOHandlerImpl.cpp src/ChunkInfo.cpp + src/Error.cpp + src/IO/IOTask.cpp src/IO/ADIOS/CommonADIOS1IOHandler.cpp src/IO/ADIOS/ADIOS1IOHandler.cpp src/IO/IOTask.cpp) set(IO_ADIOS1_SOURCE src/auxiliary/Filesystem.cpp + src/auxiliary/JSON.cpp + src/IO/AbstractIOHandlerImpl.cpp src/ChunkInfo.cpp + src/Error.cpp + src/IO/IOTask.cpp src/IO/ADIOS/CommonADIOS1IOHandler.cpp src/IO/ADIOS/ParallelADIOS1IOHandler.cpp src/IO/IOTask.cpp) @@ -715,9 +723,6 @@ if(openPMD_HAVE_ADIOS1) target_compile_definitions(openPMD.ADIOS1.Serial PRIVATE openPMD_HAVE_ADIOS1=1) target_compile_definitions(openPMD.ADIOS1.Serial PRIVATE openPMD_HAVE_MPI=0) target_compile_definitions(openPMD.ADIOS1.Serial PRIVATE _NOMPI) # ADIOS header - # This ensures that the ADIOS1 targets don't ever include Error.hpp - # To avoid incompatible error types in weird compile configurations - target_compile_definitions(openPMD.ADIOS1.Serial PRIVATE OPENPMD_ADIOS1_IMPLEMENTATION) if(openPMD_HAVE_MPI) set_target_properties(openPMD.ADIOS1.Parallel PROPERTIES diff --git a/include/openPMD/Error.hpp b/include/openPMD/Error.hpp index 6bbabd1c73..f503dd2294 100644 --- a/include/openPMD/Error.hpp +++ b/include/openPMD/Error.hpp @@ -8,10 +8,6 @@ #include #include -#if defined(OPENPMD_ADIOS1_IMPLEMENTATION) -static_assert(false, "ADIOS1 implementation must not include Error.hpp"); -#endif - namespace openPMD { /** diff --git a/include/openPMD/auxiliary/JSON_internal.hpp b/include/openPMD/auxiliary/JSON_internal.hpp index e865ddc7de..299cd6987c 100644 --- a/include/openPMD/auxiliary/JSON_internal.hpp +++ b/include/openPMD/auxiliary/JSON_internal.hpp @@ -231,7 +231,7 @@ namespace json * Vector containing the lower-case keys to the single backends' * configurations. */ - extern std::vector backendKeys; + extern std::vector backendKeys(); /** * Function that can be called after reading all global options from the diff --git a/src/IO/ADIOS/CommonADIOS1IOHandler.cpp b/src/IO/ADIOS/CommonADIOS1IOHandler.cpp index f15ab0fdd4..98e14f020c 100644 --- a/src/IO/ADIOS/CommonADIOS1IOHandler.cpp +++ b/src/IO/ADIOS/CommonADIOS1IOHandler.cpp @@ -20,7 +20,7 @@ */ #include "openPMD/IO/ADIOS/CommonADIOS1IOHandler.hpp" -#include "openPMD/ThrowError.hpp" +#include "openPMD/Error.hpp" #if openPMD_HAVE_ADIOS1 diff --git a/src/IO/IOTask.cpp b/src/IO/IOTask.cpp index 0b43cc3835..e6ff0be887 100644 --- a/src/IO/IOTask.cpp +++ b/src/IO/IOTask.cpp @@ -50,7 +50,7 @@ void Parameter::warnUnusedParameters< auto shadow = config.invertShadow(); // The backends are supposed to deal with this // Only global options here - for (auto const &backendKey : json::backendKeys) + for (auto const &backendKey : json::backendKeys()) { if (backendKey != currentBackendName) { diff --git a/src/auxiliary/JSON.cpp b/src/auxiliary/JSON.cpp index 9cfe6539fa..f57cf7455a 100644 --- a/src/auxiliary/JSON.cpp +++ b/src/auxiliary/JSON.cpp @@ -499,14 +499,17 @@ std::optional asLowerCaseStringDynamic(nlohmann::json const &value) return maybeString; } -std::vector backendKeys{"adios1", "adios2", "json", "hdf5"}; +std::vector backendKeys() +{ + return {"adios1", "adios2", "json", "hdf5"}; +} void warnGlobalUnusedOptions(TracingJSON const &config) { auto shadow = config.invertShadow(); // The backends are supposed to deal with this // Only global options here - for (auto const &backendKey : json::backendKeys) + for (auto const &backendKey : json::backendKeys()) { shadow.erase(backendKey); } diff --git a/test/SerialIOTest.cpp b/test/SerialIOTest.cpp index e1296d4a89..9dda38cd4a 100644 --- a/test/SerialIOTest.cpp +++ b/test/SerialIOTest.cpp @@ -6564,10 +6564,15 @@ TEST_CASE("unfinished_iteration_test", "[serial]") "bp", IterationEncoding::fileBased, R"({"backend": "adios2"})"); #endif #if openPMD_HAVE_ADIOS1 - unfinished_iteration_test( - "adios1.bp", IterationEncoding::groupBased, R"({"backend": "adios1"})"); - unfinished_iteration_test( - "adios1.bp", IterationEncoding::fileBased, R"({"backend": "adios1"})"); + /* + * Catching errors from ADIOS1 is not generally supported + */ + // unfinished_iteration_test( + // "adios1.bp", IterationEncoding::groupBased, R"({"backend": + // "adios1"})"); + // unfinished_iteration_test( + // "adios1.bp", IterationEncoding::fileBased, R"({"backend": + // "adios1"})"); #endif #if openPMD_HAVE_HDF5 unfinished_iteration_test("h5", IterationEncoding::groupBased);