Skip to content
This repository was archived by the owner on Sep 22, 2025. It is now read-only.
Merged
12 changes: 12 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:
jobs:
checks:
runs-on: intel-ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Ubuntu dependencies
Expand All @@ -34,6 +35,7 @@ jobs:

unit_tests:
runs-on: pvc
timeout-minutes: 30
strategy:
# test everything, even if one fails
fail-fast: false
Expand Down Expand Up @@ -68,6 +70,7 @@ jobs:

pvc_unit_tests:
runs-on: pvc
timeout-minutes: 30
strategy:
# test everything, even if one fails
fail-fast: false
Expand All @@ -84,6 +87,8 @@ jobs:
- uses: actions/checkout@v4
- name: Generate
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config }}
- name: Save environment dump
run: printenv > build/envdump.txt
- name: Build tests
run: cmake --build build --target all-tests -- -j
- name: Unit tests
Expand All @@ -93,13 +98,19 @@ jobs:
with:
name: log-pvc-impi-icpx-${{ matrix.config }}
path: |
build/CMakeCache.txt
build/envdump.txt
build/Testing
build/test/gtest/mhp/*.log
build/benchmarks/gbench/mhp/*.log
build/examples/mhp/*.log
build/test/gtest/shp/*.log
build/benchmarks/gbench/shp/*.log
build/examples/shp/*.log

ishmem_unit_tests:
runs-on: pvc
timeout-minutes: 30
strategy:
# test everything, even if one fails
fail-fast: false
Expand Down Expand Up @@ -134,6 +145,7 @@ jobs:
publish:
needs: [checks, unit_tests, pvc_unit_tests, ishmem_unit_tests]
runs-on: intel-ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
env:
Expand Down
33 changes: 26 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ add_custom_target(shp-all-tests)
add_custom_target(all-tests DEPENDS mhp-all-tests shp-all-tests)

function(add_mhp_ctest_impl)
set(options OFFLOAD GDB SYCL DRLOGS)
set(oneValueArgs NAME TEST_NAME NPROC)
set(options OFFLOAD GDB SYCL DRLOGS TESTLABEL)
set(oneValueArgs NAME TEST_NAME NPROC TIMEOUT)
set(multiValueArgs TARGS) # Test ARGumentS

cmake_parse_arguments(AMC "${options}" "${oneValueArgs}" "${multiValueArgs}"
Expand Down Expand Up @@ -220,19 +220,34 @@ function(add_mhp_ctest_impl)
${MPIEXEC_PREFLAGS} ${extra_mpiflags} ${wrapper_script} ./${AMC_NAME}
${drlogs_param} ${sycl_param} ${AMC_TARGS} COMMAND_EXPAND_LISTS)

if(NOT AMC_GDB AND NOT AMC_DRLOGS)
if(DEFINED AMC_TIMEOUT)
set_tests_properties(${AMC_TEST_NAME} PROPERTIES TIMEOUT ${AMC_TIMEOUT})
else()
set_tests_properties(${AMC_TEST_NAME} PROPERTIES TIMEOUT 60)
endif()

if(AMC_TESTLABEL)
set_property(TEST ${AMC_TEST_NAME} PROPERTY LABELS TESTLABEL MHP)
endif()
add_dependencies(mhp-all-tests ${AMC_NAME})
endfunction()

function(add_mhp_ctest)
add_mhp_ctest_impl(${ARGN})
function(add_mhp_auxiliary_ctests)
add_mhp_ctest_impl(${ARGN} GDB)
add_mhp_ctest_impl(${ARGN} GDB DRLOGS)
add_mhp_ctest_impl(${ARGN} DRLOGS)
endfunction()

function(add_mhp_ctest)
add_mhp_ctest_impl(${ARGN} TESTLABEL)
add_mhp_auxiliary_ctests(${ARGN})
endfunction()

function(add_mhp_disabled_ctest)
add_mhp_ctest_impl(${ARGN})
add_mhp_auxiliary_ctests(${ARGN})
endfunction()

if(ENABLE_ISHMEM)

set(OFI_PROVIDER
Expand Down Expand Up @@ -334,12 +349,16 @@ if(ENABLE_ISHMEM)

endif()

function(add_shp_ctest test_name name)
function(add_shp_disabled_ctest test_name name)
add_test(NAME ${test_name} COMMAND ./${name} ${ARGN})
set_property(TEST ${test_name} PROPERTY LABELS TESTLABEL SHP)
add_dependencies(shp-all-tests ${name})
endfunction()

function(add_shp_ctest test_name name)
add_shp_disabled_ctest(${test_name} ${name} ${ARGN})
set_property(TEST ${test_name} PROPERTY LABELS TESTLABEL SHP)
endfunction()

install(DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX})

add_subdirectory(include)
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/gbench/mhp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release" AND NOT MPI_IMPL STREQUAL "openmpi")
# of static column size for stencil2D disable DPL benchmarks because we get
# intermittent fails with: ONEAPI_DEVICE_SELECTOR=opencl:cpu mpirun -n 1
# ./mhp-bench --vector-size 30000 --rows 100 --columns 100 --check
add_mhp_ctest(
add_mhp_disabled_ctest(
NAME mhp-bench TARGS --vector-size 30000 --rows 100 --columns 100 --check
--benchmark_filter=-FFT3D.*)
if(ENABLE_SYCL)
add_mhp_ctest(
add_mhp_disabled_ctest(
NAME mhp-bench SYCL TARGS --vector-size 30000 --rows 100 --columns 100
--check --benchmark_filter=-.*DPL.*)
endif()
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/gbench/shp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if(NOT ENABLE_CUDA)
target_sources(shp-bench PRIVATE ../common/black_scholes.cpp)
endif()
target_link_libraries(shp-bench shp-benchmark)
add_shp_ctest(shp-bench shp-bench --vector-size 200000 --check)
add_shp_disabled_ctest(shp-bench shp-bench --vector-size 200000 --check)

# builds only 1 benchmark for quick testing. Change this to the benchmark you
# are testing
Expand Down
25 changes: 13 additions & 12 deletions examples/mhp/transpose-ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <iostream>

#include <stdlib.h>
#include <vector>

#include "mpi.h"

Expand Down Expand Up @@ -216,18 +217,18 @@ int main(int argc, char *argv[]) {
double total_local_copy_time =
cpu_times.local_copy - cpu_times.block_exchange;

double total_times[Num_procs];
double local_transpose_times[Num_procs];
double block_transfer_times[Num_procs];
double local_copy_times[Num_procs];

MPI_Gather(&cpu_times.total, 1, MPI_DOUBLE, total_times, 1, MPI_DOUBLE, 0,
MPI_COMM_WORLD);
MPI_Gather(&total_local_transpose_time, 1, MPI_DOUBLE, local_transpose_times,
1, MPI_DOUBLE, 0, MPI_COMM_WORLD);
MPI_Gather(&total_block_transfer_time, 1, MPI_DOUBLE, block_transfer_times, 1,
MPI_DOUBLE, 0, MPI_COMM_WORLD);
MPI_Gather(&total_local_copy_time, 1, MPI_DOUBLE, local_copy_times, 1,
std::vector<double> total_times(Num_procs);
std::vector<double> local_transpose_times(Num_procs);
std::vector<double> block_transfer_times(Num_procs);
std::vector<double> local_copy_times(Num_procs);

MPI_Gather(&cpu_times.total, 1, MPI_DOUBLE, total_times.data(), 1, MPI_DOUBLE,
0, MPI_COMM_WORLD);
MPI_Gather(&total_local_transpose_time, 1, MPI_DOUBLE,
local_transpose_times.data(), 1, MPI_DOUBLE, 0, MPI_COMM_WORLD);
MPI_Gather(&total_block_transfer_time, 1, MPI_DOUBLE,
block_transfer_times.data(), 1, MPI_DOUBLE, 0, MPI_COMM_WORLD);
MPI_Gather(&total_local_copy_time, 1, MPI_DOUBLE, local_copy_times.data(), 1,
MPI_DOUBLE, 0, MPI_COMM_WORLD);

if (my_ID == 0) {
Expand Down
3 changes: 3 additions & 0 deletions scripts/run_command_on_compute_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ cd ${PBS_O_WORKDIR:-.}
unset SLURM_TASKS_PER_NODE
unset SLURM_JOBID

# workaround for missing libaccel-config.so.1 on jfpvc compute nodes
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/dmozog/usr/lib64/

echo "Host: " $(hostname)
echo "CWD: " $(pwd)
module list
Expand Down
24 changes: 15 additions & 9 deletions test/gtest/mhp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,27 @@ if(NOT ENABLE_ISHMEM)

if(NOT MPI_IMPL STREQUAL "openmpi")
# MPI_Win_create fails for communicator with size 1
add_mhp_ctest(NAME mhp-tests NPROC 1)
add_mhp_ctest(NAME mhp-tests NPROC 1 TIMEOUT 150)
endif()
foreach(nproc RANGE 2 4)
add_mhp_ctest(NAME mhp-tests NPROC ${nproc})
add_mhp_ctest(NAME mhp-tests NPROC ${nproc} TIMEOUT 150)
endforeach()
add_mhp_ctest(TEST_NAME mhp-tests-3-only NAME mhp-tests-3 NPROC 3)
add_mhp_ctest(
TEST_NAME mhp-tests-3-only NAME mhp-tests-3 NPROC 3 TIMEOUT 150)
endif()

if(ENABLE_SYCL)
# DRA-83: Slide isn't complete
set(sycl-exclusions *Slide*:ComplexSlide*:)

if(ENABLE_ISHMEM)
# DRA-84 some Halo3 cases don't work on IshmemBackend (work on MPI)
set(sycl-exclusions ${sycl-exclusions}Halo3/*:)
# Some Halo3 cases don't work on IshmemBackend (work on MPI, see: DRA-84),
# Counted.large fails with
# distributed-ranges/test/gtest/common/counted.cpp:62: Failure Expected
# equality of these values: *(--counted_result.end()) Which is: 5, should be
# 77 Mdspan, Mdarray hangs sometimes on ISHMEM.
set(sycl-exclusions
${sycl-exclusions}Halo3/*:Sort*:Counted/*:Mdspan*:Mdarray*:)
endif()

add_mhp_ctest(NAME mhp-quick-test NPROC 1 SYCL)
Expand All @@ -106,7 +112,7 @@ if(ENABLE_SYCL)
NAME mhp-quick-test NPROC 2 OFFLOAD SYCL TARGS --device-memory)

add_mhp_ctest(
NAME mhp-tests NPROC 2 OFFLOAD SYCL TARGS --device-memory
NAME mhp-tests NPROC 2 TIMEOUT 150 OFFLOAD SYCL TARGS --device-memory
--gtest_filter=-${sycl-exclusions})
if(NOT MPI_IMPL STREQUAL "openmpi")
# MPI_Win_create fails for communicator with size 1
Expand All @@ -118,10 +124,10 @@ if(ENABLE_SYCL)

foreach(nproc RANGE 2 4)
add_mhp_ctest(
NAME mhp-tests NPROC ${nproc} SYCL TARGS
NAME mhp-tests NPROC ${nproc} TIMEOUT 150 SYCL TARGS
--gtest_filter=-${sycl-exclusions})
endforeach()
add_mhp_ctest(
TEST_NAME mhp-tests-sycl-3-only NAME mhp-tests-3 NPROC 3 SYCL TARGS
--gtest_filter=-${sycl-exclusions})
TEST_NAME mhp-tests-sycl-3-only NAME mhp-tests-3 NPROC 3 TIMEOUT 150 SYCL
TARGS --gtest_filter=-${sycl-exclusions})
endif()
6 changes: 4 additions & 2 deletions test/gtest/shp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ foreach(test-exec IN ITEMS shp-tests shp-tests-3 shp-quick-test)
target_link_libraries(${test-exec} GTest::gtest_main DR::shp fmt::fmt cxxopts)
endforeach()

add_shp_ctest(shp-tests shp-tests)
add_shp_ctest(shp-tests-3 shp-tests --devicesCount 3)
# timeout in SHP tests
add_shp_disabled_ctest(shp-tests shp-tests)
add_shp_disabled_ctest(shp-tests-3 shp-tests --devicesCount 3)

add_shp_ctest(shp-tests-3-only shp-tests-3 --devicesCount 3)