-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
RFC: add procs argument to @-everywhere and move code to a function #22589
Conversation
base/distributed/macros.jl
Outdated
`@everywhere` with [`@eval`](@ref) allows us to broadcast | ||
local variables using interpolation : | ||
`@everywhere` does not capture any local variables. | ||
Instead, local variable can be broadcast using interpolation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variables
base/distributed/macros.jl
Outdated
yield() # ensure that the remotecall_fetch has been started | ||
remotecall_eval(m::Module, procs, expression) | ||
|
||
Execute an expression under module `m` on all procs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on the specified procs
c2fda80
to
4187526
Compare
this by itself is less controversial than #22588. please decouple them. |
a592f3f
to
f8b84f2
Compare
8225299
to
1e811d9
Compare
unshift!(LOAD_PATH, $load_path) | ||
unshift!(LOAD_CACHE_PATH, $load_cache_path) | ||
end) | ||
@everywhere test_workers begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a pretty indirect test, could use something more specific in the distributed tests
adding remotecall_eval lets us simplify code that previously needed awkward contortions to use remotecall_fetch on an anonymous function fixes a code-duplication bug in the case where something is spliced into expr and removes and corrects misleading information in the doc string
1e811d9
to
d1de420
Compare
Adding a function
remotecall_eval
lets us simplify code that previously needed awkward contortions to useremotecall_fetch
on an anonymous function. This allows us to transform the more complex pattern of:into:
@everywhere pids expression
which resolves #18166
(note: This is against PR #22588, since I wanted to use this functionality to simplify its tests. When the RFCs are removed, I'll rebase whichever ones we decide to merge first.)