Skip to content

Pass cluster cookie to workers as std input rather than on command line #8

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
Nov 18, 2021
Merged
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
8 changes: 6 additions & 2 deletions src/slurmmanager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ function launch(manager::SlurmManager, params::Dict, instances_arr::Array, c::Co
exename = params[:exename]
exeflags = params[:exeflags]

srun_cmd = `srun -D $exehome $exename $exeflags --worker=$(cluster_cookie())`
manager.srun_proc = open(srun_cmd)
# Pass cookie as stdin to srun; srun forwards stdin to process
# This way the cookie won't be visible in ps, top, etc on the compute node
srun_cmd = `srun -D $exehome $exename $exeflags --worker`
manager.srun_proc = open(srun_cmd, write=true, read=true)
write(manager.srun_proc, cluster_cookie())
write(manager.srun_proc, "\n")

t = @async for i in 1:manager.ntasks
manager.verbose && println("connecting to worker $i out of $(manager.ntasks)")
Expand Down