-
Notifications
You must be signed in to change notification settings - Fork 11
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
Surprising and undocumented import
handling in Distributed.@everywhere
#65
Comments
x-ref: JuliaLang/julia#21718 |
Thank you!! I was getting very strange errors
were not actually loaded at all. Putting |
Consider the following code:
This fails with a
LoadError
, because@everywhere
cherry-picks the imports for each everywhere block and runs them first regardless of the order of statements inside the block. Instead, one has to do this:This behaviour thoroughly breaks my internal parser, because these two blocks look equivalent (modulo an unnecessary synchronization point in the middle). Worse, the behaviour is not documented, and in fact contradicts the documentation.
Unfortunately, no rationale is given in the code as to why this was chosen. However, I think at the very least, one should amend the documentation with a corresponding note and add a rationale for this in the code.
One could maybe also issue a warning for
@everywhere
blocks which do not haveimport
statements as their first statements. This would help poor newbies like me :)Julia version: 1.2.0 (also present in master)
The text was updated successfully, but these errors were encountered: