Skip to content

Test Flang in AMD AOCC #185

Test Flang in AMD AOCC

Test Flang in AMD AOCC #185

Workflow file for this run

name: Test Flang in AMD AOCC
on:
# Trigger the workflow on push or pull request
#push:
pull_request:
# Trigger the workflow by cron. The default time zone of GitHub Actions is UTC.
schedule:
- cron: '0 4 1-31/3 * *'
# Trigger the workflow manually
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
required: false
# Show the git ref in the workflow name if it is invoked manually.
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0}', inputs.git-ref) || '' }}
jobs:
test:
name: Run AOCC Flang tests
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
ikind: [i2, i8]
solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa]
fflags: [-O1, -O2, -O3, -g, -fast]
testdim: [small, big]
# As of AOCC Flang 16.0.3, the following combination encounters a SEGFAULT when evaluating
# constr_internal(1:m_lcon) = matprod(x_internal, amat) - bvec in calcfc_internal
# Is it because of stack overflow due to the large arrays?
exclude:
- solver: cobyla
fflags: -g
testdim: big
steps:
- name: Clone Repository (Latest)
uses: actions/checkout@v4
if: github.event.inputs.git-ref == ''
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS
submodules: recursive
- name: Clone Repository (Custom Ref)
uses: actions/checkout@v4
if: github.event.inputs.git-ref != ''
with:
ref: ${{ github.event.inputs.git-ref }}
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS
submodules: recursive
- name: Install AOCC
run: bash .github/scripts/install_aocc
- name: Miscellaneous setup
run: bash .github/scripts/misc_setup
- name: Conduct the test
run: |
cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint --all && bash ./mlint --all
export FFLAGS=${{ matrix.fflags }}
export TESTDIM=${{ matrix.testdim }}
cd "$ROOT_DIR"/fortran/tests && make dtest_${{ matrix.ikind }}.${{ matrix.solver }}
cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }}
export EXAMPLE_NUM=1 && make clean && make dtest
export EXAMPLE_NUM=2 && make clean && make dtest
- name: Store artifacts
uses: actions/upload-artifact@v4.3.1
if: always() # Always run even if the workflow is canceled manually or due to overtime.
with:
name: ${{ matrix.solver }}-${{ matrix.ikind }}-${{ matrix.fflags }}-${{ matrix.testdim }}
path: ${{ env.TEST_DIR }}/prima/fortran/tests/test.${{ matrix.solver }}/log/*.log
- name: Remove the test data
if: always() # Always run even if the workflow is canceled manually or due to overtime.
run: rm -rf ${{ env.TEST_DIR }}
# The following job check whether the tests were successful or cancelled due to timeout.
# N.B.: Remember to specify `continue-on-error: true` for the job of the tests.
check_success_timeout:
runs-on: ubuntu-latest
if: ${{ !cancelled() }}
needs: test
steps:
- name: Clone the GitHub actions scripts
uses: actions/checkout@v4
with:
repository: equipez/github_actions_scripts
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS
path: scripts
- name: Check whether the tests were successful or cancelled due to timeout
run: bash scripts/check_success_timeout_big_test ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }}