Add overflow check to dump_h5md

This commit is contained in:
Stan Gerald Moore
2021-12-21 13:28:36 -07:00
parent 5932a3f6f9
commit 2fec3eee6b
2 changed files with 6 additions and 0 deletions

View File

@ -181,6 +181,7 @@ DumpH5MD::DumpH5MD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg)
// allocate global array for atom coords
bigint n = group->count(igroup);
if ((bigint) domain->dimension*n > MAXSMALLINT) error->all(FLERR,"Too many atoms for dump h5md");
natoms = static_cast<int> (n);
if (every_position>=0)

View File

@ -90,6 +90,11 @@ E: Dump h5md requires sorting by atom ID
Use the dump_modify sort command to enable this.
E: Too many atoms for dump h5md
The system size must fit in a 32-bit integer to use this dump
style.
E: Cannot use variable every setting for dump xtc
The format of this file requires snapshots at regular intervals.