Skip to content

Don't use bare using Foo #36

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

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/SlurmClusterManager.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
module SlurmClusterManager

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

using Distributed
import Distributed: launch, manage
import Distributed

# Bring these names into scope because we are going to re-export them:
using Distributed: launch, manage

# We re-export Distributed.launch and Distributed.manage:
export launch, manage

# We also export SlurmManager:
export SlurmManager

# Bring some other names into scope, just for convenience:
using Distributed: ClusterManager, WorkerConfig, cluster_cookie

include("slurmmanager.jl")

Expand Down
4 changes: 2 additions & 2 deletions src/slurmmanager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function _new_environment_additions(params_env::Dict{String, String})
return env2
end

function launch(manager::SlurmManager, params::Dict, instances_arr::Array, c::Condition)
function Distributed.launch(manager::SlurmManager, params::Dict, instances_arr::Array, c::Condition)
try
exehome = params[:dir]
exename = params[:exename]
Expand Down Expand Up @@ -157,6 +157,6 @@ function launch(manager::SlurmManager, params::Dict, instances_arr::Array, c::Co
end
end

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