-
Notifications
You must be signed in to change notification settings - Fork 117
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
Different RNG seeding strategies in complex vs real versions of parallel getv0() #411
Comments
Also, this does not look right: if (igen .gt. 4095) then
write(0,*) 'Error in p_getv0: seed exceeds 4095!'
end if The requirement on the elements of
To achieve this, it is not necessary for I'll note that the original seeding PARPACK looked like this:
In APRACK-NG this is changed to This is unnecessary since |
You're likely right. Feel free to propose a PR to keep things symmetric. |
@szhorvat: do you plan to PR a patch before the next release? |
I won't have a computer for the next 10 days |
Bug: opencollab/arpack-ng#401 Bug: opencollab/arpack-ng#410 Bug: opencollab/arpack-ng#411 Bug: igraph/igraph#2311 Signed-off-by: Sam James <sam@gentoo.org>
I believe this is actually harmful as it fixes the least significant digits, causing the seed to be potentially same on multiple parallel threads. I will fix this as well in the upcoming patch. |
- fixes opencollab#401, opencollab#410, opencollab#411 - restores 'inits' variable removed in ce2e69a, ensuring that the RNG state is propagated - reverts e0d6705 to ensure that seed is different on each parallel thread - updates seed initialization of parallel pdgetv0/psgetv0 so that they match that of pzgetv0/pcgetv0
- fixes opencollab#401, opencollab#410, opencollab#411 - restores 'inits' variable removed in ce2e69a, ensuring that the RNG state is propagated - reverts e0d6705 to ensure that seed is different on each parallel thread - updates seed initialization of parallel pdgetv0/psgetv0 so that they match that of pzgetv0/pcgetv0
I noticed that in PARPACK, the initial seed is chosen differently in Z/C-prefix complex functions vs D/S-prefix real ones.
In
pcgetv0
(andpzgetv0
), we have:https://github.com/opencollab/arpack-ng/blob/master/PARPACK/SRC/MPI/pcgetv0.f#L218
I.e., each parallel thread gets a unique seed, making sure they don't generate the same sequence of random numbers.
But in
psgetv0
/pdgetv0
, we have the same fixed initial seed as in the serial version:https://github.com/opencollab/arpack-ng/blob/master/PARPACK/SRC/MPI/pdgetv0.f#L215
This does not look correct to me. The seed should be different for each parallel thread, just like in the
Z
/C
versions.This is not related to the earlier seeding issues I reported. I do not use PARPACK myself, this is just something I noticed while looking at the code.
This goes back to the original PARPACK, and is not something that was changed in ARPACK-NG. To be accurate, the setting of
iseed(4)
was changed (unnecessarily, as it was already odd), but the general setup wasn't.Note that the original PARPACK came as two archives: the original code, and a patch. Only the patch has the special seeding based on the process ID. It seems to me that they simply forgot to include the
D
/S
versions in the patch.The text was updated successfully, but these errors were encountered: