Skip to content
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

randi usage in load_all_transformations causes trouble for compiled runs #27

Open
trautmane opened this issue Nov 20, 2018 · 0 comments

Comments

@trautmane
Copy link
Contributor

The usage of randi here:

https://github.com/khaledkhairy/EM_aligner/blob/master/renderer_api/load_all_transformations.m#L10

causes problems when I run concurrent compiled solve_montage_SL processes on the same cluster node. Apparently, compiled Matlab binaries bake in the random generator seed so concurrent runs will get the same sequence of "random" numbers (see https://www.mathworks.com/matlabcentral/answers/104306-why-does-my-compiled-rand-function-give-the-same-values-every-time-i-run-my-matlab-generated-standal).

It would help to have the intended-to-be-unique-per-run file names include hostname and process id information to reduce the chance of namespace collisions. I see Matlab includes a getpid function (https://www.mathworks.com/help/symbolic/mupad_ref/getpid.html). Another option is to create a unique "work" directory within the user specified temp_dir or dir_scratch for each run - then you don't need to worry about unique names within the run "work" directory.

@davidackerman - I'm hoping you might get the chance to address this at some point but it is not critical since I've worked around it for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant