openPMD / openPMD-api

:floppy_disk: C++ & Python API for Scientific I/O
https://openpmd-api.readthedocs.io
GNU Lesser General Public License v3.0
134 stars 51 forks source link

ADIOS2: Optionally write attributes only from given ranks #1542

Closed franzpoeschel closed 7 months ago

franzpoeschel commented 8 months ago

Performance optimization especially for large scale Ref. https://github.com/ornladios/ADIOS2/issues/3846#issuecomment-1769255906

TODO:

ax3l commented 7 months ago

@eschnett thinking about portable code that also supports HDF5, would this interrupt you if we enabled this by default (in a follow-up PR)? :sweat_smile:

eschnett commented 7 months ago

@ax3l I don't understand the ramifications. On the surface this all seems benign and beneficial.

franzpoeschel commented 7 months ago

@eschnett The possible pitfall is that this would by default ignore any attribute that is not written on rank 0. Background:

In consequence: Portable code using the openPMD-api should treat attribute writes as something collective. If attributes are written collectively, there's no harm in ADIOS2 to ignore any attribute write except for those on rank 0. This is why we're thinking about enabling this by default.

If for some reason you have routines that create some data only on a few select ranks, this could lead to problems.

franzpoeschel commented 7 months ago

@ax3l If we decide to activate this by default, we should maybe add some easy way to activate attribute writing from all ranks. Currently, attribute_writing_ranks is a list of ranks that opt into writing attributes. Something like attribute_writing_ranks = "all" might then be needed to restore the current behavior.

eschnett commented 6 months ago

Thanks for the explanation.

I was not aware that openPMD treated attribute writes as global. This will be good to know.