Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

Commit

Permalink
Lunch the the number of workers even for the host of master process
Browse files Browse the repository at this point in the history
  • Loading branch information
neversakura committed May 2, 2020
1 parent 93ea4bc commit 648737f
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/HPCManager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,11 @@ function init_cluster(method = :worker_per_task; kwargs...)
nothing
elseif (length(node_list) == 1) && (method == :worker_per_task)
@info "Task is assigned to a single node. Starting with local manager..."
addprocs(tpn[1] - 1; kwargs...)
addprocs(tpn[1]; kwargs...)
elseif (length(node_list) > 1) && (method == :worker_per_node)
machine = []
for i in zip(node_list, tpn)
if i[1] == host_name
num = i[2] > 1 ? 1 : 0
push!(machine, (i[1], num))
else
push!(machine, (i[1], 1))
end
push!(machine, (i[1], 1))
end
@info "Task is assigned to multiple nodes. Starting with SSH manager..."
@info "Machine configuration: " machine
Expand All @@ -34,11 +29,7 @@ function init_cluster(method = :worker_per_task; kwargs...)
end
machine = []
for i in zip(node_list, tpn)
if i[1] == host_name
push!(machine, (i[1], i[2] - 1))
else
push!(machine, i)
end
push!(machine, i)
end
@info "Task is assigned to multiple nodes. Starting with SSH manager..."
@info "Machine configuration: " machine
Expand Down

0 comments on commit 648737f

Please sign in to comment.