Skip to content

Commit

Permalink
Playing with benchmarks script
Browse files Browse the repository at this point in the history
  • Loading branch information
ABenC377 committed Oct 27, 2024
1 parent d9b90f2 commit d8c074d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
34 changes: 19 additions & 15 deletions .github/actions/simeng_benchmarks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ inputs:
required: true
description: The path to the corresponding data file for that benchmark e.g. simeng-benchmarks/Data_Files/CloverLeaf.

pass_string:
runs:
required: true
description: test
default: 10
description: The number of times a single benchmark should be averaged over.

runs:
using: 'composite'
Expand All @@ -31,27 +32,30 @@ runs:
benchmark_path=${{ inputs.path }}
benchmark_name=${{ inputs.name }}
datafile_path=${{ inputs.datafile_path }}
pass_string=${{ inputs.pass_string }}
output_file="benchmark_output.txt"
total_time=0
runs=${{ inputs.runs }}
cd "${{ github.workspace }}/$benchmark_path"
# Loop to run the benchmark 10 times
# Run the benchmark and redirect output to a file
if [ $datafile_path ]; then
sudo simeng "${{ github.workspace }}/configs/a64fx.yaml" $benchmark_name -n 64 -i 1 --deck "${{ github.workspace }}/$datafile_path" > "$output_file"
else
sudo simeng "${{ github.workspace }}/configs/a64fx.yaml" $benchmark_name > "$output_file"
fi
# Extract the time in milliseconds from the output
current_time=$(grep 'ticks in' "$output_file" | awk '{print substr($6, 1, length($6)-2)}')

# Add the extracted time to the total time
total_time=$(echo "scale=2; $total_time + $current_time" | bc)
for (( i=1; i<=runs; i++ ))
do
# Run the benchmark and redirect output to a file
if [ $datafile_path ]; then
sudo simeng "${{ github.workspace }}/configs/a64fx.yaml" $benchmark_name -n 64 -i 1 --deck "${{ github.workspace }}/$datafile_path" > "$output_file"
else
sudo simeng "${{ github.workspace }}/configs/a64fx.yaml" $benchmark_name > "$output_file"
fi
# Extract the time in milliseconds from the output
current_time=$(grep 'ticks in' "$output_file" | awk '{print substr($6, 1, length($6)-2)}')
# Add the extracted time to the total time
total_time=$(echo "scale=2; $total_time + $current_time" | bc)
done
# Calculate the average time
average_time=$(echo "scale=2; $total_time / ${{ inputs.runs }}" | bc)
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/LINUX_BUILD_TEST.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ jobs:
- name: INFO
shell: bash
run: |
sudo apt-get -y install bc
sudo apt-get -y install gcc-10 g++-10 pip
pip install pyparsing
cat /etc/os-release
echo "_______________________________________"
uname -a
Expand Down Expand Up @@ -182,7 +185,7 @@ jobs:
path: "simeng-benchmarks/binaries/CloverLeaf/openmp"
name: "cloverleaf_gcc10.3.0_armv8.4+sve"
datafile_path: "simeng-benchmarks/Data_Files/CloverLeaf"
pass_string: "This test is considered PASSED"
runs: 1


# - if: ${{ inputs.SIMENG-MODE == 'Release' }}
Expand Down

0 comments on commit d8c074d

Please sign in to comment.