How to run with DLB
In general, the following steps are required to run DLB with your application:
Link or preload (via
LD_PRELOAD) your application with any flavour of the DLB shared libraries. When linking, we recommendlibdlb.sofor simplicity. Then, at runtime, set theLD_PRELOADenvironment variable to any other flavour such as MPI, debug or instrumentation.Configure the environment variable
DLB_ARGSwith the desired DLB options. Typically, you will want to set at least--lewi,--drom,-talp, or any combination of them. Executedlb --helpfor a list of options. You can also use the Scripts provided in the installation.Run you application as you would normally do.
If you want to use the API you might need to link with DLB.
Starting with version 3.5, we provide a CMake Config file to make it easier to use DLB in CMake based projects:
find_package(DLB 3.5 REQUIRED) # Note that the version is optional
target_link_libraries(<your_target> DLB::DLB)
For more information we provide more detailed information depending on the component used:
Examples
MPI application that does not require the usage of the DLB API:
export DLB_ARGS="..." mpirun ... env LD_PRELOAD=<dlb_install_path>/lib/libdlb_mpi.so <app> <args>
Same as (1), but using the provided scripts (using
talp.shas an example):cp <dlb_install_path>/share/doc/dlb/scripts/talp.sh . edit talp.sh # Optional, review and edit DLB_ARGS mpirun ... ./talp.sh <app> <args>
MPI application that requires the usage of the DLB API (linking required):
# Compile and link you application with the base DLB library in order to # just satisfy the requirement of DLB symbols and avoid other dependences DLB_CPPFLAGS="-I<dlb_install_path>/include" DLB_LDLAGS="-L<dlb_install_path>/lib -ldlb -Wl,-rpath,<dlb_install_path>/lib" mpicc ... -o <app> $DLB_CPPFLAGS $DLB_LDFLAGS # Run as the examples above export DLB_ARGS="..." mpirun ... env LD_PRELOAD=<dlb_install_path>/lib/libdlb_mpi.so <app> <args>
Same as (3), but using the CMake script:
export CMAKE_PREFIX_PATH+=":<dlb_install_path>/lib" cmake <source-dir> ... # Run as the examples above export DLB_ARGS="..." mpirun ... env LD_PRELOAD=<dlb_install_path>/lib/libdlb_mpi.so <app> <args>
Python program that requires the usage of the DLB API:
PY_MAJOR=$(python3 -c "import sys; print(sys.version_info[0])") PY_MINOR=$(python3 -c "import sys; print(sys.version_info[1])") export PYTHONPATH="<dlb_install_path>/lib/python${PY_MAJOR}.${PY_MINOR}/site-packages:${PYTHONPATH}" # Run the application python3 <app.py> <args> # Run with debug enabled DLB_DEBUG=1 python3 <app.py> <args>