Skip to content

Commit 44f3bad

Browse files
committed
Scaffolding for JSON in ADIOS1
1 parent fb24b8e commit 44f3bad

8 files changed

+28
-14
lines changed

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,11 @@ if(openPMD_HAVE_ADIOS1)
548548
target_compile_definitions(openPMD.ADIOS1.Parallel PRIVATE openPMD_HAVE_MPI=0)
549549
endif()
550550

551+
target_include_directories(openPMD.ADIOS1.Serial SYSTEM PRIVATE
552+
$<TARGET_PROPERTY:openPMD::thirdparty::nlohmann_json,INTERFACE_INCLUDE_DIRECTORIES>)
553+
target_include_directories(openPMD.ADIOS1.Parallel SYSTEM PRIVATE
554+
$<TARGET_PROPERTY:openPMD::thirdparty::nlohmann_json,INTERFACE_INCLUDE_DIRECTORIES>)
555+
551556
set_target_properties(openPMD.ADIOS1.Serial PROPERTIES
552557
CXX_EXTENSIONS OFF
553558
CXX_STANDARD_REQUIRED ON

include/openPMD/IO/ADIOS/ADIOS1IOHandler.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "openPMD/config.hpp"
2424
#include "openPMD/auxiliary/Export.hpp"
25+
#include "openPMD/auxiliary/JSON.hpp"
2526
#include "openPMD/IO/AbstractIOHandler.hpp"
2627

2728
#include <future>
@@ -42,7 +43,7 @@ namespace openPMD
4243
friend class ADIOS1IOHandlerImpl;
4344

4445
public:
45-
ADIOS1IOHandler(std::string path, Access);
46+
ADIOS1IOHandler(std::string path, Access, json::TracingJSON );
4647
~ADIOS1IOHandler() override;
4748

4849
std::string backendName() const override { return "ADIOS1"; }
@@ -61,7 +62,7 @@ namespace openPMD
6162
friend class ADIOS1IOHandlerImpl;
6263

6364
public:
64-
ADIOS1IOHandler(std::string path, Access);
65+
ADIOS1IOHandler(std::string path, Access, json::TracingJSON );
6566
~ADIOS1IOHandler() override;
6667

6768
std::string backendName() const override { return "DUMMY_ADIOS1"; }

include/openPMD/IO/ADIOS/ADIOS1IOHandlerImpl.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace openPMD
4444
class OPENPMDAPI_EXPORT ADIOS1IOHandlerImpl : public AbstractIOHandlerImpl
4545
{
4646
public:
47-
ADIOS1IOHandlerImpl(AbstractIOHandler*);
47+
ADIOS1IOHandlerImpl(AbstractIOHandler*, json::TracingJSON);
4848
virtual ~ADIOS1IOHandlerImpl();
4949

5050
virtual void init();

include/openPMD/IO/ADIOS/ParallelADIOS1IOHandler.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "openPMD/config.hpp"
2424
#include "openPMD/auxiliary/Export.hpp"
25+
#include "openPMD/auxiliary/JSON.hpp"
2526
#include "openPMD/IO/AbstractIOHandler.hpp"
2627

2728
#include <future>
@@ -42,9 +43,9 @@ namespace openPMD
4243

4344
public:
4445
# if openPMD_HAVE_MPI
45-
ParallelADIOS1IOHandler(std::string path, Access, MPI_Comm);
46+
ParallelADIOS1IOHandler(std::string path, Access, json::TracingJSON , MPI_Comm);
4647
# else
47-
ParallelADIOS1IOHandler(std::string path, Access);
48+
ParallelADIOS1IOHandler(std::string path, Access, json::TracingJSON);
4849
# endif
4950
~ParallelADIOS1IOHandler() override;
5051

include/openPMD/IO/ADIOS/ParallelADIOS1IOHandlerImpl.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "openPMD/config.hpp"
2424
#include "openPMD/auxiliary/Export.hpp"
25+
#include "openPMD/auxiliary/JSON.hpp"
2526
#include "openPMD/IO/AbstractIOHandler.hpp"
2627

2728
#if openPMD_HAVE_ADIOS1 && openPMD_HAVE_MPI
@@ -45,7 +46,7 @@ namespace openPMD
4546
class OPENPMDAPI_EXPORT ParallelADIOS1IOHandlerImpl : public AbstractIOHandlerImpl
4647
{
4748
public:
48-
ParallelADIOS1IOHandlerImpl(AbstractIOHandler*, MPI_Comm);
49+
ParallelADIOS1IOHandlerImpl(AbstractIOHandler*, json::TracingJSON, MPI_Comm);
4950
virtual ~ParallelADIOS1IOHandlerImpl();
5051

5152
virtual void init();

src/IO/ADIOS/ADIOS1IOHandler.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace openPMD
4646
# define VERIFY(CONDITION, TEXT) do{ (void)sizeof(CONDITION); } while( 0 )
4747
# endif
4848

49-
ADIOS1IOHandlerImpl::ADIOS1IOHandlerImpl(AbstractIOHandler* handler)
49+
ADIOS1IOHandlerImpl::ADIOS1IOHandlerImpl(AbstractIOHandler* handler, json::TracingJSON json)
5050
: AbstractIOHandlerImpl(handler)
5151
{ }
5252

@@ -223,9 +223,9 @@ ADIOS1IOHandlerImpl::init()
223223
#endif
224224

225225
#if openPMD_HAVE_ADIOS1
226-
ADIOS1IOHandler::ADIOS1IOHandler(std::string path, Access at)
226+
ADIOS1IOHandler::ADIOS1IOHandler(std::string path, Access at, json::TracingJSON json)
227227
: AbstractIOHandler(std::move(path), at),
228-
m_impl{new ADIOS1IOHandlerImpl(this)}
228+
m_impl{new ADIOS1IOHandlerImpl(this, std::move(json))}
229229
{
230230
m_impl->init();
231231
}
@@ -326,7 +326,7 @@ ADIOS1IOHandlerImpl::initialize_group(std::string const &name)
326326
#endif
327327

328328
#else
329-
ADIOS1IOHandler::ADIOS1IOHandler(std::string path, Access at)
329+
ADIOS1IOHandler::ADIOS1IOHandler(std::string path, Access at, json::TracingJSON)
330330
: AbstractIOHandler(std::move(path), at)
331331
{
332332
throw std::runtime_error("openPMD-api built without ADIOS1 support");

src/IO/ADIOS/ParallelADIOS1IOHandler.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ namespace openPMD
4646
# endif
4747

4848
ParallelADIOS1IOHandlerImpl::ParallelADIOS1IOHandlerImpl(AbstractIOHandler* handler,
49+
json::TracingJSON json,
4950
MPI_Comm comm)
5051
: AbstractIOHandlerImpl{handler},
5152
m_mpiInfo{MPI_INFO_NULL}
@@ -245,9 +246,10 @@ ParallelADIOS1IOHandlerImpl::init()
245246

246247
ParallelADIOS1IOHandler::ParallelADIOS1IOHandler(std::string path,
247248
Access at,
249+
json::TracingJSON json,
248250
MPI_Comm comm)
249251
: AbstractIOHandler(std::move(path), at, comm),
250-
m_impl{new ParallelADIOS1IOHandlerImpl(this, comm)}
252+
m_impl{new ParallelADIOS1IOHandlerImpl(this, std::move(json), comm)}
251253
{
252254
m_impl->init();
253255
}
@@ -358,14 +360,16 @@ ParallelADIOS1IOHandlerImpl::initialize_group(std::string const &name)
358360
# if openPMD_HAVE_MPI
359361
ParallelADIOS1IOHandler::ParallelADIOS1IOHandler(std::string path,
360362
Access at,
363+
json::TracingJSON,
361364
MPI_Comm comm)
362365
: AbstractIOHandler(std::move(path), at, comm)
363366
{
364367
throw std::runtime_error("openPMD-api built without ADIOS1 support");
365368
}
366369
# else
367370
ParallelADIOS1IOHandler::ParallelADIOS1IOHandler(std::string path,
368-
Access at)
371+
Access at,
372+
json::TracingJSON)
369373
: AbstractIOHandler(std::move(path), at)
370374
{
371375
throw std::runtime_error("openPMD-api built without parallel ADIOS1 support");

src/IO/AbstractIOHandlerHelper.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ namespace openPMD
4949
path, access, comm, std::move( options ) );
5050
case Format::ADIOS1:
5151
# if openPMD_HAVE_ADIOS1
52-
return std::make_shared< ParallelADIOS1IOHandler >( path, access, comm );
52+
return std::make_shared< ParallelADIOS1IOHandler >(
53+
path, access, std::move( options ), comm );
5354
# else
5455
throw std::runtime_error("openPMD-api built without ADIOS1 support");
5556
# endif
@@ -85,7 +86,8 @@ namespace openPMD
8586
path, access, std::move( options ) );
8687
case Format::ADIOS1:
8788
#if openPMD_HAVE_ADIOS1
88-
return std::make_shared< ADIOS1IOHandler >( path, access );
89+
return std::make_shared< ADIOS1IOHandler >(
90+
path, access, std::move( options ) );
8991
#else
9092
throw std::runtime_error("openPMD-api built without ADIOS1 support");
9193
#endif

0 commit comments

Comments
 (0)