README.md 1.04 KB
Newer Older
Mike Smith's avatar
Mike Smith committed
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
72
73
74
75
76
77
78
79
80
## Identifying our computer

```
hostname
```

## Our first SLURM job

```
srun hostname
```

## Exploring our example program

```
cd $HOME/embl_swc_hpc/exercises
./hpc_example.py -t 10 -l 100
```

## Running example program on on the cluster

```
srun ./hpc_example.py -t 10 -l 100
```

## Running in the background

```
srun ./hpc_example.py -t 10 -l 100 &
```

## Redirecting output

```
srun --output=output.txt ./hpc_example.py -t 20 -l 100 &
```

## Creating a larger list

```
srun --output=output.txt ./hpc_example.py -t 30 -l 5000000 &
```

## Displaying details of our cluster queue

```
scontrol show partition
```

## Requesting more resources

```
srun --mem=250 \
--output=output.txt \
./hpc_example.py -t 30 -l 5000000 &
```

## Running interactive jobs
```
srun --pty bash
```

## Interactive job with more memory
```
srun --mem=250 --pty bash
```

## Using `sbatch` instead

```
sbatch batch_jobs.sh
```

## Using job dependencies to build pipelines

```
jid=$(sbatch --parsable batch_job.sh)

sbatch --dependency=afterok:$jid batch_job.sh
```