Skip to content

Commit 969b430

Browse files
ax3lfranzpoeschel
andauthored
ADIOS2: v2.7.0+ (#927)
* ADIOS2: v2.7.0+ Increase ADIOS2 dependency to v2.7.0+ * CI: Newer Spack Version This one does not yet have E4S caches, so build times might go up a bit. * [Draft] Remove Work-Arounds for ADIOS2<2.7.0 * Activate ADIOS2 SSC test * Update some comments on ADIOS2 workarounds * Only run SSC tests if ADIOS2 has been built with SSC To do this, add .ssc as a possible file ending and enlist it under the file endings. * Activate tests for new ADIOS2 schema on MSVC This also fixes broken array placement new in MSVC * Update documentation in adios2.rst Co-authored-by: Franz Pöschel <franz.poeschel@gmail.com>
1 parent 9b349eb commit 969b430

19 files changed

Lines changed: 122 additions & 67 deletions

File tree

.github/workflows/dependencies/install_spack

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@
33

44
set -eu -o pipefail
55

6-
spack_ver="0.16.0"
6+
spack_ver="2b6f896ca744081a38579573a52824bf334fb54b"
77

88
cd /opt
9+
if [[ -d spack && ! -f spack_${spack_ver} ]]
10+
then
11+
rm -rf spack /usr/bin/spack $HOME/.spack/
12+
fi
913
if [ ! -d spack ]
1014
then
1115
# download
12-
curl -sOL https://github.com/spack/spack/archive/v${spack_ver}.tar.gz
13-
tar -xf v${spack_ver}.tar.gz && rm v${spack_ver}.tar.gz
16+
curl -sOL https://github.com/spack/spack/archive/${spack_ver}.tar.gz
17+
tar -xf ${spack_ver}.tar.gz && rm ${spack_ver}.tar.gz
1418
mv spack-${spack_ver} spack
19+
touch spack_${spack_ver}
1520
fi
1621

1722
# install

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Bug Fixes
2323
Other
2424
"""""
2525

26+
- ADIOS2: require version 2.7.0+ #927
27+
2628

2729
0.13.2
2830
------

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,14 @@ endif()
273273

274274
# external library: ADIOS2 (optional)
275275
if(openPMD_USE_ADIOS2 STREQUAL AUTO)
276-
find_package(ADIOS2 2.6.0 CONFIG)
276+
find_package(ADIOS2 2.7.0 CONFIG)
277277
if(ADIOS2_FOUND)
278278
set(openPMD_HAVE_ADIOS2 TRUE)
279279
else()
280280
set(openPMD_HAVE_ADIOS2 FALSE)
281281
endif()
282282
elseif(openPMD_USE_ADIOS2)
283-
find_package(ADIOS2 2.6.0 REQUIRED CONFIG)
283+
find_package(ADIOS2 2.7.0 REQUIRED CONFIG)
284284
set(openPMD_HAVE_ADIOS2 TRUE)
285285
else()
286286
set(openPMD_HAVE_ADIOS2 FALSE)

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ RUN curl -sLo adios-1.13.1.tar.gz http://users.nccs.gov/~pnorbert/adios-1
6565
&& make \
6666
&& make install
6767

68-
RUN curl -sLo adios2-2.6.0.tar.gz https://github.com/ornladios/ADIOS2/archive/v2.6.0.tar.gz \
68+
RUN curl -sLo adios2-2.7.1.tar.gz https://github.com/ornladios/ADIOS2/archive/v2.7.1.tar.gz \
6969
&& file adios2*.tar.gz \
7070
&& tar -xzf adios2*.tar.gz \
7171
&& rm adios2*.tar.gz \

NEWS.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
Upgrade Guide
44
=============
55

6+
0.14.0
7+
------
8+
9+
ADIOS 2.7.0 is now the minimally supported version for ADIOS2 support.
10+
11+
612
0.13.0
713
------
814

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ I/O backends:
112112
* [JSON](https://en.wikipedia.org/wiki/JSON)
113113
* [HDF5](https://support.hdfgroup.org/HDF5) 1.8.13+ (optional)
114114
* [ADIOS1](https://www.olcf.ornl.gov/center-projects/adios) 1.13.1+ (optional)
115-
* [ADIOS2](https://github.com/ornladios/ADIOS2) 2.6.0+ (optional)
115+
* [ADIOS2](https://github.com/ornladios/ADIOS2) 2.7.0+ (optional)
116116

117117
while those can be built either with or without:
118118
* MPI 2.1+, e.g. OpenMPI 1.6.5+ or MPICH2

docs/source/backends/adios2.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ Steps
2222

2323
ADIOS2 is optimized towards organizing the process of reading/writing data into IO steps.
2424
In order to activate steps, it is imperative to use the :ref:`Streaming API <usage-streaming>` (which can be used for either file-based or streaming-based workflows).
25-
With ADIOS2 release 2.6.0 containing a bug (fixed in development versions, see `PR #2348 <https://github.com/ornladios/ADIOS2/pull/2348>`_) that disallows random-accessing steps in file-based engines, step-based processing must currently be opted in to via use of the :ref:`JSON parameter<backendconfig>` ``adios2.engine.usesteps = true`` when using a file-based engine such as BP3 or BP4.
26-
With these ADIOS2 releases, files written in such a way may only be read using the streaming API.
25+
26+
ADIOS2 release 2.6.0 contained a bug (fixed in ADIOS 2.7.0, see `PR #2348 <https://github.com/ornladios/ADIOS2/pull/2348>`_) that disallows random-accessing steps in file-based engines.
27+
With this ADIOS2 release, files written with steps may only be read using the streaming API.
28+
In order to keep compatibility with older codes reading ADIOS2 files, step-based processing must currently be opted in to via use of the :ref:`JSON parameter<backendconfig>` ``adios2.engine.usesteps = true`` when using a file-based engine such as BP3 or BP4.
29+
2730
Upon reading a file, the ADIOS2 backend will automatically recognize whether it has been written with or without steps, ignoring the JSON option mentioned above.
2831
Steps are mandatory for streaming-based engines and trying to switch them off will result in a runtime error.
2932

docs/source/dev/dependencies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Optional: I/O backends
2828
* `JSON <https://en.wikipedia.org/wiki/JSON>`_
2929
* `HDF5 <https://support.hdfgroup.org/HDF5>`_ 1.8.13+
3030
* `ADIOS1 <https://www.olcf.ornl.gov/center-projects/adios>`_ 1.13.1+
31-
* `ADIOS2 <https://github.com/ornladios/ADIOS2>`_ 2.6.0+
31+
* `ADIOS2 <https://github.com/ornladios/ADIOS2>`_ 2.7.0+
3232

3333
while those can be build either with or without:
3434

include/openPMD/IO/ADIOS/ADIOS2IOHandler.hpp

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,10 +1127,13 @@ namespace detail
11271127
* step are shown which hinders parsing. So, until a step is
11281128
* explicitly opened via ADIOS2IOHandlerImpl::advance, do not open
11291129
* one.
1130-
* (This is a workaround for the fact that attributes
1131-
* are not associated with steps in ADIOS -- seeing all attributes
1132-
* from all steps in file-based engines, but only the current
1133-
* variables breaks parsing otherwise.)
1130+
* This is to enable use of ADIOS files without the Streaming API
1131+
* (i.e. all iterations should be visible to the user upon opening
1132+
* the Series.)
1133+
* @todo Add a workflow without up-front parsing of all iterations
1134+
* for file-based engines.
1135+
* (This would merely be an optimization since the streaming
1136+
* API still works with files as intended.)
11341137
*
11351138
*/
11361139
enum class StreamStatus
@@ -1155,23 +1158,40 @@ namespace detail
11551158
* API. This is due to the fact that ADIOS2.6.0 requires using
11561159
* steps to read BP4 files written with steps, so using steps
11571160
* is opt-in for now.
1161+
* Notice that while the openPMD API requires ADIOS >= 2.7.0,
1162+
* the resulting files need to be readable from ADIOS 2.6.0 as
1163+
* well. This workaround is hence staying until switching to
1164+
* a new ADIOS schema.
11581165
* 2) Reading with the Streaming API any file that has been written
1159-
* without steps.
1166+
* without steps. This is not a workaround since not using steps,
1167+
* while inefficient in ADIOS2, is something that we support.
11601168
*/
11611169
NoStream,
11621170
/**
1163-
* Necessary workaround under the following circumstances:
1164-
* 1) Using ADIOS2.6.0
1165-
* 2) Using attribute-based layout
1166-
* 3) Reading from a file-based engine a Series written with steps
1167-
* Up until ADIOS2.6.0, attributes are not associated with ADIOS
1168-
* steps in file-based engines. As a consequence, parsing one
1169-
* ADIOS step will show only the variables of that step, but the
1170-
* attributes of all steps which breaks our parsing logic.
1171-
* Workaround: If parsing before opening any step, all variables
1172-
* and attributes in the file will be shown.
1173-
* Hence, streamStatus == Parsing means that the first step has yet
1174-
* to be opened.
1171+
* Rationale behind this state:
1172+
* When user code opens a Series, series.iterations should contain
1173+
* all available iterations.
1174+
* If accessing a file without opening a step, ADIOS2 will grant
1175+
* access to variables and attributes from all steps, allowing us
1176+
* to parse the complete dump.
1177+
* This state indicates that no step should be opened for parsing
1178+
* purposes (which is necessary in streaming engines, hence they
1179+
* are initialized with the OutsideOfStep state).
1180+
* A step should only be opened if an explicit ADVANCE task arrives
1181+
* at the backend.
1182+
*
1183+
* @todo If the streaming API is used on files, parsing the whole
1184+
* Series up front is unnecessary work.
1185+
* Our frontend does not yet allow to distinguish whether
1186+
* parsing the whole series will be necessary since parsing
1187+
* happens upon construction time of Series,
1188+
* but the classical and the streaming API are both activated
1189+
* afterwards from the created Series object.
1190+
* Hence, improving this requires refactoring in our
1191+
* user-facing API. Ideas:
1192+
* (1) Delayed lazy parsing of iterations upon accessing
1193+
* (would bring other benefits also).
1194+
* (2) Introduce a restricted class StreamingSeries.
11751195
*/
11761196
Parsing,
11771197
/**

include/openPMD/IO/Format.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ namespace openPMD
3333
ADIOS1,
3434
ADIOS2,
3535
ADIOS2_SST,
36+
ADIOS2_SSC,
3637
JSON,
3738
DUMMY
3839
};

0 commit comments

Comments
 (0)