-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non reproducible system initialization for PACKMOL compiled for different operating systems #30
Comments
I think that is expected and dependent on implementation details of the random number generators on each system. I do not think I can do anything about it. |
It looks like there are some recent contributions and discussions in the Fortran standard library repo about pseudo random number generators. I'm not familiar enough with Fortran to know if this is a solution, but maybe it would be worth looking into? fortran-lang/stdlib#271 Thank you! |
I will check the possibilities, but anyway, why is that important? No simulation should be dependent on the exact positions of the particles, and any subsequent simulation, notably those running in parallel, will most likely not be reproducible because of floating point operations not being associative. Is there any compelling reason to force the random sequence to be identical? Or, more specifically: did anyone find a situation in which the result in one platform is acceptable and in other platform is not? If that is the case, probably that is a sign of another type of bug. |
I understand your point, and it is unlikely that this is a blocking operation for most simulators. |
If anyone is interested in making a small, test, use the code below. Compile it with:
and run it with:
It will write two sequence of 10 numbers, that may or not be identical, depending on the system and compiler. If the first sequence is different in the two architectures and the second is identical everywhere, there is an easy way to make the results identical at least in this case (it will never be a generic solution, as there are not guarantees from any standard that two random number sequences will be identical across compilers, versions, or operating systems).
|
Thank you for looking into this. I've run your test.
And on Linux GNU Fortran (GCC) 8.3.0
It appears that sequence 1 and 2 are identical on both systems but not across systems. |
Ok, so then this is OS and compiler dependent. If for some reason that is very important, what is needed is to put a custom random number generator function in the package, and not use the one implemented in the compiler library. That is not too hard, let me know if that makes a difference to you. I won't release a version of Packmol with that, but we can have a custom build. |
I am using packmol following the example at https://sites.ualberta.ca/~chipuije/initial.html and additionally including a random seed.
If I run the same input pdb and configuration file on OSX and linux, I get different outputs.
My input files and output files can be found here.
OSX system: OSX Mojave 10.14.6
Linux system: CentOS Linux 7
Packmol was installed via conda in both instances
The text was updated successfully, but these errors were encountered: