Skip to content
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

add support for cookie changes #37

Merged
merged 1 commit into from
May 28, 2016
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
9 changes: 8 additions & 1 deletion src/ClusterManagers.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
module ClusterManagers

export launch, manage, kill, init_worker, connect
export launch, manage, kill, init_worker, connect
import Base: launch, manage, kill, init_worker, connect

if VERSION >= v"0.5.0-dev+4047"
worker_arg = `--worker $(Base.cluster_cookie())`
else
worker_arg = `--worker`
end

# PBS doesn't have the same semantics as SGE wrt to file accumulate,
# a different solution will have to be found
include("qsub.jl")
Expand Down
2 changes: 1 addition & 1 deletion src/affinity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function launch(manager::LocalAffinityManager, params::Dict, launched::Array, c:

for core_id in manager.affinities
io, pobj = open(detach(
setenv(`taskset -c $core_id $(Base.julia_cmd(exename)) $exeflags --worker`, dir=dir)), "r")
setenv(`taskset -c $core_id $(Base.julia_cmd(exename)) $exeflags $worker_arg`, dir=dir)), "r")
wconfig = WorkerConfig()
wconfig.process = pobj
wconfig.io = io
Expand Down
2 changes: 1 addition & 1 deletion src/condor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function condor_script(portnum::Integer, np::Integer, params::Dict)
scriptf = open("$tdir/$jobname.sh", "w")
println(scriptf, "#!/bin/sh")
println(scriptf, "cd $(Base.shell_escape(dir))")
println(scriptf, "$(Base.shell_escape(exename)) --worker | /usr/bin/telnet $(Base.shell_escape(hostname)) $portnum")
println(scriptf, "$(Base.shell_escape(exename)) $(Base.shell_escape(worker_arg)) | /usr/bin/telnet $(Base.shell_escape(hostname)) $portnum")
close(scriptf)

subf = open("$tdir/$jobname.sub", "w")
Expand Down
2 changes: 1 addition & 1 deletion src/qsub.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function launch(manager::Union{PBSManager, SGEManager}, params::Dict, instances_

jobname = `julia-$(getpid())`

cmd = `cd $dir && $exename $exeflags --worker`
cmd = `cd $dir && $exename $exeflags $worker_arg`
qsub_cmd = pipeline(`echo $(Base.shell_escape(cmd))` , (isPBS ? `qsub -N $jobname -j oe -k o -t 1-$np $queue $qsub_env` : `qsub -N $jobname -terse -j y -t 1-$np $queue $qsub_env`))
out,qsub_proc = open(qsub_cmd)
if !success(qsub_proc)
Expand Down
2 changes: 1 addition & 1 deletion src/scyld.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function launch(manager::ScyldManager, params::Dict, instances_arr::Array, c::Co
end
nodes = split(chomp(readline(out)),':')
for (i,node) in enumerate(nodes)
cmd = `cd $dir && $exename $exeflags --worker`
cmd = `cd $dir && $exename $exeflags $worker_arg`
cmd = detach(`bpsh $node sh -l -c $(Base.shell_escape(cmd))`)
config = WorkerConfig()

Expand Down
2 changes: 1 addition & 1 deletion src/slurm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function launch(manager::SlurmManager, params::Dict, instances_arr::Array,

np = manager.np
jobname = "julia-$(getpid())"
srun_cmd = `srun -J $jobname -n $np -o "job%4t.out" -D $exehome $(srunargs) $exename $exeflags --worker`
srun_cmd = `srun -J $jobname -n $np -o "job%4t.out" -D $exehome $(srunargs) $exename $exeflags $worker_arg`
out, srun_proc = open(srun_cmd)
for i = 0:np - 1
print("connecting to worker $(i + 1) out of $np\r")
Expand Down