You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose you need to use TensorFlow 2.11.0 on JupyterLab. First, note we do not have `tensorflow/2.11.0` as a module:
259
+
Suppose you need to use TensorFlow 2.17.0 on JupyterLab. First, note we do not have `tensorflow/2.17.0` as a module:
259
260
260
261
```bash
261
262
module spider tensorflow
262
263
```
263
264
264
-
Go to [TensorFlow's Docker Hub page](https://hub.docker.com/r/tensorflow/tensorflow/tags?page=1&name=2.11.0) and search for the tag (i.e. version). You'll want to use one that has the `-gpu-jupyter` suffix. Pull the container in your account.
265
+
Go to [TensorFlow's Docker Hub page](https://hub.docker.com/r/tensorflow/tensorflow) and search for the tag (i.e. version). You'll want to use one that has the `-gpu-jupyter` suffix. Pull the container in your account.
Copy file name to clipboardExpand all lines: content/courses/parallel-computing-introduction/distributed_mpi_setup.md
+36-8
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,44 @@ menu:
9
9
parent: Distributed-Memory Programming
10
10
---
11
11
12
+
Using MPI requires access to a computer with at least one node with multiple cores. The Message Passing Interface is a standard and there are multiple implementations of it, so a choice of distribution must be made. Popular implementations include [MPICH](https://www.mpich.org/), [OpenMPI](https://www.open-mpi.org/), [MVAPICH2](https://mvapich.cse.ohio-state.edu/), and [IntelMPI](https://www.intel.com/content/www/us/en/developer/tools/oneapi/mpi-library.html#gs.gdkhva). MPICH, OpenMPI, and MVAPICH2 must be built for a system, so a compiler must be chosen as well. IntelMPI is typically used with the Intel compiler and is provided by the vendor as part of their [HPC Toolkit](https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit.html#gs.gdkm8y). MVAPICH2 is a version of MPICH that is specialized for high-speed [Infiniband](https://en.wikipedia.org/wiki/InfiniBand) networks on high-performance clusters, so would generally not be appropriate for installation on individual computers.
13
+
12
14
### On a Remote Cluster
13
15
14
-
Refer to the instructions from your site, for example [UVA Research Computing](https://www.rc.virginia.edu/userinfo/howtos/rivanna/mpi-howto/) for our local environment. Nearly always, you will be required to prepare your code and run it through a _resource manager_ such as [Slurm](https://www.rc.virginia.edu/userinfo/rivanna/slurm/).
16
+
Refer to the instructions from your site, for example [UVA Research Computing](https://www.rc.virginia.edu/userinfo/howtos/rivanna/mpi-howto/) for our local environment. Nearly always, you will be required to prepare your code and run it through a _resource manager_ such as [Slurm](https://www.rc.virginia.edu/userinfo/rivanna/slurm/). Most HPC sites use a _modules_ system, so generally you will need to load modules for an MPI version and usually the corresponding compiler. It is important to be sure that you use a version of MPI that can communicate correctly with your resource manager.
17
+
```bash
18
+
module load gcc
19
+
module load openmpi
20
+
```
21
+
is an example setup for compiled-language users.
22
+
23
+
For Python, the mpi4py package is most widely available. It is generally preferable, and may be required, that mpi4py be installed from the conda-forge repository. On a cluster, mpi4py will need to link to a locally-built version of MPI that can communicate with the resource manager. The conda-forge maintainers provide instructions for this [here](https://conda-forge.org/docs/user/tipsandtricks/#using-external-message-passing-interface-mpi-libraries). In our example, we will use openmpi. First we must load the modules for the compiler and MPI version:
15
24
16
-
For Python, you will need to install mpi4py. You may wish to create a conda environment for it. On the UVA system you must use `pip` rather than conda.
17
25
```bash
18
26
module load gcc openmpi
19
-
module load anaconda
20
-
pip install --user mpi4py
27
+
```
28
+
We must not install OpenMPI directly from conda-forge; rather we make use of the "hooks" they have provided.
29
+
```bash
30
+
module list openmpi
31
+
```
32
+
In our example, the module list returns
33
+
```bash
34
+
Currently Loaded Modules Matching: openmpi
35
+
1) openmpi/4.1.4
36
+
```
37
+
Now we check that our version of OpenMPI is available
38
+
```bash
39
+
conda search -f openmpi -c conda-forge
40
+
```
41
+
Most versions are there, so we can install the one we need
@@ -32,7 +61,7 @@ The author of mpi4py [recommends](https://mpi4py.readthedocs.io/en/stable/instal
32
61
```no-highlight
33
62
python -m pip install mpi4py
34
63
```
35
-
This may avoid some issues that occasionally arise in prebuilt mpi4py packages. Be sure that an appropriate `mpicc` executable is in the path. Alternatively, use the `conda-forge` channel (recommended in general for most scientific software).
64
+
This may avoid some issues that occasionally arise in prebuilt mpi4py packages. Be sure that an appropriate `mpicc` executable is in the path. Alternatively, use the `conda-forge` channel (recommended in general for most scientific software). Most of the time, if you are installing mpi4py from conda-forge, you can simply install the package. MPICH is the default when installed as a prerequisite for conda-forge.
36
65
37
66
#### Linux
38
67
@@ -47,7 +76,7 @@ Installing the HPC Toolkit will also install IntelMPI.
47
76
_NVIDIA HPC SDK_
48
77
The NVIDIA software ships with a precompiled version of OpenMPI.
49
78
50
-
The headers and libraries for MPI _must_ match. Using a header from one MPI and libraries from another, or using headers from a version from one compiler and libraries from a different compiler, usually results in some difficult-to-interpret bugs. Moreover, the process manager must be compatible with the MPI used to compile the code. Because of this, if more than one compiler and especially more than one MPI version is installed, the use of _modules_ ([environment modules](http://modules.sourceforge.net/) or [lmod](https://lmod.readthedocs.io/en/latest/)) becomes particularly beneficial. Both Intel and NVIDIA provide scripts for the environment modules package (lmod can also read these), with possibly some setup required. If you plan to use mpi4py as well as compiled-language versions, creating a module for your Python distribution would also be advisable.
79
+
The headers and libraries for MPI _must_ match. Using a header from one MPI and libraries from another, or using headers from a version from one compiler and libraries from a different compiler, usually results in some difficult-to-interpret bugs. Moreover, the process manager must be compatible with the MPI used to compile the code. Because of this, if more than one compiler and especially more than one MPI version is installed, the use of _modules_ ([environment modules](http://modules.sourceforge.net/) or [lmod](https://lmod.readthedocs.io/en/latest/)) becomes particularly beneficial. Both Intel and NVIDIA provide scripts for the environment modules package (lmod can also read these), with possibly some setup required. If you plan to use mpi4py as well as compiled-language versions, creating a module for your Python distribution would also be advisable. Installation of a module system on an individual Linux system is straightforward for an administrator with some experience.
51
80
52
81
#### Mac OS
53
82
@@ -63,7 +92,7 @@ The NVIDIA suite is not available for Mac OS.
63
92
#### Windows
64
93
65
94
_GCC_
66
-
The simplest way to use OpenMPI on Windows is through [Cygwin](https://www.cygwin.com/). In this case, the gcc compiler suite would first be installed, with g++ and/or gfortran added. Then the openmpi package could also be installed through the cygwin package manager.
95
+
The easiest way to use OpenMPI on Windows is through [Cygwin](https://www.cygwin.com/). In this case, the gcc compiler suite would first be installed, with g++ and/or gfortran added. Then the openmpi package could also be installed through the cygwin package manager.
67
96
68
97
_Intel oneAPI_
69
98
Install the HPC Toolkit.
@@ -74,4 +103,3 @@ Download the package when it is available.
74
103
MPI codes must generally be compiled and run through a command line on Windows. Cygwin users can find a variety of tutorials online, for example [here](https://www.youtube.com/watch?v=ENH70zSaztM).
75
104
76
105
The Intel oneAPI Basic Toolkit includes a customized command prompt in its folder in the Apps menu.
0 commit comments