What is HPX?

HPX (High Performance ParalleX) is a general purpose C++ runtime system for parallel and distributed applications of any scale. It strives to provide a unified programming model which transparently utilizes the available resources to achieve unprecedented levels of scalability. read more

License Terms and Conditions

HPX is Open Source, publsihed under the Boost Software License 1.0.

Getting Started

On the LRZ clusters, use the Environment Modules to find and set the environment.

> module av hpx
------- /lrz/sys/spack/staging/20.1/modules/haswell/linux-sles15-haswell -------
hpx/1.4.1-gcc8-impi   hpx/1.4.1-intel19-impi
> module load hpx/1.4.1-gcc8-impi

The module makes the examples available provided with the installation. But it sets also CMAKE_PREFIX_PATH and PKG_CONFIG_PATH, for those who want to build and link their applications to HPX. In order to do this correctly, the same compiler must be used as for building the HPX libraries itself. The corresponding compiler is therefore loaded with the HPX module. If something goes wrong, the compiler and its version can be found in the HPX_COMPILER_MODULE environment variable. Furthermore, HPX_CXX_COMPILER and HPX_CXX_COMPILER_VERSION are set.

For CMake projects, we recomment

> cmake -DCMAKE_CXX_COMPILE=$(which $HPX_CXX_COMPILER) ...

to catch the correct compiler.

Example

Example applications can be found on HPX Github. We use here the hello_world_distributed example. The CMakeLists.txt file and a Slurm example script may look as follows.

CMakeLists.txt
cmake_minimum_required(VERSION 3.3.2)
project(my_hpx_project CXX)
find_package(HPX REQUIRED)
add_hpx_executable( hello_world_distributed
    SOURCES hello_world_distributed.cpp
    COMPONENT_DEPENDENCIES iostreams)
slurm.sh
#!/bin/bash
#SBATCH -o ./job.cm2.%N.%x.%j.out 
#SBATCH -D .
#SBATCH -J HPXtest
#SBATCH --get-user-env
#SBATCH --export=none 
#SBATCH --clusters=cm2
#SBATCH --partition=cm2_tiny
#SBATCH --qos=cm2_tiny
#SBATCH --nodes=2
#SBATCH --tasks-per-node=1
#SBATCH --cpus-per-task=28
#SBATCH --mail-type=none
#SBATCH --time=00:05:00

module load slurm_setup
module load hpx

mpiexec ./hello_world_distributed --hpx:numa-sensitive=1 --hpx:threads $SLURM_CPUS_PER_TASK

Load also a more recent CMake module if spurious messages occur, such as boost warnings or errors. Each application built has a command-line interface to HPX. So, the following will give you a comprehensive list of possible command-line options.

> ./hello_world_distributed --hpx:help

Documentation

Help can be found on the Official Documentation Page. In case of cluster system related questions, or need for help in compiling the library for oneself, please open a ticket at the LRZ ServiceDesk.