forked from cdt-data-science/cluster-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interactive
executable file
·71 lines (59 loc) · 2.23 KB
/
interactive
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
default_args="--partition=Interactive --time=08:00:00 --mem=14000 --cpus-per-task=4 --gres=gpu:1"
read -r -d '' default_msg << EOM
======================= WELCOME MESSAGE =======================
It's good practice to set a few parameters when using srun
(this command is essentailly an alias for 'srun --pty bash').
We have added some default parameters to maximise your chance
of getting an interactive session. See the Slurm Documentation
for further info.
https://slurm.schedmd.com/
Default args added:
[$default_args]
Useful arg examples:
* --time=08:00:00 terminate job after 8 hours (good
practice and curteous)
* --time=1-04:00:30 terminate job after 1 day, 4 hours,
and 30 seconds
* --gres=gpu:1 give me 1 gpu
* --nodelist=charles19 put me on a specific node
* --mem=4000 give me 4G of RAM, there's about 50G
per box but memory is not shared
(note this is not GPU memory)
* --cpus-per-task=1 give me 1 cpu, there's 32 on most
nodes
* --partition=... there is a partition explicitly for
interactive jobs (called Interactive).
You are welcome to run interactive
jobs on other partitions if the
Interactive partition is full. To
get the full list, run "sinfo"
For more informtion about node configuration, see the
computing support docs:
http://computing.help.inf.ed.ac.uk/james-and-charles-cluster
When you run this command with args, this message will
disappear, and no additional args will be added.
===============================================================
EOM
print_usage () {
cat << EOM
Usage: $0 [other args for srun]
Arguments:
see documentation for srun. You can specify all arguments, and they'll
be used.
EOM
}
if [ $# -eq 0 ]; then
echo "$default_msg"
args=$default_args
else
args=$@
fi
echo
echo Doing a --test-only to estimate wait time...
srun $args --test-only --pty bash
echo
echo Running the following command to get you an interactive session:
echo "srun $args --pty bash"
echo ...
srun $args --pty bash