|
| 1 | +.. |
| 2 | + Copyright (c) 2025 Jiakun Yan |
| 3 | +
|
| 4 | + SPDX-License-Identifier: BSL-1.0 |
| 5 | + Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 6 | + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 7 | + |
| 8 | +.. _using_the_lcw_parcelport: |
| 9 | + |
| 10 | +======================== |
| 11 | +Using the LCW parcelport |
| 12 | +======================== |
| 13 | + |
| 14 | +.. _info_lcw: |
| 15 | + |
| 16 | +Basic information |
| 17 | +================= |
| 18 | + |
| 19 | +The LCW parcelport is an advanced MPI parcelport that can utilize the MPICH VCI |
| 20 | +and Continuation extensions. The exact MPI implementation is wrapped in a thin |
| 21 | +wrapper layer (the Lightweight Communication Wrapper, or LCW). This wrapper |
| 22 | +provides an active message, send/recv, completion queue, and device abstraction |
| 23 | +on top of MPI (with/without extensions), GASNet-EX, and LCI. The GASNet-EX |
| 24 | +backend of LCW cannot be used in |hpx| for now, as it lacks send/recv support. |
| 25 | + |
| 26 | +.. _`Lightweight Communication Wrapper`: https://github.com/JiakunYan/lcw |
| 27 | + |
| 28 | +.. _build_lcw_pp: |
| 29 | + |
| 30 | +Build |hpx| with the LCW parcelport |
| 31 | +=================================== |
| 32 | + |
| 33 | +While building |hpx|, you can specify a set of |cmake|_ variables to enable |
| 34 | +and configure the LCW parcelport. Below, there is a set of the most important |
| 35 | +and frequently used CMake variables. |
| 36 | + |
| 37 | +.. option:: HPX_WITH_PARCELPORT_LCW |
| 38 | + |
| 39 | + Enable the LCW parcelport. This enables the use of LCW for networking |
| 40 | + operations in the |hpx| runtime. The default value is ``OFF`` because it's |
| 41 | + not available on all systems and/or requires another dependency. |
| 42 | + You must set this variable to ``ON`` in order to use the LCW parcelport. All |
| 43 | + the following variables only make sense when this variable is set to ``ON``. |
| 44 | + |
| 45 | +.. option:: HPX_WITH_FETCH_LCW |
| 46 | + |
| 47 | + Use FetchContent to fetch LCW. The default value is ``OFF``. |
| 48 | + If this option is set to ``OFF``. You need to install your own LCW library |
| 49 | + and |hpx| will try to find it using |cmake|_ ``find_package``. You can |
| 50 | + specify the location of the LCW installation by the environmental variable |
| 51 | + ``LCW_ROOT``. Refer to the `LCW README`_ for how to install LCW. |
| 52 | + If this option is set to ``ON``. |hpx| will fetch and build LCW for you. You |
| 53 | + can use the following |cmake|_ variables to configure this behavior for your |
| 54 | + platform. |
| 55 | + |
| 56 | +.. _`LCW README`: https://github.com/JiakunYan/lcw#readme |
| 57 | + |
| 58 | +.. option:: HPX_WITH_LCW_TAG |
| 59 | + |
| 60 | + This variable only takes effect when ``HPX_WITH_FETCH_LCW`` is set to ``ON`` |
| 61 | + and ``FETCHCONTENT_SOURCE_DIR_LCW`` is not set. |
| 62 | + |hpx| will fetch LCW from its github repository. This variable controls the |
| 63 | + branch/tag LCW will be fetched. |
| 64 | + |
| 65 | +.. option:: FETCHCONTENT_SOURCE_DIR_LCW |
| 66 | + |
| 67 | + This variable only takes effect when ``HPX_WITH_FETCH_LCW`` is set to ``ON``. |
| 68 | + When it is defined, ``HPX_WITH_LCW_TAG`` will be ignored. |
| 69 | + It accepts a path to a local version of LCW source code and |hpx| will fetch |
| 70 | + and build LCW from there. |
| 71 | + |
| 72 | +.. _run_lcw_pp: |
| 73 | + |
| 74 | +Run |hpx| with the LCW parcelport |
| 75 | +================================= |
| 76 | + |
| 77 | +You can configure runtime behavior with the following options. |
| 78 | + |
| 79 | +.. option:: --hpx:ini=hpx.parcel.lcw.ndevices=<n> |
| 80 | + |
| 81 | + The number of LCW devices to use (default: 2). Each LCW device maps to an MPI |
| 82 | + communicator or an LCI device. When the MPICH VCI extension is enabled, each |
| 83 | + MPI communicator will be mapped to a dedicated collection of network resources. |
| 84 | + More devices lead to lower thread contention, but too many devices |
| 85 | + may lead to load imbalance or hardware overhead. |
| 86 | + |
| 87 | +Reference |
| 88 | +========= |
| 89 | + |
| 90 | +Yan, Jiakun, Marc Snir, and Yanfei Guo. *Examining MPI and its Extensions for |
| 91 | +Asynchronous Multithreaded Communication.* In *European MPI Users' Group Meeting*, |
| 92 | +pp. 122-142. Cham: Springer Nature Switzerland, 2025. |
0 commit comments