Describe the bug
I get invalid field data , when I'm loading a PIConGPU simulation output with the API.
The fields are almost everywhere equal zero, for some iterations there are nan values as well.
If I load the same arrays using h5py, I get a normal field distribution .
To Reproduce
import openPMD
import os
import matplotlib.pyplot as plt
path = os.path.join("/bigdata/hplsim/scratch/ordyna35/runs/FoilLTC_02/", "simOutput/h5/simData_%T.h5")
series = openPMD.Series(path, openPMD.Access_Type.read_only)
i = series.iterations[1000]
B_z = i.meshes['B']['z']
B_z_dat = B_z.load_chunk([0,0], B_z.shape)
See the attached file for more details.
notebook pdf
Expected behavior
The array returned with load_chunk should be the same as the one acquired through the h5py package.
Software Environment:
Hi and thank you for the well-documented report!
Before you can use the load_chunk-ed data, make sure to perform series.flush(). openPMD-api is a asynchronous-API that by default collects several read and write operations in order to increase performance.
Side note: please be warned that the next release will change the argument order of the store_chunk/load_chunk methods in order to make it simpler: https://openpmd-api.readthedocs.io/en/latest/install/upgrade.html#alpha Just switch your argument order when updating to the upcoming 0.7.0 release in a few days.
Thank you for the tip with series.flush() now it works just fine.
Hurray, glad that helped! :)