Colvars / colvars

Collective variables library for molecular simulation and analysis programs
http://colvars.github.io/
GNU Lesser General Public License v3.0
196 stars 56 forks source link

Use 64bit integers to store prev timestep #640

Closed jhenin closed 7 months ago

jhenin commented 7 months ago

Should fix #639

giacomofiorin commented 7 months ago

Looks good to me!

For reference:

What about GROMACS 2024?

jhenin commented 7 months ago

In GROMACS 2024, Colvars gets the current time step explicitly through the ForceProvider API, so not affected. https://github.com/Colvars/colvars/blob/7934bb674bfe071f3119e0430811ca638c5209b5/gromacs/gromacs-mdmodules/applied_forces/colvars/colvarsforceprovider.cpp#L318

jhenin commented 7 months ago

Does the standard specify that size_t is 64 bit? Maybe in practice only? https://en.cppreference.com/w/c/types/size_t

giacomofiorin commented 7 months ago

Does the standard specify that size_t is 64 bit? Maybe in practice only? https://en.cppreference.com/w/c/types/size_t

I believe you'd have to go to a 32-bit architecture to find a narrower type for size_t.