openPMD-api
ADIOS2IOHandler.hpp
1 /* Copyright 2017-2021 Fabian Koller and Franz Poeschel
2  *
3  * This file is part of openPMD-api.
4  *
5  * openPMD-api is free software: you can redistribute it and/or modify
6  * it under the terms of of either the GNU General Public License or
7  * the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * openPMD-api is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License and the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * and the GNU Lesser General Public License along with openPMD-api.
19  * If not, see <http://www.gnu.org/licenses/>.
20  */
21 #pragma once
22 
23 #include "openPMD/Error.hpp"
24 #include "openPMD/IO/ADIOS/ADIOS2Auxiliary.hpp"
25 #include "openPMD/IO/ADIOS/ADIOS2FilePosition.hpp"
26 #include "openPMD/IO/AbstractIOHandler.hpp"
27 #include "openPMD/IO/AbstractIOHandlerImpl.hpp"
28 #include "openPMD/IO/AbstractIOHandlerImplCommon.hpp"
29 #include "openPMD/IO/FlushParametersInternal.hpp"
30 #include "openPMD/IO/IOTask.hpp"
31 #include "openPMD/IO/InvalidatableFile.hpp"
32 #include "openPMD/IterationEncoding.hpp"
33 #include "openPMD/ThrowError.hpp"
34 #include "openPMD/auxiliary/JSON_internal.hpp"
35 #include "openPMD/backend/Writable.hpp"
36 #include "openPMD/config.hpp"
37 #include <stdexcept>
38 
39 #if openPMD_HAVE_ADIOS2
40 #include <adios2.h>
41 #endif
42 #if openPMD_HAVE_MPI
43 #include <mpi.h>
44 #endif
45 #include <nlohmann/json.hpp>
46 
47 #include <array>
48 #include <exception>
49 #include <future>
50 #include <iostream>
51 #include <memory> // shared_ptr
52 #include <optional>
53 #include <set>
54 #include <string>
55 #include <unordered_map>
56 #include <utility> // pair
57 #include <vector>
58 
59 namespace openPMD
60 {
61 #if openPMD_HAVE_ADIOS2
62 
63 std::optional<size_t> joinedDimension(adios2::Dims const &dims);
64 
65 class ADIOS2IOHandler;
66 
67 namespace detail
68 {
69  template <typename, typename>
70  struct DatasetHelper;
71  struct GetSpan;
72  struct DatasetReader;
73  struct AttributeReader;
74  struct AttributeWriter;
75  struct AttributeReader;
76  struct AttributeWriter;
77  template <typename>
78  struct AttributeTypes;
79  struct DatasetOpener;
80  struct VariableDefiner;
81  template <typename>
82  struct DatasetTypes;
83  struct WriteDataset;
84  class ADIOS2File;
85  struct BufferedPut;
86  struct BufferedGet;
87  struct BufferedAttributeRead;
88  struct BufferedAttributeWrite;
89  struct RunUniquePtrPut;
90 } // namespace detail
91 
93  : public AbstractIOHandlerImplCommon<ADIOS2FilePosition>
94 {
95  template <typename, typename>
96  friend struct detail::DatasetHelper;
97  friend struct detail::GetSpan;
98  friend struct detail::DatasetReader;
99  friend struct detail::AttributeReader;
100  friend struct detail::AttributeWriter;
101  friend struct detail::AttributeReader;
102  friend struct detail::AttributeWriter;
103  template <typename>
104  friend struct detail::AttributeTypes;
105  friend struct detail::DatasetOpener;
106  friend struct detail::VariableDefiner;
107  template <typename>
108  friend struct detail::DatasetTypes;
109  friend struct detail::WriteDataset;
110  friend class detail::ADIOS2File;
111  friend struct detail::BufferedAttributeRead;
112  friend struct detail::RunUniquePtrPut;
113 
114  using UseGroupTable = adios_defs::UseGroupTable;
115  using FlushTarget = adios_defs::FlushTarget;
116 
117 public:
118 #if openPMD_HAVE_MPI
119 
122  MPI_Comm,
123  json::TracingJSON config,
124  std::string engineType,
125  std::string specifiedExtension);
126 
127 #endif // openPMD_HAVE_MPI
128 
129  explicit ADIOS2IOHandlerImpl(
131  json::TracingJSON config,
132  std::string engineType,
133  std::string specifiedExtension);
134 
135  ~ADIOS2IOHandlerImpl() override;
136 
137  std::future<void> flush(internal::ParsedFlushParams &);
138 
139  void
141 
143 
144  // MPI Collective
145  bool checkFile(std::string fullFilePath) const;
146 
147  void
149 
150  void createDataset(
151  Writable *, Parameter<Operation::CREATE_DATASET> const &) override;
152 
153  void extendDataset(
154  Writable *, Parameter<Operation::EXTEND_DATASET> const &) override;
155 
157 
158  void
160 
161  void openPath(Writable *, Parameter<Operation::OPEN_PATH> const &) override;
162 
163  void
165 
167 
168  void
170 
171  void
173 
174  void deleteDataset(
175  Writable *, Parameter<Operation::DELETE_DATASET> const &) override;
176 
177  void deleteAttribute(
178  Writable *, Parameter<Operation::DELETE_ATT> const &) override;
179 
180  void
182 
183  void writeAttribute(
184  Writable *, Parameter<Operation::WRITE_ATT> const &) override;
185 
187 
188  void
190 
192 
194 
195  void
197 
198  void listAttributes(
199  Writable *, Parameter<Operation::LIST_ATTS> &parameters) override;
200 
201  void advance(Writable *, Parameter<Operation::ADVANCE> &) override;
202 
203  void availableChunks(
205 
206  void
208 
213  adios2::Mode adios2AccessMode(std::string const &fullPath);
214 
215  FlushTarget m_flushTarget = FlushTarget::Disk;
216 
217 private:
218  adios2::ADIOS m_ADIOS;
219 #if openPMD_HAVE_MPI
220  std::optional<MPI_Comm> m_communicator;
221 #endif
225  std::string m_engineType;
226  /*
227  * The filename extension specified by the user.
228  */
229  std::string m_userSpecifiedExtension;
230 
231  /*
232  * Empty option: No choice about the group table has been explicitly made,
233  * use default.
234  */
235  std::optional<UseGroupTable> m_useGroupTable;
236 
237  enum class UseSpan : char
238  {
239  Yes,
240  No,
241  Auto
242  };
243 
244  UseSpan m_useSpanBasedPutByDefault = UseSpan::Auto;
245 
246  enum class ModifiableAttributes : char
247  {
248  Yes,
249  No,
250  Unspecified
251  };
252 
253  ModifiableAttributes m_modifiableAttributes =
254  ModifiableAttributes::Unspecified;
255 
256  inline UseGroupTable useGroupTable() const
257  {
258  if (!m_useGroupTable.has_value())
259  {
260  return UseGroupTable::No;
261  }
262  return m_useGroupTable.value();
263  }
264 
265  bool m_writeAttributesFromThisRank = true;
266 
267  struct ParameterizedOperator
268  {
269  adios2::Operator op;
270  adios2::Params params;
271  };
272 
273  std::vector<ParameterizedOperator> defaultOperators;
274 
275  json::TracingJSON m_config;
276  static json::TracingJSON nullvalue;
277 
278  template <typename Callback>
279  void
280  init(json::TracingJSON config, Callback &&callbackWriteAttributesFromRank);
281 
282  template <typename Key>
283  json::TracingJSON config(Key &&key, json::TracingJSON &cfg)
284  {
285  if (cfg.json().is_object() && cfg.json().contains(key))
286  {
287  return cfg[key];
288  }
289  else
290  {
291  return nullvalue;
292  }
293  }
294 
295  template <typename Key>
296  json::TracingJSON config(Key &&key)
297  {
298  return config<Key>(std::forward<Key>(key), m_config);
299  }
300 
308  std::optional<std::vector<ParameterizedOperator>>
309  getOperators(json::TracingJSON config);
310 
311  // use m_config
312  std::optional<std::vector<ParameterizedOperator>> getOperators();
313 
314  std::string fileSuffix(bool verbose = true) const;
315 
316  /*
317  * We need to give names to IO objects. These names are irrelevant
318  * within this application, since:
319  * 1) The name of the file written to is decided by the opened Engine's
320  * name.
321  * 2) The IOs are managed by the unordered_map m_fileData, so we do not
322  * need the ADIOS2 internal management.
323  * Since within one m_ADIOS object, the same IO name cannot be used more
324  * than once, we ensure different names by using the name counter.
325  * This allows to overwrite a file later without error.
326  */
327  int nameCounter{0};
328 
329  /*
330  * IO-heavy actions are deferred to a later point. This map stores for
331  * each open file (identified by an InvalidatableFile object) an object
332  * that manages IO-heavy actions, as well as its ADIOS2 objects, i.e.
333  * IO and Engine object.
334  * Not to be accessed directly, use getFileData().
335  */
336  std::unordered_map<InvalidatableFile, std::unique_ptr<detail::ADIOS2File>>
337  m_fileData;
338 
339  std::map<std::string, adios2::Operator> m_operators;
340 
341  // Overrides from AbstractIOHandlerImplCommon.
342 
343  std::string
344  filePositionToString(std::shared_ptr<ADIOS2FilePosition>) override;
345 
346  std::shared_ptr<ADIOS2FilePosition> extendFilePosition(
347  std::shared_ptr<ADIOS2FilePosition> const &pos,
348  std::string extend) override;
349 
350  // Helper methods.
351 
352  std::optional<adios2::Operator>
353  getCompressionOperator(std::string const &compression);
354 
355  /*
356  * The name of the ADIOS2 variable associated with this Writable.
357  * To be used for Writables that represent a dataset.
358  */
359  std::string nameOfVariable(Writable *writable);
360 
370  std::string nameOfAttribute(Writable *writable, std::string attribute);
371 
372  /*
373  * Figure out whether the Writable corresponds with a
374  * group or a dataset.
375  */
376  GroupOrDataset groupOrDataset(Writable *);
377 
378  enum class IfFileNotOpen : bool
379  {
380  OpenImplicitly,
381  ThrowError
382  };
383 
385  getFileData(InvalidatableFile const &file, IfFileNotOpen);
386 
387  void dropFileData(InvalidatableFile const &file);
388 
389  /*
390  * Prepare a variable that already exists for an IO
391  * operation, including:
392  * (1) checking that its datatype matches T.
393  * (2) the offset and extent match the variable's shape
394  * (3) setting the offset and extent (ADIOS lingo: start
395  * and count)
396  */
397  template <typename T>
398  adios2::Variable<T> verifyDataset(
399  Offset const &offset,
400  Extent const &extent,
401  adios2::IO &IO,
402  std::string const &varName)
403  {
404  {
405  auto requiredType = adios2::GetType<T>();
406  auto actualType = IO.VariableType(varName);
407 
408  if (requiredType != actualType)
409  {
410  std::stringstream errorMessage;
411  errorMessage << "Trying to access a dataset with wrong type "
412  "(trying to access dataset with type '"
413  << requiredType << "', but has type '"
414  << actualType << "')";
415  throw error::ReadError(
416  error::AffectedObject::Dataset,
417  error::Reason::UnexpectedContent,
418  "ADIOS2",
419  errorMessage.str());
420  };
421  }
422  adios2::Variable<T> var = IO.InquireVariable<T>(varName);
423  if (!var.operator bool())
424  {
425 
426  throw std::runtime_error(
427  "[ADIOS2] Internal error: Failed opening ADIOS2 variable.");
428  }
429  // TODO leave this check to ADIOS?
430  adios2::Dims shape = var.Shape();
431  auto actualDim = shape.size();
432  {
433  auto requiredDim = extent.size();
434  if (requiredDim != actualDim)
435  {
436  throw error::ReadError(
437  error::AffectedObject::Dataset,
438  error::Reason::UnexpectedContent,
439  "ADIOS2",
440  "Trying to access a dataset with wrong dimensionality "
441  "(trying to access dataset with dimensionality " +
442  std::to_string(requiredDim) +
443  ", but has dimensionality " +
444  std::to_string(actualDim) + ")");
445  }
446  }
447  auto joinedDim = joinedDimension(shape);
448  if (joinedDim.has_value())
449  {
450  if (!offset.empty())
451  {
452  throw std::runtime_error(
453  "[ADIOS2] Offset must be an empty vector in case of joined "
454  "array.");
455  }
456  for (unsigned int i = 0; i < actualDim; i++)
457  {
458  if (*joinedDim != i && extent[i] != shape[i])
459  {
460  throw std::runtime_error(
461  "[ADIOS2] store_chunk extent of non-joined dimensions "
462  "must be equivalent to the total extent.");
463  }
464  }
465  }
466  else
467  {
468  for (unsigned int i = 0; i < actualDim; i++)
469  {
470  if (!(joinedDim.has_value() && *joinedDim == i) &&
471  offset[i] + extent[i] > shape[i])
472  {
473  throw std::runtime_error(
474  "[ADIOS2] Dataset access out of bounds.");
475  }
476  }
477  }
478 
479  var.SetSelection(
480  {adios2::Dims(offset.begin(), offset.end()),
481  adios2::Dims(extent.begin(), extent.end())});
482  return var;
483  }
484 
485  struct
486  {
487  bool noGroupBased = false;
488  bool blosc2bp5 = false;
489  } printedWarningsAlready;
490 }; // ADIOS2IOHandlerImpl
491 
492 namespace detail
493 {
494  // Helper structs for calls to the switchType function
495 
496  template <typename T>
497  inline constexpr bool IsUnsupportedComplex_v =
498  std::is_same_v<T, std::complex<long double>> ||
499  std::is_same_v<T, std::vector<std::complex<long double>>>;
500 
502  {
503  template <typename T>
504  static Datatype call(
506  adios2::IO &IO,
507  std::string name,
508  Attribute::resource &resource);
509 
510  template <int n, typename... Params>
511  static Datatype call(Params &&...);
512  };
513 
515  {
516  template <typename T>
517  static void call(
518  ADIOS2IOHandlerImpl *impl,
519  Writable *writable,
520  const Parameter<Operation::WRITE_ATT> &parameters);
521 
522  template <int n, typename... Params>
523  static void call(Params &&...);
524  };
525 
527  {
528  template <typename T>
529  static void call(
530  ADIOS2IOHandlerImpl *impl,
531  InvalidatableFile const &,
532  std::string const &varName,
534 
535  static constexpr char const *errorMsg = "ADIOS2: openDataset()";
536  };
537 
539  {
555  template <typename T>
556  static void call(
557  adios2::IO &IO,
558  std::string const &name,
559  std::vector<ADIOS2IOHandlerImpl::ParameterizedOperator> const
560  &compressions,
561  adios2::Dims const &shape = adios2::Dims(),
562  adios2::Dims const &start = adios2::Dims(),
563  adios2::Dims const &count = adios2::Dims(),
564  bool const constantDims = false);
565 
566  static constexpr char const *errorMsg = "ADIOS2: defineVariable()";
567  };
568 
570  {
571  template <typename T>
572  static void call(
574  adios2::IO &IO,
575  adios2::Engine &engine,
576  std::string const &varName,
577  bool allSteps);
578 
579  template <int n, typename... Params>
580  static void call(Params &&...);
581  };
582 
583  // Helper structs to help distinguish valid attribute/variable
584  // datatypes from invalid ones
585 
586  /*
587  * This struct's purpose is to have specialisations
588  * for vector and array types, as well as the boolean
589  * type (which is not natively supported by ADIOS).
590  */
591  template <typename T>
593  {
598  static bool attributeUnchanged(adios2::IO &IO, std::string name, T val)
599  {
600  auto attr = IO.InquireAttribute<T>(name);
601  if (!attr)
602  {
603  return false;
604  }
605  std::vector<T> data = attr.Data();
606  if (data.size() != 1)
607  {
608  return false;
609  }
610  return data[0] == val;
611  }
612  };
613 
614  template <>
615  struct AttributeTypes<std::complex<long double>>
616  {
617  static bool
618  attributeUnchanged(adios2::IO &, std::string, std::complex<long double>)
619  {
620  throw std::runtime_error(
621  "[ADIOS2] Internal error: no support for long double complex "
622  "attribute types");
623  }
624  };
625 
626  template <>
627  struct AttributeTypes<std::vector<std::complex<long double>>>
628  {
629  static bool attributeUnchanged(
630  adios2::IO &, std::string, std::vector<std::complex<long double>>)
631  {
632  throw std::runtime_error(
633  "[ADIOS2] Internal error: no support for long double complex "
634  "vector attribute types");
635  }
636  };
637 
638  template <typename T>
639  struct AttributeTypes<std::vector<T>>
640  {
641  static bool
642  attributeUnchanged(adios2::IO &IO, std::string name, std::vector<T> val)
643  {
644  auto attr = IO.InquireAttribute<T>(name);
645  if (!attr)
646  {
647  return false;
648  }
649  std::vector<T> data = attr.Data();
650  if (data.size() != val.size())
651  {
652  return false;
653  }
654  for (size_t i = 0; i < val.size(); ++i)
655  {
656  if (data[i] != val[i])
657  {
658  return false;
659  }
660  }
661  return true;
662  }
663  };
664 
665  template <>
666  struct AttributeTypes<std::vector<std::string>>
667  {
668  static bool attributeUnchanged(
669  adios2::IO &IO, std::string name, std::vector<std::string> val)
670  {
671  auto attr = IO.InquireAttribute<std::string>(name);
672  if (!attr)
673  {
674  return false;
675  }
676  std::vector<std::string> data = attr.Data();
677  if (data.size() != val.size())
678  {
679  return false;
680  }
681  for (size_t i = 0; i < val.size(); ++i)
682  {
683  if (data[i] != val[i])
684  {
685  return false;
686  }
687  }
688  return true;
689  }
690  };
691 
692  template <typename T, size_t n>
693  struct AttributeTypes<std::array<T, n>>
694  {
695  static bool attributeUnchanged(
696  adios2::IO &IO, std::string name, std::array<T, n> val)
697  {
698  auto attr = IO.InquireAttribute<T>(name);
699  if (!attr)
700  {
701  return false;
702  }
703  std::vector<T> data = attr.Data();
704  if (data.size() != n)
705  {
706  return false;
707  }
708  for (size_t i = 0; i < n; ++i)
709  {
710  if (data[i] != val[i])
711  {
712  return false;
713  }
714  }
715  return true;
716  }
717  };
718 
719  namespace bool_repr
720  {
721  using rep = detail::bool_representation;
722 
723  static constexpr rep toRep(bool b)
724  {
725  return b ? 1U : 0U;
726  }
727 
728  static constexpr bool fromRep(rep r)
729  {
730  return r != 0;
731  }
732  } // namespace bool_repr
733 
734  template <>
735  struct AttributeTypes<bool>
736  {
737  using rep = detail::bool_representation;
738 
739  static constexpr rep toRep(bool b)
740  {
741  return b ? 1U : 0U;
742  }
743 
744  static constexpr bool fromRep(rep r)
745  {
746  return r != 0;
747  }
748 
749  static bool
750  attributeUnchanged(adios2::IO &IO, std::string name, bool val)
751  {
752  auto attr = IO.InquireAttribute<rep>(name);
753  if (!attr)
754  {
755  return false;
756  }
757  std::vector<rep> data = attr.Data();
758  if (data.size() != 1)
759  {
760  return false;
761  }
762  return data[0] == toRep(val);
763  }
764  };
765 } // namespace detail
766 #endif // openPMD_HAVE_ADIOS2
767 
769 {
770 #if openPMD_HAVE_ADIOS2
771 
772  friend class ADIOS2IOHandlerImpl;
773 
774 private:
775  ADIOS2IOHandlerImpl m_impl;
776 
777 public:
778  ~ADIOS2IOHandler() override
779  {
780  // we must not throw in a destructor
781  try
782  {
783  auto params = internal::defaultParsedFlushParams;
784  this->flush(params);
785  }
786  catch (std::exception const &ex)
787  {
788  std::cerr << "[~ADIOS2IOHandler] An error occurred: " << ex.what()
789  << std::endl;
790  }
791  catch (...)
792  {
793  std::cerr << "[~ADIOS2IOHandler] An error occurred." << std::endl;
794  }
795  }
796 
797 #else
798 public:
799 #endif
800 
801 #if openPMD_HAVE_MPI
802 
804  std::string path,
805  Access,
806  MPI_Comm,
807  json::TracingJSON options,
808  std::string engineType,
809  std::string specifiedExtension);
810 
811 #endif
812 
814  std::string path,
815  Access,
816  json::TracingJSON options,
817  std::string engineType,
818  std::string specifiedExtension);
819 
820  std::string backendName() const override
821  {
822  return "ADIOS2";
823  }
824 
825  std::future<void> flush(internal::ParsedFlushParams &) override;
826 }; // ADIOS2IOHandler
827 } // namespace openPMD
Definition: ADIOS2IOHandler.hpp:769
std::future< void > flush(internal::ParsedFlushParams &) override
Process operations in queue according to FIFO.
Definition: ADIOS2IOHandler.cpp:2097
std::string backendName() const override
The currently used backend.
Definition: ADIOS2IOHandler.hpp:820
Definition: ADIOS2IOHandler.hpp:94
void readDataset(Writable *, Parameter< Operation::READ_DATASET > &) override
Read a chunk of data from an existing dataset.
Definition: ADIOS2IOHandler.cpp:1052
void openFile(Writable *, Parameter< Operation::OPEN_FILE > &) override
Open an existing file assuming it conforms to openPMD.
Definition: ADIOS2IOHandler.cpp:873
void writeAttribute(Writable *, Parameter< Operation::WRITE_ATT > const &) override
Create a single attribute and fill the value, possibly overwriting an existing attribute.
Definition: ADIOS2IOHandler.cpp:1015
void createFile(Writable *, Parameter< Operation::CREATE_FILE > const &) override
Create a new file in physical storage, possibly overriding an existing file.
Definition: ADIOS2IOHandler.cpp:577
void deletePath(Writable *, Parameter< Operation::DELETE_PATH > const &) override
Delete all objects within an existing path.
Definition: ADIOS2IOHandler.cpp:978
void deleteDataset(Writable *, Parameter< Operation::DELETE_DATASET > const &) override
Delete an existing dataset.
Definition: ADIOS2IOHandler.cpp:984
void listDatasets(Writable *, Parameter< Operation::LIST_DATASETS > &) override
List all datasets inside a group, non-recursively.
Definition: ADIOS2IOHandler.cpp:1348
void closePath(Writable *, Parameter< Operation::CLOSE_PATH > const &) override
Close an openPMD group.
Definition: ADIOS2IOHandler.cpp:1427
void advance(Writable *, Parameter< Operation::ADVANCE > &) override
Advance the file/stream that this writable belongs to.
Definition: ADIOS2IOHandler.cpp:1419
void deleteFile(Writable *, Parameter< Operation::DELETE_FILE > const &) override
Delete an existing file from physical storage.
Definition: ADIOS2IOHandler.cpp:972
void listAttributes(Writable *, Parameter< Operation::LIST_ATTS > &parameters) override
List all attributes associated with an object.
Definition: ADIOS2IOHandler.cpp:1390
void openDataset(Writable *, Parameter< Operation::OPEN_DATASET > &) override
Open an existing dataset and determine its datatype and extent.
Definition: ADIOS2IOHandler.cpp:955
void extendDataset(Writable *, Parameter< Operation::EXTEND_DATASET > const &) override
Increase the extent of an existing dataset.
Definition: ADIOS2IOHandler.cpp:858
void availableChunks(Writable *, Parameter< Operation::AVAILABLE_CHUNKS > &) override
Report chunks that are available for loading from the dataset represented by this writable.
Definition: ADIOS2IOHandler.cpp:1459
void closeFile(Writable *, Parameter< Operation::CLOSE_FILE > const &) override
Close the file corresponding with the writable and release file handles.
Definition: ADIOS2IOHandler.cpp:900
adios2::Mode adios2AccessMode(std::string const &fullPath)
The ADIOS2 access type to chose for Engines opened within this instance.
Definition: ADIOS2IOHandler.cpp:1485
void createDataset(Writable *, Parameter< Operation::CREATE_DATASET > const &) override
Create a new dataset of given type, extent and storage properties.
Definition: ADIOS2IOHandler.cpp:730
void checkFile(Writable *, Parameter< Operation::CHECK_FILE > &) override
Check if the file specified by the parameter is already present on disk.
Definition: ADIOS2IOHandler.cpp:642
void writeDataset(Writable *, Parameter< Operation::WRITE_DATASET > &) override
Write a chunk of data into an existing dataset.
Definition: ADIOS2IOHandler.cpp:998
void listPaths(Writable *, Parameter< Operation::LIST_PATHS > &) override
List all paths/sub-groups inside a group, non-recursively.
Definition: ADIOS2IOHandler.cpp:1219
void createPath(Writable *, Parameter< Operation::CREATE_PATH > const &) override
Create all necessary groups for a path, possibly recursively.
Definition: ADIOS2IOHandler.cpp:696
void getBufferView(Writable *, Parameter< Operation::GET_BUFFER_VIEW > &) override
Get a view into a dataset buffer that can be filled by a user.
Definition: ADIOS2IOHandler.cpp:1131
void readAttribute(Writable *, Parameter< Operation::READ_ATT > &) override
Read the value of an existing attribute.
Definition: ADIOS2IOHandler.cpp:1196
void openPath(Writable *, Parameter< Operation::OPEN_PATH > const &) override
Open all contained groups in a path, possibly recursively.
Definition: ADIOS2IOHandler.cpp:927
void deregister(Writable *, Parameter< Operation::DEREGISTER > const &) override
Notify the backend that the Writable has been / will be deallocated.
Definition: ADIOS2IOHandler.cpp:1479
void deleteAttribute(Writable *, Parameter< Operation::DELETE_ATT > const &) override
Delete an existing attribute.
Definition: ADIOS2IOHandler.cpp:991
Interface for communicating between logical and physically persistent data.
Definition: AbstractIOHandler.hpp:186
Definition: AbstractIOHandlerImplCommon.hpp:38
std::string fullPath(InvalidatableFile)
Definition: AbstractIOHandlerImplCommon.hpp:177
Layer to mirror structure of logical data and persistent data in file.
Definition: Writable.hpp:75
Definition: ADIOS2File.hpp:137
Definition: Error.hpp:92
Extend nlohmann::json with tracing of which keys have been accessed by operator[]().
Definition: JSON_internal.hpp:68
nlohmann::json & json()
Access the underlying JSON value.
Definition: JSON_internal.hpp:79
Public definitions of openPMD-api.
Definition: Date.cpp:29
Access
File access mode to use during IO.
Definition: Access.hpp:30
Datatype
Concrete datatype of an object available at runtime.
Definition: Datatype.hpp:51
Wrapper around a shared pointer to:
Definition: InvalidatableFile.hpp:44
Definition: ADIOS2IOHandler.hpp:502
Definition: ADIOS2IOHandler.hpp:593
static bool attributeUnchanged(adios2::IO &IO, std::string name, T val)
Is the attribute given by parameters name and val already defined exactly in that way within the give...
Definition: ADIOS2IOHandler.hpp:598
Definition: ADIOS2IOHandler.hpp:515
Definition: ADIOS2File.hpp:67
Definition: ADIOS2File.hpp:88
Definition: ADIOS2IOHandler.hpp:70
Definition: ADIOS2IOHandler.hpp:527
Definition: ADIOS2File.hpp:75
Definition: ADIOS2IOHandler.hpp:82
Definition: ADIOS2IOHandler.cpp:1068
Definition: ADIOS2IOHandler.hpp:570
Definition: ADIOS2File.cpp:140
Definition: ADIOS2IOHandler.hpp:539
static void call(adios2::IO &IO, std::string const &name, std::vector< ADIOS2IOHandlerImpl::ParameterizedOperator > const &compressions, adios2::Dims const &shape=adios2::Dims(), adios2::Dims const &start=adios2::Dims(), adios2::Dims const &count=adios2::Dims(), bool const constantDims=false)
Define a Variable of type T within the passed IO.
Definition: ADIOS2IOHandler.cpp:1959
Definition: ADIOS2File.hpp:96
Definition: FlushParametersInternal.hpp:32