Skip to content

Commit 29650c6

Browse files
authored
Add comments about the mpirun vs. srun behavior
1 parent 24de29b commit 29650c6

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

docs/PrincetonUTutorial.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Tutorials
2-
*Last updated 2019-10-16*
2+
*Last updated 2019-10-16.*
33

44
### Login to TigerGPU
55

@@ -57,13 +57,13 @@ $ which mpicc
5757
/usr/local/openmpi/cuda-8.0/3.0.0/intel170/x86_64/bin/mpicc
5858
```
5959

60-
If you source activate the Anaconda environment after loading the openmpi, you would pick the MPI from Anaconda, which is not good and could lead to errors.
60+
If you `source activate` the Anaconda environment **after** loading the OpenMPI library, your application would be built with the MPI library from Anaconda, which has worse performance on this cluster and could lead to errors. See [On Computing Well: Installing and Running ‘mpi4py’ on the Cluster](https://oncomputingwell.princeton.edu/2018/11/installing-and-running-mpi4py-on-the-cluster/) for a related discussion.
6161

6262
#### Location of the data on Tigress
6363

64-
The JET and D3D datasets containing multi-modal time series of sensory measurements leading up to deleterious events called plasma disruptions are located on `/tigress/FRNN` filesystem on Princeton U clusters.
65-
Fo convenience, create following symbolic links:
64+
The JET and D3D datasets contain multi-modal time series of sensory measurements leading up to deleterious events called plasma disruptions. The datasets are located in the `/tigress/FRNN` project directory of the [GPFS](https://www.ibm.com/support/knowledgecenter/en/SSPT3X_3.0.0/com.ibm.swg.im.infosphere.biginsights.product.doc/doc/bi_gpfs_overview.html) filesystem on Princeton University clusters.
6665

66+
For convenience, create following symbolic links:
6767
```bash
6868
cd /tigress/<netid>
6969
ln -s /tigress/FRNN/shot_lists shot_lists
@@ -76,22 +76,22 @@ ln -s /tigress/FRNN/signal_data signal_data
7676
cd examples/
7777
python guarantee_preprocessed.py
7878
```
79-
This will preprocess the data and save it in `/tigress/<netid>/processed_shots`, `/tigress/<netid>/processed_shotlists` and `/tigress/<netid>/normalization`
79+
This will preprocess the data and save rescaled copies of the signals in `/tigress/<netid>/processed_shots`, `/tigress/<netid>/processed_shotlists` and `/tigress/<netid>/normalization`
8080

8181
You would only have to run preprocessing once for each dataset. The dataset is specified in the config file `examples/conf.yaml`:
8282
```yaml
8383
paths:
8484
data: jet_data_0D
8585
```
86-
It take takes about 20 minutes to preprocess in parallel and can normally be done on the cluster headnode.
86+
Preprocessing this dataset takes about 20 minutes to preprocess in parallel and can normally be done on the cluster headnode.
8787
8888
#### Training and inference
8989
9090
Use Slurm scheduler to perform batch or interactive analysis on TigerGPU cluster.
9191
9292
##### Batch analysis
9393
94-
For batch analysis, make sure to allocate 1 MPI process per GPU. Save the following to slurm.cmd file (or make changes to the existing `examples/slurm.cmd`):
94+
For batch analysis, make sure to allocate 1 MPI process per GPU. Save the following to `slurm.cmd` file (or make changes to the existing `examples/slurm.cmd`):
9595

9696
```bash
9797
#!/bin/bash
@@ -114,7 +114,9 @@ module load hdf5/intel-17.0/intel-mpi/1.10.0
114114
srun python mpi_learn.py
115115
116116
```
117-
where `X` is the number of nodes for distibuted training.
117+
where `X` is the number of nodes for distibuted training and the total number of GPUs is `X * 4`. This configuration guarantees 1 MPI process per GPU, regardless of the value of `X`.
118+
119+
Update the `num_gpus` value in `conf.yaml` to correspond to the total number of GPUs specified for your Slurm allocation.
118120

119121
Submit the job with (assuming you are still in the `examples/` subdirectory):
120122
```bash
@@ -126,7 +128,11 @@ And monitor it's completion via:
126128
```bash
127129
squeue -u <netid>
128130
```
129-
Optionally, add an email notification option in the Slurm about the job completion.
131+
Optionally, add an email notification option in the Slurm configuration about the job completion:
132+
```
133+
#SBATCH --mail-user=<netid>@princeton.edu
134+
#SBATCH --mail-type=ALL
135+
```
130136

131137
##### Interactive analysis
132138

@@ -136,13 +142,18 @@ The workflow is to request an interactive session:
136142
```bash
137143
salloc -N [X] --ntasks-per-node=4 --ntasks-per-socket=2 --gres=gpu:4 -c 4 --mem-per-cpu=0 -t 0-6:00
138144
```
139-
where the number of GPUs is X * 4.
140-
141-
Then launch the application from the command line:
145+
Then, launch the application from the command line:
142146

143147
```bash
144-
mpirun -npernode 4 python mpi_learn.py
148+
mpirun -N 4 python mpi_learn.py
145149
```
150+
where `-N` is a synonym for `-npernode` in OpenMPI. Do **not** use `srun` to launch the job inside an interactive session.
151+
[//]: # (This option appears to be redundant given the salloc options; "mpirun python mpi_learn.py" appears to work just the same. HOWEVER, "srun python mpi_learn.py", "srun --ntasks-per-node python mpi_learn.py", etc. NEVER works--- it just hangs without any output. Why?)
152+
153+
[//]: # (Consistent with https://www.open-mpi.org/faq/?category=slurm ?)
154+
155+
[//]: # (certain output seems to be repeated by ntasks-per-node, e.g. echoing the conf.yaml. Expected?)
156+
146157

147158
### Understanding the data
148159

0 commit comments

Comments
 (0)