Skip to content

Using APEX with HPX5

Kevin Huck edited this page Dec 22, 2016 · 14 revisions

NB: the following instructions assume the bash shell.

Step 1. Download, configure and build APEX (using the latest code in Github).

Obviously, change the installation prefix if desired, and you can use your own builds of Active Harmony and Binutils. See the full documentation for details. A "vanilla" configuration (definitely don't use jemalloc or tcmalloc or any other memory heap manager - HPX provides one) that would work with HPX-5 and provide support for APEX policies would use the following steps:

git clone https://github.com/khuck/xpress-apex
cd xpress-apex
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_OMPT=FALSE -DBUILD_EXAMPLES=TRUE -DBUILD_TESTS=TRUE -DBUILD_BFD=TRUE -DBUILD_ACTIVEHARMONY=TRUE -DUSE_OTF2=FALSE ..
make -j8
make doc
make install

Step 2. Download, configure and build HPX-5 (using the latest release, or their Gitlab code if desired).

Again, change the installation prefix if desired, and you can specify your own versions of HPX dependencies - see the HPX documentation for details.

wget http://hpx.crest.iu.edu/release/hpx-4.0.0.tar.gz
tar -xzf hpx-4.0.0.tar.gz
cd hpx-4.0.0/hpx/scripts
./setup-autotools.sh `pwd`/../../autotools-install
cd ../..
export PATH=`pwd`/autotools-install/bin:$PATH
export LD_LIBRARY_PATH=/path/to/xpress-apex/install/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=/path/to/xpress-apex/install/lib/pkgconfig:$MPI/lib/pkgconfig:$PKG_CONFIG_PATH
cd hpx
./bootstrap
./configure --enable-testsuite --prefix=`pwd`/../hpx-install --with-apex=yes --enable-instrumentation --enable-shared --enable-mpi --with-libffi=contrib --with-jemalloc=contrib
make -j8
make install
cd ..
export PKG_CONFIG_PATH=`pwd`/hpx-install/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=`pwd`/hpx-install/lib:$LD_LIBRARY_PATH

Step 3. Configure and build HPX application example: LibPXGL

cd hpx-apps/LibPXGL
./bootstrap
./configure --with-hpx="hpx,apex,hwloc"
make

Step 4. Run the HPX LibPXGL example

The executable should exist as hpx-4.0.0/hpx-apps/LibPXGL/examples/sssp. Replace "$i" with the number of cores per node. If the "10" example isn't available, use the "9" example, although it is rather small.

mpirun -np 2 ./examples/sssp -q 60 \
    --hpx-threads=$i --hpx-thread-affinity=core \
    ./examples/input/Random4-n.10.0.gr \
    ./examples/input/Random4-n.10.0.ss

To run with a moderate size problem, generate a graph:

mpirun -np 2 ./examples/sssp -g 8.0 --hpx-threads=$i --hpx-thread-affinity=core

Step 5. Run the example with APEX policies enabled

(coming soon)