Skip to content

WIP: Using oneapi Intel Advisor with Devito

George Bisbas edited this page Apr 2, 2024 · 2 revisions

Work in progress

Script for testing

# All good, Intel compiler and advisor are available
export DEVITO_ARCH=icc

# Tell Devito to instrument the generated code for Advisor
# export DEVITO_PROFILING = advisor

# Devito Logging is disabled unless the user asks explicitly to see it
export DEVITO_LOGGING=DEBUG

# Roofline analyses are recommended with threading enabled
export DEVITO_LANGUAGE=openmp

# Prevent NumPy from using threads, which otherwise leads to a deadlock when
# used in combination with Advisor. This issue has been described at:
#     `software.intel.com/en-us/forums/intel-advisor-xe/topic/780506`
# Note: we should rather sniff the BLAS library used by NumPy, and set the
# appropriate env var only
export OPENBLAS_NUM_THREADS=1
export MKL_NUM_THREADS=1
# Note: `Numaexpr`, used by NumPy, also employs threading, so we shall disable
# it too via the corresponding env var. See:
#     `stackoverflow.com/questions/17053671/python-how-do-you-stop-numpy-from-multithreading`  # noqa
export NUMEXPR_NUM_THREADS=1

# prefix; numactl --cpunodebind=0 advixe-cl -data-limit=500 -project-dir mydir

numactl --cpunodebind=0 advixe-cl -data-limit=500 -project-dir mydir -collect survey -run-pass-thru=--no-altstack -run-pass-thru=-timestamp=sys -strategy ldconfig:notrace:notrace -- python3 examples/seismic/acoustic/acoustic_example.py -d 100 100 100

numactl --cpunodebind=0 advixe-cl -data-limit=500 -project-dir mydir -collect tripcounts --enable-cache-simulation --flop --stacks --collect=map -- python3 examples/seismic/acoustic/acoustic_example.py -d 100 100 100