pynbody / genetIC

The GM initial conditions generator
GNU General Public License v3.0
21 stars 8 forks source link

Address inconsistency in big gadget files #94

Closed apontzen closed 3 years ago

apontzen commented 3 years ago

Gadget uses a fortran-style file format, with integers saying how long different data blocks are.

By casting a size_t to an int, when this overflowed the behaviour was undefined.

In practice, zeros got written into the fortran length field which did not play nice with pynbody.

Fix by setting fortran field size to numeric_limits::max() in these circumstances, and issuing a warning.

Add an option to split gadget output across multiple files.