Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Particle openPMD IO issues when species not present in the first dump #2900

Closed
MaxThevenet opened this issue Mar 1, 2022 · 2 comments · Fixed by #2980
Closed

Particle openPMD IO issues when species not present in the first dump #2900

MaxThevenet opened this issue Mar 1, 2022 · 2 comments · Fixed by #2980
Assignees
Labels
bug: affects latest release Bug also exists in latest release version bug Something isn't working component: diagnostics all types of outputs component: openPMD openPMD I/O

Comments

@MaxThevenet
Copy link
Member

MaxThevenet commented Mar 1, 2022

When using openPMD output, if no particles of a species is written at the first dump, the openPMD-viewer cannot read particle data in the later dumps, even if particles are actually dumped. This happens in a wakefield acceleration simulation with a moving window, where the box z dimension is originally (-100.e-6,0) and the plasma starts at 200.e-6 for some reasons.

A reproducer can be found below (using ADIOS2 here, but I think it's the same for HDF5). For a box with z = (-25.e-6,5.e-6), it runs:

  • A simulation with plasma electrons starting in the box (at z=0.e-6)
  • A simulation with plasma electrons starting out of the box (at z=10.e-6)

This is done with the following submission script (a few seconds, here on the Juwels Booster):

#!/bin/bash -l
#SBATCH -A plasmabbq
#SBATCH --partition=booster
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=4
#SBATCH --gres=gpu:4
#SBATCH --time=00:10:00
#SBATCH --job-name=test

source ../profile.sh

EXEC=$HOME/src/warpx/build/bin/warpx.3d.MPI.CUDA.DP.OPMD

srun -n 4 --cpu_bind=sockets $EXEC inputs \
     xz_slice.file_prefix = diags_in/xz_slice \
     yz_slice.file_prefix = diags_in/yz_slice \
     beams.file_prefix = diags_in/beams \
     electrons.zmin = 0.e-6 \
    &> output_in.txt

srun -n 4 --cpu_bind=sockets $EXEC inputs \
     xz_slice.file_prefix = diags_out/xz_slice \
     yz_slice.file_prefix = diags_out/yz_slice \
     beams.file_prefix = diags_out/beams \
     electrons.zmin = 10.e-6 \
    &> output_out.txt

After 500 iterations, the box contains electrons in both cases, but only the first run can be properly read by the openPMD-viewer. This can be seen with the following Notebook:

%matplotlib inline
from openpmd_viewer import OpenPMDTimeSeries

iteration = 500

# Works fine
ts_in = OpenPMDTimeSeries('diags_in/beams')
z, = ts_in.get_particle(species='electrons', iteration=iteration, var_list = ['z'])
print(z.shape)

# Gives warnings and errors
ts_out = OpenPMDTimeSeries('diags_out/beams')
z, = ts_out.get_particle(species='electrons', iteration=iteration, var_list = ['z'])
print(z.shape)

In the second case, one gets warnings and errors like:

Warning: File 200 has different openPMD parameters than the rest of the time series.
OpenPMDException: No particle data in this time series

Here is the input file used.

@MaxThevenet MaxThevenet added bug Something isn't working component: openPMD openPMD I/O component: diagnostics all types of outputs labels Mar 1, 2022
@RemiLehe
Copy link
Member

RemiLehe commented Mar 1, 2022

Yes, I have experienced the same issue. I will discuss with @ax3l next week to try to find a solution.

@ax3l ax3l added the bug: affects latest release Bug also exists in latest release version label Mar 3, 2022
@ax3l ax3l self-assigned this Mar 3, 2022
@ax3l
Copy link
Member

ax3l commented Mar 17, 2022

Thank you for the great reproducer @MaxThevenet 💖

That's in part a regression to #1898 and I am on it in #2980 :)
I will also improve a bit on our backend support for BTD from #1898.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: affects latest release Bug also exists in latest release version bug Something isn't working component: diagnostics all types of outputs component: openPMD openPMD I/O
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants