-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement an interface for Distributed-like libraries
This moves support for Distributed into a package extension and adds an interface for other distributed worker libraries to use to support Revise for their workers.
- Loading branch information
1 parent
67ee77c
commit 5955e0e
Showing
3 changed files
with
97 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module DistributedExt | ||
|
||
import Distributed: myid, workers, remotecall | ||
|
||
import Revise | ||
import Revise: DistributedWorker | ||
|
||
|
||
function get_workers() | ||
map(DistributedWorker, workers()) | ||
end | ||
|
||
function Revise.remotecall_impl(f, worker::DistributedWorker, args...; kwargs...) | ||
remotecall(f, worker.id, args...; kwargs...) | ||
end | ||
|
||
Revise.is_master_worker(::typeof(get_workers)) = myid() == 1 | ||
Revise.is_master_worker(worker::DistributedWorker) = worker.id == 1 | ||
|
||
function __init__() | ||
Revise.register_workers_function(get_workers) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters