diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 000000000..96218eb28 --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,45 @@ +As of now, the GitHub CI is designed to run in three instances: +1. A per component basis, meaning if a component's codebase is updated then we only will run CI tests for that component. As an example, if we update `cupti_profiler.c` in `src/components/cuda` then we will only run CI tests for that component. +2. A change in the PAPI framework i.e. in the `src/` directory. If this occurs then we will run a full test suite. +3. A weekly test which builds PAPI with multiple components. This is currently programmed to run weekly on Sundays at 5:00PM eastern time. This is being done to simulate users' behavior of compiling in multiple components for a PAPI build. + + +# Per Component Basis + All per component basis tests have a `.yml` that is structured with `componentName_component.yml`. As +an example for the `cuda` component we would have a `.yml` of `cuda_component.yml`. Therefore, +if a new component is added to PAPI, you will need to create a `.yml` based on the aforementioned structure. + +Along with creating the `.yml` file, you will need to add an associated workflow. Below is a skeleton that can +be used as a starting point. As a reminder, make sure to change the necessary fields out for your component. + +``` +name: cuda # replace cuda with your component name + +on: + pull_request: + paths: + - 'src/components/cuda/**' # replace the cuda path with your component + +jobs: + component_tests: + strategy: + matrix: + component: [cuda] # replace cuda with your component name + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, nvidia_gpu] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: cuda component tests # replace cuda with your component name + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} +```` + +# PAPI Framework + + +# Weekly Test +For the weekly test, we utilize the files `weekly_papi_build.yml` and the script `ci_weekly_papi_build.sh`. Any changes for the weekly test need to be done to these two files. + +As a reminder this weekly test is ran on Sunday's at 5:00PM eastern time. diff --git a/.github/workflows/appio_component.yml b/.github/workflows/appio_component.yml new file mode 100644 index 000000000..ce6ffb0ff --- /dev/null +++ b/.github/workflows/appio_component.yml @@ -0,0 +1,23 @@ +name: appio + +on: + pull_request: + # run CI only if appio directory or appio sub-directories receive updates + # run CI if framework receives an update + paths: + - 'src/components/appio/**' + +jobs: + component_tests: + strategy: + matrix: + component: [appio] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, cpu_intel] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: appio component tests + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} diff --git a/.github/workflows/cat.yml b/.github/workflows/cat.yml new file mode 100644 index 000000000..dd2dd473f --- /dev/null +++ b/.github/workflows/cat.yml @@ -0,0 +1,20 @@ +name: counter analysis toolkit + +on: + pull_request: + # run CI for updates to counter analysis toolkit + paths: + - 'src/counter_analysis_toolkit/**' +jobs: + component_tests: + strategy: + matrix: + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, cpu_intel] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: counter analysis toolkit tests + run: .github/workflows/ci_cat.sh ${{matrix.debug}} ${{matrix.shlib}} diff --git a/.github/workflows/ci.sh b/.github/workflows/ci.sh deleted file mode 100755 index 38652db2b..000000000 --- a/.github/workflows/ci.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -e - -COMPONENT=$1 -DEBUG=$2 -COMPILER=$3 - -[ -z "$COMPILER" ] && COMPILER=gcc@11 - -source /etc/profile -set +x -set -e -trap 'echo "# $BASH_COMMAND"' DEBUG -shopt -s expand_aliases - -module load $COMPILER - -cd src - -if [ "$COMPONENT" = "lmsensors" ]; then - wget https://github.com/groeck/lm-sensors/archive/V3-4-0.tar.gz - tar -zxf V3-4-0.tar.gz - cd lm-sensors-3-4-0 - make install PREFIX=../lm ETCDIR=../lm/etc - cd .. - export PAPI_LMSENSORS_ROOT=lm - export PAPI_LMSENSORS_INC=$PAPI_LMSENSORS_ROOT/include/sensors - export PAPI_LMSENSORS_LIB=$PAPI_LMSENSORS_ROOT/lib64 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PAPI_LMSENSORS_ROOT/lib -fi - -if [ "$COMPONENT" = "cuda" ] || [ "$COMPONENT" = "nvml" ]; then - module load cuda - export PAPI_CUDA_ROOT=$ICL_CUDA_ROOT - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PAPI_CUDA_ROOT/extras/CUPTI/lib64 -fi - -if [ "$COMPONENT" = "rocm" ] || [ "$COMPONENT" = "rocm_smi" ]; then - export PAPI_ROCM_ROOT=`ls -d /opt/rocm-*` - export PAPI_ROCMSMI_ROOT=$PAPI_ROCM_ROOT/rocm_smi -fi - -if [ "$COMPONENT" = "infiniband_umad" ]; then - export PAPI_INFINIBAND_UMAD_ROOT=/usr -fi - -if [ "$COMPONENT" = "perf_event" ]; then - ./configure --with-debug=$DEBUG --enable-warnings -else - ./configure --with-debug=$DEBUG --enable-warnings --with-components=$COMPONENT -fi - -make -j4 - -utils/papi_component_avail - -# Make sure the $COMPONENT is active -utils/papi_component_avail | grep -A1000 'Active components' | grep -q "Name: $COMPONENT " - -if [ "$COMPONENT" != "cuda" ]; then - echo Testing - ./run_tests.sh -fi diff --git a/.github/workflows/ci_cat.sh b/.github/workflows/ci_cat.sh new file mode 100644 index 000000000..754c86c8e --- /dev/null +++ b/.github/workflows/ci_cat.sh @@ -0,0 +1,47 @@ +#!/bin/bash -e + +DEBUG=$1 +SHLIB=$2 +COMPILER=$3 + +[ -z "$COMPILER" ] && COMPILER=gcc@11 + +source /etc/profile +set +x +set -e +trap 'echo "# $BASH_COMMAND"' DEBUG +shopt -s expand_aliases + +module load $COMPILER + +# configuring and install PAPI +if [ "$SHLIB" = "with" ]; then + ./configure --prefix=$PWD/cat-ci --with-debug=$DEBUG --enable-warnings --with-shlib-tools +else + ./configure --prefix=$PWD/cat-ci --with-debug=$DEBUG --enable-warnings +fi +make -j4 && make install + +# set PAPI_DIR for CAT +export PAPI_DIR=$PWD/cat-ci + +cd counter_analysis_toolkit + +# check detected architecture was correct +DETECTED_ARCH=$(make | head -n 1 | grep -o 'ARCH.*') +if [ "$DETECTED_ARCH" != "ARCH=X86" ]; then + echo "Failed to detect appropriate architecture." + exit 1 +fi + +make -j4 + +mkdir OUT_DIR +echo "BR_INST_RETIRED 0" > event_list.txt +echo "PAPI_CI_FAKE_EVENT 0" >> event_list.txt +./cat_collect -in event_list.txt -out OUT_DIR -branch + +# we expect this file to exist and have values +[ -f BR_INST_RETIRED.branch ]; [ -s BR_INST_RETIRED.branch ] +# we expect this file to exist but be empty +[ -f PAPI_CI_FAKE_EVENT.branch ]; [ ! -s PAPI_CI_FAKE_EVENT.branch ] diff --git a/.github/workflows/ci_papi_framework.sh b/.github/workflows/ci_papi_framework.sh new file mode 100755 index 000000000..3e298da96 --- /dev/null +++ b/.github/workflows/ci_papi_framework.sh @@ -0,0 +1,79 @@ +#!/bin/bash -e + +COMPONENTS=$1 +DEBUG=$2 +SHLIB=$3 +COMPILER=$4 + +[ -z "$COMPILER" ] && COMPILER=gcc@11 + +source /etc/profile +set +x +set -e +trap 'echo "# $BASH_COMMAND"' DEBUG +shopt -s expand_aliases + +module load $COMPILER + +cd src + +# set necessary environment variables for lmsensors +case "$COMPONENTS" in + *"lmsensors"*) + wget https://github.com/groeck/lm-sensors/archive/V3-4-0.tar.gz + tar -zxf V3-4-0.tar.gz + cd lm-sensors-3-4-0 + make install PREFIX=../lm ETCDIR=../lm/etc + cd .. + export PAPI_LMSENSORS_ROOT=lm + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PAPI_LMSENSORS_ROOT/lib + ;; +esac + +# set necessary environment variables for rocm and rocm_smi +case "$COMPONENTS" in + *"rocm rocm_smi"*) + export PAPI_ROCM_ROOT=`ls -d /opt/rocm-*` + export PAPI_ROCMSMI_ROOT=$PAPI_ROCM_ROOT/rocm_smi + ;; +esac + +# set necessary environment variables for cuda and nvml +case "$COMPONENTS" in + *"cuda nvml"*) + module load cuda + export PAPI_CUDA_ROOT=$ICL_CUDA_ROOT + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PAPI_CUDA_ROOT/extras/CUPTI/lib64 + ;; +esac + +# test linking with or without --with-shlib-tools +if [ "$SHLIB" = "with" ]; then + ./configure --with-debug=$DEBUG --enable-warnings --with-components="$COMPONENTS" --with-shlib-tools +else + ./configure --with-debug=$DEBUG --enable-warnings --with-components="$COMPONENTS" +fi + +make -j4 + +# run PAPI utilities +utils/papi_component_avail + +# check list of active components +#ACTIVE_COMPONENTS=$(utils/papi_component_avail | grep -A1000 'Active components' | grep "Name:" | sed 's/Name: //' | awk '{print $1}' | paste -sd ' ' -) +#EXPECTED_ACTIVE_COMPONENTS="perf_event perf_event_uncore cuda nvml powercap net appio io stealtime coretemp lmsensors sde sysdetect" +#if [ "$ACTIVE_COMPONENTS" != "$EXPECTED_ACTIVE_COMPONENTS" ]; then +# DISABLED_COMPONENTS=$(diff --side-by-side --suppress-common-lines <(echo "$EXPECTED_ACTIVE_COMPONENTS" | sed 's/ /\n/g') <(echo "$ACTIVE_COMPONENTS" | sed 's/ /\n/g') | awk '{print $2}') +# echo -e "Components are disabled that should be active, these are:\n$DISABLED_COMPONENTS" +# exit 1 +#fi + +# without '--with-shlib-tools' in ./configure +if [ "$SHLIB" = "without" ]; then + echo "Running full test suite for active components" + ./run_tests.sh +# with '--with-shlib-tools' in ./configure +else + echo "Running single component test for active components" + ./ci_run_tests_shlib.sh TESTS_QUIET +fi diff --git a/.github/workflows/ci_per_component.sh b/.github/workflows/ci_per_component.sh new file mode 100755 index 000000000..4b2928ba6 --- /dev/null +++ b/.github/workflows/ci_per_component.sh @@ -0,0 +1,74 @@ +#!/bin/bash -e + +COMPONENT=$1 +DEBUG=$2 +SHLIB=$3 +COMPILER=$4 + +[ -z "$COMPILER" ] && COMPILER=gcc@11 + +source /etc/profile +set +x +set -e +trap 'echo "# $BASH_COMMAND"' DEBUG +shopt -s expand_aliases + +module load $COMPILER + +CPU_COMPONENTS="perf_event perf_event_uncore sysdetect" + +cd src + +# lmsensors environment variables +if [ "$COMPONENT" = "lmsensors"]; then + wget https://github.com/groeck/lm-sensors/archive/V3-4-0.tar.gz + tar -zxf V3-4-0.tar.gz + cd lm-sensors-3-4-0 + make install PREFIX=../lm ETCDIR=../lm/etc + cd .. + export PAPI_LMSENSORS_ROOT=lm + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PAPI_LMSENSORS_ROOT/lib +fi + +# rocm and rocm_smi environment variables +if [ "$COMPONENT" = "rocm" || "$COMPONENT" = "rocm_smi" ]; then + export PAPI_ROCM_ROOT=`ls -d /opt/rocm-*` + export PAPI_ROCMSMI_ROOT=$PAPI_ROCM_ROOT/rocm_smi +fi + +# set necessary environemnt variables for cuda and nvml +if [ "$COMPONENT" = "cuda" || "$COMPONENT" = "nvml" ]; then + module load cuda + export PAPI_CUDA_ROOT=$ICL_CUDA_ROOT + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PAPI_CUDA_ROOT/extras/CUPTI/lib64 +fi + +# test linking with or without --with-shlib-tools +if [ "$SHLIB" = "with" ]; then + ./configure --with-debug=$DEBUG --enable-warnings --with-components="$COMPONENT" --with-shlib-tools +else + ./configure --with-debug=$DEBUG --enable-warnings --with-components="$COMPONENT" +fi + +make -j4 + +# run PAPI utilities +utils/papi_component_avail +ACTIVE_COMPONENTS=$(utils/papi_component_avail | grep -A1000 'Active components' | grep "Name:" | sed 's/Name: //' | awk '{print $1}' | paste -sd ' ' -) + +#if [ "$ACTIVE_COMPONENTS" != "$CPU_COMPONENTS $COMPONENT" ]; then +# DISABLED_COMPONENTS=$(diff --side-by-side --suppress-common-lines <(echo "$EXPECTED_ACTIVE_COMPONENTS" | sed 's/ /\n/g') <(echo "$ACTIVE_COMPONENTS" | sed 's/ /\n/g') | awk '{print $2}') +# echo -e "Components are disabled that should be active, these are:\n$DISABLED_COMPONENTS" +# exit 1 +#fi + + +# without '--with-shlib-tools' in ./configure +if [ "$SHLIB" = "without" ]; then + echo "Running full test suite for active components" + ./run_tests.sh +# with '--with-shlib-tools' in ./configure +else + echo "Running single component test for active components" + ./ci_run_tests_shlib.sh TESTS_QUIET +fi diff --git a/.github/workflows/coretemp_component.yml b/.github/workflows/coretemp_component.yml new file mode 100644 index 000000000..3ddf908ff --- /dev/null +++ b/.github/workflows/coretemp_component.yml @@ -0,0 +1,23 @@ +name: coretemp + +on: + pull_request: + # run CI only if coretemp directory or coretemp sub-directories receive updates + # run CI if framework receives an update + paths: + - 'src/components/coretemp/**' + +jobs: + component_tests: + strategy: + matrix: + component: [coretemp] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, cpu_intel] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: coretemp component tests + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} diff --git a/.github/workflows/cuda_component.yml b/.github/workflows/cuda_component.yml new file mode 100644 index 000000000..e9c8cc962 --- /dev/null +++ b/.github/workflows/cuda_component.yml @@ -0,0 +1,23 @@ +name: cuda + +on: + pull_request: + # run CI only if cuda directory or cuda sub-directories receive updates + # run CI if framework receives an update + paths: + - 'src/components/cuda/**' + +jobs: + component_tests: + strategy: + matrix: + component: [cuda] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, gpu_nvidia] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: cuda component tests + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} diff --git a/.github/workflows/example_component.yml b/.github/workflows/example_component.yml new file mode 100644 index 000000000..c93cc5623 --- /dev/null +++ b/.github/workflows/example_component.yml @@ -0,0 +1,23 @@ +name: example + +on: + pull_request: + # run CI only if example directory or example sub-directories receive updates + # run CI if framework receives an update + paths: + - 'src/components/example/**' + +jobs: + component_tests: + strategy: + matrix: + component: [example] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, cpu_intel] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: example component tests + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} diff --git a/.github/workflows/intel_gpu_component.yml b/.github/workflows/intel_gpu_component.yml new file mode 100644 index 000000000..362eee9c0 --- /dev/null +++ b/.github/workflows/intel_gpu_component.yml @@ -0,0 +1,23 @@ +name: intel_gpu + +on: + pull_request: + # run CI only if intel_gpu directory or intel_gpu sub-directories receive updates + # run CI if framework receives an update + paths: + - 'src/components/intel_gpu/**' + +jobs: + component_tests: + strategy: + matrix: + component: [intel_gpu] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, gpu_intel] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: intel_gpu component tests + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} diff --git a/.github/workflows/io_component.yml b/.github/workflows/io_component.yml new file mode 100644 index 000000000..d9b7ca8b0 --- /dev/null +++ b/.github/workflows/io_component.yml @@ -0,0 +1,23 @@ +name: io + +on: + pull_request: + # run CI only if io directory or io sub-directories receive updates + # run CI if framework receives an update + paths: + - 'src/components/io/**' + +jobs: + component_tests: + strategy: + matrix: + component: [io] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, cpu_intel] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: io component tests + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} diff --git a/.github/workflows/lmsensors_component.yml b/.github/workflows/lmsensors_component.yml new file mode 100644 index 000000000..5b5991cec --- /dev/null +++ b/.github/workflows/lmsensors_component.yml @@ -0,0 +1,23 @@ +name: lmsensors + +on: + pull_request: + # run CI only if lmsensors directory or lmsensors sub-directories receive updates + # run CI if framework receives an update + paths: + - 'src/components/lmsensors/**' + +jobs: + component_tests: + strategy: + matrix: + component: [lmsensors] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, cpu_intel] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: lmsensors component tests + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 0f3b01f6d..000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - papi_component: - strategy: - matrix: - component: [perf_event, lmsensors, io, net, powercap, appio, coretemp, stealtime] - debug: [yes, no] - fail-fast: false - runs-on: cpu_intel - timeout-minutes: 60 - steps: - - uses: actions/checkout@v3 - - name: Test - run: .github/workflows/ci.sh ${{matrix.component}} ${{matrix.debug}} - papi_component_nvidia: - strategy: - matrix: - component: [cuda, nvml] - debug: [yes, no] - fail-fast: false - runs-on: gpu_nvidia - timeout-minutes: 60 - steps: - - uses: actions/checkout@v3 - - name: Test - run: .github/workflows/ci.sh ${{matrix.component}} ${{matrix.debug}} - papi_component_amd: - strategy: - matrix: - component: [rocm, rocm_smi] - debug: [yes, no] - fail-fast: false - runs-on: gpu_amd - timeout-minutes: 60 - steps: - - uses: actions/checkout@v3 - - name: Test - run: .github/workflows/ci.sh ${{matrix.component}} ${{matrix.debug}} - papi_spack: - runs-on: cpu - timeout-minutes: 60 - steps: - - uses: actions/checkout@v3 - - name: Build/Test/Install via Spack - run: .github/workflows/spack.sh - papi_clang_analysis: - runs-on: cpu - steps: - - uses: actions/checkout@v3 - - name: Run static analysis - run: .github/workflows/clang_analysis.sh clang-analysis-output - - name: Archive analysis results - uses: actions/upload-artifact@v3 - if: always() - with: - name: clang-analysis-output - path: src/clang-analysis-output diff --git a/.github/workflows/net_component.yml b/.github/workflows/net_component.yml new file mode 100644 index 000000000..eb0e9c4ab --- /dev/null +++ b/.github/workflows/net_component.yml @@ -0,0 +1,23 @@ +name: net + +on: + pull_request: + # run CI only if net directory or net sub-directories receive updates + # run CI if framework receives an update + paths: + - 'src/components/net/**' + +jobs: + component_tests: + strategy: + matrix: + component: [net] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, cpu_intel] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: net component tests + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} diff --git a/.github/workflows/nvml_component.yml b/.github/workflows/nvml_component.yml new file mode 100644 index 000000000..f40119c3d --- /dev/null +++ b/.github/workflows/nvml_component.yml @@ -0,0 +1,23 @@ +name: nvml + +on: + pull_request: + # run CI only if nvml directory or nvml sub-directories receive updates + # run CI if framework receives an update + paths: + - 'src/components/nvml/**' + +jobs: + component_tests: + strategy: + matrix: + component: [nvml] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, gpu_nvidia] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: nvml component tests + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} diff --git a/.github/workflows/papi_framework.yml b/.github/workflows/papi_framework.yml new file mode 100644 index 000000000..2ec28bd25 --- /dev/null +++ b/.github/workflows/papi_framework.yml @@ -0,0 +1,75 @@ +name: papi framework + +on: + pull_request: + # run CI if framework receives an update + paths: + - 'src/**' + - '!src/components/**' + - '!src/counter_analysis_toolkit/**' + # allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + # build PAPI with multiple components to simulate a users' workflow + # rocm, rocm_smi, powercap_ppc, rapl, sensors_ppc, infiniband, lustre, and mx should all + # be disabled upon the build finishing + papi_components_comprehensive: + strategy: + matrix: + components: [cuda nvml rocm rocm_smi powercap powercap_ppc rapl sensors_ppc infiniband net appio io lustre stealtime coretemp lmsensors mx sde] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, cpu_intel, gpu_nvidia] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: Test + run: .github/workflows/ci_papi_framework.sh "${{matrix.components}}" ${{matrix.debug}} ${{matrix.shlib}} + # build PAPI only with amd components, as they will not be active in the above comprehensive job + papi_components_amd: + strategy: + matrix: + components: [rocm rocm_smi] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, gpu_amd] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: Test + run: .github/workflows/ci_papi_framework.sh "${{matrix.components}}" ${{matrix.debug}} ${{matrix.shlib}} + papi_component_infiniband: + strategy: + matrix: + components: [infiniband] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, guyot] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: Test + run: .github/workflows/ci_papi_framework.sh "${{matrix.components}}" ${{matrix.debug}} ${{matrix.shlib}} + papi_spack: + runs-on: cpu + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: Build/Test/Install via Spack + run: .github/workflows/spack.sh + papi_clang_analysis: + runs-on: cpu + steps: + - uses: actions/checkout@v4 + - name: Run static analysis + run: .github/workflows/clang_analysis.sh clang-analysis-output + - name: Archive analysis results + uses: actions/upload-artifact@v3 + if: always() + with: + name: clang-analysis-output + path: src/clang-analysis-output diff --git a/.github/workflows/powercap_component.yml b/.github/workflows/powercap_component.yml new file mode 100644 index 000000000..d66644b08 --- /dev/null +++ b/.github/workflows/powercap_component.yml @@ -0,0 +1,23 @@ +name: powercap + +on: + pull_request: + # run CI only if powercap directory or powercap sub-directories receive updates + # run CI if framework receives an update + paths: + - 'src/components/powercap/**' + +jobs: + component_tests: + strategy: + matrix: + component: [powercap] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, cpu_intel] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: powercap component tests + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} diff --git a/.github/workflows/rocm_component.yml b/.github/workflows/rocm_component.yml new file mode 100644 index 000000000..55498e95d --- /dev/null +++ b/.github/workflows/rocm_component.yml @@ -0,0 +1,23 @@ +name: rocm + +on: + pull_request: + # run CI only if rocm directory or rocm sub-directories receive updates + # run CI if framework receives an update + paths: + - 'src/components/rocm/**' + +jobs: + component_tests: + strategy: + matrix: + component: [rocm] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, gpu_amd] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: rocm component tests + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} diff --git a/.github/workflows/rocm_smi_component.yml b/.github/workflows/rocm_smi_component.yml new file mode 100644 index 000000000..e1bc5e7c6 --- /dev/null +++ b/.github/workflows/rocm_smi_component.yml @@ -0,0 +1,23 @@ +name: rocm_smi + +on: + pull_request: + # run CI only if rocm_smi directory or rocm_smi sub-directories receive updates + # run CI if framework receives an update + paths: + - 'src/components/rocm_smi/**' + +jobs: + component_tests: + strategy: + matrix: + component: [rocm_smi] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, gpu_amd] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: rocm_smi component tests + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} diff --git a/.github/workflows/sde_component.yml b/.github/workflows/sde_component.yml new file mode 100644 index 000000000..66c0f9d04 --- /dev/null +++ b/.github/workflows/sde_component.yml @@ -0,0 +1,23 @@ +name: sde + +on: + pull_request: + # run CI only if sde directory or sde sub-directories receive updates + # run CI if framework receives an update + paths: + - 'src/components/sde/**' + +jobs: + component_tests: + strategy: + matrix: + component: [ssde] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, cpu_intel] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: sde component tests + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} diff --git a/.github/workflows/stealtime_component.yml b/.github/workflows/stealtime_component.yml new file mode 100644 index 000000000..cd082ff79 --- /dev/null +++ b/.github/workflows/stealtime_component.yml @@ -0,0 +1,23 @@ +name: stealtime + +on: + pull_request: + # run CI only if stealtime directory or stealtime sub-directories receive updates + # run CI if framework receives an update + paths: + - 'src/components/stealtime/**' + +jobs: + component_tests: + strategy: + matrix: + component: [stealtime] + debug: [yes, no] + shlib: [with, without] + fail-fast: false + runs-on: [self-hosted, cpu_intel] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: stealtime component tests + run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}} diff --git a/src/ci_run_tests_shlib.sh b/src/ci_run_tests_shlib.sh new file mode 100755 index 000000000..4e18c73ef --- /dev/null +++ b/src/ci_run_tests_shlib.sh @@ -0,0 +1,107 @@ +#!/bin/sh + +# File: run_tests_shlib.sh +# Author: Treece Burgess +# tburgess@icl.utk.edu + +# If the tests are not built then build them +echo $BUILD +if [ "x$BUILD" != "x" ]; then + for comp in `ls components/*/tests` ; do \ + cd components/$$comp/tests ; make; cd ../../.. ; + done +fi + +TESTS_QUIET="" +# Determine if to suppress output or send to stdout +if [ $# != 0 ]; then + if [ $1 = "TESTS_QUIET" ]; then + TESTS_QUIET=$1 + else + echo "Failed to quiet tests. Must pass TESTS_QUIET." + echo "" + fi +fi + +# Determine if VALGRIND is set +if [ "x$VALGRIND" != "x" ]; then + VALGRIND="valgrind --leak-check=full"; +fi + +# List of active components +ACTIVE_COMPONENTS=$(utils/papi_component_avail | awk '/Active components:/{flag=1; next} flag' | grep "Name:" | sed 's/Name: //' | awk '{print $1}' | paste -sd' ' -) + +# Format active components to get inactive components +ACTIVE_COMPONENTS_PATTERN=$(echo $ACTIVE_COMPONENTS | sed 's/ /|/g') + +# Find the test files, filtering for inactive components +INACTIVE_COMPONENTS=$(find components/*/tests -perm -u+x -type f ! \( -name "*.[c|h]" -o -name "*.cu" -o -name "*.so" \) | grep -vE "components/($ACTIVE_COMPONENTS_PATTERN)/") + +EXCLUDE_TXT=`grep -v -e '^#\|^$' run_tests_exclude.txt` +EXCLUDE_TESTS="$EXCLUDE_TXT $INACTIVE_COMPONENTS"; + +ACTIVE_COMPONENTS_TESTS="" +for cmp in $ACTIVE_COMPONENTS; +do + query_cmp_test=$(find components/*/tests -perm -u+x -type f ! \( -name "*.[c|h]" -o -name "*.cu" -o -name "*.so" \) | grep -E -m 1 "components/($cmp)/") + case $EXCLUDE_TESTS in + *"$query_cmp_test"*) + continue + ;; + esac + ACTIVE_COMPONENTS_TESTS="$ACTIVE_COMPONENTS_TESTS $query_cmp_test" +done + +# System information +echo "Platform:" +uname -a + +echo "Date:" +date + +echo "" +if [ -r /proc/cpuinfo ]; then + echo "Cpuinfo:" + # only print info on first processor on x86 + sed '/^$/q' /proc/cpuinfo +fi + +echo "" +if [ "x$VALGRIND" != "x" ]; then + echo "The following test cases will be run using valgrind:"; +else + echo "The following test cases will be run:"; +fi + +# This List will only show a single test for each active component +echo $ACTIVE_COMPONENTS_TESTS + +echo "" +echo "The following test cases will NOT be run:"; +echo $EXCLUDE_TESTS; + +# Set LD_LIBRARY_PATH +if [ "$LD_LIBRARY_PATH" = "" ]; then + LD_LIBRARY_PATH=.:./libpfm4/lib +else + LD_LIBRARY_PATH=.:./libpfm4/lib:"$LD_LIBRARY_PATH" +fi +export LD_LIBRARY_PATH + +echo ""; +echo "Running a Single Component Test for --with-shlib-tools"; +echo "" + +# Run a single component test +for cmp_test in $ACTIVE_COMPONENTS_TESTS; +do + if [ -x $cmp_test ]; then + printf "Running $cmp_test:\n"; + printf "%-59s" "" + if [ x$cmp == xsde ]; then + LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PWD}/components/sde/sde_lib:${PWD}/components/sde/tests/lib $VALGRIND ./$cmp_test $TESTS_QUIET + else + $VALGRIND ./$cmp_test $TESTS_QUIET + fi + fi +done diff --git a/src/ctests/all_native_events.c b/src/ctests/all_native_events.c index 0dc788a1e..b2dd5f491 100644 --- a/src/ctests/all_native_events.c +++ b/src/ctests/all_native_events.c @@ -107,7 +107,7 @@ main( int argc, char **argv ) numcmp = PAPI_num_components( ); int rocm_id = PAPI_get_component_index("rocm"); - + int cuda_id = PAPI_get_component_index("cuda"); /* Loop through all components */ for( cid = 0; cid < numcmp; cid++ ) { @@ -116,6 +116,10 @@ main( int argc, char **argv ) * crashes PAPI if multiple GPUs are present */ continue; } + + if (cid == cuda_id) { + continue; + } cmpinfo = PAPI_get_component_info( cid ); if (cmpinfo == NULL) {