On my cluster, I can get a shell for interactive mode if I run:
srun -N 1 --ntasks-per-node=1 --gres=gpu:1 --pty zsh
However, on this cluster, each node that is allocated has an empty $HOME directory (without the .zshrc), which is stored on a shared drive. How can I run in interactive mode with a pre-specified command to load my .zshrc automatically on login? i.e., I would ideally want something like this
srun -N 1 --ntasks-per-node=1 --gres=gpu:1 --pty zsh --runCommandOnLaunch='source /shared_drive/razvan/.zshrc'
Try with
Upon startup, Zsh will look for a startup file (
zshrc
) in$ZDOTDIR
. (See more details here). Assrun
will, by default, export all environment variables to the remote commands it spawns, Zsh should load your RC file upon startup.