-
Notifications
You must be signed in to change notification settings - Fork 0
/
submit.sh
39 lines (27 loc) · 1.05 KB
/
submit.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Written by Ajay Melekamburath (https://github.com/ajay-mk)
# See README.md before making changes
# SLURM Options - Make necessary chanages according to available resources and QOS settings of the cluster
#SBATCH --job-name=Notebook
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=14
#SBATCH --time=02:00:00
#SBATCH --output=Jupyter-%j.out
# Loading modules and activating environments
# Loading Anaconda, this may vary according to your setup. Load which ever conda setup you are using
module load anaconda
# Activate a specific conda environment
#conda activate env_name
#Getting the node name
NODE_NAME=$(hostname)
# Setting a random port for the notebook
PORT=`shuf -i 10000-11000 -n 1`
# Before running, change the ADRESS to the public adress of your login node
PUB_ADDRESS='[email protected]'
echo "ssh -N -f -L $PORT:$NODE_NAME:$PORT $(whoami)@$PUB_ADDRESS"
# Running Jupyter Lab or Jupyter Notebook
jupyter-lab --no-browser --port=$PORT --ip=0.0.0.0
#jupyter-notebook --no-browser --port=$PORT --ip=0.0.0.0
wait
# EOF