diff --git a/.github/actions/simeng_benchmarks/action.yml b/.github/actions/simeng_benchmarks/action.yml index c4b12bf1cd..6023a74eac 100644 --- a/.github/actions/simeng_benchmarks/action.yml +++ b/.github/actions/simeng_benchmarks/action.yml @@ -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' @@ -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) diff --git a/.github/workflows/LINUX_BUILD_TEST.yml b/.github/workflows/LINUX_BUILD_TEST.yml index 86fc9b7ded..878966ff10 100644 --- a/.github/workflows/LINUX_BUILD_TEST.yml +++ b/.github/workflows/LINUX_BUILD_TEST.yml @@ -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 @@ -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' }}