Skip to content

Commit d35498d

Browse files
committed
Don't use bare using Foo
1 parent 83fe844 commit d35498d

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/SlurmClusterManager.jl

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
module SlurmClusterManager
22

3-
export SlurmManager, launch, manage
3+
# We don't do `using Foo`.
4+
# We either do `using Foo: hello, world`, or we do `import Foo`.
5+
# https://github.com/JuliaLang/julia/pull/42080
46

5-
using Distributed
6-
import Distributed: launch, manage
7+
import Distributed
8+
9+
# Bring these names into scope because we are going to re-export them:
10+
using Distributed: launch, manage
11+
12+
# We re-export Distributed.launch and Distributed.manage:
13+
export launch, manage
14+
15+
# We also export SlurmManager:
16+
export SlurmManager
17+
18+
# Bring some other names into scope, just for convenience:
19+
using Distributed: ClusterManager, WorkerConfig, cluster_cookie
720

821
include("slurmmanager.jl")
922

src/slurmmanager.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function _new_environment_additions(params_env::Dict{String, String})
8282
return env2
8383
end
8484

85-
function launch(manager::SlurmManager, params::Dict, instances_arr::Array, c::Condition)
85+
function Distributed.launch(manager::SlurmManager, params::Dict, instances_arr::Array, c::Condition)
8686
try
8787
exehome = params[:dir]
8888
exename = params[:exename]
@@ -157,6 +157,6 @@ function launch(manager::SlurmManager, params::Dict, instances_arr::Array, c::Co
157157
end
158158
end
159159

160-
function manage(manager::SlurmManager, id::Integer, config::WorkerConfig, op::Symbol)
160+
function Distributed.manage(manager::SlurmManager, id::Integer, config::WorkerConfig, op::Symbol)
161161
# This function needs to exist, but so far we don't do anything
162162
end

0 commit comments

Comments
 (0)