Skip to content

Commit a6f5131

Browse files
ax3lfranzpoeschel
andauthored
ADIOS1 on macOS (#1396)
* CI: ADIOS1 Ensure symbol exports are properly set. * Include error symbols into ADIOS1 ... but don't rely on catching - Add missing .cpp files to ADIOS1 - Avoid global variables in JSON.cpp --------- Co-authored-by: Franz Pöschel <franz.poeschel@gmail.com>
1 parent 7813b6f commit a6f5131

File tree

8 files changed

+35
-17
lines changed

8 files changed

+35
-17
lines changed

.github/workflows/macos.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,24 @@ jobs:
4343
cmake --build build --parallel 2
4444
ctest --test-dir build --verbose
4545
46-
appleclang12_py:
46+
appleclang12_py_ad1:
4747
runs-on: macos-10.15
4848
# next: macOS-11
4949
if: github.event.pull_request.draft == false
5050
steps:
5151
- uses: actions/checkout@v3
5252
- name: Install
53+
env: {MACOSX_DEPLOYMENT_TARGET: 10.14}
5354
run: |
5455
set +e
5556
python3 -m pip install -U numpy pandas
57+
58+
curl -Lo adios-1.13.1.tar.gz http://users.nccs.gov/~pnorbert/adios-1.13.1.tar.gz
59+
tar -xzf adios-1.13.1.tar.gz
60+
cd adios-1.13.1/
61+
CFLAGS="-fPIC" ./configure --enable-static --enable-shared --prefix=/usr/local --without-mpi --disable-fortran
62+
make -j 2
63+
make install
5664
set -e
5765
- name: Build
5866
env: {CXXFLAGS: -Werror -DTOML11_DISABLE_STD_FILESYSTEM, MACOSX_DEPLOYMENT_TARGET: 10.14}
@@ -65,6 +73,7 @@ jobs:
6573
-DopenPMD_USE_PYTHON=ON \
6674
-DopenPMD_USE_MPI=OFF \
6775
-DopenPMD_USE_HDF5=OFF \
76+
-DopenPMD_USE_ADIOS1=ON \
6877
-DopenPMD_USE_ADIOS2=OFF \
6978
-DopenPMD_USE_INVASIVE_TESTS=ON
7079
cmake --build build --parallel 2

CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,13 +543,21 @@ set(IO_SOURCE
543543
src/IO/InvalidatableFile.cpp)
544544
set(IO_ADIOS1_SEQUENTIAL_SOURCE
545545
src/auxiliary/Filesystem.cpp
546+
src/auxiliary/JSON.cpp
547+
src/IO/AbstractIOHandlerImpl.cpp
546548
src/ChunkInfo.cpp
549+
src/Error.cpp
550+
src/IO/IOTask.cpp
547551
src/IO/ADIOS/CommonADIOS1IOHandler.cpp
548552
src/IO/ADIOS/ADIOS1IOHandler.cpp
549553
src/IO/IOTask.cpp)
550554
set(IO_ADIOS1_SOURCE
551555
src/auxiliary/Filesystem.cpp
556+
src/auxiliary/JSON.cpp
557+
src/IO/AbstractIOHandlerImpl.cpp
552558
src/ChunkInfo.cpp
559+
src/Error.cpp
560+
src/IO/IOTask.cpp
553561
src/IO/ADIOS/CommonADIOS1IOHandler.cpp
554562
src/IO/ADIOS/ParallelADIOS1IOHandler.cpp
555563
src/IO/IOTask.cpp)
@@ -715,9 +723,6 @@ if(openPMD_HAVE_ADIOS1)
715723
target_compile_definitions(openPMD.ADIOS1.Serial PRIVATE openPMD_HAVE_ADIOS1=1)
716724
target_compile_definitions(openPMD.ADIOS1.Serial PRIVATE openPMD_HAVE_MPI=0)
717725
target_compile_definitions(openPMD.ADIOS1.Serial PRIVATE _NOMPI) # ADIOS header
718-
# This ensures that the ADIOS1 targets don't ever include Error.hpp
719-
# To avoid incompatible error types in weird compile configurations
720-
target_compile_definitions(openPMD.ADIOS1.Serial PRIVATE OPENPMD_ADIOS1_IMPLEMENTATION)
721726

722727
if(openPMD_HAVE_MPI)
723728
set_target_properties(openPMD.ADIOS1.Parallel PROPERTIES

include/openPMD/Error.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
#include <utility>
99
#include <vector>
1010

11-
#if defined(OPENPMD_ADIOS1_IMPLEMENTATION)
12-
static_assert(false, "ADIOS1 implementation must not include Error.hpp");
13-
#endif
14-
1511
namespace openPMD
1612
{
1713
/**

include/openPMD/auxiliary/JSON_internal.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ namespace json
231231
* Vector containing the lower-case keys to the single backends'
232232
* configurations.
233233
*/
234-
extern std::vector<std::string> backendKeys;
234+
extern std::vector<std::string> backendKeys();
235235

236236
/**
237237
* Function that can be called after reading all global options from the

src/IO/ADIOS/CommonADIOS1IOHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121

2222
#include "openPMD/IO/ADIOS/CommonADIOS1IOHandler.hpp"
23-
#include "openPMD/ThrowError.hpp"
23+
#include "openPMD/Error.hpp"
2424

2525
#if openPMD_HAVE_ADIOS1
2626

src/IO/IOTask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void Parameter<Operation::CREATE_DATASET>::warnUnusedParameters<
5050
auto shadow = config.invertShadow();
5151
// The backends are supposed to deal with this
5252
// Only global options here
53-
for (auto const &backendKey : json::backendKeys)
53+
for (auto const &backendKey : json::backendKeys())
5454
{
5555
if (backendKey != currentBackendName)
5656
{

src/auxiliary/JSON.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,14 +499,17 @@ std::optional<std::string> asLowerCaseStringDynamic(nlohmann::json const &value)
499499
return maybeString;
500500
}
501501

502-
std::vector<std::string> backendKeys{"adios1", "adios2", "json", "hdf5"};
502+
std::vector<std::string> backendKeys()
503+
{
504+
return {"adios1", "adios2", "json", "hdf5"};
505+
}
503506

504507
void warnGlobalUnusedOptions(TracingJSON const &config)
505508
{
506509
auto shadow = config.invertShadow();
507510
// The backends are supposed to deal with this
508511
// Only global options here
509-
for (auto const &backendKey : json::backendKeys)
512+
for (auto const &backendKey : json::backendKeys())
510513
{
511514
shadow.erase(backendKey);
512515
}

test/SerialIOTest.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6564,10 +6564,15 @@ TEST_CASE("unfinished_iteration_test", "[serial]")
65646564
"bp", IterationEncoding::fileBased, R"({"backend": "adios2"})");
65656565
#endif
65666566
#if openPMD_HAVE_ADIOS1
6567-
unfinished_iteration_test(
6568-
"adios1.bp", IterationEncoding::groupBased, R"({"backend": "adios1"})");
6569-
unfinished_iteration_test(
6570-
"adios1.bp", IterationEncoding::fileBased, R"({"backend": "adios1"})");
6567+
/*
6568+
* Catching errors from ADIOS1 is not generally supported
6569+
*/
6570+
// unfinished_iteration_test(
6571+
// "adios1.bp", IterationEncoding::groupBased, R"({"backend":
6572+
// "adios1"})");
6573+
// unfinished_iteration_test(
6574+
// "adios1.bp", IterationEncoding::fileBased, R"({"backend":
6575+
// "adios1"})");
65716576
#endif
65726577
#if openPMD_HAVE_HDF5
65736578
unfinished_iteration_test("h5", IterationEncoding::groupBased);

0 commit comments

Comments
 (0)