Skip to content

Commit 9503da8

Browse files
authored
Merge pull request #36 from DilumAluthge-forks/dpa/no-bare-using
Don't use bare `using Foo`
2 parents 4798f3f + d35498d commit 9503da8

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
@@ -122,7 +122,7 @@ function _new_environment_additions(params_env::Dict{String, String})
122122
return env2
123123
end
124124

125-
function launch(manager::SlurmManager, params::Dict, instances_arr::Array, c::Condition)
125+
function Distributed.launch(manager::SlurmManager, params::Dict, instances_arr::Array, c::Condition)
126126
try
127127
exehome = params[:dir]
128128
exename = params[:exename]
@@ -193,6 +193,6 @@ function launch(manager::SlurmManager, params::Dict, instances_arr::Array, c::Co
193193
end
194194
end
195195

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

0 commit comments

Comments
 (0)