Skip to content

Commit a22aa21

Browse files
authored
openPMD-api: 0.12.0+ (#1302)
Update WarpX to depend on openPMD-api 0.12.0+. Remove deprecated type usage (`AccessType` -> `Access`).
1 parent a8899d2 commit a22aa21

File tree

8 files changed

+17
-15
lines changed

8 files changed

+17
-15
lines changed

Docs/source/building/cmake.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Optional dependencies include:
2525
- `OpenMP 3.1+ <https://www.openmp.org>`_: for threaded CPU execution (currently not fully accelerated)
2626
- `FFTW3 <http://www.fftw.org>`_: for spectral solver (PSATD) support
2727
- `Boost 1.66.0+ <https://www.boost.org/>`_: for QED support
28-
- `openPMD-api 0.11.1+ <https://github.com/openPMD/openPMD-api>`_: we automatically download and compile a copy of openPMD-api for openPMD I/O support
28+
- `openPMD-api 0.12.0+ <https://github.com/openPMD/openPMD-api>`_: we automatically download and compile a copy of openPMD-api for openPMD I/O support
2929

3030
- see `optional I/O backends <https://github.com/openPMD/openPMD-api#dependencies>`_
3131
- `CCache <https://ccache.dev>`_: to speed up rebuilds (needs 3.7.9+ for CUDA)
@@ -39,11 +39,12 @@ macOS/Linux:
3939
4040
spack env create warpx-dev
4141
spack env activate warpx-dev
42+
spack add adios2
4243
spack add ccache
4344
spack add cmake
4445
spack add fftw
46+
spack add hdf5
4547
spack add mpi
46-
spack add openpmd-api
4748
spack add pkgconfig # for fftw
4849
# optional:
4950
# spack add cuda
@@ -56,13 +57,14 @@ or macOS/Linux:
5657
.. code-block:: bash
5758
5859
brew update
60+
brew install adios2
5961
brew install ccache
6062
brew install cmake
6163
brew install fftw
64+
brew install hdf5-mpi
6265
brew install libomp
6366
brew install pkg-config # for fftw
6467
brew install open-mpi
65-
brew install openpmd-api
6668
6769
Now, ``cmake --version`` should be at version 3.14.0 or newer.
6870

Docs/source/building/openpmd.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
Building WarpX with support for openPMD output
44
==============================================
55

6-
WarpX can dump data in the `openPMD format <https://github.com/openPMD>`__.
6+
WarpX can dump data in the `openPMD format <https://github.com/openPMD>`_.
77
This feature currently requires to have a parallel version of HDF5 installed ;
88
therefore we recommend to use `spack <https://
99
spack.io>`__ in order to facilitate the installation.
1010

1111
More specifically, we recommend that you try installing the
12-
`openPMD-api library 0.11.0a or newer <https://openpmd-api.readthedocs.io/en/0.11.0-alpha/>`__
12+
`openPMD-api library 0.12.0a or newer <https://openpmd-api.readthedocs.io/en/0.12.0-alpha/>`_
1313
using spack (first section below). If this fails, a back-up solution
1414
is to install parallel HDF5 with spack, and then install the openPMD-api
1515
library from source.

Source/Diagnostics/WarpXOpenPMD.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public:
110110

111111

112112
private:
113-
void Init(openPMD::AccessType accessType, const std::string& filePrefix);
113+
void Init(openPMD::Access access, const std::string& filePrefix);
114114

115115
/** This function sets up the entries for storing the particle positions, global IDs, and constant records (charge, mass)
116116
*

Source/Diagnostics/WarpXOpenPMD.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,12 @@ void WarpXOpenPMDPlot::SetStep(int ts, const std::string& filePrefix)
247247
}
248248

249249
m_CurrentStep = ts;
250-
Init(openPMD::AccessType::CREATE, filePrefix);
250+
Init(openPMD::Access::CREATE, filePrefix);
251251

252252
}
253253

254254
void
255-
WarpXOpenPMDPlot::Init(openPMD::AccessType accessType, const std::string& filePrefix)
255+
WarpXOpenPMDPlot::Init(openPMD::Access access, const std::string& filePrefix)
256256
{
257257
// either for the next ts file,
258258
// or init a single file for all ts
@@ -267,7 +267,7 @@ WarpXOpenPMDPlot::Init(openPMD::AccessType accessType, const std::string& filePr
267267
{
268268
#if defined(AMREX_USE_MPI)
269269
m_Series = std::make_unique<openPMD::Series>(
270-
filename, accessType,
270+
filename, access,
271271
amrex::ParallelDescriptor::Communicator()
272272
);
273273
m_MPISize = amrex::ParallelDescriptor::NProcs();
@@ -278,7 +278,7 @@ WarpXOpenPMDPlot::Init(openPMD::AccessType accessType, const std::string& filePr
278278
}
279279
else
280280
{
281-
m_Series = std::make_unique<openPMD::Series>(filename, accessType);
281+
m_Series = std::make_unique<openPMD::Series>(filename, access);
282282
m_MPISize = 1;
283283
m_MPIRank = 1;
284284
}

Source/Diagnostics/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# License: BSD-3-Clause-LBNL
66

77
# keep this entry for GitHub's dependency graph
8-
openPMD-api>=0.11.0
8+
openPMD-api>=0.12.0

Source/Initialization/PlasmaInjector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ PlasmaInjector::PlasmaInjector (int ispecies, const std::string& name)
268268
#ifdef WARPX_USE_OPENPMD
269269
if (ParallelDescriptor::IOProcessor()) {
270270
m_openpmd_input_series = std::make_unique<openPMD::Series>(
271-
str_injection_file, openPMD::AccessType::READ_ONLY);
271+
str_injection_file, openPMD::Access::READ_ONLY);
272272

273273
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
274274
m_openpmd_input_series->iterations.size() == 1u,

Source/Make.WarpX

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ endif
136136

137137
ifeq ($(USE_OPENPMD), TRUE)
138138
# try pkg-config query
139-
ifeq (0, $(shell pkg-config "openPMD >= 0.11.0"; echo $$?))
139+
ifeq (0, $(shell pkg-config "openPMD >= 0.12.0"; echo $$?))
140140
CXXFLAGS += $(shell pkg-config --cflags openPMD)
141141
LIBRARY_LOCATIONS += $(shell pkg-config --variable=libdir openPMD)
142142
libraries += $(shell pkg-config --libs-only-l openPMD)

cmake/dependencies/openPMD.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function(find_openpmd)
44
include(FetchContent)
55
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
66

7-
# see https://openpmd-api.readthedocs.io/en/0.11.1-alpha/dev/buildoptions.html
7+
# see https://openpmd-api.readthedocs.io/en/0.12.0-alpha/dev/buildoptions.html
88
set(openPMD_USE_MPI ${WarpX_MPI} CACHE INTERNAL "")
99
set(openPMD_USE_PYTHON OFF CACHE INTERNAL "")
1010
set(BUILD_CLI_TOOLS OFF CACHE INTERNAL "") # FIXME
@@ -52,7 +52,7 @@ function(find_openpmd)
5252
else()
5353
set(COMPONENT_WMPI NOMPI)
5454
endif()
55-
find_package(openPMD 0.11.1 CONFIG REQUIRED COMPONENTS ${COMPONENT_WMPI})
55+
find_package(openPMD 0.12.0 CONFIG REQUIRED COMPONENTS ${COMPONENT_WMPI})
5656
message(STATUS "openPMD-api: Found version '${openPMD_VERSION}'")
5757
endif()
5858
endfunction()

0 commit comments

Comments
 (0)