Skip to content

Instantly share code, notes, and snippets.

@hiraksarkar
Created September 9, 2023 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiraksarkar/c681dd13568b33c547bdcb40ea680fdc to your computer and use it in GitHub Desktop.
Save hiraksarkar/c681dd13568b33c547bdcb40ea680fdc to your computer and use it in GitHub Desktop.
della slurm jupyter job submission
#!/bin/bash
#SBATCH --mincpus 16
#SBATCH --mem 64G
#SBATCH --time 5:00:00
#SBATCH --job-name mendel
#SBATCH --mail-type=begin # send email when job begins
#SBATCH --mail-type=end # send email when job ends
#SBATCH --mail-user=hs0424@princeton.edu
#SBATCH --output jupyter_logs/jupyter-notebook-%J.log
# get tunneling info
XDG_RUNTIME_DIR=""
port=$(shuf -i10001-20000 -n1)
node=$(hostname -s)
user=$(whoami)
cluster="della"
# print tunneling instructions jupyter-log
echo -e "
MacOS or linux terminal command to create your ssh tunnel
ssh -N -L ${port}:${node}:${port} ${user}@${cluster}.princeton.edu
Windows MobaXterm info
Forwarded port:same as remote port
Remote server: ${node}
Remote port: ${port}
SSH server: ${cluster}.cs.princeton.edu
SSH login: $user
SSH port: 22
Use a Browser on your local machine to go to:
localhost:${port} (prefix w/ https:// if using password)
"
# load modules or conda environments here
# uncomment the following two lines to use your conda environment called notebook_env
source /scratch/gpfs/KANG/hirak/mambaforge/bin/activate base
conda activate r42
# conda activate spagcn
# conda activate py-stagate
cd /scratch/gpfs/KANG/hirak/mendel/Projects/neuroblastoma_analysis/notebook
# DON'T USE ADDRESS BELOW.
# DO USE TOKEN BELOW
jupyter lab --no-browser --port=${port} --ip=${node}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment