Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
4db74a0
Fix missing type from previous refactor
Andrew-Beggs-ECMWF Feb 19, 2026
b315c24
Add 'lib_type' to workflow
Andrew-Beggs-ECMWF Feb 19, 2026
899e4f5
Update 'ecmwf-actions/build-package@v2' -> 'ecmwf/build-package@v2'
Andrew-Beggs-ECMWF Feb 19, 2026
872d62e
Add ability to test features in the CI
Andrew-Beggs-ECMWF Feb 19, 2026
a89b324
Use nvhpc compiler name to derive version for downloads
Andrew-Beggs-ECMWF Feb 20, 2026
ed587e5
Cache nvhpc compiler download
Andrew-Beggs-ECMWF Feb 20, 2026
21c44a4
Update AUTHORS
Andrew-Beggs-ECMWF Feb 20, 2026
eb5c49b
Install papi when testing feature in CI
Andrew-Beggs-ECMWF Feb 20, 2026
9732d8e
Install rocprofiler-sdk for roctx when testing feature in CI
Andrew-Beggs-ECMWF Feb 20, 2026
ccbf72f
Add rocm requirements for rocprofiler-sdk
Andrew-Beggs-ECMWF Feb 20, 2026
ca24234
Fix changing ubuntu version
Andrew-Beggs-ECMWF Feb 20, 2026
f361830
Limit rocprofiler-sdk to only installing the required rocprofiler-sdk…
Andrew-Beggs-ECMWF Feb 20, 2026
4b5c1e5
Fix matrix exclude
Andrew-Beggs-ECMWF Feb 20, 2026
cc6c127
Fix package required for PAPI libs
Andrew-Beggs-ECMWF Feb 20, 2026
9bcd3cf
Fix linking to '${fiatlib}' instead of 'fiat'
Andrew-Beggs-ECMWF Feb 20, 2026
37d5343
Add package for nvtx libs
Andrew-Beggs-ECMWF Feb 21, 2026
ead19d2
Change to use 'nvidia-cuda-toolkit' for nvtx & only when not nvhpc co…
Andrew-Beggs-ECMWF Feb 21, 2026
a9e0e4b
Update packages for NVTX feature to include nsys
Andrew-Beggs-ECMWF Feb 21, 2026
6f68aaf
Set CUDAToolkit_ROOT for cmake
Andrew-Beggs-ECMWF Feb 21, 2026
9ab5abc
Fix CUDAToolkit_ROOT exporting
Andrew-Beggs-ECMWF Feb 21, 2026
8b7d22f
Add package for nvcc so cmake can find nvtx
Andrew-Beggs-ECMWF Feb 21, 2026
547b3d0
Update CUDA version to 12.5
Andrew-Beggs-ECMWF Feb 21, 2026
fcf5224
Revert CUDA version to 12.4 for Ubuntu 22.04
Andrew-Beggs-ECMWF Feb 21, 2026
91dc6d8
Fix typo
Andrew-Beggs-ECMWF Feb 21, 2026
f323486
Tmp debug outputs
Andrew-Beggs-ECMWF Feb 21, 2026
4b71ab8
Add nsight-systems specific bin folder to $GITHUB_PATH
Andrew-Beggs-ECMWF Feb 21, 2026
0a530fd
Fix PAPI using printf(...) vs fprintf(stderr,..)
Andrew-Beggs-ECMWF Feb 24, 2026
43cfd1c
Tmp debug outputs
Andrew-Beggs-ECMWF Feb 24, 2026
351d598
Add 'papi-tools' package for papi_avail
Andrew-Beggs-ECMWF Feb 24, 2026
7bb684d
Add DR_HOOK_PAPI on macos to list of excluded test configurations
Andrew-Beggs-ECMWF Feb 24, 2026
f469286
Tmp debug outputs
Andrew-Beggs-ECMWF Feb 24, 2026
eaee7f8
Tmp debug outputs
Andrew-Beggs-ECMWF Feb 24, 2026
5dc005d
Add hints to FindROCTX.cmake for modern ROCm structure
Andrew-Beggs-ECMWF Feb 24, 2026
e2e6dd1
Add alternative path for roctx.h for finding ROCM_PATH
Andrew-Beggs-ECMWF Feb 24, 2026
1a60bff
Refactor finding ROCM_PATH so find_package( rocprofiler-sdk-roctx ...…
Andrew-Beggs-ECMWF Feb 24, 2026
fadec7d
Update url to match AMD remote
Andrew-Beggs-ECMWF Feb 24, 2026
03aa077
Add rocprofiler-sdk package for DR_HOOK_ROCTX
Andrew-Beggs-ECMWF Feb 24, 2026
c30a52a
Add rocm/bin to PATH
Andrew-Beggs-ECMWF Feb 24, 2026
4a99a3a
Add rocm-comgr
Andrew-Beggs-ECMWF Feb 24, 2026
2f23d74
rocm-comgr -> comgr
Andrew-Beggs-ECMWF Feb 24, 2026
c5371aa
Add hsa-amd-aqlprofile package for DR_HOOK_ROCTX
Andrew-Beggs-ECMWF Feb 24, 2026
6c74927
Add 'NOPROPAGATE_SIGNALS' to fiat_test_drhook_roctx_mismatched_regions
Andrew-Beggs-ECMWF Feb 24, 2026
40eb050
Add --verbose to ctest
Andrew-Beggs-ECMWF Feb 25, 2026
564a523
Add --disable-signal-handlers to ROCTX tests that WILL_FAIL to preven…
Andrew-Beggs-ECMWF Feb 25, 2026
e625038
Add comments
Andrew-Beggs-ECMWF Feb 25, 2026
49b6061
Add NOPROPAGATE_SIGNALS
Andrew-Beggs-ECMWF Feb 25, 2026
526c576
Skip papi tests
Andrew-Beggs-ECMWF Feb 26, 2026
8259b2e
Change -E to -LE for label PAPI_BROKEN_GITHUB_CI
Andrew-Beggs-ECMWF Feb 27, 2026
ca41ec0
Only set opt_papi when DR_HOOK_HAVE_PAPI
Andrew-Beggs-ECMWF Feb 27, 2026
b18b027
Fix downstream detection of optional dependencies.
marsdeno Mar 3, 2026
94c05b9
Tidy-up left-over comments
marsdeno Mar 6, 2026
64a9c3b
Fix style
Andrew-Beggs-ECMWF Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/tools/install-nvhpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,26 @@ ver="$(echo $version | tr -d . )"
URL=$(curl -s "https://developer.nvidia.com/nvidia-hpc-sdk-$ver-downloads" | grep -oP "https://developer.download.nvidia.com/hpc-sdk/([0-9]{2}\.[0-9]+)/nvhpc_([0-9]{4})_([0-9]+)_Linux_$(uname -m)_cuda_([0-9\.]+).tar.gz" | sort | tail -1)
FOLDER="$(basename "$(echo "${URL}" | grep -oP '[^/]+$')" .tar.gz)"

if [ ! -d "${TEMPORARY_FILES}/${FOLDER}" ]; then
MD5_HASH=$(curl -s "https://developer.download.nvidia.com/hpc-sdk/$ver/md5sum.txt" | grep -P "nvhpc_([0-9]{4})_([0-9]+)_Linux_$(uname -m)_cuda_([0-9\.]+).tar.gz" | awk '{print $1}')

DOWNLOAD_REQUIRED=true
if [ -d "${TEMPORARY_FILES}/${FOLDER}" ]; then
echo "Download already present in ${TEMPORARY_FILES}/${FOLDER}"
if [ "${MD5_HASH}" = "$(cat ${TEMPORARY_FILES}/${FOLDER}/md5sum.txt)" ]; then
echo "MD5 hash matches expected value, using existing download"
DOWNLOAD_REQUIRED=false
else
echo "MD5 hash does not match expected value"
fi
fi

if [ ${DOWNLOAD_REQUIRED} = true ]; then
echo "Downloading ${TEMPORARY_FILES}/${FOLDER} from URL [${URL}]"
mkdir -p ${TEMPORARY_FILES}
curl --location \
--user-agent "pgi-travis (https://github.com/nemequ/pgi-travis)" \
"${URL}" | tar zx -C "${TEMPORARY_FILES}"
else
echo "Download already present in ${TEMPORARY_FILES}/${FOLDER}"
echo "${MD5_HASH}" >> "${TEMPORARY_FILES}/${FOLDER}/md5sum.txt"
fi

echo "+ ${TEMPORARY_FILES}/${FOLDER}/install"
Expand Down
41 changes: 36 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:

matrix:
build_type: [Release,Debug]
lib_type: [Shared,Static]
feature: [None,DR_HOOK_PAPI,DR_HOOK_NVTX,DR_HOOK_ROCTX]
name:
- linux gnu-10
- linux gnu-12
Expand Down Expand Up @@ -117,6 +119,17 @@ jobs:
coverage: false
cmake_options: -DMPI_SLOTS=4 -DMPI_ARGS=--oversubscribe

- feature: DR_HOOK_PAPI
ctest_options: -LE PAPI_BROKEN_GITHUB_CI

exclude:
- name: macos
feature: DR_HOOK_ROCTX
- name: macos
feature: DR_HOOK_NVTX
- name: macos
feature: DR_HOOK_PAPI

runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
Expand All @@ -129,11 +142,25 @@ jobs:
echo "CXX=${{ matrix.compiler_cxx }}" >> $GITHUB_ENV
echo "FC=${{ matrix.compiler_fc }}" >> $GITHUB_ENV

# https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=24.04&target_type=deb_network
if [[ "${{ matrix.feature }}" == "DR_HOOK_NVTX" ]]; then
wget https://developer.download.nvidia.com/compute/cuda/repos/${{ case(matrix.os == 'ubuntu-22.04', 'ubuntu2204', 'ubuntu2404') }}/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
echo "/usr/lib/nsight-systems/bin" >> "$GITHUB_PATH"
fi

# https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html
if [[ "${{ matrix.feature }}" == "DR_HOOK_ROCTX" ]]; then
wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/${{ case(matrix.os == 'ubuntu-22.04', 'jammy', 'noble') }}/amdgpu-install_7.2.70200-1_all.deb
sudo apt install ./amdgpu-install_7.2.70200-1_all.deb
echo "/opt/rocm/bin" >> "$GITHUB_PATH"
fi

if [[ "${{ matrix.os }}" =~ macos ]]; then
brew install ninja
else
sudo apt-get update
sudo apt-get install ninja-build
sudo apt-get install ninja-build ${{ case( matrix.feature == 'DR_HOOK_PAPI', 'libpapi-dev', matrix.feature == 'DR_HOOK_ROCTX', 'rocprofiler-sdk-roctx rocprofiler-sdk comgr hsa-amd-aqlprofile', matrix.feature == 'DR_HOOK_NVTX' && matrix.compiler != 'nvhpc-25.1' , 'nsight-systems cuda-nvtx-12-5 cuda-nvcc-12-5', '') }}
fi

printenv
Expand Down Expand Up @@ -168,9 +195,13 @@ jobs:

- name: Install NVHPC compiler
if: contains( matrix.compiler, 'nvhpc' )
env:
COMPILER_NAME: ${{ matrix.name }}
shell: bash -eux {0}
# This uses a parameter expansion to strip the leading everything up to & including
# the last '-'
run: |
${FIAT_TOOLS}/install-nvhpc.sh --prefix /opt/nvhpc --version 25.1
${FIAT_TOOLS}/install-nvhpc.sh --prefix /opt/nvhpc --tmpdir ${{ env.DEPS_DIR }} --version ${COMPILER_NAME##*-}
source /opt/nvhpc/env.sh
echo "${NVHPC_DIR}/compilers/bin" >> $GITHUB_PATH
echo "NVHPC_ROOT=${NVHPC_DIR}" >> $GITHUB_ENV
Expand Down Expand Up @@ -212,7 +243,7 @@ jobs:

- name: Build & Test
id: build-test
uses: ecmwf-actions/build-package@v2
uses: ecmwf/build-package@v2
with:
self_coverage: ${{ matrix.coverage }}
force_build: true
Expand All @@ -226,8 +257,8 @@ jobs:
dependency_cmake_options: |
ecmwf/eckit: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TESTS=OFF -DENABLE_ECKIT_CMD=OFF -DENABLE_ECKIT_SQL=OFF -DENABLE_MPI=ON -DENABLE_OMP=OFF"
ecmwf/fckit: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TESTS=OFF"
cmake_options: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.cmake_options }} -DENABLE_MPI=ON"
ctest_options: "${{ matrix.ctest_options }}"
cmake_options: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_SHARED_LIBS=${{ case(matrix.lib_type == 'Shared', 'ON', matrix.lib_type == 'Static', 'OFF', 'ON') }} ${{ case(matrix.feature == 'None', '', format('-DENABLE_{0}=ON', matrix.feature)) }} ${{ matrix.cmake_options }} -DENABLE_MPI=ON"
ctest_options: ${{ matrix.ctest_options }}

