kleinhenz / SlurmClusterManager.jl

julia package for running code on slurm clusters
46 stars 5 forks source link

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

Closed mattwigway closed 3 years ago

mattwigway commented 3 years ago

This passes the cluster cookie as standard input to srun, rather than as a --worker=<cookie> flag; srun then forwards that stdin to the worker. This is the recommended/default behavior of addprocs; the --worker=<cookie> format was only added to support Windows workers that don't properly forward stdin. Since Slurm doesn't run on Windows this should be a non-issue.

This improves security in shared cluster environments as the cookie is not available to other logged-in users through inspection of ps -ef.

mattwigway commented 3 years ago

(oh and I did test this, I have a slurm job running across five nodes with the modified code now)

kleinhenz commented 3 years ago

Looks good to me. Thanks!