Skip to content

Commit ad7cd84

Browse files
committed
Intel(R) SHMEM Library (ISHMEM) 1.2.0 doc pages
1 parent fb89fc5 commit ad7cd84

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+12578
-2046
lines changed

README.md

Lines changed: 75 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,32 @@ Intel® SHMEM provides an efficient implementation of GPU-initiated communicatio
2222
### SYCL support <!-- omit in toc -->
2323
Intel® oneAPI DPC++/C++ Compiler with Level Zero support.
2424

25-
To install Level Zero, refer to the instructions in [Intel® Graphics Compute Runtime for oneAPI Level Zero and OpenCL™ Driver repository](https://github.com/intel/compute-runtime/releases) or to the [installation guide](https://dgpu-docs.intel.com/installation-guides/index.html) for oneAPI users.
2625

2726
## Installation
28-
Intel® SHMEM requires a host OpenSHMEM back-end to be used for host-sided operations support. In particular, it relies on a collection of extension APIs (`shmemx_heap_create`, `shmemx_heap_preinit`, and `shmemx_heap_postinit`) to coordinate the Intel® SHMEM and OpenSHMEM heaps. We recommend [Sandia OpenSHMEM v1.5.3rc1](https://github.com/Sandia-OpenSHMEM/SOS/releases/tag/v1.5.3rc1) or newer for this purpose.
27+
28+
### Building Level Zero
29+
For detailed information on Level Zero, refer to the [Intel® Graphics Compute Runtime for oneAPI Level Zero and OpenCL™ Driver repository](https://github.com/intel/compute-runtime/releases) or to the [installation guide](https://dgpu-docs.intel.com/installation-guides/index.html) for oneAPI users.
30+
31+
To install, download the oneAPI Level Zero from the repository.
32+
33+
```
34+
git clone https://github.com/oneapi-src/level-zero.git
35+
```
36+
37+
Build Level Zero following instructions below.
38+
39+
```
40+
cd level-zero
41+
mkdir build
42+
cd build
43+
cmake -DCMAKE_INSTALL_PREFIX=<level_zero_dir> ..
44+
make -j
45+
make install
46+
```
47+
### The Host Back-End Library
48+
Intel® SHMEM requires a host OpenSHMEM or MPI back-end to be used for host-sided operations support. In particular, the OpenSHMEM back-end relies on a collection of extension APIs (`shmemx_heap_create`, `shmemx_heap_preinit`, and `shmemx_heap_postinit`) to coordinate the Intel® SHMEM and OpenSHMEM heaps. We recommend [Sandia OpenSHMEM v1.5.3rc1](https://github.com/Sandia-OpenSHMEM/SOS/releases/tag/v1.5.3rc1) or newer for this purpose. A [work-in-progress branch](https://github.com/davidozog/oshmpi/tree/wip/ishmem) of [OSHMPI](https://github.com/pmodels/oshmpi.git) is also supported but is currently considered experimental. See the [Building OSHMPI](#building-oshmpi-optional-and-experimental) section before for more details.
49+
50+
We recommend the Intel® MPI Library as the MPI back-end option for the current version of Intel® SHMEM. See the [Building Intel® SHMEM](#building-intel-shmem) section below for more details.
2951

3052
### Building Sandia OpenSHMEM (SOS)
3153
Download the SOS repo to be configured as a back-end for Intel® SHMEM.
@@ -39,67 +61,105 @@ Build SOS following instructions below. `FI_HMEM` support in the provider is req
3961
```
4062
cd SOS
4163
./autogen.sh
42-
./configure --prefix=<sos_dir> --with-ofi=<ofi_installation> --enable-pmi-simple --enable-ofi-mr=basic --disable-ofi-inject --enable-ofi-hmem --disable-bounce-buffers --enable-hard-polling
64+
CC=icx CXX=icpx ./configure --prefix=<shmem_dir> --with-ofi=<ofi_installation> --enable-pmi-simple --enable-ofi-mr=basic --disable-ofi-inject --enable-ofi-hmem --disable-bounce-buffers --enable-hard-polling
4365
make -j
4466
make install
4567
```
4668
To configure SOS with the HPE Slingshot provider `cxi`, please use the following instructions:
4769
```
4870
cd SOS
4971
./autogen.sh
50-
./configure --prefix=<sos_dir> --with-ofi=<ofi_installation> --enable-pmi-simple --enable-ofi-mr=basic --disable-ofi-inject --enable-ofi-hmem --disable-bounce-buffers --enable-ofi-manual-progress --enable-mr-endpoint --disable-nonfetch-amo --enable-manual-progress
72+
CC=icx CXX=icpx ./configure --prefix=<shmem_dir> --with-ofi=<ofi_installation> --enable-pmi-simple --enable-ofi-mr=basic --disable-ofi-inject --enable-ofi-hmem --disable-bounce-buffers --enable-ofi-manual-progress --enable-mr-endpoint --disable-nonfetch-amo --enable-manual-progress
5173
make -j
5274
make install
5375
```
5476
To configure SOS with the `psm3` provider, please use the following instructions:
5577
```
5678
cd SOS
5779
./autogen.sh
58-
./configure --prefix=<sos_dir> --with-ofi=<ofi_installation> --enable-pmi-simple --enable-manual-progress --enable-ofi-hmem --disable-bounce-buffers --enable-ofi-mr=basic --enable-mr-endpoint
80+
CC=icx CXX=icpx ./configure --prefix=<shmem_dir> --with-ofi=<ofi_installation> --enable-pmi-simple --enable-manual-progress --enable-ofi-hmem --disable-bounce-buffers --enable-ofi-mr=basic --enable-mr-endpoint
5981
make -j
6082
make install
6183
```
62-
84+
6385
Please choose an appropriate PMI configure flag based on the available PMI client library in the system. Please check for further instructions on [SOS Wiki pages](https://github.com/Sandia-OpenSHMEM/SOS/wiki). Optionally, users may also choose to add `--disable-fortran` since fortran interfaces will not be used.
6486

87+
### Building OSHMPI (Optional and experimental)
88+
Intel® SHMEM has experimental support for OSHMPI when built using the Intel® MPI Library.
89+
Here is information on how to [Get Started with Intel® MPI Library on Linux](https://www.intel.com/content/www/us/en/docs/mpi-library/get-started-guide-linux/2021-11/overview.html).
90+
91+
To download the OSHMPI repository:
92+
93+
```
94+
git clone -b wip/ishmem --recurse-submodules https://github.com/davidozog/oshmpi.git oshmpi
95+
```
96+
After ensuring Intel® MPI Library is enabled (for example, by sourcing the `/opt/intel/oneapi/setvars.sh` script),
97+
please build OSHMPI following the instructions below.
98+
99+
```
100+
cd oshmpi
101+
./autogen.sh
102+
CC=mpiicx CXX=mpiicpx ./configure --prefix=<shmem_dir> --disable-fortran --enable-rma=direct --enable-amo=direct --enable-async-thread=yes
103+
make -j
104+
make install
105+
```
65106

66107
### Building Intel® SHMEM
67-
Check that the SOS build process has successfully created an `<sos_dir>` directory with `include` and `lib` as subdirectories. Please find `shmem.h` and `shmemx.h` in `include`.
108+
Check that the SOS build process has successfully created a `<shmem_dir>` directory with `include` and `lib` as subdirectories. Please find `shmem.h` and `shmemx.h` in `include`.
68109

69-
Build Intel® SHMEM using the following instructions:
110+
Build Intel® SHMEM with an OpenSHMEM back-end using the following instructions:
70111

71112
```
72113
cd ishmem
73114
mkdir build
74115
cd build
75-
cmake .. -DSHMEM_INSTALL_PREFIX=<sos_dir> -DCMAKE_INSTALL_PREFIX=<ishmem_install_dir>
116+
CC=icx CXX=icpx cmake .. -DENABLE_OPENSHMEM=ON -DSHMEM_DIR=<shmem_dir> -DCMAKE_INSTALL_PREFIX=<ishmem_install_dir>
76117
make -j
77118
```
119+
Alternatively, Intel® SHMEM can be built by enabling an Intel® MPI Library back-end.
120+
Here is information on how to [Get Started with Intel® MPI Library on Linux](https://www.intel.com/content/www/us/en/docs/mpi-library/get-started-guide-linux/2021-11/overview.html).
121+
122+
```
123+
CC=icx CXX=icpx cmake .. -DENABLE_OPENSHMEM=OFF -DENABLE_MPI=ON -DMPI_DIR=<impi_dir> -DCMAKE_INSTALL_PREFIX=<ishmem_install_dir>
124+
```
125+
where `<impi_dir>` is the path to the Intel® MPI Library installation.
126+
127+
Enabling both the OpenSHMEM and MPI back-ends is also supported. In this case,
128+
the desired backend can be selected via the environment variable,
129+
`ISHMEM_RUNTIME`, which can be set to either "OpenSHMEM" or "MPI".
130+
The default value for `ISHMEM_RUNTIME` is "OpenSHMEM".
78131

79132
## Usage
80133

81134
### Launching Example Application
82135

83136
Validate that Intel® SHMEM was built correctly by running an example program.
84137

85-
1. Add the library path for SOS to the environment:
138+
1. Add the path for the back-end library to the environment, for example:
86139

87140
```
88-
export LD_LIBRARY_PATH=<sos_dir>/lib:$LD_LIBRARY_PATH
141+
export LD_LIBRARY_PATH=<shmem_dir>/lib:$LD_LIBRARY_PATH
89142
```
90143

144+
When enabling only the Intel® MPI Library back-end, simply source the appropriate
145+
`setvars.sh` script. When enabling both OpenSHMEM and MPI back-ends, first
146+
source the `setvars.sh` script, then configure the dynamic linker to load the
147+
OpenSHMEM library (for example by prepending `<shmem_dir>/lib` to
148+
`LD_LIBRARY_PATH`).
149+
91150
2. Run the example program or test on an allocated node using a process launcher:
92151

93152
```
94-
mpiexec.hydra -n 2 -hosts <allocated_node_id> ./scripts/ishmrun ./test/unit/SHMEM/int_get_device
153+
ISHMEM_RUNTIME=<back-end> mpiexec.hydra -n 2 -hosts <allocated_node_id> ./scripts/ishmrun ./test/unit/int_get_device
95154
```
155+
where `<back-end>` is the selected host back-end library.
96156

97157
- *Note:* Current supported launchers include: MPI process launchers (i.e. `mpiexec`, `mpiexec.hydra`, `mpirun`, etc.), Slurm (i.e. `srun`, `salloc`, etc.), and PBS (i.e. `qsub`).
98158

99159
- *Note:* Intel® SHMEM execution model requires applications to use a 1:1 mapping between PEs and GPU devices. Attempting to run an application without the ishmrun launch script may result in undefined behavior if this mapping is not maintained.
100160
- For further details on the device selection, please see [the ONEAPI_DEVICE_SELECTOR](https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md#oneapi_device_selector).
101161

102-
3. Validate the application ran succesfully; example output:
162+
3. Validate the application ran successfully; example output:
103163

104164
```
105165
Selected device: Intel(R) Data Center GPU Max 1550
@@ -124,7 +184,7 @@ To launch a single test, execute:
124184
ctest -R <test_name>
125185
```
126186

127-
Alternatively, all the tests in a directory (such as `test/unit/SHMEM/`) can be run with the following command:
187+
Alternatively, all the tests in a directory (such as `test/unit/`) can be run with the following command:
128188

129189
```
130190
ctest --test-dir <directory_name>
@@ -141,7 +201,7 @@ By default, a passed or failed test can be detected by the output:
141201
To have a test's output printed to the console, add either the `--verbose` or `--output-on-failure` flag to the `ctest` command
142202

143203
### Available Scheduler Wrappers for Jobs Run via CTest
144-
The following values may be assigned to `CTEST_SCHEDULER` at configure-time (ex. `-DCTEST_SCHEDULER=mpi`) to set which scheduler will be used to run tests launched through a call to `ctest`:
204+
The following values may be assigned to `CTEST_LAUNCHER` at configure-time (ex. `-DCTEST_LAUNCHER=mpi`) to set which scheduler will be used to run tests launched through a call to `ctest`:
145205
- srun (default)
146206
- Launches CTest jobs on a single node using Slurm's `srun`.
147207
- mpi

docs/_sources/building_ishmem.rst

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
.. _building_ishmem:
2+
3+
=====================
4+
Building Intel® SHMEM
5+
=====================
6+
7+
To download Intel® SHMEM, either clone the repository::
8+
9+
git clone https://github.com/oneapi-src/ishmem.git
10+
11+
or download a release tarball from: https://github.com/oneapi-src/ishmem/releases.
12+
13+
The ``README.md`` file describes how to build the dependencies of Intel® SHMEM.
14+
15+
The :ref:`CMake Build Options<cmake_options>` section lists all the available
16+
CMake build options for customizing Intel® SHMEM.
17+
18+
Intel® SHMEM requires enabling a host back-end that is either:
19+
20+
#. a suitable OpenSHMEM v1.5 library
21+
#. Intel® MPI Library (Message Passing Interface)
22+
23+
.. #. PMI (Process Manager Interface)
24+
25+
These options are covered in sections :ref:`Enabling
26+
OpenSHMEM<enabling_openshmem>` and :ref:`Enabling MPI<enabling_mpi>`,
27+
respectively.
28+
29+
.. and :ref:`Enabling PMI<enabling_pmi>`, respectively.
30+
31+
.. _enabling_openshmem:
32+
33+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34+
Enabling the OpenSHMEM back-end
35+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36+
37+
As of version |release|, Intel® SHMEM supports the following OpenSHMEM
38+
libraries:
39+
40+
- |sos_url| - please use the ``v1.5.3`` release.
41+
- |oshmpi_url| - please use this |oshmpi_branch|.
42+
43+
The OpenSHMEM back-end is enabled by default and is controlled via the
44+
``ENABLE_OPENSHMEM`` CMake option, and the installation path is set via the
45+
``SHMEM_DIR`` option, for example::
46+
47+
CC=icx CXX=icpx cmake .. -DSHMEM_DIR=<shmem_dir> -DCMAKE_INSTALL_PREFIX=<ishmem_install_dir>
48+
49+
where ``<shmem_dir>`` is the path to the Sandia OpenSHMEM installation
50+
directory, and ``<ishmem_install_dir>`` is the path to the desired Intel®
51+
SHMEM installation directory.
52+
53+
After successfully running the ``cmake`` command, run ``make`` to build the
54+
library and ``make install`` to install the library to
55+
``<ishmem_install_dir>``.
56+
57+
To enable OSHMPI, the build process is similar::
58+
59+
CC=icx CXX=icpx cmake .. -DSHMEM_DIR=<oshmpi_dir> -DCMAKE_INSTALL_PREFIX=<ishmem_install_dir>
60+
61+
where ``<oshmpi_dir>`` is the path to the OSHMPI installation. Additionally,
62+
setting the following environment variables are required for execution::
63+
64+
export ISHMEM_SHMEM_LIB_NAME=liboshmpi.so
65+
export ISHMEM_RUNTIME_USE_OSHMPI=true
66+
67+
.. note:: Enabling the OSHMPI back-end in Intel® SHMEM version |release| may
68+
require setting environment variable ``OSHMPI_TEAM_SHARED_ONLY_SELF=1`` if the
69+
``ISHMEM_TEAM_SHARED`` team does not properly match ``SHMEM_TEAM_SHARED``. This
70+
is likely the case if the following warning is encountered:
71+
``ishmemi_runtime_team_predefined_set SHARED failed. Runtime ISHMEM_TEAM_SHARED
72+
unable to use SHMEMX_TEAM_NODE``
73+
74+
.. |sos_url| raw:: html
75+
76+
<a href="https://github.com/Sandia-OpenSHMEM/SOS.git" target="_blank">Sandia OpenSHMEM</a>
77+
78+
.. |oshmpi_url| raw:: html
79+
80+
<a href="https://github.com/pmodels/oshmpi.git" target="_blank">OSHMPI</a>
81+
82+
.. |oshmpi_branch| raw:: html
83+
84+
<a href="https://github.com/davidozog/oshmpi/tree/wip/ishmem" target="_blank">experimental branch</a>
85+
86+
.. _enabling_mpi:
87+
88+
^^^^^^^^^^^^^^^^^^^^^^^^^
89+
Enabling the MPI back-end
90+
^^^^^^^^^^^^^^^^^^^^^^^^^
91+
92+
As of version |release|, Intel® SHMEM supports the following MPI libraries:
93+
94+
- |impi_url| - please use the ``2021.14.0`` release.
95+
96+
.. |impi_url| raw:: html
97+
98+
<a href="https://www.intel.com/content/www/us/en/developer/tools/oneapi/mpi-library-download.html" target="_blank">Intel® MPI Library</a>
99+
100+
To enable the MPI back-end and disable the OpenSHMEM back-end::
101+
102+
CC=icx CXX=icpx cmake .. -DENABLE_OPENSHMEM=OFF -DENABLE_MPI=ON -DMPI_DIR=<impi_install_dir> -DCMAKE_INSTALL_PREFIX=<ishmem_install_dir>
103+
104+
where ``<impi_install_dir>`` is the path to the Intel® MPI Library installation.
105+
106+
After successfully running the ``cmake`` command, run ``make`` to build the
107+
library and ``make install`` to install the library to
108+
``<ishmem_install_dir>``.
109+
110+
Note that enabling *both* the OpenSHMEM and MPI back-ends is also supported.
111+
In this case, the desired backend can be selected via the environment variable,
112+
``ISHMEM_RUNTIME``, which can be set to either "OpenSHMEM" or "MPI". For
113+
example building with both runtimes enabled::
114+
115+
CC=icx CXX=icpx cmake .. -DSHMEM_DIR=<shmem_dir> -DENABLE_MPI=ON -DMPI_DIR=<impi_install_dir>
116+
117+
And running with either ``ISHMEM_RUNTIME=OPENSHMEM`` or ``ISHMEM_RUNTIME=MPI``.
118+
119+
.. TODO: add "PMI" as a possible ISHMEM_RUNTIME option above
120+
.. .. _enabling_pmi:
121+
..
122+
.. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
123+
.. Enabling the PMI back-end (experimental)
124+
.. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
125+
..
126+
.. The Process Management Interface (PMI) is planned to be supported as an Intel®
127+
.. SHMEM back-end in a future release.
128+
129+
.. _cmake_options:
130+
131+
^^^^^^^^^^^^^^^^^^^
132+
CMake Build Options
133+
^^^^^^^^^^^^^^^^^^^
134+
135+
+---------------------------------+------------------------------------------------------------+---------+
136+
| **CMake Variable** | Description | Default |
137+
+=================================+============================================================+=========+
138+
| ``ENABLE_OPENSHMEM`` | Enable OpenSHMEM back-end support | ON |
139+
+---------------------------------+------------------------------------------------------------+---------+
140+
| ``ENABLE_MPI`` | Enable MPI back-end support | OFF |
141+
+---------------------------------+------------------------------------------------------------+---------+
142+
| ``BUILD_UNIT_TESTS`` | Build unit tests | OFF |
143+
+---------------------------------+------------------------------------------------------------+---------+
144+
| ``BUILD_PERF_TESTS`` | Build performance tests | OFF |
145+
+---------------------------------+------------------------------------------------------------+---------+
146+
| ``BUILD_EXAMPLES`` | Build examples | OFF |
147+
+---------------------------------+------------------------------------------------------------+---------+
148+
| ``BUILD_APPS`` | Build apps | OFF |
149+
+---------------------------------+------------------------------------------------------------+---------+
150+
| ``BUILD_CMAKE_CONFIG`` | Build CMake config files | ON |
151+
+---------------------------------+------------------------------------------------------------+---------+
152+
| ``ENABLE_ERROR_CHECKING`` | Validate API inputs | OFF |
153+
+---------------------------------+------------------------------------------------------------+---------+
154+
| ``ENABLE_DLMALLOC`` | Enable dlmalloc for shared heap | ON |
155+
+---------------------------------+------------------------------------------------------------+---------+
156+
| ``ENABLE_REDUCED_LINK_ENGINES`` | Enable reduced link engines (i.e. for single tile devices) | OFF |
157+
+---------------------------------+------------------------------------------------------------+---------+
158+
| ``ENABLE_AOT_COMPILATION`` | Enables Ahead-Of-Time compilation for GPU kernels | ON |
159+
+---------------------------------+------------------------------------------------------------+---------+
160+
| ``SKIP_COMPILER_CHECK`` | Skips compiler validation (NOT RECOMMENDED) | OFF |
161+
+---------------------------------+------------------------------------------------------------+---------+

0 commit comments

Comments
 (0)