Skip to content

Test Arm Fortran compiler (armflang) #66

Test Arm Fortran compiler (armflang)

Test Arm Fortran compiler (armflang) #66

Workflow file for this run

name: Test Arm Fortran compiler (armflang)
on:
# Trigger the workflow on push or pull request
#push:
#pull_request: # DANGEROUS! MUST be disabled for self-hosted runners!
# Trigger the workflow by cron. The default time zone of GitHub Actions is UTC.
schedule:
- cron: '0 4 4-31/4 * *'
# 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 armflang tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04-arm]
solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa]
fflags: [-O1, -O2, -O3, -g, -fast]
testdim: [small, big]
steps:
- name: Run `sudo apt update`
run: sudo apt update || true # Otherwise, free-disk-space or other actions relying on `apt` may fail
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
# all of these default to true, but feel free to set to "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: false # Important, or the runner may be shut down due to memory starvation.
- name: Clone Repository (Latest)
uses: actions/checkout@v6.0.2
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@v6.0.2
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: Miscellaneous setup
run: bash .github/scripts/misc_setup
- name: Install Arm Toolchain for Linux
run: bash .github/scripts/install_atfl
# - name: Revise lincoa/lincob.f90 to see why `call safealloc(ixl, int(count(xl > -BOUNDMAX), IK))` leads to a SIGSEGV
# shell: bash
# run: |
# cd fortran/lincoa || exit 42
# $SEDI "s|call safealloc(ixl, int(count(xl > -BOUNDMAX), IK))|write(*,*) '======> xl = ', xl, 'BOUNDMAX = ', BOUNDMAX, 'size(ixl) = ', count(xl > -BOUNDMAX), 'int(size(ixl)) = ', int(count(xl > -BOUNDMAX), IK)\ncall safealloc(ixl, int(count(xl > -BOUNDMAX), IK))|" lincob.f90
# $SEDI "s|call safealloc(ixu, int(count(xu < BOUNDMAX), IK))|write(*,*) '======> xu = ', xu, 'BOUNDMAX = ', BOUNDMAX, 'size(ixu) = ', count(xu < BOUNDMAX), 'int(size(ixu)) = ', int(count(xu < BOUNDMAX), IK)\ncall safealloc(ixu, int(count(xu < BOUNDMAX), IK))|" lincob.f90
# cat lincob.f90
- name: Revise bobyqa/trustregion.f90 to see why `xbdi(trueloc(xopt >= su .and. gopt <= 0)) = 1` leads to a SIGFPE
shell: bash
run: |
cd fortran/bobyqa || exit 42
$SEDI "s|xbdi(trueloc(xopt >= su .and. gopt <= 0)) = 1|write(*,*) '======> su = ', su, 'xopt = ', xopt, 'gopt = ', gopt\nxbdi(trueloc(xopt >= su .and. gopt <= 0)) = 1|" trustregion.f90
cat trustregion.f90
- name: Conduct the test
run: |
cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint -r && bash ./mlint -r
export FFLAGS=${{ matrix.fflags }}
export TESTDIM=${{ matrix.testdim }}
IK=i$(( 2**(1 + $(date +%-d) % 3) ))
echo "IK=${IK}"
echo "IK=${IK}" >> "$GITHUB_ENV"
cd "$ROOT_DIR"/fortran/tests && make rtest_${IK}.${{ matrix.solver }}
cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }}
export EXAMPLE_NUM=1 && make clean && make rtest
export EXAMPLE_NUM=2 && make clean && make rtest
- name: Store artifacts
uses: actions/upload-artifact@v7
if: always() # Always run even if the workflow is canceled manually or due to overtime.
with:
name: ${{ matrix.os }}-${{ matrix.solver }}-${{ env.IK }}-${{ 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 }}