yt-project / yt

Main yt repository
http://yt-project.org
Other
467 stars 277 forks source link

DataIO Not Allocating New Buffer in Some Frontends #4185

Open cindytsai opened 1 year ago

cindytsai commented 1 year ago

DataIO Not Allocating New Buffer in Some Frontends

Summary

Some frontends didn't allocate new buffer in function _read_fluid_selection (io.py) when using GridSelector.

When running this line, it writes changes to the view of the data array read in.

grid = ds.index.grids[gid][(ftype, fname)]

This is not a problem for post-processing, cause they create a data buffer for data read from file. But this is a serious problem for in-situ analysis (Enzo in-memory and libyt frontend), as the above line tries to alter the ongoing simulation data.

Frontends that didn't allocate new buffer

neutrinoceros commented 1 year ago

Thank you @cindytsai for reporting this For completeness, did you check all frontends or just reported the ones you already found to have this problem ? I'm not sure it's a real problem as far as the AMRVAC frontend is concerned because I don't know of any way to inspect AMRVAC data for an ongoing simulation, but I can still take a look and patch it to avoid a false positive

cindytsai commented 1 year ago

Hi @neutrinoceros, thanks for replying! I have checked all the frontends, and only these frontends listed above have this problem. They are not a real problem except Enzo in-memory frontend (IOHandlerInMemory), cause the other frontends listed read data from files.