Skip to content

Commit

Permalink
Merge branch 'main' into python_binding
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang authored Apr 30, 2024
2 parents 0c49d2a + 5070380 commit 9e3c257
Show file tree
Hide file tree
Showing 14 changed files with 166 additions and 51 deletions.
3 changes: 3 additions & 0 deletions .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2256,3 +2256,6 @@ tcpclient
tomemoryview
scm
nuj
PARKCH
TESTQUAD
WAITALL
2 changes: 1 addition & 1 deletion .github/scripts
42 changes: 26 additions & 16 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,22 @@ jobs:
- {compiler: gcc, version: 11, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'}
- {compiler: gcc, version: 12, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'}
- {compiler: gcc, version: 13, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'}
- {compiler: intel-classic, version: '2021.8', cflags: '-diag-disable=10441', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'}
- {compiler: intel-classic, version: '2021.9', cflags: '-diag-disable=10441', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'}
- {compiler: intel-classic, version: '2021.10', cflags: '-diag-disable=10441', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'}
- {compiler: intel-classic, version: '2021.8', cflags: '-diag-disable=10441 -Wall -w3 -Werror-all', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'}
- {compiler: intel-classic, version: '2021.9', cflags: '-diag-disable=10441 -Wall -w3 -Werror-all', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'}
- {compiler: intel-classic, version: '2021.10', cflags: '-diag-disable=10441 -Wall -w3 -Werror-all', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'}

include:
# intel compiler (ifx) does not support macOS. So they are not included above but below.
# Zaikun 20240423
# On ubuntu-latest, we want to use '-Wall -w3 -Werror-all' as what we do for the intel-classic
# compiler, but the (new) intel c compiler does not recognize '-W3 -Werror-all', even though the
# official documentation of the compiler mentions them. Why?
- os: ubuntu-latest
toolchain: {compiler: intel, version: '2023.2', cflags: '', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'}
toolchain: {compiler: intel, version: '2023.2', cflags: '-Wall -Werror', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'}
- os: ubuntu-latest
toolchain: {compiler: intel, version: '2024.0', cflags: '', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'}
toolchain: {compiler: intel, version: '2024.0', cflags: '-Wall -Werror', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'}
- os: ubuntu-latest
toolchain: {compiler: intel, version: '2024.1', cflags: '', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'}
toolchain: {compiler: intel, version: '2024.1', cflags: '-Wall -Werror', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'}

# What follows contains the toolchains for Windows, including gcc, intel classic, and intel.
- os: windows-latest
Expand All @@ -57,22 +61,28 @@ jobs:
toolchain: {compiler: gcc, version: 12, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'}
- os: windows-latest
toolchain: {compiler: gcc, version: 13, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'}
# Zaikun 20240423:
# 1. On windows-latest, the cflags will not be recognized correctly if we start them with `/` instead
# of `-`, even though the former aligns with the official documentation of the compilers. Why?
# 2. On windows-latest, we want to use '-Wall -W5 -Werror-all' as what we do for the intel-classic
# compiler, but the (new) intel c compiler does not recognize '-W5 -Werror-all', even though the
# official documentation of the compiler mentions them. Why?
- os: windows-latest
toolchain: {compiler: intel, version: '2023.2', cflags: '', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'}
toolchain: {compiler: intel, version: '2023.2', cflags: '-Wall -Werror', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'}
- os: windows-latest
toolchain: {compiler: intel, version: '2024.0', cflags: '', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'}
toolchain: {compiler: intel, version: '2024.0', cflags: '-Wall -Werror', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'}
- os: windows-latest
toolchain: {compiler: intel, version: '2024.1', cflags: '', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'}
toolchain: {compiler: intel, version: '2024.1', cflags: '-Wall -Werror', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'}
- os: windows-latest
toolchain: {compiler: intel, version: '2024.1', cflags: '', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion', cc: cl}
toolchain: {compiler: intel, version: '2024.1', cflags: '-Wall -W4 -WX', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion', cc: cl}
# N.B.: As of 20240401, setup-fortran fails constantly with windows-latest and intel-classic
# 2021.8. Thus this combination is not included.
- os: windows-latest
toolchain: {compiler: intel-classic, version: '2021.9', cflags: '/Qdiag-disable:10441', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'}
toolchain: {compiler: intel-classic, version: '2021.9', cflags: '-Qdiag-disable:10441 -Wall -W5 -Werror-all', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'}
- os: windows-latest
toolchain: {compiler: intel-classic, version: '2021.10', cflags: '/Qdiag-disable:10441', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'}
toolchain: {compiler: intel-classic, version: '2021.10', cflags: '-Qdiag-disable:10441 -Wall -W5 -Werror-all', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'}
- os: windows-latest
toolchain: {compiler: intel-classic, version: '2021.10', cflags: '/Qdiag-disable:10441', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion', cc: cl}
toolchain: {compiler: intel-classic, version: '2021.10', cflags: '-Wall -W4 -WX', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion', cc: cl}

steps:

Expand Down Expand Up @@ -158,9 +168,9 @@ jobs:
toolchain:
# Classic Flang family with -Mchkptr would fail. See https://forums.developer.nvidia.com/t/bug-in-nvfortran-with-mchkptr-for-unallocated-optional-arguments/223220
# As of 20240220, aflang with -Mbounds would fail due to the bug at https://github.com/flang-compiler/flang/issues/1238
- {compiler: nvfortran, cflags: '-Wall', fflags: '-C -Wall -Wextra -Minform=warn -Mstandard -Mrecursive -Mbounds -Mchkstk'}
- {compiler: flang, cflags: '-Werror', fflags: '-std=f2018 -pedantic -fno-stack-arrays -mmlir -fdynamic-heap-array'}
- {compiler: aflang, cflags: '-Wall', fflags: '-pedantic -Weverything -Wall -Wextra -Minform=warn -Mstandard -Mrecursive'}
- {compiler: nvfortran, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-C -Wall -Wextra -Minform=warn -Mstandard -Mrecursive -Mbounds -Mchkstk'}
- {compiler: flang, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-std=f2018 -pedantic -fimplicit-none -Werror -fno-stack-arrays -mmlir -fdynamic-heap-array'}
- {compiler: aflang, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-pedantic -Weverything -Wall -Wextra -Minform=warn -Mstandard -Mrecursive'}

steps:

Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/compile_mex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false

# The matrix is essentially the same as that of test_matlab.yml
matrix:
os: [macos-11, macos-12, macos-13, ubuntu-20.04, ubuntu-22.04]
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13]
matlab: [R2020b, R2021a, R2021b, R2022a, R2022b, R2023a, R2023b, R2024a]

include:
Expand Down Expand Up @@ -89,14 +91,25 @@ jobs:
fi
bash .github/scripts/link_gfortran "$GFVER"
- name: Decide the version of oneAPI to use
shell: bash
run: |
ONEAPI_VERSION=
if [[ "${{ matrix.os }}" = "windows-"* ]] ; then
if [[ "${{ matrix.matlab }}" = "R2020"* || "${{ matrix.matlab }}" = "R2021"* || "${{ matrix.matlab }}" = "R2022"* || "${{ matrix.matlab }}" = "R2023"* ]] ; then
ONEAPI_VERSION=2023
fi
fi
echo "ONEAPI_VERSION=$ONEAPI_VERSION" >> $GITHUB_ENV
echo "ONEAPI_VERSION:" $ONEAPI_VERSION
- name: Install Intel oneAPI on macOS
if: startsWith(matrix.os, 'macos')
run: bash .github/scripts/install_oneapi_macos.sh
run: bash .github/scripts/install_oneapi_macos.sh $ONEAPI_VERSION

- name: Install Intel oneAPI on Windows
if: startsWith(matrix.os, 'windows')
#run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat"' # As of MATLAB R2023a, oneAPI 2024 does not work. Try again later.
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat 2023"'
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat %ONEAPI_VERSION%"'

- name: Set up MATLAB
uses: matlab-actions/[email protected]
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/parallel_test_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,25 @@ jobs:
if: startsWith(matrix.os, 'ubuntu')
run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }}

- name: Decide the version of oneAPI to use
shell: bash
run: |
ONEAPI_VERSION=
if [[ "${{ matrix.os }}" = "windows-"* ]] ; then
if [[ "${{ matrix.matlab }}" = "R2020"* || "${{ matrix.matlab }}" = "R2021"* || "${{ matrix.matlab }}" = "R2022"* || "${{ matrix.matlab }}" = "R2023"* ]] ; then
ONEAPI_VERSION=2023
fi
fi
echo "ONEAPI_VERSION=$ONEAPI_VERSION" >> $GITHUB_ENV
echo "ONEAPI_VERSION:" $ONEAPI_VERSION
- name: Install Intel oneAPI on macOS
if: startsWith(matrix.os, 'macos')
run: bash .github/scripts/install_oneapi_macos.sh
run: bash .github/scripts/install_oneapi_macos.sh $ONEAPI_VERSION

- name: Install Intel oneAPI on Windows
if: startsWith(matrix.os, 'windows')
#run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat"' # As of MATLAB R2023a, oneAPI 2024 does not work. Try again later.
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat 2023"'
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat %ONEAPI_VERSION%"'

- name: Set up MATLAB with optimization toolbox
uses: matlab-actions/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/profile_npt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ jobs:
options.blacklist = {'CHEBYQAD', 'HOLMES', 'LEVYMONT', 'BQPGASIM', 'DECONVU', 'DECONVB', '3PK'};
end
prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'b', '${{ matrix.competitor }}', options);
else
else % newuoa
if ismember('${{ matrix.npt }}', {'n*sqrt(n)', '0.25*n*n', '0.5*(n+1)*(n+2)', '3*n', '4*n'})
options.blacklist = {'ARGLINA', 'ARGLINB', 'ARGLINC', 'BA-L1LS', 'BA-L1SPLS', 'CHNROSNB', 'CHNRSNBM', 'ERRINROS', 'FBRAIN3LS', 'LUKSAN11LS', 'LUKSAN13LS', 'LUKSAN15LS', 'LUKSAN16LS', 'QING', 'SENSORS', 'SPIN2LS', 'TOINTPSP', 'TOINTQOR', 'METHANB8LS', 'TOINTGOR'};
options.blacklist = {'ARGLINA', 'ARGLINB', 'ARGLINC', 'BA-L1LS', 'BA-L1SPLS', 'CHNROSNB', 'CHNRSNBM', 'ERRINROS', 'FBRAIN3LS', 'LUKSAN11LS', 'LUKSAN13LS', 'LUKSAN15LS', 'LUKSAN16LS', 'QING', 'SENSORS', 'SPIN2LS', 'TOINTPSP', 'TOINTQOR', 'METHANB8LS', 'TOINTGOR', 'HYDCAR6LS', 'METHANL8LS', 'PARKCH'};
end
prof('${{ matrix.solver }}', '${{ matrix.dim }}', '${{ matrix.competitor }}', options);
end
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/recursive_test_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
continue-on-error: true
strategy:
fail-fast: false

# The matrix is the same as that of stress_test_matlab.yml.
matrix:
os: [ubuntu-20.04, ubuntu-latest, windows-2019, windows-latest, macos-11, macos-12, macos-13]
matlab: [R2020b, R2021a, R2022a, R2023a, latest]
Expand Down Expand Up @@ -136,14 +138,25 @@ jobs:
fi
bash .github/scripts/link_gfortran "$GFVER"
- name: Decide the version of oneAPI to use
shell: bash
run: |
ONEAPI_VERSION=
if [[ "${{ matrix.os }}" = "windows-"* ]] ; then
if [[ "${{ matrix.matlab }}" = "R2020"* || "${{ matrix.matlab }}" = "R2021"* || "${{ matrix.matlab }}" = "R2022"* || "${{ matrix.matlab }}" = "R2023"* ]] ; then
ONEAPI_VERSION=2023
fi
fi
echo "ONEAPI_VERSION=$ONEAPI_VERSION" >> $GITHUB_ENV
echo "ONEAPI_VERSION:" $ONEAPI_VERSION
- name: Install Intel oneAPI on macOS
if: startsWith(matrix.os, 'macos')
run: bash .github/scripts/install_oneapi_macos.sh
run: bash .github/scripts/install_oneapi_macos.sh $ONEAPI_VERSION

- name: Install Intel oneAPI on Windows
if: startsWith(matrix.os, 'windows')
#run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat"' # As of MATLAB R2023a, oneAPI 2024 does not work. Try again later.
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat 2023"'
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat %ONEAPI_VERSION%"'

- name: Set up MATLAB with optimization toolbox
uses: matlab-actions/[email protected]
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/stress_test_fortran.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,13 @@ jobs:
cd "$ROOT_DIR"/fortran/tests
export TESTDIM=${{ matrix.testdim }}
RK=$((2**($(date +%-d) % 3 + 2)))
echo "RK = " $RK
if [[ $RK==16 && dfrv == *${{ matrix.compiler }}* ]] ; then
echo "r16 test is skipped for compiler " ${{ matrix.compiler }}
else
make ${{ matrix.compiler }}test_i2_r${RK}_d1_tst.${{ matrix.solver }}
echo "Test r8 instead"
RK=8
fi
echo "RK = " $RK
make ${{ matrix.compiler }}test_i2_r${RK}_d1_tst.${{ matrix.solver }}
- name: Store artifacts
uses: actions/[email protected]
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/stress_test_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
continue-on-error: true
strategy:
fail-fast: false

# The matrix is the same as that of recursive_test_matlab.yml, except for `test`.
matrix:
os: [ubuntu-20.04, ubuntu-latest, windows-2019, windows-latest, macos-11, macos-12, macos-13]
matlab: [R2020b, R2021a, R2022a, R2023a, latest]
Expand Down Expand Up @@ -134,14 +136,25 @@ jobs:
fi
bash .github/scripts/link_gfortran "$GFVER"
- name: Decide the version of oneAPI to use
shell: bash
run: |
ONEAPI_VERSION=
if [[ "${{ matrix.os }}" = "windows-"* ]] ; then
if [[ "${{ matrix.matlab }}" = "R2020"* || "${{ matrix.matlab }}" = "R2021"* || "${{ matrix.matlab }}" = "R2022"* || "${{ matrix.matlab }}" = "R2023"* ]] ; then
ONEAPI_VERSION=2023
fi
fi
echo "ONEAPI_VERSION=$ONEAPI_VERSION" >> $GITHUB_ENV
echo "ONEAPI_VERSION:" $ONEAPI_VERSION
- name: Install Intel oneAPI on macOS
if: startsWith(matrix.os, 'macos')
run: bash .github/scripts/install_oneapi_macos.sh
run: bash .github/scripts/install_oneapi_macos.sh $ONEAPI_VERSION

- name: Install Intel oneAPI on Windows
if: startsWith(matrix.os, 'windows')
#run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat"' # As of MATLAB R2023a, oneAPI 2024 does not work. Try again later.
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat 2023"'
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat %ONEAPI_VERSION%"'

- name: Set up MATLAB with optimization toolbox
uses: matlab-actions/[email protected]
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/test_flang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ on:
git-ref:
description: Git Ref (Optional)
required: false
maxtr:
description: Maximum number of trust-region iterations
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) || '' }}
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0}, maxtr {1}', inputs.git-ref, inputs.maxtr) || '' }}


jobs:
Expand Down Expand Up @@ -57,11 +60,13 @@ jobs:
- name: Revise maxtr
# This is to see whether "GitHub Actions xx lost communication with the server" was caused
# by maxtr = huge(maxtr) - 1_IK. We suspect this because the error occurs with ikind = i8
# but not ikind = i2.
if: ${{ matrix.ikind == 'i8' }}
# and ikind = i4 for all solvers when testdim = small, but not with ikind = i2 at all.
# Update 20240422: The error does not occur any more after the update. WHY? Does this imply
# INFINITE CYCLING in the code?
if: ${{ matrix.ikind != 'i2' && github.event.inputs.maxtr != '' }}
run: |
cd fortran/${{ matrix.solver }}
$SEDI 's|maxtr = huge(maxtr) - 1_IK|maxtr = 60000|' *.f90
$SEDI 's|maxtr = huge(maxtr) - 1_IK|maxtr = ${{ github.event.inputs.maxtr }}|' *.f90
grep 'maxtr = ' *.f90
- name: Conduct the test
Expand Down
Loading

0 comments on commit 9e3c257

Please sign in to comment.