Support writing particles with ADIOS2#400
Conversation
not yet implemented
configure which columns to write
on my macbook, using 1 aggregator per proc outperforms hdf5 writes, but the default of 1 aggregator per node (i.e., 1 aggregator) underperforms hdf5. On larger scales, I'd expect this to be reversed. Since prt output isn't a bottleneck either way, I defer a complete solution.
This fixes a cursed bug wherein e.g. increasing the size of BndFields_ (by adding _hi background constants) caused a segfault in the hdf5 writer. Perhaps it only happened when using H5 prt output with BP params, which is what I was doing. On the bright side, I finally know how to use lldb/gdb.
|
The thing I'm least sure about is not using PSC's ADIOS2 wrappers. @germasch was there a reason for that/did I ADIOS2 wrong? I did notice that prt.bp was slower than prt.h5 on my laptop with default ADIOS2 parameters, with the bulk of the loss coming from the ADIOS2 write itself (not the data processing steps beforehand). |
germasch
left a comment
There was a problem hiding this comment.
LGTM 👍
One minor comment: I've been thinking about renaming p[xyz] -> u[xyz] for quite a while -- not sure it's really worth it, but it might make one point of confusion less likely. Doing so internally isn't too big of an issue, but externally (in the output) of course has compatibility issues. Since this is new, and if that renaming is indeed the plan, maybe now is the time to change the naming there?
Definitely. Should all outputs be changed, or just the ADIOS2 output? |
|
Well, I was thinking just the adios2 right now, but if you want to do the other ones, feel free ;) (probably best in a separate PR) |
The main thing here is
output_particles_adios2_impl.hxx, which provides theOutputParticlesAdios2particle diagnostic. Some highlights/notes:prt.i.<step>.bpandprt.e.<step>.bp. Species name, charge, and mass are stored as file-level attributes (in addition to the usualgdims,corner,length,time).x,py,w,tag) is written to its own 1d variable, and can be independently toggled. By default,q,m,id, andtagare not written. (Assuming the remaining properties are stored as floats, this reduces disk size by 50% compared to the existing h5 implementation, from 56 bytes per particle to 28.)This PR doesn't address the problem of reading the bp data. A prt.bp reader was implemented here in psc-plot: JamesMcClung/psc-plot#33. Also see psc-code/pscpy#41.
Other minor changes:
nicell(or rather, the more self-descriptiveprts_per_unit_density) was added as a file-level attribute for bp and h5 particle data.output_particles_none_impl.hxx.