# - name: Verify tools
# run: |
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Authors and Contributors
========================

- A. Beggs (ECMWF)
- W. Deconinck (ECMWF)
- D. Dent (ECMWF)
- R. El Khatib (Meteo France)
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ if( target_build_type STREQUAL STATIC_LIBRARY OR TARGET fiat-static )
set( fiat_REQUIRES_PRIVATE_DEPENDENCIES TRUE )
endif()

set(FIAT_CMAKEMACROS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

ecbuild_install_project( NAME fiat )

ecbuild_print_summary()
Expand Down
27 changes: 14 additions & 13 deletions cmake/FindROCTX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,23 @@
# granted to it by virtue of its status as an intergovernmental organisation
# nor does it submit to any jurisdiction.

set( HAVE_ROCPROFILER_SDK_ROCTX 0)
set( HAVE_ROCPROFILER_SDK_ROCTX 0)
set( ROCTX_REQUIRED_VARS ROCTX_LIBRARIES )

find_package( rocprofiler-sdk-roctx CONFIG PATHS ${ROCM_PATH}/lib )
if( NOT rocprofiler-sdk-roctx_FOUND )
ecbuild_info( "rocprofiler-sdk-roctx libraries not found" )
if ( NOT DEFINED ROCM_PATH OR NOT ROCM_PATH_FOUND )
find_path(
if ( NOT DEFINED ROCM_PATH OR NOT ROCM_PATH_FOUND )
find_path(
ROCM_PATH
NAMES include/roctracer/roctx.h
NAMES include/roctracer/roctx.h include/rocprofiler-sdk-roctx/roctx.h
HINTS ENV ROCM_DIR ENV ROCM_PATH ENV HIP_PATH ENV ROCM_ROOT_DIR /opt/rocm
)
ecbuild_info( "ROCM path: ${ROCM_PATH}" )
endif()
)
ecbuild_info( "ROCM path: ${ROCM_PATH}" )
endif()

find_path( ROCTX_INCLUDE_DIRS NAMES roctx.h HINTS ${ROCM_PATH}/include/roctracer/ )
find_package( rocprofiler-sdk-roctx CONFIG PATHS ${ROCM_PATH}/lib ${ROCM_PATH}/lib/cmake )
if( NOT rocprofiler-sdk-roctx_FOUND )
ecbuild_info( "rocprofiler-sdk-roctx libraries not found" )

find_path( ROCTX_INCLUDE_DIRS NAMES roctx.h HINTS ${ROCM_PATH}/include/roctracer/ ${ROCM_PATH}/include/rocprofiler-sdk-roctx )
list( APPEND ROCTX_REQUIRED_VARS ROCTX_INCLUDE_DIRS )
find_path( ROCTX_LIBRARY_PATH NAMES libroctx64.so HINTS ${ROCM_PATH}/lib/ )

Expand All @@ -31,8 +32,8 @@ if( NOT rocprofiler-sdk-roctx_FOUND )
else()
if( TARGET ${rocprofiler-sdk-roctx_LIBRARIES} )
set( ROCTX_LIBRARIES ${rocprofiler-sdk-roctx_LIBRARIES} )
set( ROCTX_INCLUDE_DIRS ${rocprofiler-sdk-roctx_INCLUDE_DIR} )
list( APPEND ROCTX_REQUIRED_VARS ROCTX_INCLUDE_DIRS )
set( ROCTX_INCLUDE_DIRS ${rocprofiler-sdk-roctx_INCLUDE_DIR} )
list( APPEND ROCTX_REQUIRED_VARS ROCTX_INCLUDE_DIRS )
set( HAVE_ROCPROFILER_SDK_ROCTX 1 )
endif()
endif()
Expand Down
21 changes: 21 additions & 0 deletions cmake/fiat-import.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,22 @@ set( fiat_VERSION_STR @fiat_VERSION_STR@ )
set( fiat_HAVE_MPI @fiat_HAVE_MPI@ )
set( fiat_HAVE_OMP @fiat_HAVE_OMP@ )
set( fiat_HAVE_FCKIT @fiat_HAVE_FCKIT@ )
set( fiat_HAVE_DR_HOOK_NVTX @fiat_HAVE_DR_HOOK_NVTX@ )
set( fiat_HAVE_DR_HOOK_ROCTX @fiat_HAVE_DR_HOOK_ROCTX@ )
set( fiat_HAVE_DR_HOOK_PAPI @fiat_HAVE_DR_HOOK_PAPI@ )
set( fiat_HAVE_SINGLE_PRECISION @fiat_HAVE_SINGLE_PRECISION@ )
set( fiat_HAVE_DOUBLE_PRECISION @fiat_HAVE_DOUBLE_PRECISION@ )
set( fiat_HAVE_MPL_F08 @fiat_HAVE_MPL_F08@ )
set( fiat_REQUIRES_PRIVATE_DEPENDENCIES @fiat_REQUIRES_PRIVATE_DEPENDENCIES@ )

set( fiat_SOURCE_FILENAMES @fiat_SOURCE_FILENAMES@ )


# This variable picks up the source dir location for builds
set(FIAT_CMAKEMACROS_DIR @FIAT_CMAKEMACROS_DIR@)
list(APPEND CMAKE_MODULE_PATH ${FIAT_CMAKEMACROS_DIR})


if( fiat_HAVE_OMP AND NOT TARGET OpenMP::OpenMP_Fortran )
if( NOT CMAKE_Fortran_COMPILER_LOADED )
enable_language( Fortran )
Expand All @@ -39,6 +48,18 @@ if( fiat_HAVE_MPI AND NOT TARGET MPI::MPI_Fortran )
endif()
endif()

if( fiat_HAVE_DR_HOOK_NVTX )
find_dependency( NVTX )
endif()

if( fiat_HAVE_DR_HOOK_ROCTX )
find_dependency( ROCTX )
endif()

if( fiat_HAVE_DR_HOOK_PAPI )
find_dependency( PAPI )
endif()

if( fiat_HAVE_FCKIT AND NOT TARGET fckit )
find_dependency( fckit HINTS ${CMAKE_CURRENT_LIST_DIR}/../fckit @fckit_DIR@ )
endif()
Expand Down
1 change: 1 addition & 0 deletions src/fiat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ foreach( LIB_TYPE ${LIB_TYPES} )
target_link_libraries (${fiatlib} PRIVATE ${NVTX_LIBRARIES})
target_include_directories(${fiatlib} PRIVATE ${NVTX_INCLUDE_DIRS})
endif()
set(LINK_FIAT_MPI_LIBRARIES PUBLIC_LIBS ${FIAT_MPI_LIBRARIES})

if (HAVE_DR_HOOK_ROCTX)
# Files from within DrHook
Expand Down
9 changes: 7 additions & 2 deletions src/fiat/drhook/drhook.c
Original file line number Diff line number Diff line change
Expand Up @@ -2659,8 +2659,11 @@ process_options()
char* opt_name = p;
/* Assume that everything is OFF by default */
if (strequ(p,"ALL")) { /* all except profiler data */
opt_papi = opt_gethwm = opt_getstk = opt_getrss = opt_getpag = opt_walltime = opt_cputime = opt_cycles = 1;
opt_gethwm = opt_getstk = opt_getrss = opt_getpag = opt_walltime = opt_cputime = opt_cycles = 1;
opt_calls = 1;
#ifdef DR_HOOK_HAVE_PAPI
opt_papi = 1;
#endif
any_memstat++;
}
else if (strequ(p,"MEM") || strequ(p,"MEMORY")) {
Expand Down Expand Up @@ -2732,7 +2735,9 @@ process_options()
opt_cpuprof = 0; /* Note: Switches cpuprof OFF */
opt_calls = 1;
opt_cycles = 1;
#ifdef DR_HOOK_HAVE_PAPI
opt_papi = 1;
#endif
}
else if (strequ(p,"CPUPROF")) {
opt_cpuprof = 1;
Expand Down Expand Up @@ -2824,7 +2829,7 @@ process_options()

#if defined(DR_HOOK_HAVE_PAPI)
if (opt_papi) {
newline = 0;
int newline = 0;
env = getenv("DR_HOOK_PAPI_COUNTERS");
if (env) {
const char delim[] = ", \t/";
Expand Down
Loading
Loading