diff --git a/.github/CI/env_setup.sh b/.github/CI/env_setup.sh index ba3107228..ce24b44f2 100755 --- a/.github/CI/env_setup.sh +++ b/.github/CI/env_setup.sh @@ -36,7 +36,7 @@ fi -DBUILD_SHARED_LIBS=$SHARED_TYPE -DPARSEC_PROF_TRACE=$PROFILING -DMPIEXEC_PREFLAGS='--bind-to;none;--oversubscribe' - -DCMAKE_INSTALL_PREFIX=install + -DCMAKE_INSTALL_PREFIX=$PARSEC_INSTALL_DIR -DPARSEC_GPU_WITH_CUDA=$CUDA -DPARSEC_GPU_WITH_HIP=$HIP EOF diff --git a/.github/dplasma/action.yml b/.github/dplasma/action.yml new file mode 100644 index 000000000..c07d9cd1e --- /dev/null +++ b/.github/dplasma/action.yml @@ -0,0 +1,40 @@ +name: DPLASMA +description: Uses the DPLASMA CI as a tester for PaRSEC + +# Environment variables required: +# BUILD_TYPE: ${{matrix.build_type}} +# SHARED_TYPE: ${{matrix.shared_type}} +# DEVICE: ${{matrix.device}} +# PARSEC_INSTALL_DIR: +# INSTALL_DIRECTORY: ${{github.workspace}}/dplasma/install +# SETUP: ${{github.workspace}}/dplasma/.github/workflows/env_setup.sh + +runs: + using: "composite" + steps: + - name: Build and Install DPLASMA + shell: bash + run: | + export INSTALL_DIRECTORY=$PWD/dplasma/install + git clone https://github.com/ICLDisco/dplasma + sed -i s/MPIEXEC_NUMPROC_FLAGS/MPIEXEC_NUMPROC_FLAG/ dplasma/CMakeLists.txt + source dplasma/.github/workflows/env_setup.sh + mkdir dplasma/build + cd dplasma/build + CC=gcc CXX=g++ FC=gfortran cmake $BUILD_CONFIG -DPaRSEC_ROOT=$PARSEC_INSTALL_DIR .. + cmake --build . + cmake --build . --target install + + - name: Test + working-directory: dplasma/build + shell: bash + run: | + source ../.github/workflows/env_setup.sh + ctest --output-on-failure + + - name: Save Artifact + if: failure() + uses: actions/upload-artifact@v4 + with: + name: CMake-error-log + path: dplasma/build/CMakeFiles/CMakeError.log diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9a1b5d746..a264f3a0c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,21 +14,22 @@ jobs: fail-fast: false matrix: build_type : [ Debug, Release ] - shared_type : [ OFF, ON ] - profiling : [ OFF, ON ] + shared_type : [ ON, OFF ] + profiling : [ ON, OFF ] device: [ cpu, gpu_nvidia, gpu_amd ] exclude: - build_type: Debug profiling: OFF - build_type: Release shared_type: OFF - name: "${{matrix.build_type}} Shared=${{matrix.shared_type}} Profile=${{matrix.profiling}} ${{matrix.device}}" + name: "PaRSEC ${{matrix.build_type}} Shared=${{matrix.shared_type}} Profile=${{matrix.profiling}} ${{matrix.device}}" runs-on: [ "${{matrix.device}}", self-hosted ] env: BUILD_TYPE: ${{matrix.build_type}} SHARED_TYPE: ${{matrix.shared_type}} PROFILING: ${{matrix.profiling}} DEVICE: ${{matrix.device}} + PARSEC_INSTALL_DIR: ${{github.workspace}}/install SETUP: ${{github.workspace}}/.github/CI/env_setup.sh steps: - uses: actions/checkout@v4 @@ -76,3 +77,6 @@ jobs: with: name: CMake-error-log path: CMakeFiles/CMakeError.log + + - name: Test with DPLASMA + uses: ./.github/dplasma diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e328a043..9934f682d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -736,14 +736,14 @@ int main(int argc, char *argv[]) { endif( PARSEC_GPU_WITH_CUDA ) if( PARSEC_GPU_WITH_HIP ) - # This is kinda ugly but the PATH and HINTS don't get transmitted to sub-dependents - set(CMAKE_SYSTEM_PREFIX_PATH_save ${CMAKE_SYSTEM_PREFIX_PATH}) - list(APPEND CMAKE_SYSTEM_PREFIX_PATH /opt/rocm) + if( NOT DEFINED ROCM_ROOT_DIR AND IS_DIRECTORY /opt/rocm ) + set(ROCM_ROOT_DIR /opt/rocm) + endif() + list(APPEND CMAKE_PREFIX_PATH ${ROCM_ROOT_DIR}/hip ${ROCM_ROOT_DIR}) find_package(HIP QUIET) #quiet because hip-config.cmake is not part of core-cmake and will spam a loud warning when hip/rocm is not installed if(HIP_FOUND AND HIP_VERSION VERSION_LESS 5) # find_package(HIP 5...6) does not work for some reason message(FATAL_ERROR "Found HIP version ${HIP_VERSION} in ${HIP_LIB_INSTALL_DIR} is too old, use HIP_ROOT to select another version") endif() - set(CMAKE_SYSTEM_PREFIX_PATH ${CMAKE_SYSTEM_PREFIX_PATH_save}) if(HIP_FOUND AND PARSEC_HAVE_CUDA) # the underlying reason is that the generated ptg code cannot include at the same time # cuda_runtime.h and hip_runtime.h, so we need to modify the dev_cuda.h to not expose any diff --git a/cmake_modules/PaRSECConfig.cmake.in b/cmake_modules/PaRSECConfig.cmake.in index 5d7827bee..9c2a16919 100644 --- a/cmake_modules/PaRSECConfig.cmake.in +++ b/cmake_modules/PaRSECConfig.cmake.in @@ -69,6 +69,7 @@ endif(@PARSEC_HAVE_CUDA@) if(@PARSEC_HAVE_HIP@) enable_language(CXX) + list (APPEND CMAKE_PREFIX_PATH @ROCM_ROOT_DIR@/hip @ROCM_ROOT_DIR@) find_package(HIP REQUIRED) set(PARSEC_HAVE_HIP TRUE) endif(@PARSEC_HAVE_HIP@) diff --git a/parsec/data_dist/matrix/CMakeLists.txt b/parsec/data_dist/matrix/CMakeLists.txt index 51beffec2..527d78719 100644 --- a/parsec/data_dist/matrix/CMakeLists.txt +++ b/parsec/data_dist/matrix/CMakeLists.txt @@ -32,7 +32,10 @@ if( TARGET parsec-ptgpp ) target_ptg_sources(parsec PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/reduce_col.jdf;${CMAKE_CURRENT_SOURCE_DIR}/reduce_row.jdf;${CMAKE_CURRENT_SOURCE_DIR}/reduce.jdf;${CMAKE_CURRENT_SOURCE_DIR}/diag_band_to_rect.jdf;${CMAKE_CURRENT_SOURCE_DIR}/apply.jdf") set_property(TARGET parsec APPEND PROPERTY - PRIVATE_HEADER_H data_dist/matrix/diag_band_to_rect.h) + PRIVATE_HEADER_H + data_dist/matrix/diag_band_to_rect.h + data_dist/matrix/apply.h + ) endif( TARGET parsec-ptgpp ) target_sources(parsec PRIVATE ${sources})