Created
March 12, 2015 03:28
-
-
Save bholt/5d0d8638c0c1bb89a943 to your computer and use it in GitHub Desktop.
Ssh to first allocated node, passing Slurm environment variables through.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: salloc <options> slurm-ssh | |
first=$(scontrol show hostname $SLURM_NODELIST | head -n1) | |
env=$(printenv | grep SLURM | sed -rn "s/=(.*)/='\1'/p" | paste -d' ' -s) | |
exec ssh $first -t "$env zsh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
great