Skip to content

Commit c5f2f40

Browse files
authored
[CI] Use pre-built binaries for perf check (#271)
1 parent 02b8a75 commit c5f2f40

File tree

4 files changed

+31
-33
lines changed

4 files changed

+31
-33
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,36 +1043,20 @@ jobs:
10431043
runs-on: ubuntu-24.04
10441044
steps:
10451045
- uses: actions/checkout@v4
1046-
with:
1047-
submodules: recursive
10481046
- name: Setup environment
10491047
run: |
10501048
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
10511049
sudo apt-get update
10521050
sudo apt-get install -y gcc-14 g++-14 ninja-build mpich libomp-dev valgrind
10531051
python3 -m pip install -r requirements.txt
1054-
- name: ccache
1055-
uses: hendrikmuhs/ccache-action@v1.2
1052+
- name: Download installed package
1053+
uses: actions/download-artifact@v4
10561054
with:
1057-
key: ${{ runner.os }}-gcc
1058-
create-symlink: true
1059-
max-size: 1G
1060-
- name: CMake configure
1061-
run: >
1062-
cmake -S . -B build
1063-
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
1064-
-G Ninja -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON
1065-
-D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON
1066-
-D CMAKE_BUILD_TYPE=RELEASE
1067-
env:
1068-
CC: gcc-14
1069-
CXX: g++-14
1070-
- name: Build project
1055+
name: ubuntu-gcc-install
1056+
- name: Extract installed package
10711057
run: |
1072-
cmake --build build --parallel
1073-
env:
1074-
CC: gcc-14
1075-
CXX: g++-14
1058+
mkdir -p install
1059+
tar -xzvf ubuntu-gcc-install.tar.gz -C install
10761060
- name: Run perf count checker
10771061
run: |
10781062
source scripts/run_perf_count_checker.sh

scripts/generate_perf_results.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
mkdir build/perf_stat_dir
1+
mkdir -p build/perf_stat_dir
22
source scripts/run_perf_collector.sh | tee build/perf_stat_dir/perf_log.txt
33
python3 scripts/create_perf_table.py --input build/perf_stat_dir/perf_log.txt --output build/perf_stat_dir

scripts/run_perf_collector.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
#!/bin/bash
2-
source build/ppc_opencv/install/bin/setup_vars_opencv4.sh
2+
if [[ -f build/ppc_opencv/install/bin/setup_vars_opencv4.sh ]]; then
3+
INSTALL_BIN_DIR="build/bin"
4+
source build/ppc_opencv/install/bin/setup_vars_opencv4.sh
5+
else
6+
INSTALL_BIN_DIR="install/bin"
7+
source $INSTALL_BIN_DIR/setup_vars_opencv4.sh
8+
fi
39

410
if [[ -z "$ASAN_RUN" ]]; then
511
if [[ $OSTYPE == "linux-gnu" ]]; then
6-
mpirun -np 4 ./build/bin/all_perf_tests --gtest_color=no
7-
mpirun -np 4 ./build/bin/mpi_perf_tests --gtest_color=no
12+
mpirun -np 4 $INSTALL_BIN_DIR/all_perf_tests --gtest_color=no
13+
mpirun -np 4 $INSTALL_BIN_DIR/mpi_perf_tests --gtest_color=no
814
elif [[ $OSTYPE == "darwin"* ]]; then
9-
mpirun -np 2 ./build/bin/all_perf_tests --gtest_color=no
10-
mpirun -np 2 ./build/bin/mpi_perf_tests --gtest_color=no
15+
mpirun -np 2 $INSTALL_BIN_DIR/all_perf_tests --gtest_color=no
16+
mpirun -np 2 $INSTALL_BIN_DIR/mpi_perf_tests --gtest_color=no
1117
fi
1218
fi
13-
./build/bin/omp_perf_tests
14-
./build/bin/seq_perf_tests
15-
./build/bin/stl_perf_tests
16-
./build/bin/tbb_perf_tests
19+
$INSTALL_BIN_DIR/omp_perf_tests
20+
$INSTALL_BIN_DIR/seq_perf_tests
21+
$INSTALL_BIN_DIR/stl_perf_tests
22+
$INSTALL_BIN_DIR/tbb_perf_tests

scripts/run_perf_count_checker.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
if [[ -f build/ppc_opencv/install/bin/setup_vars_opencv4.sh ]]; then
4+
INSTALL_BIN_DIR="build/bin"
5+
source build/ppc_opencv/install/bin/setup_vars_opencv4.sh
6+
else
7+
INSTALL_BIN_DIR="install/bin"
8+
source $INSTALL_BIN_DIR/setup_vars_opencv4.sh
9+
fi
10+
311
REQUIRED_TESTS_COUNT=2
412

513
get_ref_tests_number() {
@@ -31,7 +39,7 @@ run_check() {
3139
# shellcheck disable=SC2004
3240
local ref_num="$(get_ref_tests_number "tasks/$1" $(($REQUIRED_TESTS_COUNT+1)))"
3341
# shellcheck disable=SC2155
34-
local curr_num="$(get_current_tests_number "./build/bin/$1_perf_tests")"
42+
local curr_num="$(get_current_tests_number "$INSTALL_BIN_DIR/$1_perf_tests")"
3543

3644
if [[ ref_num -ne curr_num ]]; then
3745
# shellcheck disable=SC2005

0 commit comments

Comments
 (0)