Conversation
5ceadfe to
a9f8737
Compare
The arguments are sanity-checked, but no operation is passed down to the backend.
See openPMD PR: openPMD/openPMD-api#529 This allows to write empty datasets
ax3l
left a comment
There was a problem hiding this comment.
Just a few little inline comments.
Can you please expose the new makeEmpty functionality in the Python bindings as well? :)
| RecordComponent& makeConstant(T); | ||
|
|
||
| template< typename T > | ||
| RecordComponent& makeEmpty( uint8_t dimensions ); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
include/openPMD/RecordComponent.hpp
Outdated
|
|
||
| std::shared_ptr< std::queue< IOTask > > m_chunks; | ||
| std::shared_ptr< Attribute > m_constantValue; | ||
| std::shared_ptr< bool > m_isEmpty{ |
There was a problem hiding this comment.
shouldn't a simple = ... work as well here?
| private: | ||
| void flush(std::string const&); | ||
| virtual void read(); | ||
| RecordComponent& makeEmpty( Dataset ); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
include/openPMD/RecordComponent.hpp
Outdated
| RecordComponent::storeChunk(std::shared_ptr<T> data, Offset o, Extent e) | ||
| { | ||
| if( *m_isConstant ) | ||
| if( *m_isConstant && !*m_isEmpty ) |
There was a problem hiding this comment.
shouldn't we throw a runtime error on m_isEmpty if storeChunk is called on it?
There was a problem hiding this comment.
My intention was to allow writing generic code that does not need to distinguish empty datasets from non-empty ones. The offset and extent are still sanity-checked, meaning that the call to storeChunk will throw anyway if a non-empty chunk is passed. If all checks pass, this operation is a no-op.
There was a problem hiding this comment.
So just to understand this better: what do you consider a valid value for data in this case?
There was a problem hiding this comment.
I guess you are hinting at the following lines?
if( !data )
throw std::runtime_error("Unallocated pointer passed during chunk store.");You are raising a point that I didn't think about thoroughly enough apparently. C++ does not allow zero-sized arrays (I was under the impression it did), so the user will need to make some distinction. (Meaning I'll have to check my PIConGPU plugin)
I guess, we should let nullpointers slide in this case?
There was a problem hiding this comment.
I mean I follow your wish to have simple code paths, but just contextually it seams wrong to me to call storeChunk on a constant or empty record component.
If we decided to allow this, which I feel makes the API actually more corner-casy than simple, then the only logically allowed value for data should be a nullptr because everything else is quite surprising.
There was a problem hiding this comment.
Using storeChunk on a constant record component is still forbidden because its intention in the openPMD standard is to be an alternative to dealing with chunks.
Here, on the other hand, constant record components are merely an (arguably quick and dirty) implementation to allow storing chunks that are incidentally empty.
But given this implementation, I see your point that storeChunk may give the wrong impression that the backend will eventually receive a dataset-related task which is definitely not the case. And since the C++ standard already makes a unified code path impossible, I would be ok with removing this functionality again if you prefer.
Related question: storeChunk does not yet support workflows where one rank contributes no data to a dataset that has data, right? We should consider this, if we decide to keep the change.
There was a problem hiding this comment.
(answered below since mail answer was wrapped around)
| namespace detail | ||
| { | ||
| template< typename RecordComponent_T > | ||
| struct DefaultValue |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| std::shared_ptr< Dataset > m_dataset; | ||
| std::shared_ptr< bool > m_isConstant; | ||
| }; // BaseRecordComponent | ||
| namespace detail |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
src/RecordComponent.cpp
Outdated
| { | ||
| if( written ) | ||
| throw std::runtime_error("A Records Dataset can not (yet) be changed after it has been written."); | ||
| throw std::runtime_error( "A Records Dataset can not (yet) be changed " |
There was a problem hiding this comment.
typos:
| throw std::runtime_error( "A Records Dataset can not (yet) be changed " | |
| throw std::runtime_error( "A record's Dataset cannot (yet) be changed " |
src/RecordComponent.cpp
Outdated
| { | ||
| if( written ) | ||
| throw std::runtime_error( | ||
| "A recordComponent can not (yet) be made" |
There was a problem hiding this comment.
RecordComponent is a type, so let's keep the spelling to the typename as above:
| "A recordComponent can not (yet) be made" | |
| "A RecordComponent cannot (yet) be made" |
test/SerialIOTest.cpp
Outdated
| { | ||
| for (auto const & t: backends) | ||
| { | ||
| //if (std::get<0>(t) == "json") |
|
Agreed.
Related question: `storeChunk` does not yet support workflows where one rank contributes no data to a dataset that has data, right? We should consider this, if we decide to keep the change.
Regarding the last point: no, storeChunk supports partial zero contributions (if not even all-zero for most backends). That's an important use case, e.g. for particles.
|
|
Agreed = agreed to removing it again?
Isn't the nullpointer check problematic in this case? |
|
|
||
| /** | ||
| * Create a dataset with zero extent in each dimension. | ||
| * Implemented by creating a constant record component with |
There was a problem hiding this comment.
potentially add an empty comment line to separate title and brief description in doxygen :)
| namespace detail | ||
| { | ||
| /** | ||
| * Functor template to be used in combination with <switchType>"()" |
There was a problem hiding this comment.
Maybe also keep a one-line title and a separate brief description here.
No, no contribution means: do not call |
See also openPMD#529 Add a non-template overload to RecordComponent::makeEmpty Add tests for previous commit Refactor python binding to use non-template version of makeEmpty Add python tests for make_empty Add an overload to RecordComponent.make_empty for numpy datatypes Add tests for numpy datatypes Fix datatype tests Only test fixed-sized types
See also openPMD#529 Add a non-template overload to RecordComponent::makeEmpty Add tests for previous commit Refactor python binding to use non-template version of makeEmpty Add python tests for make_empty Add an overload to RecordComponent.make_empty for numpy datatypes Add tests for numpy datatypes Fix datatype tests Only test fixed-sized types
See also openPMD#529 Add a non-template overload to RecordComponent::makeEmpty Add tests for previous commit Refactor python binding to use non-template version of makeEmpty Add python tests for make_empty Add an overload to RecordComponent.make_empty for numpy datatypes Add tests for numpy datatypes Fix datatype tests Only test fixed-sized types
See openPMD PR: openPMD/openPMD-api#529 This allows to write empty datasets
Create openPMDWriter based on ADIOSWriter (WIP) Adapt CountParticles partially to openPMD Adapt WriteSpecies to openPMD Translate WriteMeta.hpp to openPMD Add function "asStandardVector()" Translate NDScalars.hpp to openPMD Adapt everything to openPMD except for the main file (openPMDWriter.hpp) Adapt openPMDWriter.hpp to openPMD WIP Change management of openPMD Series Further adapt openPMDWriter to openPMD Add openPMD to CMake Add openPMD to version formatting Properly acquaint openPMD plugin with build and help system Make openPMD namespacing explicit Remove adios-specific fields from ThreadParams First successfull run with LaserWakeField example Cleanup Use clang-format Update licensing information Separate basename and filename extension into two separate help parameters Refactor dataset creation Use Mesh::setTimeOffset() template Causes a linker error with the current version of openPMD API, a fix will be merged soon on the dev branch. Clean up some leftovers Use ASCII characters to spell my name Remove unnecessary whitespaces Adapt to removal of pmacc::forward Remove accidentally versioned config file Make checkpoints usable Fix a number of bugs concerning the reading of checkpoints Still problematic is the attribute "timeOffset", currently mitigated by uncommenting the sanity check in the openPMD API. Needs further investigation. Remove CollectFieldsSizes Legacy from ADIOS writer, not necessary in openPMD. Remove ParticleAttributeSize and openPMDCountParticles Legacy from ADIOS Writer Use clang-format Adhere to openPMD requirements before flushing For a given particle species, the openPMD API requires that required records (such as "position", "positionOffset") and their contained components be defined (not necessarily written). Make sure to define all such datasets before issuing the first flush. Maybe open an issue in the openPMD API to allow for a more flexible usage. Fix an indexing bug Eliminate dataset preparation for NDScalars Also fix a bug where particles were named wrongly in checkpoints. Do not write empty particle datasets Treat non-existing datasets as empty in reading Remove prepared datasets Remove WithWindow struct Use transform to enable ADIOS1 compression Remove accidentally versioned files Rename LoadParticleAttributesFromADIOS to LoadParticleAttributesFromOpenPMD Remove traces of the old ADIOS plugin mostly the word "adios" from comments Take copies and not references of openPMD handles Fix autoformatting Require newer openPMD API Also add ADIOS2_ROOT to CMAKE_PREFIX_PATH Add version label to format string only if present Replace typedefs with using Remove further indexing bug in writing particles_info table Cleanup restart Remove dataset preparation Commit 0b50561 reintroduced a reduced form of dataset preparation in order to adhere to requirements (restrictions) of the openPMD API. This workaround results in dummy dataset writes (likely a bug in the openPMD API), hence this commit reverts those changes. The corresponding pull request in the openPMD API to relax this restriction can be found at openPMD/openPMD-api#518. Postpone writing of meta attributes Due to a bug in the ADIOS1 backend of the openPMD API, the first dataset needs to be written before the first flush. This works around the problem by first defining all the fields and particles. Bug report will follow. Resolve counting bug during particle writing Fix whitespaces Separate ADIOS and HDF5 particle writing strategies Allow choosing strategy as runtime parameter Cleanup Fix openPMD version formatting Update examples to use openPMD Refactor passing of filename and extension Reassemble filename and extension upon opening the series. Fix some missing includes Do not skip writing empty datasets See openPMD PR: openPMD/openPMD-api#529 This allows to write empty datasets Remove debugging leftovers Write timeOffset for particles in a standard-compliant way Do not declare zero-sized arrays C++ standard requires that array size evaluate to a value greater than zero. Do not use storeChunk on empty datasets centralize initialization of thread params from config Fix undefined identifier in assert statements Error passes silently in release builds. Pass JSON config to openPMD::Series ctor Do not copy Series object see openPMD/openPMD-api#534 Allow NULL as configuration infix to denote empty string Adapt to changes in pmacc etc. Enable use of group-based layout as well Requires keeping openPMD Series open. Since openPMD currently has no explicit call to close a file, we implement this only for group-based layout for now. Do not use deprecated Series::setSoftwareVersion call Apply commit b797c0a to openPMD backend Formatting in .cfg files Fix an uninitialized value and an indexing bug Implement reviewers' comments concerning CMakeLists
Create openPMDWriter based on ADIOSWriter (WIP) Adapt CountParticles partially to openPMD Adapt WriteSpecies to openPMD Translate WriteMeta.hpp to openPMD Add function "asStandardVector()" Translate NDScalars.hpp to openPMD Adapt everything to openPMD except for the main file (openPMDWriter.hpp) Adapt openPMDWriter.hpp to openPMD WIP Change management of openPMD Series Further adapt openPMDWriter to openPMD Add openPMD to CMake Add openPMD to version formatting Properly acquaint openPMD plugin with build and help system Make openPMD namespacing explicit Remove adios-specific fields from ThreadParams First successfull run with LaserWakeField example Cleanup Use clang-format Update licensing information Separate basename and filename extension into two separate help parameters Refactor dataset creation Use Mesh::setTimeOffset() template Causes a linker error with the current version of openPMD API, a fix will be merged soon on the dev branch. Clean up some leftovers Use ASCII characters to spell my name Remove unnecessary whitespaces Adapt to removal of pmacc::forward Remove accidentally versioned config file Make checkpoints usable Fix a number of bugs concerning the reading of checkpoints Still problematic is the attribute "timeOffset", currently mitigated by uncommenting the sanity check in the openPMD API. Needs further investigation. Remove CollectFieldsSizes Legacy from ADIOS writer, not necessary in openPMD. Remove ParticleAttributeSize and openPMDCountParticles Legacy from ADIOS Writer Use clang-format Adhere to openPMD requirements before flushing For a given particle species, the openPMD API requires that required records (such as "position", "positionOffset") and their contained components be defined (not necessarily written). Make sure to define all such datasets before issuing the first flush. Maybe open an issue in the openPMD API to allow for a more flexible usage. Fix an indexing bug Eliminate dataset preparation for NDScalars Also fix a bug where particles were named wrongly in checkpoints. Do not write empty particle datasets Treat non-existing datasets as empty in reading Remove prepared datasets Remove WithWindow struct Use transform to enable ADIOS1 compression Remove accidentally versioned files Rename LoadParticleAttributesFromADIOS to LoadParticleAttributesFromOpenPMD Remove traces of the old ADIOS plugin mostly the word "adios" from comments Take copies and not references of openPMD handles Fix autoformatting Require newer openPMD API Also add ADIOS2_ROOT to CMAKE_PREFIX_PATH Add version label to format string only if present Replace typedefs with using Remove further indexing bug in writing particles_info table Cleanup restart Remove dataset preparation Commit 0b50561 reintroduced a reduced form of dataset preparation in order to adhere to requirements (restrictions) of the openPMD API. This workaround results in dummy dataset writes (likely a bug in the openPMD API), hence this commit reverts those changes. The corresponding pull request in the openPMD API to relax this restriction can be found at openPMD/openPMD-api#518. Postpone writing of meta attributes Due to a bug in the ADIOS1 backend of the openPMD API, the first dataset needs to be written before the first flush. This works around the problem by first defining all the fields and particles. Bug report will follow. Resolve counting bug during particle writing Fix whitespaces Separate ADIOS and HDF5 particle writing strategies Allow choosing strategy as runtime parameter Cleanup Fix openPMD version formatting Update examples to use openPMD Refactor passing of filename and extension Reassemble filename and extension upon opening the series. Fix some missing includes Do not skip writing empty datasets See openPMD PR: openPMD/openPMD-api#529 This allows to write empty datasets Remove debugging leftovers Write timeOffset for particles in a standard-compliant way Do not declare zero-sized arrays C++ standard requires that array size evaluate to a value greater than zero. Do not use storeChunk on empty datasets centralize initialization of thread params from config Fix undefined identifier in assert statements Error passes silently in release builds. Pass JSON config to openPMD::Series ctor Do not copy Series object see openPMD/openPMD-api#534 Allow NULL as configuration infix to denote empty string Adapt to changes in pmacc etc. Enable use of group-based layout as well Requires keeping openPMD Series open. Since openPMD currently has no explicit call to close a file, we implement this only for group-based layout for now. Do not use deprecated Series::setSoftwareVersion call Apply commit b797c0a to openPMD backend Formatting in .cfg files Fix an uninitialized value and an indexing bug Implement reviewers' comments concerning CMakeLists
Create openPMDWriter based on ADIOSWriter (WIP) Adapt CountParticles partially to openPMD Adapt WriteSpecies to openPMD Translate WriteMeta.hpp to openPMD Add function "asStandardVector()" Translate NDScalars.hpp to openPMD Adapt everything to openPMD except for the main file (openPMDWriter.hpp) Adapt openPMDWriter.hpp to openPMD WIP Change management of openPMD Series Further adapt openPMDWriter to openPMD Add openPMD to CMake Add openPMD to version formatting Properly acquaint openPMD plugin with build and help system Make openPMD namespacing explicit Remove adios-specific fields from ThreadParams First successfull run with LaserWakeField example Cleanup Use clang-format Update licensing information Separate basename and filename extension into two separate help parameters Refactor dataset creation Use Mesh::setTimeOffset() template Causes a linker error with the current version of openPMD API, a fix will be merged soon on the dev branch. Clean up some leftovers Use ASCII characters to spell my name Remove unnecessary whitespaces Adapt to removal of pmacc::forward Remove accidentally versioned config file Make checkpoints usable Fix a number of bugs concerning the reading of checkpoints Still problematic is the attribute "timeOffset", currently mitigated by uncommenting the sanity check in the openPMD API. Needs further investigation. Remove CollectFieldsSizes Legacy from ADIOS writer, not necessary in openPMD. Remove ParticleAttributeSize and openPMDCountParticles Legacy from ADIOS Writer Use clang-format Adhere to openPMD requirements before flushing For a given particle species, the openPMD API requires that required records (such as "position", "positionOffset") and their contained components be defined (not necessarily written). Make sure to define all such datasets before issuing the first flush. Maybe open an issue in the openPMD API to allow for a more flexible usage. Fix an indexing bug Eliminate dataset preparation for NDScalars Also fix a bug where particles were named wrongly in checkpoints. Do not write empty particle datasets Treat non-existing datasets as empty in reading Remove prepared datasets Remove WithWindow struct Use transform to enable ADIOS1 compression Remove accidentally versioned files Rename LoadParticleAttributesFromADIOS to LoadParticleAttributesFromOpenPMD Remove traces of the old ADIOS plugin mostly the word "adios" from comments Take copies and not references of openPMD handles Fix autoformatting Require newer openPMD API Also add ADIOS2_ROOT to CMAKE_PREFIX_PATH Add version label to format string only if present Replace typedefs with using Remove further indexing bug in writing particles_info table Cleanup restart Remove dataset preparation Commit 0b50561 reintroduced a reduced form of dataset preparation in order to adhere to requirements (restrictions) of the openPMD API. This workaround results in dummy dataset writes (likely a bug in the openPMD API), hence this commit reverts those changes. The corresponding pull request in the openPMD API to relax this restriction can be found at openPMD/openPMD-api#518. Postpone writing of meta attributes Due to a bug in the ADIOS1 backend of the openPMD API, the first dataset needs to be written before the first flush. This works around the problem by first defining all the fields and particles. Bug report will follow. Resolve counting bug during particle writing Fix whitespaces Separate ADIOS and HDF5 particle writing strategies Allow choosing strategy as runtime parameter Cleanup Fix openPMD version formatting Update examples to use openPMD Refactor passing of filename and extension Reassemble filename and extension upon opening the series. Fix some missing includes Do not skip writing empty datasets See openPMD PR: openPMD/openPMD-api#529 This allows to write empty datasets Remove debugging leftovers Write timeOffset for particles in a standard-compliant way Do not declare zero-sized arrays C++ standard requires that array size evaluate to a value greater than zero. Do not use storeChunk on empty datasets centralize initialization of thread params from config Fix undefined identifier in assert statements Error passes silently in release builds. Pass JSON config to openPMD::Series ctor Do not copy Series object see openPMD/openPMD-api#534 Allow NULL as configuration infix to denote empty string Adapt to changes in pmacc etc. Enable use of group-based layout as well Requires keeping openPMD Series open. Since openPMD currently has no explicit call to close a file, we implement this only for group-based layout for now. Do not use deprecated Series::setSoftwareVersion call Apply commit b797c0a to openPMD backend Formatting in .cfg files Fix an uninitialized value and an indexing bug Implement reviewers' comments concerning CMakeLists
See also openPMD#529 Add a non-template overload to RecordComponent::makeEmpty Add tests for previous commit Refactor python binding to use non-template version of makeEmpty Add python tests for make_empty Add an overload to RecordComponent.make_empty for numpy datatypes Add tests for numpy datatypes Fix datatype tests Only test fixed-sized types
See also openPMD#529 Add a non-template overload to RecordComponent::makeEmpty Add tests for previous commit Refactor python binding to use non-template version of makeEmpty Add python tests for make_empty Add an overload to RecordComponent.make_empty for numpy datatypes Add tests for numpy datatypes Fix datatype tests Only test fixed-sized types
See also openPMD#529 Add a non-template overload to RecordComponent::makeEmpty Add tests for previous commit Refactor python binding to use non-template version of makeEmpty Add python tests for make_empty Add an overload to RecordComponent.make_empty for numpy datatypes Add tests for numpy datatypes Fix datatype tests Only test fixed-sized types
See also openPMD#529 Add a non-template overload to RecordComponent::makeEmpty Add tests for previous commit Refactor python binding to use non-template version of makeEmpty Add python tests for make_empty Add an overload to RecordComponent.make_empty for numpy datatypes Add tests for numpy datatypes Fix datatype tests Only test fixed-sized types
See also openPMD#529 Add a non-template overload to RecordComponent::makeEmpty Add tests for previous commit Refactor python binding to use non-template version of makeEmpty Add python tests for make_empty Add an overload to RecordComponent.make_empty for numpy datatypes Add tests for numpy datatypes Fix datatype tests Only test fixed-sized types
Create openPMDWriter based on ADIOSWriter (WIP) Adapt CountParticles partially to openPMD Adapt WriteSpecies to openPMD Translate WriteMeta.hpp to openPMD Add function "asStandardVector()" Translate NDScalars.hpp to openPMD Adapt everything to openPMD except for the main file (openPMDWriter.hpp) Adapt openPMDWriter.hpp to openPMD WIP Change management of openPMD Series Further adapt openPMDWriter to openPMD Add openPMD to CMake Add openPMD to version formatting Properly acquaint openPMD plugin with build and help system Make openPMD namespacing explicit Remove adios-specific fields from ThreadParams First successfull run with LaserWakeField example Cleanup Use clang-format Update licensing information Separate basename and filename extension into two separate help parameters Refactor dataset creation Use Mesh::setTimeOffset() template Causes a linker error with the current version of openPMD API, a fix will be merged soon on the dev branch. Clean up some leftovers Use ASCII characters to spell my name Remove unnecessary whitespaces Adapt to removal of pmacc::forward Remove accidentally versioned config file Make checkpoints usable Fix a number of bugs concerning the reading of checkpoints Still problematic is the attribute "timeOffset", currently mitigated by uncommenting the sanity check in the openPMD API. Needs further investigation. Remove CollectFieldsSizes Legacy from ADIOS writer, not necessary in openPMD. Remove ParticleAttributeSize and openPMDCountParticles Legacy from ADIOS Writer Use clang-format Adhere to openPMD requirements before flushing For a given particle species, the openPMD API requires that required records (such as "position", "positionOffset") and their contained components be defined (not necessarily written). Make sure to define all such datasets before issuing the first flush. Maybe open an issue in the openPMD API to allow for a more flexible usage. Fix an indexing bug Eliminate dataset preparation for NDScalars Also fix a bug where particles were named wrongly in checkpoints. Do not write empty particle datasets Treat non-existing datasets as empty in reading Remove prepared datasets Remove WithWindow struct Use transform to enable ADIOS1 compression Remove accidentally versioned files Rename LoadParticleAttributesFromADIOS to LoadParticleAttributesFromOpenPMD Remove traces of the old ADIOS plugin mostly the word "adios" from comments Take copies and not references of openPMD handles Fix autoformatting Require newer openPMD API Also add ADIOS2_ROOT to CMAKE_PREFIX_PATH Add version label to format string only if present Replace typedefs with using Remove further indexing bug in writing particles_info table Cleanup restart Remove dataset preparation Commit 0b50561 reintroduced a reduced form of dataset preparation in order to adhere to requirements (restrictions) of the openPMD API. This workaround results in dummy dataset writes (likely a bug in the openPMD API), hence this commit reverts those changes. The corresponding pull request in the openPMD API to relax this restriction can be found at openPMD/openPMD-api#518. Postpone writing of meta attributes Due to a bug in the ADIOS1 backend of the openPMD API, the first dataset needs to be written before the first flush. This works around the problem by first defining all the fields and particles. Bug report will follow. Resolve counting bug during particle writing Fix whitespaces Separate ADIOS and HDF5 particle writing strategies Allow choosing strategy as runtime parameter Cleanup Fix openPMD version formatting Update examples to use openPMD Refactor passing of filename and extension Reassemble filename and extension upon opening the series. Fix some missing includes Do not skip writing empty datasets See openPMD PR: openPMD/openPMD-api#529 This allows to write empty datasets Remove debugging leftovers Write timeOffset for particles in a standard-compliant way Do not declare zero-sized arrays C++ standard requires that array size evaluate to a value greater than zero. Do not use storeChunk on empty datasets centralize initialization of thread params from config Fix undefined identifier in assert statements Error passes silently in release builds. Pass JSON config to openPMD::Series ctor Do not copy Series object see openPMD/openPMD-api#534 Allow NULL as configuration infix to denote empty string Adapt to changes in pmacc etc. Enable use of group-based layout as well Requires keeping openPMD Series open. Since openPMD currently has no explicit call to close a file, we implement this only for group-based layout for now. Do not use deprecated Series::setSoftwareVersion call Apply commit b797c0a to openPMD backend Formatting in .cfg files Fix an uninitialized value and an indexing bug Implement reviewers' comments concerning CMakeLists
See also openPMD#529 Add a non-template overload to RecordComponent::makeEmpty Add tests for previous commit Refactor python binding to use non-template version of makeEmpty Add python tests for make_empty Add an overload to RecordComponent.make_empty for numpy datatypes Add tests for numpy datatypes Fix datatype tests Only test fixed-sized types
Create openPMDWriter based on ADIOSWriter (WIP) Adapt CountParticles partially to openPMD Adapt WriteSpecies to openPMD Translate WriteMeta.hpp to openPMD Add function "asStandardVector()" Translate NDScalars.hpp to openPMD Adapt everything to openPMD except for the main file (openPMDWriter.hpp) Adapt openPMDWriter.hpp to openPMD WIP Change management of openPMD Series Further adapt openPMDWriter to openPMD Add openPMD to CMake Add openPMD to version formatting Properly acquaint openPMD plugin with build and help system Make openPMD namespacing explicit Remove adios-specific fields from ThreadParams First successfull run with LaserWakeField example Cleanup Use clang-format Update licensing information Separate basename and filename extension into two separate help parameters Refactor dataset creation Use Mesh::setTimeOffset() template Causes a linker error with the current version of openPMD API, a fix will be merged soon on the dev branch. Clean up some leftovers Use ASCII characters to spell my name Remove unnecessary whitespaces Adapt to removal of pmacc::forward Remove accidentally versioned config file Make checkpoints usable Fix a number of bugs concerning the reading of checkpoints Still problematic is the attribute "timeOffset", currently mitigated by uncommenting the sanity check in the openPMD API. Needs further investigation. Remove CollectFieldsSizes Legacy from ADIOS writer, not necessary in openPMD. Remove ParticleAttributeSize and openPMDCountParticles Legacy from ADIOS Writer Use clang-format Adhere to openPMD requirements before flushing For a given particle species, the openPMD API requires that required records (such as "position", "positionOffset") and their contained components be defined (not necessarily written). Make sure to define all such datasets before issuing the first flush. Maybe open an issue in the openPMD API to allow for a more flexible usage. Fix an indexing bug Eliminate dataset preparation for NDScalars Also fix a bug where particles were named wrongly in checkpoints. Do not write empty particle datasets Treat non-existing datasets as empty in reading Remove prepared datasets Remove WithWindow struct Use transform to enable ADIOS1 compression Remove accidentally versioned files Rename LoadParticleAttributesFromADIOS to LoadParticleAttributesFromOpenPMD Remove traces of the old ADIOS plugin mostly the word "adios" from comments Take copies and not references of openPMD handles Fix autoformatting Require newer openPMD API Also add ADIOS2_ROOT to CMAKE_PREFIX_PATH Add version label to format string only if present Replace typedefs with using Remove further indexing bug in writing particles_info table Cleanup restart Remove dataset preparation Commit 0b50561 reintroduced a reduced form of dataset preparation in order to adhere to requirements (restrictions) of the openPMD API. This workaround results in dummy dataset writes (likely a bug in the openPMD API), hence this commit reverts those changes. The corresponding pull request in the openPMD API to relax this restriction can be found at openPMD/openPMD-api#518. Postpone writing of meta attributes Due to a bug in the ADIOS1 backend of the openPMD API, the first dataset needs to be written before the first flush. This works around the problem by first defining all the fields and particles. Bug report will follow. Resolve counting bug during particle writing Fix whitespaces Separate ADIOS and HDF5 particle writing strategies Allow choosing strategy as runtime parameter Cleanup Fix openPMD version formatting Update examples to use openPMD Refactor passing of filename and extension Reassemble filename and extension upon opening the series. Fix some missing includes Do not skip writing empty datasets See openPMD PR: openPMD/openPMD-api#529 This allows to write empty datasets Remove debugging leftovers Write timeOffset for particles in a standard-compliant way Do not declare zero-sized arrays C++ standard requires that array size evaluate to a value greater than zero. Do not use storeChunk on empty datasets centralize initialization of thread params from config Fix undefined identifier in assert statements Error passes silently in release builds. Pass JSON config to openPMD::Series ctor Do not copy Series object see openPMD/openPMD-api#534 Allow NULL as configuration infix to denote empty string Adapt to changes in pmacc etc. Enable use of group-based layout as well Requires keeping openPMD Series open. Since openPMD currently has no explicit call to close a file, we implement this only for group-based layout for now. Do not use deprecated Series::setSoftwareVersion call Apply commit b797c0a to openPMD backend Formatting in .cfg files Fix an uninitialized value and an indexing bug Implement reviewers' comments concerning CMakeLists
Create openPMDWriter based on ADIOSWriter (WIP) Adapt CountParticles partially to openPMD Adapt WriteSpecies to openPMD Translate WriteMeta.hpp to openPMD Add function "asStandardVector()" Translate NDScalars.hpp to openPMD Adapt everything to openPMD except for the main file (openPMDWriter.hpp) Adapt openPMDWriter.hpp to openPMD WIP Change management of openPMD Series Further adapt openPMDWriter to openPMD Add openPMD to CMake Add openPMD to version formatting Properly acquaint openPMD plugin with build and help system Make openPMD namespacing explicit Remove adios-specific fields from ThreadParams First successfull run with LaserWakeField example Cleanup Use clang-format Update licensing information Separate basename and filename extension into two separate help parameters Refactor dataset creation Use Mesh::setTimeOffset() template Causes a linker error with the current version of openPMD API, a fix will be merged soon on the dev branch. Clean up some leftovers Use ASCII characters to spell my name Remove unnecessary whitespaces Adapt to removal of pmacc::forward Remove accidentally versioned config file Make checkpoints usable Fix a number of bugs concerning the reading of checkpoints Still problematic is the attribute "timeOffset", currently mitigated by uncommenting the sanity check in the openPMD API. Needs further investigation. Remove CollectFieldsSizes Legacy from ADIOS writer, not necessary in openPMD. Remove ParticleAttributeSize and openPMDCountParticles Legacy from ADIOS Writer Use clang-format Adhere to openPMD requirements before flushing For a given particle species, the openPMD API requires that required records (such as "position", "positionOffset") and their contained components be defined (not necessarily written). Make sure to define all such datasets before issuing the first flush. Maybe open an issue in the openPMD API to allow for a more flexible usage. Fix an indexing bug Eliminate dataset preparation for NDScalars Also fix a bug where particles were named wrongly in checkpoints. Do not write empty particle datasets Treat non-existing datasets as empty in reading Remove prepared datasets Remove WithWindow struct Use transform to enable ADIOS1 compression Remove accidentally versioned files Rename LoadParticleAttributesFromADIOS to LoadParticleAttributesFromOpenPMD Remove traces of the old ADIOS plugin mostly the word "adios" from comments Take copies and not references of openPMD handles Fix autoformatting Require newer openPMD API Also add ADIOS2_ROOT to CMAKE_PREFIX_PATH Add version label to format string only if present Replace typedefs with using Remove further indexing bug in writing particles_info table Cleanup restart Remove dataset preparation Commit 0b50561 reintroduced a reduced form of dataset preparation in order to adhere to requirements (restrictions) of the openPMD API. This workaround results in dummy dataset writes (likely a bug in the openPMD API), hence this commit reverts those changes. The corresponding pull request in the openPMD API to relax this restriction can be found at openPMD/openPMD-api#518. Postpone writing of meta attributes Due to a bug in the ADIOS1 backend of the openPMD API, the first dataset needs to be written before the first flush. This works around the problem by first defining all the fields and particles. Bug report will follow. Resolve counting bug during particle writing Fix whitespaces Separate ADIOS and HDF5 particle writing strategies Allow choosing strategy as runtime parameter Cleanup Fix openPMD version formatting Update examples to use openPMD Refactor passing of filename and extension Reassemble filename and extension upon opening the series. Fix some missing includes Do not skip writing empty datasets See openPMD PR: openPMD/openPMD-api#529 This allows to write empty datasets Remove debugging leftovers Write timeOffset for particles in a standard-compliant way Do not declare zero-sized arrays C++ standard requires that array size evaluate to a value greater than zero. Do not use storeChunk on empty datasets centralize initialization of thread params from config Fix undefined identifier in assert statements Error passes silently in release builds. Pass JSON config to openPMD::Series ctor Do not copy Series object see openPMD/openPMD-api#534 Allow NULL as configuration infix to denote empty string Adapt to changes in pmacc etc. Enable use of group-based layout as well Requires keeping openPMD Series open. Since openPMD currently has no explicit call to close a file, we implement this only for group-based layout for now. Do not use deprecated Series::setSoftwareVersion call Apply commit b797c0a to openPMD backend Formatting in .cfg files Fix an uninitialized value and an indexing bug Implement reviewers' comments concerning CMakeLists Fix some bugs and remove unneeded parameters Some ADIOS-specific parameters have been remove that haven't been implemented anyway and are going to be implemented via JSON. Don't set compression if set to "none". Also, I missed a small part when porting b797c0a to this plugin. Add documentation for openPMD plugin [WIP] Further write documentation Rename data preparation strategies adios -> doubleBuffer hdf5 -> mappedMemory Old names may still be used alternatively. Fix indexing bug for non domain-bound fields Fix indexing order in fields Implement Reviewer's comments Remove workaround for ADIOS1 backend fix attributes Mesh record component positions and unitSI Iteration: time ParticleAttribute unitDimension Implement reviewer's comments (2) Update copyright headers of files changed Add compression to openPMD TBG example Use openPMD::getVersion remove unnecessary parentheses
Create openPMDWriter based on ADIOSWriter (WIP) Adapt CountParticles partially to openPMD Adapt WriteSpecies to openPMD Translate WriteMeta.hpp to openPMD Add function "asStandardVector()" Translate NDScalars.hpp to openPMD Adapt everything to openPMD except for the main file (openPMDWriter.hpp) Adapt openPMDWriter.hpp to openPMD WIP Change management of openPMD Series Further adapt openPMDWriter to openPMD Add openPMD to CMake Add openPMD to version formatting Properly acquaint openPMD plugin with build and help system Make openPMD namespacing explicit Remove adios-specific fields from ThreadParams First successfull run with LaserWakeField example Cleanup Use clang-format Update licensing information Separate basename and filename extension into two separate help parameters Refactor dataset creation Use Mesh::setTimeOffset() template Causes a linker error with the current version of openPMD API, a fix will be merged soon on the dev branch. Clean up some leftovers Use ASCII characters to spell my name Remove unnecessary whitespaces Adapt to removal of pmacc::forward Remove accidentally versioned config file Make checkpoints usable Fix a number of bugs concerning the reading of checkpoints Still problematic is the attribute "timeOffset", currently mitigated by uncommenting the sanity check in the openPMD API. Needs further investigation. Remove CollectFieldsSizes Legacy from ADIOS writer, not necessary in openPMD. Remove ParticleAttributeSize and openPMDCountParticles Legacy from ADIOS Writer Use clang-format Adhere to openPMD requirements before flushing For a given particle species, the openPMD API requires that required records (such as "position", "positionOffset") and their contained components be defined (not necessarily written). Make sure to define all such datasets before issuing the first flush. Maybe open an issue in the openPMD API to allow for a more flexible usage. Fix an indexing bug Eliminate dataset preparation for NDScalars Also fix a bug where particles were named wrongly in checkpoints. Do not write empty particle datasets Treat non-existing datasets as empty in reading Remove prepared datasets Remove WithWindow struct Use transform to enable ADIOS1 compression Remove accidentally versioned files Rename LoadParticleAttributesFromADIOS to LoadParticleAttributesFromOpenPMD Remove traces of the old ADIOS plugin mostly the word "adios" from comments Take copies and not references of openPMD handles Fix autoformatting Require newer openPMD API Also add ADIOS2_ROOT to CMAKE_PREFIX_PATH Add version label to format string only if present Replace typedefs with using Remove further indexing bug in writing particles_info table Cleanup restart Remove dataset preparation Commit 0b50561 reintroduced a reduced form of dataset preparation in order to adhere to requirements (restrictions) of the openPMD API. This workaround results in dummy dataset writes (likely a bug in the openPMD API), hence this commit reverts those changes. The corresponding pull request in the openPMD API to relax this restriction can be found at openPMD/openPMD-api#518. Postpone writing of meta attributes Due to a bug in the ADIOS1 backend of the openPMD API, the first dataset needs to be written before the first flush. This works around the problem by first defining all the fields and particles. Bug report will follow. Resolve counting bug during particle writing Fix whitespaces Separate ADIOS and HDF5 particle writing strategies Allow choosing strategy as runtime parameter Cleanup Fix openPMD version formatting Update examples to use openPMD Refactor passing of filename and extension Reassemble filename and extension upon opening the series. Fix some missing includes Do not skip writing empty datasets See openPMD PR: openPMD/openPMD-api#529 This allows to write empty datasets Remove debugging leftovers Write timeOffset for particles in a standard-compliant way Do not declare zero-sized arrays C++ standard requires that array size evaluate to a value greater than zero. Do not use storeChunk on empty datasets centralize initialization of thread params from config Fix undefined identifier in assert statements Error passes silently in release builds. Pass JSON config to openPMD::Series ctor Do not copy Series object see openPMD/openPMD-api#534 Allow NULL as configuration infix to denote empty string Adapt to changes in pmacc etc. Enable use of group-based layout as well Requires keeping openPMD Series open. Since openPMD currently has no explicit call to close a file, we implement this only for group-based layout for now. Do not use deprecated Series::setSoftwareVersion call Apply commit b797c0a to openPMD backend Formatting in .cfg files Fix an uninitialized value and an indexing bug Implement reviewers' comments concerning CMakeLists Fix some bugs and remove unneeded parameters Some ADIOS-specific parameters have been remove that haven't been implemented anyway and are going to be implemented via JSON. Don't set compression if set to "none". Also, I missed a small part when porting b797c0a to this plugin. Add documentation for openPMD plugin [WIP] Further write documentation Rename data preparation strategies adios -> doubleBuffer hdf5 -> mappedMemory Old names may still be used alternatively. Fix indexing bug for non domain-bound fields Fix indexing order in fields Implement Reviewer's comments Remove workaround for ADIOS1 backend fix attributes Mesh record component positions and unitSI Iteration: time ParticleAttribute unitDimension Implement reviewer's comments (2) Update copyright headers of files changed Add compression to openPMD TBG example Use openPMD::getVersion remove unnecessary parentheses
See also openPMD#529 Add a non-template overload to RecordComponent::makeEmpty Add tests for previous commit Refactor python binding to use non-template version of makeEmpty Add python tests for make_empty Add an overload to RecordComponent.make_empty for numpy datatypes Add tests for numpy datatypes Fix datatype tests Only test fixed-sized types
* Add Python bindings for RecordComponent::makeEmpty() See also #529 Add a non-template overload to RecordComponent::makeEmpty Add tests for previous commit Refactor python binding to use non-template version of makeEmpty Add python tests for make_empty Add an overload to RecordComponent.make_empty for numpy datatypes Add tests for numpy datatypes Fix datatype tests Only test fixed-sized types * Fix whitespaces
Close #514 and #516.
This PR adds the following member to the class
RecordComponent:This lets the user explicitly create an empty dataset.
Upon detecting an empty dataset, the member
RecordComponent& resetDataset(Dataset);will not fail any more, but also create an empty dataset.Since backends do currently not expect empty datasets, I implemented this feature by using constant record components. Zero-dimensional datasets are still not allowed.