diff --git a/.github/workflows/lint_hosted.yml b/.github/workflows/lint_hosted.yml new file mode 100644 index 0000000000..c8b47e269f --- /dev/null +++ b/.github/workflows/lint_hosted.yml @@ -0,0 +1,135 @@ +name: Lint the Fortran code and the MEX gateways on GitHub hosted runners + +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 17 * * *' + # 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: Lint the Fortran code + runs-on: ubuntu-latest + continue-on-error: true + strategy: + fail-fast: false + matrix: + linter: [flint, mlint] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + + steps: + + - 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@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: Miscellaneous setup + run: bash .github/scripts/misc_setup + + - name: Set up MATLAB + id: set-up-matlab + if: ${{ matrix.linter == 'mlint' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: latest + + - name: Get fintrf.h and remove MATLAB + if: ${{ matrix.linter == 'mlint' }} + run: | + MATLABROOT=${{steps.set-up-matlab.outputs.matlabroot}} + # fintrf.h must be located under a directory "extern/include/", or mlint cannot find it. + mkdir -p ~/extern/include/ + cp "$MATLABROOT"/extern/include/fintrf.h ~/extern/include/ || exit 2 + sudo chmod 777 ~/extern/include/fintrf.h || exit 3 + # Remove MATLAB, or the runner will run out of space. + sudo rm -rf "$MATLABROOT"/* || exit 4 + # mlint uses `locate` to find fintrf.h + sudo apt update && sudo apt install mlocate -y && sudo updatedb + locate '/extern/include/fintrf.h' || exit 5 + + - name: Install AOCC + run: bash .github/scripts/install_aocc + + - name: Install gfortran + uses: awvwgk/setup-fortran@main + id: setup-fortran + with: + compiler: gcc + version: 13 + + - name: Install Intel oneAPI + run: bash .github/scripts/install_oneapi_linux.sh + + - name: Install g95 + run: bash .github/scripts/install_g95 + + - name: Install nvfortran + run: bash .github/scripts/install_nvfortran + + - name: Install Oracle sunf95 + run: bash .github/scripts/install_sunf95 + + # Install Flang after AOCC, to make sure that flang is this one, while AOCC flang will be + # known as aflang. + - name: Install Flang + run: bash .github/scripts/install_flang + + - name: Conduct the test + run: | + type gfortran ifort ifx aflang g95 nvfortran sunf95 flang + cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./${{ matrix.linter }} --all + + - 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 ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }} diff --git a/.github/workflows/lint_nagfor.yml b/.github/workflows/lint_nagfor.yml new file mode 100644 index 0000000000..1e05eb107a --- /dev/null +++ b/.github/workflows/lint_nagfor.yml @@ -0,0 +1,81 @@ +name: Lint the Fortran code and the MEX gateways with nagfor + +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 17 * * *' + # 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: Lint the Fortran code and the MEX gateways with nagfor + runs-on: [self-hosted, nagfor] + continue-on-error: true + strategy: + fail-fast: false + matrix: + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + + 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: Miscellaneous setup + run: bash .github/scripts/misc_setup + + - name: Conduct the test + run: | + source ~/.bashrc + export PATH=$PATH:"~/local/bin" + source ~/local/bin/nag_licensing || (echo "\n\nNAG licensing failed.\n\n" && exit 2) + cd "$ROOT_DIR"/fortran/${{ matrix.solver }} + if [[ $(($(date +%-d) % 2)) == 0 ]] ; then + bash ./flint -n --all + else + bash ./mlint -n --all + fi + + - 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 ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }} diff --git a/.github/workflows/profile_all.yml b/.github/workflows/profile_all.yml new file mode 100644 index 0000000000..ff8e3cc15e --- /dev/null +++ b/.github/workflows/profile_all.yml @@ -0,0 +1,187 @@ +name: Plot performance profiles for all + +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 16 * * *' + # 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) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + test: + name: Profile PRIMA. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + dim: [all] + solver: [cobylal, cobylan, uobyqa, newuoa, bobyqa, lincoa] # prima is too expensive + competitor: [classical, archiva] + with_optim_toolbox: [yes, no] + ctol_indicator: [0, 1, 2] + exclude: + - solver: cobylan + with_optim_toolbox: yes + - solver: uobyqa + with_optim_toolbox: yes + - solver: newuoa + with_optim_toolbox: yes + - solver: bobyqa + with_optim_toolbox: yes + - solver: uobyqa + ctol_indicator: 1 + - solver: uobyqa + ctol_indicator: 2 + - solver: newuoa + ctol_indicator: 1 + - solver: newuoa + ctol_indicator: 2 + - solver: bobyqa + ctol_indicator: 1 + - solver: bobyqa + ctol_indicator: 2 + + steps: + - name: Get the solver name + run: echo "SOLNAME=$(echo ${{ matrix.solver }} | cut -c1-6)" >> $GITHUB_ENV + + - 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@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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Install epstopdf and ghostscript + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/install_epstopdf && bash .github/scripts/install_ghostscript + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }}-${{ matrix.with_optim_toolbox }} + + - name: Set up MATLAB with optimization toolbox + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox == 'yes' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + products: Optimization_Toolbox + + - name: Set up MATLAB without optimization toolbox + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox != 'yes' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + cd(fullfile(root_dir, 'matlab/tests')); + options = struct(); + options.nr = 4; % 4 random runs for each problem + options.ctol_multiple = 10^(2*str2num('${{ matrix.ctol_indicator }}')); + + if strcmp('${{ matrix.solver }}', 'cobylal') + %options.nr = 3; + prof('cobyla', '${{ matrix.dim }}', 'l', '${{ matrix.competitor }}', options); + elseif strcmp('${{ matrix.solver }}', 'cobylan') + %options.nr = 3; + prof('cobyla', '${{ matrix.dim }}', 'n', '${{ matrix.competitor }}', options); + elseif strcmp('${{ matrix.solver }}', 'lincoa') + prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'l', '${{ matrix.competitor }}', options); + elseif strcmp('${{ matrix.solver }}', 'bobyqa') + prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'b', '${{ matrix.competitor }}', options); + else + prof('${{ matrix.solver }}', '${{ matrix.dim }}', '${{ matrix.competitor }}', options); + end + + + % Move the files to prepare for uploading artifacts + + solver = '${{ env.SOLNAME }}'; + cd(fullfile(cd(), 'testdata')); + files = dir([solver, '*.summary.*.pdf']) + for ifile = 1 : length(files) + file = fullfile(files(ifile).folder, files(ifile).name) + newfile = fullfile(files(ifile).folder, ['ctol', '${{ matrix.ctol_indicator }}_', '${{ matrix.with_optim_toolbox }}', '_optool_', files(ifile).name]) + movefile(file, newfile); + end + movefile(fullfile(cd(), '*summary*.pdf'), ['/tmp/', solver, '_profile_prima/']); + movefile(fullfile(cd(), '*.txt'), ['/tmp/', solver, '_profile_prima/']); + + files = [dir(['/tmp/', solver, '_profile_prima/*start*']); dir(['/tmp/', solver, '_profile_prima/*end*'])] + for ifile = 1 : length(files) + file = fullfile(files(ifile).folder, files(ifile).name) + newfile = fullfile(files(ifile).folder, ['ctol', '${{ matrix.ctol_indicator }}_', '${{ matrix.with_optim_toolbox }}', '_optool_', files(ifile).name]) + movefile(file, newfile); + end + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/${{ env.SOLNAME }}_profile_prima/*summary*.pdf + /tmp/${{ env.SOLNAME }}_profile_prima/*.txt + /tmp/${{ env.SOLNAME }}_profile_prima/*start* + /tmp/${{ env.SOLNAME }}_profile_prima/*end* + + - name: Remove the test data + if: always() # Always run even if the workflow is canceled manually or due to overtime. + run: rm -rf ./matlab/tests/testdata && rm -rf /tmp/${{ env.SOLNAME }}_profile_prima diff --git a/.github/workflows/profile_bobyqa_small.yml b/.github/workflows/profile_bobyqa_small.yml new file mode 100644 index 0000000000..cb1c1fcbfc --- /dev/null +++ b/.github/workflows/profile_bobyqa_small.yml @@ -0,0 +1,117 @@ +name: Plot performance profiles for BOBYQA, small + +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 2,6,10,14,18,22 * * *' + # 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) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + + test: + name: Profile PRIMA. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + dim: [small] + solver: [bobyqa] + competitor: [classical, archiva] + + 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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Install epstopdf and ghostscript + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/install_epstopdf && bash .github/scripts/install_ghostscript + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }} + + - name: Set up MATLAB + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + cd(fullfile(root_dir, 'matlab/tests')); + options = struct(); + options.nr = 3; + + prof('${{ matrix.solver }}', '${{ matrix.dim }}', '${{ matrix.competitor }}', options); + + + % Move the files to prepare for uploading artifacts + + movefile(fullfile(cd(), 'testdata', '*summary*.pdf'), '/tmp/${{ matrix.solver }}_profile_prima/'); + movefile(fullfile(cd(), 'testdata', '*.txt'), '/tmp/${{ matrix.solver }}_profile_prima/'); + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/${{ matrix.solver }}_profile_prima/*summary*.pdf + /tmp/${{ matrix.solver }}_profile_prima/*.txt + /tmp/${{ matrix.solver }}_profile_prima/*start* + /tmp/${{ matrix.solver }}_profile_prima/*end* + + - name: Remove the test data + if: always() # Always run even if the workflow is canceled manually or due to overtime. + run: rm -rf ./matlab/tests/testdata && rm -rf /tmp/${{ matrix.solver }}_profile_prima diff --git a/.github/workflows/profile_cobyla_small.yml b/.github/workflows/profile_cobyla_small.yml new file mode 100644 index 0000000000..9e16d6cd1d --- /dev/null +++ b/.github/workflows/profile_cobyla_small.yml @@ -0,0 +1,148 @@ +name: Plot performance profiles for COBYLA, small + +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 2,6,10,14,18,22 * * *' + # 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) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + test: + name: Profile PRIMA. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + dim: [small] + solver: [cobylal, cobylan] + competitor: [classical, archiva] + with_optim_toolbox: [yes, no] + ctol_indicator: [0, 1, 2] + exclude: + - solver: cobylan + with_optim_toolbox: yes + + 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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Install epstopdf and ghostscript + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/install_epstopdf && bash .github/scripts/install_ghostscript + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }}-${{ matrix.with_optim_toolbox }} + + - name: Set up MATLAB with optimization toolbox + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox == 'yes' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + products: Optimization_Toolbox + + - name: Set up MATLAB without optimization toolbox + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox != 'yes' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + cd(fullfile(root_dir, 'matlab/tests')); + options = struct(); + options.nr = 3; + options.ctol_multiple = 10^(2*str2num('${{ matrix.ctol_indicator }}')); + + if strcmp('${{ matrix.solver }}', 'cobylal') + prof('cobyla', '${{ matrix.dim }}', 'l', '${{ matrix.competitor }}', options); + elseif strcmp('${{ matrix.solver }}', 'cobylan') + prof('cobyla', '${{ matrix.dim }}', 'n', '${{ matrix.competitor }}', options); + end + + + % Move the files to prepare for uploading artifacts + + solver = 'cobyla'; + cd(fullfile(cd(), 'testdata')); + files = dir([solver, '*.summary.*.pdf']) + for ifile = 1 : length(files) + file = fullfile(files(ifile).folder, files(ifile).name) + newfile = fullfile(files(ifile).folder, ['ctol', '${{ matrix.ctol_indicator }}_', '${{ matrix.with_optim_toolbox }}', '_optool_', files(ifile).name]) + movefile(file, newfile); + end + movefile(fullfile(cd(), '*summary*.pdf'), '/tmp/cobyla_profile_prima/'); + movefile(fullfile(cd(), '*.txt'), '/tmp/cobyla_profile_prima/'); + + files = [dir(['/tmp/', solver, '_profile_prima/*start*']); dir(['/tmp/', solver, '_profile_prima/*end*'])] + for ifile = 1 : length(files) + file = fullfile(files(ifile).folder, files(ifile).name) + newfile = fullfile(files(ifile).folder, ['ctol', '${{ matrix.ctol_indicator }}_', '${{ matrix.with_optim_toolbox }}', '_optool_', files(ifile).name]) + movefile(file, newfile); + end + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/cobyla_profile_prima/*summary*.pdf + /tmp/cobyla_profile_prima/*.txt + /tmp/cobyla_profile_prima/*start* + /tmp/cobyla_profile_prima/*end* + + - name: Remove the test data + if: always() # Always run even if the workflow is canceled manually or due to overtime. + run: rm -rf ./matlab/tests/testdata && rm -rf /tmp/cobyla_profile_prima diff --git a/.github/workflows/profile_compiler_options.yml b/.github/workflows/profile_compiler_options.yml new file mode 100644 index 0000000000..4a411416a7 --- /dev/null +++ b/.github/workflows/profile_compiler_options.yml @@ -0,0 +1,200 @@ +name: Plot performance profiles, various compiler options + +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 * * *' + # 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) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + test: + name: Profile PRIMA. + runs-on: ${{ matrix.os }} + continue-on-error: true + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + dim: [all] + solver: [cobylal, cobylan, uobyqa, newuoa, bobyqa, lincoa] # prima is too expensive + compiler_options: [-O0, -O1, -O2, -O3, -Ofast -fno-stack-arrays, -ffast-math] + competitor: [classical] + with_optim_toolbox: [yes, no] + exclude: + - solver: cobylan + with_optim_toolbox: yes + - solver: uobyqa + with_optim_toolbox: yes + - solver: newuoa + with_optim_toolbox: yes + - solver: bobyqa + with_optim_toolbox: yes + + steps: + + - name: Get the solver name + run: echo "SOLNAME=$(echo ${{ matrix.solver }} | cut -c1-6)" >> $GITHUB_ENV + + - 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@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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Install epstopdf and ghostscript + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/install_epstopdf && bash .github/scripts/install_ghostscript + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }}-${{ matrix.with_optim_toolbox }} + + - name: Set up MATLAB with optimization toolbox + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox == 'yes' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + products: Optimization_Toolbox + + - name: Set up MATLAB without optimization toolbox + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox != 'yes' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + + - name: Revise setup_compiler_options to print the revised mexopt file + run: | + cd matlab/tests/private || exit 1 + sed -i "s|return|for ifile = 1 : length(config_files), ifile, cfile = fullfile(config_dir, config_files{ifile}) , system(['cat ', cfile]); end|" set_compiler_options.m + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + cd(fullfile(root_dir, 'matlab/tests')); + options = struct(); + options.compiler_options = '${{ matrix.compiler_options }}'; + options.debug = ~contains('${{ matrix.compiler_options }}', 'fast') + options.nr = 4; % 4 random runs for each problem + + if strcmp('${{ matrix.solver }}', 'cobylal') + options.nr = 3; + prof('cobyla', '${{ matrix.dim }}', 'l', '${{ matrix.competitor }}', options); + elseif strcmp('${{ matrix.solver }}', 'cobylan') + options.nr = 3; + prof('cobyla', '${{ matrix.dim }}', 'n', '${{ matrix.competitor }}', options); + elseif strcmp('${{ matrix.solver }}', 'lincoa') + prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'l', '${{ matrix.competitor }}', options); + elseif strcmp('${{ matrix.solver }}', 'bobyqa') + prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'b', '${{ matrix.competitor }}', options); + else + prof('${{ matrix.solver }}', '${{ matrix.dim }}', '${{ matrix.competitor }}', options); + end + + + % Move the files to prepare for uploading artifacts + + solver = '${{ env.SOLNAME }}' + cd(fullfile(cd(), 'testdata')); + files = dir([solver, '*.summary.*.pdf']) + for ifile = 1 : length(files) + file = fullfile(files(ifile).folder, files(ifile).name) + newfile = fullfile(files(ifile).folder, ['${{ matrix.with_optim_toolbox }}', '_', files(ifile).name]) + movefile(file, newfile); + end + movefile(fullfile(cd(), '*summary*.pdf'), ['/tmp/', solver, '_profile_prima/']); + movefile(fullfile(cd(), '*.txt'), ['/tmp/', solver, '_profile_prima/']); + + files = [dir(['/tmp/', solver, '_profile_prima/*start*']); dir(['/tmp/', solver, '_profile_prima/*end*'])] + for ifile = 1 : length(files) + file = fullfile(files(ifile).folder, files(ifile).name) + newfile = fullfile(files(ifile).folder, ['${{ matrix.with_optim_toolbox }}', '_', files(ifile).name]) + movefile(file, newfile); + end + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/${{ env.SOLNAME }}_profile_prima/*summary*.pdf + /tmp/${{ env.SOLNAME }}_profile_prima/*.txt + /tmp/${{ env.SOLNAME }}_profile_prima/*start* + /tmp/${{ env.SOLNAME }}_profile_prima/*end* + + - name: Remove the test data + if: always() # Always run even if the workflow is canceled manually or due to overtime. + run: rm -rf ./matlab/tests/testdata && rm -rf /tmp/${{ env.SOLNAME }}_profile_prima + + # 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 }} diff --git a/.github/workflows/profile_lincoa_small.yml b/.github/workflows/profile_lincoa_small.yml new file mode 100644 index 0000000000..d77e1917fa --- /dev/null +++ b/.github/workflows/profile_lincoa_small.yml @@ -0,0 +1,141 @@ +name: Plot performance profiles for LINCOA, small + +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 2,6,10,14,18,22 * * *' + # 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) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + test: + name: Profile PRIMA. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + dim: [small] + solver: [lincoa] + competitor: [classical, archiva] + with_optim_toolbox: [yes, no] + ctol_indicator: [0, 1, 2] + + 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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Install epstopdf and ghostscript + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/install_epstopdf && bash .github/scripts/install_ghostscript + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }}-${{ matrix.with_optim_toolbox }} + + - name: Set up MATLAB with optimization toolbox + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox == 'yes' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + products: Optimization_Toolbox + + - name: Set up MATLAB without optimization toolbox + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox != 'yes' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + cd(fullfile(root_dir, 'matlab/tests')); + options = struct(); + options.nr = 3; + options.ctol_multiple = 10^(2*str2num('${{ matrix.ctol_indicator }}')); + + prof('${{ matrix.solver }}', '${{ matrix.dim }}', '${{ matrix.competitor }}', options); + + + % Move the files to prepare for uploading artifacts + + solver = 'lincoa'; + cd(fullfile(cd(), 'testdata')); + files = dir([solver, '*.summary.*.pdf']) + for ifile = 1 : length(files) + file = fullfile(files(ifile).folder, files(ifile).name) + newfile = fullfile(files(ifile).folder, ['ctol', '${{ matrix.ctol_indicator }}_', '${{ matrix.with_optim_toolbox }}', '_optool_', files(ifile).name]) + movefile(file, newfile); + end + movefile(fullfile(cd(), '*summary*.pdf'), '/tmp/${{ matrix.solver }}_profile_prima/'); + movefile(fullfile(cd(), '*.txt'), '/tmp/${{ matrix.solver }}_profile_prima/'); + + files = [dir(['/tmp/', solver, '_profile_prima/*start*']); dir(['/tmp/', solver, '_profile_prima/*end*'])] + for ifile = 1 : length(files) + file = fullfile(files(ifile).folder, files(ifile).name) + newfile = fullfile(files(ifile).folder, ['ctol', '${{ matrix.ctol_indicator }}_', '${{ matrix.with_optim_toolbox }}', '_optool_', files(ifile).name]) + movefile(file, newfile); + end + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/${{ matrix.solver }}_profile_prima/*summary*.pdf + /tmp/${{ matrix.solver }}_profile_prima/*.txt + /tmp/${{ matrix.solver }}_profile_prima/*start* + /tmp/${{ matrix.solver }}_profile_prima/*end* + + - name: Remove the test data + if: always() # Always run even if the workflow is canceled manually or due to overtime. + run: rm -rf ./matlab/tests/testdata && rm -rf /tmp/${{ matrix.solver }}_profile_prima diff --git a/.github/workflows/profile_newuoa_small.yml b/.github/workflows/profile_newuoa_small.yml new file mode 100644 index 0000000000..69b7519ef3 --- /dev/null +++ b/.github/workflows/profile_newuoa_small.yml @@ -0,0 +1,115 @@ +name: Plot performance profiles for NEWUOA, small + +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 2,6,10,14,18,22 * * *' + # 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) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + + test: + name: Profile PRIMA. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + dim: [small] + solver: [newuoa] + competitor: [classical, archiva] + + 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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Install epstopdf and ghostscript + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/install_epstopdf && bash .github/scripts/install_ghostscript + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }} + + - name: Set up MATLAB + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + cd(fullfile(root_dir, 'matlab/tests')); + + prof('${{ matrix.solver }}', '${{ matrix.dim }}', '${{ matrix.competitor }}'); + + + % Move the files to prepare for uploading artifacts + + movefile(fullfile(cd(), 'testdata', '*summary*.pdf'), '/tmp/${{ matrix.solver }}_profile_prima/'); + movefile(fullfile(cd(), 'testdata', '*.txt'), '/tmp/${{ matrix.solver }}_profile_prima/'); + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/${{ matrix.solver }}_profile_prima/*summary*.pdf + /tmp/${{ matrix.solver }}_profile_prima/*.txt + /tmp/${{ matrix.solver }}_profile_prima/*start* + /tmp/${{ matrix.solver }}_profile_prima/*end* + + - name: Remove the test data + if: always() # Always run even if the workflow is canceled manually or due to overtime. + run: rm -rf ./matlab/tests/testdata && rm -rf /tmp/${{ matrix.solver }}_profile_prima diff --git a/.github/workflows/profile_prima_small.yml b/.github/workflows/profile_prima_small.yml new file mode 100644 index 0000000000..e5f36e74d4 --- /dev/null +++ b/.github/workflows/profile_prima_small.yml @@ -0,0 +1,141 @@ +name: Plot performance profiles for PRIMA, small + +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 2,6,10,14,18,22 * * *' + # 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) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + test: + name: Profile PRIMA. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + dim: [small] + solver: [prima] + competitor: [classical] + with_optim_toolbox: [yes, no] + ctol_indicator: [0, 1, 2] + + 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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Install epstopdf and ghostscript + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/install_epstopdf && bash .github/scripts/install_ghostscript + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }}-${{ matrix.with_optim_toolbox }} + + - name: Set up MATLAB with optimization toolbox + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox == 'yes' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + products: Optimization_Toolbox + + - name: Set up MATLAB without optimization toolbox + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox != 'yes' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + cd(fullfile(root_dir, 'matlab/tests')); + options = struct(); + options.nr = 3; + options.ctol_multiple = 10^(2*str2num('${{ matrix.ctol_indicator }}')); + + prof('${{ matrix.solver }}', '${{ matrix.dim }}', '${{ matrix.competitor }}', options); + + + % Move the files to prepare for uploading artifacts + + solver = '${{ matrix.solver }}'; + cd(fullfile(cd(), 'testdata')); + files = dir([solver, '*.summary.*.pdf']) + for ifile = 1 : length(files) + file = fullfile(files(ifile).folder, files(ifile).name) + newfile = fullfile(files(ifile).folder, ['ctol', '${{ matrix.ctol_indicator }}_', '${{ matrix.with_optim_toolbox }}', '_optool_', files(ifile).name]) + movefile(file, newfile); + end + movefile(fullfile(cd(), '*summary*.pdf'), '/tmp/${{ matrix.solver }}_profile_prima/'); + movefile(fullfile(cd(), '*.txt'), '/tmp/${{ matrix.solver }}_profile_prima/'); + + files = [dir(['/tmp/', solver, '_profile_prima/*start*']); dir(['/tmp/', solver, '_profile_prima/*end*'])] + for ifile = 1 : length(files) + file = fullfile(files(ifile).folder, files(ifile).name) + newfile = fullfile(files(ifile).folder, ['ctol', '${{ matrix.ctol_indicator }}_', '${{ matrix.with_optim_toolbox }}', '_optool_', files(ifile).name]) + movefile(file, newfile); + end + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/${{ matrix.solver }}_profile_prima/*summary*.pdf + /tmp/${{ matrix.solver }}_profile_prima/*.txt + /tmp/${{ matrix.solver }}_profile_prima/*start* + /tmp/${{ matrix.solver }}_profile_prima/*end* + + - name: Remove the test data + if: always() # Always run even if the workflow is canceled manually or due to overtime. + run: rm -rf ./matlab/tests/testdata && rm -rf /tmp/${{ matrix.solver }}_profile_prima diff --git a/.github/workflows/profile_quadruple.yml b/.github/workflows/profile_quadruple.yml new file mode 100644 index 0000000000..2d4d63ec79 --- /dev/null +++ b/.github/workflows/profile_quadruple.yml @@ -0,0 +1,140 @@ +name: Plot performance profiles, quadruple + +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 12 * * *' + # 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) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + test: + name: Profile PRIMA. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + dim: [small] + solver: [cobylal, cobylan, uobyqa, newuoa, bobyqa, lincoa, prima] + competitor: [quadruple] + + steps: + - name: Get the solver name + run: echo "SOLNAME=$(echo ${{ matrix.solver }} | cut -c1-6)" >> $GITHUB_ENV + + - 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@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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Install epstopdf and ghostscript + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/install_epstopdf && bash .github/scripts/install_ghostscript + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }} + + - name: Set up MATLAB + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + products: Optimization_Toolbox + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + cd(fullfile(root_dir, 'matlab/tests')); + options = struct(); options.nr = 2; % 2 random runs for each problem, as quadruple is slow + + if strcmp('${{ matrix.solver }}', 'cobylal') + prof('cobyla', '${{ matrix.dim }}', 'l', '${{ matrix.competitor }}', options); + elseif strcmp('${{ matrix.solver }}', 'cobylan') + prof('cobyla', '${{ matrix.dim }}', 'n', '${{ matrix.competitor }}', options); + elseif strcmp('${{ matrix.solver }}', 'lincoa') + prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'l', '${{ matrix.competitor }}', options); + elseif strcmp('${{ matrix.solver }}', 'bobyqa') + prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'b', '${{ matrix.competitor }}', options); + else + prof('${{ matrix.solver }}', '${{ matrix.dim }}', '${{ matrix.competitor }}', options); + end + + + % Move the files to prepare for uploading artifacts + + solver = '${{ env.SOLNAME }}'; + movefile(fullfile(cd(), 'testdata', '*summary*.pdf'), ['/tmp/', solver, '_profile_prima/']); + movefile(fullfile(cd(), 'testdata', '*.txt'), ['/tmp/', solver, '_profile_prima/']); + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/${{ env.SOLNAME }}_profile_prima/*summary*.pdf + /tmp/${{ env.SOLNAME }}_profile_prima/*.txt + /tmp/${{ env.SOLNAME }}_profile_prima/*start* + /tmp/${{ env.SOLNAME }}_profile_prima/*end* + + - name: Remove the test data + if: always() # Always run even if the workflow is canceled manually or due to overtime. + run: rm -rf ./matlab/tests/testdata && rm -rf /tmp/${{ env.SOLNAME }}_profile_prima diff --git a/.github/workflows/profile_rescue_idz_classical.yml b/.github/workflows/profile_rescue_idz_classical.yml new file mode 100644 index 0000000000..a75eeee95b --- /dev/null +++ b/.github/workflows/profile_rescue_idz_classical.yml @@ -0,0 +1,170 @@ +name: Test RESCUE and IDZ, classical + +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 20 * * *' + # 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) || '' }} + +env: + GFORTRAN_VERSION: 13 + BENCHMARK: rescue_idz + +jobs: + test: + name: Profile PRIMA. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + dim: [small, all] + solver: [newuoa, bobyqa, lincoa] + + steps: + - name: Get the solver name + run: echo "SOLNAME=$(echo ${{ matrix.solver }} | cut -c1-6)" >> $GITHUB_ENV + + - 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@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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Install epstopdf and ghostscript + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/install_epstopdf && bash .github/scripts/install_ghostscript + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }}-yes # "yes" means that the Optimization_Toolbox is included in the cache + + - name: Set up MATLAB with optimization toolbox + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + products: Optimization_Toolbox + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + % Install MatCUTEst. + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + % Remove unnecessary files to make sure that we are testing the correct version. + files = {'.development/archiva', 'fortran', '.development/norma', 'matlab'}; + for ifile = 1 : length(files) + rmdir(fullfile(root_dir, files{ifile}), 's'); + end + delete(fullfile(root_dir, 'setup.m')); + movefile(fullfile(root_dir, 'benchmark/${{ env.BENCHMARK }}'), root_dir); + rmdir(fullfile(root_dir, 'benchmark'), 's'); + + + % Conduct the test. + + cd(fullfile(root_dir, '${{ env.BENCHMARK }}/matlab/tests')); + options = struct(); + options.classical = true; + options.rhoend = 1.0e-8; + options.maxfun_dim = 500; + options.strict = 0; + options.nr = 3; % 3 random runs for each problem + + % N.B.: Parallel profiling does not work. The worker will be shut down due to the resource + % requested by some problem. Worse, we do not know which problem it is due to the parallelism. + if strcmp('${{ matrix.dim }}', 'small') || strcmp('${{ matrix.solver }}', 'newuoa') + prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'norma', options, 'seq'); + elseif strcmp('${{ matrix.solver }}', 'lincoa') + prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'l', 'norma', options, 'seq'); + elseif strcmp('${{ matrix.solver }}', 'bobyqa') + prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'b', 'norma', options, 'seq'); + end + + + % Move the files to prepare for uploading artifacts + + solver = '${{ env.SOLNAME }}'; + cd(fullfile(cd(), 'testdata')); + files = dir([solver, '*.summary.*.pdf']) + for ifile = 1 : length(files) + file = fullfile(files(ifile).folder, files(ifile).name) + newfile = fullfile(files(ifile).folder, ['classical_', files(ifile).name]) + movefile(file, newfile); + end + movefile(fullfile(cd(), '*summary*.pdf'), ['/tmp/', solver, '_profile_${{ env.BENCHMARK }}/']); + movefile(fullfile(cd(), '*.txt'), ['/tmp/', solver, '_profile_${{ env.BENCHMARK }}/']); + + files = [dir(['/tmp/', solver, '_profile_${{ env.BENCHMARK }}/*start*']); dir(['/tmp/', solver, '_profile_${{ env.BENCHMARK }}/*end*'])] + for ifile = 1 : length(files) + file = fullfile(files(ifile).folder, files(ifile).name) + newfile = fullfile(files(ifile).folder, ['classical_', files(ifile).name]) + movefile(file, newfile); + end + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/${{ env.SOLNAME }}_profile_${{ env.BENCHMARK }}/*summary*.pdf + /tmp/${{ env.SOLNAME }}_profile_${{ env.BENCHMARK }}/*.txt + /tmp/${{ env.SOLNAME }}_profile_${{ env.BENCHMARK }}/*start* + /tmp/${{ env.SOLNAME }}_profile_${{ env.BENCHMARK }}/*end* + + - name: Remove the test data + if: always() # Always run even if the workflow is canceled manually or due to overtime. + run: rm -rf ./matlab/tests/testdata && rm -rf /tmp/${{ env.SOLNAME }}_profile_${{ env.BENCHMARK }} diff --git a/.github/workflows/profile_rescue_idz_modernized.yml b/.github/workflows/profile_rescue_idz_modernized.yml new file mode 100644 index 0000000000..e89fe9474f --- /dev/null +++ b/.github/workflows/profile_rescue_idz_modernized.yml @@ -0,0 +1,170 @@ +name: Test RESCUE and IDZ, modernized + +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 16 * * *' + # 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) || '' }} + +env: + GFORTRAN_VERSION: 13 + BENCHMARK: rescue_idz + +jobs: + test: + name: Profile PRIMA. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + dim: [small, all] + solver: [newuoa, bobyqa, lincoa] + + steps: + - name: Get the solver name + run: echo "SOLNAME=$(echo ${{ matrix.solver }} | cut -c1-6)" >> $GITHUB_ENV + + - 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@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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Install epstopdf and ghostscript + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/install_epstopdf && bash .github/scripts/install_ghostscript + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }}-yes # Yes means that the Optimization_Toolbox is included in the cache + + - name: Set up MATLAB with optimization toolbox + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + products: Optimization_Toolbox + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + % Install MatCUTEst. + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + % Remove unnecessary files to make sure that we are testing the correct version. + files = {'.development/archiva', 'fortran', '.development/norma', 'matlab'}; + for ifile = 1 : length(files) + rmdir(fullfile(root_dir, files{ifile}), 's'); + end + delete(fullfile(root_dir, 'setup.m')); + movefile(fullfile(root_dir, 'benchmark/${{ env.BENCHMARK }}'), root_dir); + rmdir(fullfile(root_dir, 'benchmark'), 's'); + + + % Conduct the test. + + cd(fullfile(root_dir, '${{ env.BENCHMARK }}/matlab/tests')); + options = struct(); + options.classical = false; + options.rhoend = 1.0e-8; + options.maxfun_dim = 500; + options.strict = 0; + options.nr = 3; % 3 random runs for each problem + + % N.B.: Parallel profiling does not work. The worker will be shut down due to the resource + % requested by some problem. Worse, we do not know which problem it is due to the parallelism. + if strcmp('${{ matrix.dim }}', 'small') || strcmp('${{ matrix.solver }}', 'newuoa') + prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'norma', options, 'seq'); + elseif strcmp('${{ matrix.solver }}', 'lincoa') + prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'l', 'norma', options, 'seq'); + elseif strcmp('${{ matrix.solver }}', 'bobyqa') + prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'b', 'norma', options, 'seq'); + end + + + % Move the files to prepare for uploading artifacts + + solver = '${{ env.SOLNAME }}'; + cd(fullfile(cd(), 'testdata')); + files = dir([solver, '*.summary.*.pdf']) + for ifile = 1 : length(files) + file = fullfile(files(ifile).folder, files(ifile).name) + newfile = fullfile(files(ifile).folder, ['modernized_', files(ifile).name]) + movefile(file, newfile); + end + movefile(fullfile(cd(), '*summary*.pdf'), ['/tmp/', solver, '_profile_${{ env.BENCHMARK }}/']); + movefile(fullfile(cd(), '*.txt'), ['/tmp/', solver, '_profile_${{ env.BENCHMARK }}/']); + + files = [dir(['/tmp/', solver, '_profile_${{ env.BENCHMARK }}/*start*']); dir(['/tmp/', solver, '_profile_${{ env.BENCHMARK }}/*end*'])] + for ifile = 1 : length(files) + file = fullfile(files(ifile).folder, files(ifile).name) + newfile = fullfile(files(ifile).folder, ['modernized_', files(ifile).name]) + movefile(file, newfile); + end + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/${{ env.SOLNAME }}_profile_${{ env.BENCHMARK }}/*summary*.pdf + /tmp/${{ env.SOLNAME }}_profile_${{ env.BENCHMARK }}/*.txt + /tmp/${{ env.SOLNAME }}_profile_${{ env.BENCHMARK }}/*start* + /tmp/${{ env.SOLNAME }}_profile_${{ env.BENCHMARK }}/*end* + + - name: Remove the test data + if: always() # Always run even if the workflow is canceled manually or due to overtime. + run: rm -rf ./matlab/tests/testdata && rm -rf /tmp/${{ env.SOLNAME }}_profile_${{ env.BENCHMARK }} diff --git a/.github/workflows/profile_single.yml b/.github/workflows/profile_single.yml new file mode 100644 index 0000000000..9a7be4df2c --- /dev/null +++ b/.github/workflows/profile_single.yml @@ -0,0 +1,141 @@ +name: Plot performance profiles, single + +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 10 * * *' + # 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) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + test: + name: Profile PRIMA. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + dim: [small] + solver: [cobylal, cobylan, uobyqa, newuoa, bobyqa, lincoa, prima] + competitor: [single] + + steps: + + - name: Get the solver name + run: echo "SOLNAME=$(echo ${{ matrix.solver }} | cut -c1-6)" >> $GITHUB_ENV + + - 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@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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Install epstopdf and ghostscript + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/install_epstopdf && bash .github/scripts/install_ghostscript + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }} + + - name: Set up MATLAB + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + products: Optimization_Toolbox + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + cd(fullfile(root_dir, 'matlab/tests')); + options = struct(); options.nr = 5; % 5 random runs for each problem + + if strcmp('${{ matrix.solver }}', 'cobylal') + prof('cobyla', '${{ matrix.dim }}', 'l', '${{ matrix.competitor }}', options); + elseif strcmp('${{ matrix.solver }}', 'cobylan') + prof('cobyla', '${{ matrix.dim }}', 'n', '${{ matrix.competitor }}', options); + elseif strcmp('${{ matrix.solver }}', 'lincoa') + prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'l', '${{ matrix.competitor }}', options); + elseif strcmp('${{ matrix.solver }}', 'bobyqa') + prof('${{ matrix.solver }}', '${{ matrix.dim }}', 'b', '${{ matrix.competitor }}', options); + else + prof('${{ matrix.solver }}', '${{ matrix.dim }}', '${{ matrix.competitor }}', options); + end + + + % Move the files to prepare for uploading artifacts + + solver = '${{ env.SOLNAME }}'; + movefile(fullfile(cd(), 'testdata', '*summary*.pdf'), ['/tmp/', solver, '_profile_prima/']); + movefile(fullfile(cd(), 'testdata', '*.txt'), ['/tmp/', solver, '_profile_prima/']); + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/${{ env.SOLNAME }}_profile_prima/*summary*.pdf + /tmp/${{ env.SOLNAME }}_profile_prima/*.txt + /tmp/${{ env.SOLNAME }}_profile_prima/*start* + /tmp/${{ env.SOLNAME }}_profile_prima/*end* + + - name: Remove the test data + if: always() # Always run even if the workflow is canceled manually or due to overtime. + run: rm -rf ./matlab/tests/testdata && rm -rf /tmp/${{ env.SOLNAME }}_profile_prima diff --git a/.github/workflows/profile_uobyqa_small.yml b/.github/workflows/profile_uobyqa_small.yml new file mode 100644 index 0000000000..d71f704c26 --- /dev/null +++ b/.github/workflows/profile_uobyqa_small.yml @@ -0,0 +1,113 @@ +name: Plot performance profiles for UOBYQA, small + +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 2,6,10,14,18,22 * * *' + # 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) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + test: + name: Profile PRIMA. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + dim: [small] + solver: [uobyqa] + competitor: [classical, archiva] + + 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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Install epstopdf and ghostscript + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/install_epstopdf && bash .github/scripts/install_ghostscript + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }} + + - name: Set up MATLAB + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + cd(fullfile(root_dir, 'matcutest')); install(); which macup + cd(fullfile(root_dir, 'matlab/tests')); + + prof('${{ matrix.solver }}', '${{ matrix.dim }}', '${{ matrix.competitor }}'); + + + % Move the files to prepare for uploading artifacts + + movefile(fullfile(cd(), 'testdata', '*summary*.pdf'), '/tmp/${{ matrix.solver }}_profile_prima/'); + movefile(fullfile(cd(), 'testdata', '*.txt'), '/tmp/${{ matrix.solver }}_profile_prima/'); + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/${{ matrix.solver }}_profile_prima/*summary*.pdf + /tmp/${{ matrix.solver }}_profile_prima/*.txt + /tmp/${{ matrix.solver }}_profile_prima/*start* + /tmp/${{ matrix.solver }}_profile_prima/*end* + + - name: Remove the test data + if: always() # Always run even if the workflow is canceled manually or due to overtime. + run: rm -rf ./matlab/tests/testdata && rm -rf /tmp/${{ matrix.solver }}_profile_prima diff --git a/.github/workflows/stress_test_fortran.yml b/.github/workflows/stress_test_fortran.yml new file mode 100644 index 0000000000..c558a2e5e8 --- /dev/null +++ b/.github/workflows/stress_test_fortran.yml @@ -0,0 +1,136 @@ +name: Stress test on large problems, Fortran + +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 18 * * *' + # 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: Stress test of PRIMA on large problems + runs-on: ${{ matrix.os }} + continue-on-error: true + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + compiler: [g, i, v, s, f, x, d] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + testdim: [large] + exclude: + - os: macos-latest + compiler: v + - os: macos-latest + compiler: s + - os: macos-latest + compiler: f + - os: macos-latest + compiler: x + - os: macos-latest + compiler: d + - compiler: s # BOBYQA fails stest for unknown reason + solver: bobyqa + + 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: Miscellaneous setup + run: bash .github/scripts/misc_setup + + - name: Install AOCC + if: ${{ matrix.compiler == 'd' }} + run: bash .github/scripts/install_aocc + + - name: Install gfortran + if: ${{ matrix.compiler == 'g' }} + uses: awvwgk/setup-fortran@main + id: setup-fortran + with: + compiler: gcc + + - name: Install Intel oneAPI on Linux + if: ${{ startsWith(matrix.os, 'ubuntu') && (matrix.compiler == 'i' || matrix.compiler == 'x') }} + run: bash .github/scripts/install_oneapi_linux.sh + + - name: Install Intel oneAPI on macOS + if: ${{ startsWith(matrix.os, 'macos') && (matrix.compiler == 'i' || matrix.compiler == 'x') }} + run: bash .github/scripts/install_oneapi_macos.sh + + - name: Install nvfortran + if: ${{ matrix.compiler == 'v' }} + run: bash .github/scripts/install_nvfortran + + - name: Install Oracle sunf95 + if: ${{ matrix.compiler == 's' }} + run: bash .github/scripts/install_sunf95 + + # Install Flang after AOCC, to make sure that flang is this one, while AOCC flang will be + # known as aflang. + - name: Install Flang + if: ${{ matrix.compiler == 'f' }} + run: bash .github/scripts/install_flang + + - name: Conduct the test + run: | + 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 }} + fi + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + 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 ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }} diff --git a/.github/workflows/stress_test_matlab.yml b/.github/workflows/stress_test_matlab.yml new file mode 100644 index 0000000000..42250a84c9 --- /dev/null +++ b/.github/workflows/stress_test_matlab.yml @@ -0,0 +1,169 @@ +name: Stress test on large problems, MATLAB + +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 6 * * *' + # Trigger the workflow manually + workflow_dispatch: + inputs: + git-ref: + description: Git Ref (Optional) + required: false + random-seed: + description: Random Seed (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} , seed {1}', inputs.git-ref, inputs.random-seed) || '' }} + +jobs: + test: + name: Stress test of PRIMA on large problems + runs-on: ${{ matrix.os }} + continue-on-error: true + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-20.04, macos-11, windows-2019] + matlab: [latest, R2020b, R2021a, R2022a] + solver: [uobyqa, newuoa, bobyqa, lincoa, cobyla] + test: [normal, tough] + + # Exclude some versions of OS and MATLAB. In addition to the latest versions, we intend to + # test the earliest version of MATLAB on each OS. + exclude: + - os: ubuntu-latest + matlab: R2020b + - os: ubuntu-latest + matlab: R2021a + - os: ubuntu-latest + matlab: R2022a + - os: ubuntu-20.04 + matlab: R2021a + - os: ubuntu-20.04 + matlab: R2022a + - os: ubuntu-20.04 + matlab: latest + + - os: macos-latest + matlab: R2020b + - os: macos-latest + matlab: R2021a + - os: macos-latest + matlab: R2022a + - os: macos-11 + matlab: R2020b + - os: macos-11 + matlab: R2021a + - os: macos-11 + matlab: latest + + - os: windows-latest + matlab: R2020b + - os: windows-latest + matlab: R2021a + - os: windows-latest + matlab: R2022a + - os: windows-2019 + matlab: R2020b + - os: windows-2019 + matlab: R2022a + - os: windows-2019 + matlab: latest + + + 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: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: | + GFVER=12 + if [[ "${{ matrix.os }}" = "ubuntu-20.04" ]] ; then + GFVER=11 + fi + if [[ "${{ matrix.matlab }}" = "R2020b" || "${{ matrix.matlab }}" = "R2021a" || "${{ matrix.matlab }}" = "R2021b" ]] ; then + GFVER=9 + fi + bash .github/scripts/link_gfortran "$GFVER" + + - name: Install Intel oneAPI on macOS + if: startsWith(matrix.os, 'macos') + run: bash .github/scripts/install_oneapi_macos.sh + + - name: Install Intel oneAPI on Windows + if: startsWith(matrix.os, 'windows') + run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat"' + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }}-yes + + - name: Set up MATLAB with optimization toolbox + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + products: Optimization_Toolbox + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + cd(fullfile(root_dir, 'matlab/tests')); + options = struct(); + if ~isempty('${{ inputs.random-seed }}') + options.seed = str2num('${{ inputs.random-seed }}'); + else + copyfile('private/year_week.m', cd()); + options.seed = year_week('Asia/Shanghai'); + end + options.tough = strcmp('${{ matrix.test }}', 'tough'); + daynum = day(datetime('now', 'TimeZone', 'Asia/Shanghai')); + if mod(daynum, 3) == 0 + options.precision = 'single'; + elseif mod(daynum, 3) == 1 + options.precision = 'double'; + else + options.precision = 'quadruple'; + end + options + stress('${{ matrix.solver }}', options); + + + # 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 ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }} diff --git a/.github/workflows/test_absoft.yml b/.github/workflows/test_absoft.yml new file mode 100644 index 0000000000..3c3501982b --- /dev/null +++ b/.github/workflows/test_absoft.yml @@ -0,0 +1,72 @@ +name: Test Absoft + +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 20 * * *' + # 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 Absoft tests + runs-on: [self-hosted, absoft] + strategy: + fail-fast: false + matrix: + ikind: [i2] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + + 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: Miscellaneous setup + run: bash .github/scripts/misc_setup + + - name: Conduct the test + run: | + LOCAL="$HOME/local" + AFDIR="$(find "$LOCAL" -maxdepth 2 -name "absoft[0-9]*" -type d -print | sort | tail -n 1)" + source "$AFDIR"/bin/absvars.sh + export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH + # Use $(( )) rather than $(expr ). See https://unix.stackexchange.com/questions/63166/bash-e-exits-when-let-or-expr-evaluates-to-0 + FFLAGS=-O$(($(date +%-d) % 4)) + FFLAGS=${FFLAGS/O0/g} + export FFLAGS + cd "$ROOT_DIR"/fortran/tests && make atest_${{ matrix.ikind }}.${{ matrix.solver }} + # af95 cannot handle allocatable characters. + # cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make atest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + 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 }} diff --git a/.github/workflows/test_aflang.yml b/.github/workflows/test_aflang.yml new file mode 100644 index 0000000000..4528129587 --- /dev/null +++ b/.github/workflows/test_aflang.yml @@ -0,0 +1,94 @@ +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] + # With flang in AMD clang version 14.0.6, fortran/cobyla of 54e66dd does not pass dtest. + # See https://github.com/libprima/prima/issues/41 . To be tested when AMD flang is updated. + solver: [newuoa, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + testdim: [small, 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 }} && make dtest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + 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 }} diff --git a/.github/workflows/test_armflang_kunpeng.yml b/.github/workflows/test_armflang_kunpeng.yml new file mode 100644 index 0000000000..e6637b8dfd --- /dev/null +++ b/.github/workflows/test_armflang_kunpeng.yml @@ -0,0 +1,99 @@ +name: Test armflang on Kunpeng + +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 16 5-31/5 * *' + # 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: [self-hosted, ARM64, kp] + continue-on-error: true + strategy: + fail-fast: false + matrix: + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + testdim: [small, big] + exclude: + - solver: lincoa # As of armflang 22.1, rtest often get canceled in the following cases. + fflags: [-O2, -O3] + 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: Miscellaneous setup + run: bash .github/scripts/misc_setup + + - name: Conduct the test + run: | + ARMDIR="$(find /opt/arm -maxdepth 1 -name "arm-linux-compiler*" -type d -print | sort | tail -n 1)" + if [[ -n "$ARMDIR" ]] ; then + export PATH=$PATH:"$ARMDIR"/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib + ARMLD="$(find /opt/arm -type f -executable -name ld | xargs dirname)" + ARMLD_DIR=${ARMLD//$'\n'/:} + export PATH=$PATH:"$ARMLD_DIR" + fi + cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint -r && bash ./mlint -r + export FFLAGS=${{ matrix.fflags }} + export TESTDIM=${{ matrix.testdim }} + cd "$ROOT_DIR"/fortran/tests && make rtest_${{ matrix.ikind }}.${{ matrix.solver }} + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make rtest + + # - name: Store artifacts + # uses: actions/upload-artifact@v3.1.2 + # if: always() # Always run even if the workflow is canceled manually or due to overtime. + # with: + # 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 }} diff --git a/.github/workflows/test_armflang_pi.yml b/.github/workflows/test_armflang_pi.yml new file mode 100644 index 0000000000..be5c3fdd57 --- /dev/null +++ b/.github/workflows/test_armflang_pi.yml @@ -0,0 +1,87 @@ +name: Test armflang on Raspberry Pi + +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 16 5-31/5 * *' + # 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: [self-hosted, ARM64, pi64] + continue-on-error: true + strategy: + fail-fast: false + matrix: + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + testdim: [small, 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: Miscellaneous setup + run: bash .github/scripts/misc_setup + + - 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 }} + cd "$ROOT_DIR"/fortran/tests && make rtest_${{ matrix.ikind }}.${{ matrix.solver }} + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make rtest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + 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 }} diff --git a/.github/workflows/test_flang.yml b/.github/workflows/test_flang.yml new file mode 100644 index 0000000000..1e41a754d2 --- /dev/null +++ b/.github/workflows/test_flang.yml @@ -0,0 +1,91 @@ +name: Test Flang + +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 2-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 Flang tests + runs-on: ${{ matrix.os }} + continue-on-error: true + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] # As of 20221217, the flang installed by ../scripts/install_flang may only work with ubuntu-22.04 + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + testdim: [small, 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 Flang + run: bash .github/scripts/install_flang + + - 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 ftest_${{ matrix.ikind }}.${{ matrix.solver }} + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make ftest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + 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 }} diff --git a/.github/workflows/test_flang_kunpeng.yml b/.github/workflows/test_flang_kunpeng.yml new file mode 100644 index 0000000000..e3a15de4fa --- /dev/null +++ b/.github/workflows/test_flang_kunpeng.yml @@ -0,0 +1,96 @@ +name: Test Flang on Kunpeng + +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 16 4-31/5 * *' + # 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 Flang tests + runs-on: [self-hosted, ARM64, kp] + continue-on-error: true + strategy: + fail-fast: false + matrix: + ikind: [i2, i8] + # For COBYLA, Flang (HUAWEI BiSheng Compiler 2.1.0) raises a false positive SIGSEG in testsuite/prob.f90 + #solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + solver: [newuoa, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + testdim: [small, 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: Miscellaneous setup + run: bash .github/scripts/misc_setup + + - name: Conduct the test + run: | + ARMDIR="$(find /opt/arm -maxdepth 1 -name "arm-linux-compiler*" -type d -print | sort | tail -n 1)" + if [[ -n "$ARMDIR" ]] ; then + export PATH=$PATH:"$ARMDIR"/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib + ARMLD="$(find /opt/arm -type f -executable -name ld | xargs dirname)" + ARMLD_DIR=${ARMLD//$'\n'/:} + export PATH=$PATH:"$ARMLD_DIR" # For some reason, flang also needs this ld. The system ld does not work. + fi + cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint -f && bash ./mlint -f + export FFLAGS=${{ matrix.fflags }} + export TESTDIM=${{ matrix.testdim }} + cd "$ROOT_DIR"/fortran/tests && make ftest_${{ matrix.ikind }}.${{ matrix.solver }} + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make ftest + + # - name: Store artifacts + # uses: actions/upload-artifact@v3.1.2 + # if: always() # Always run even if the workflow is canceled manually or due to overtime. + # with: + # 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 }} diff --git a/.github/workflows/test_flang_pi.yml b/.github/workflows/test_flang_pi.yml new file mode 100644 index 0000000000..0d4104340d --- /dev/null +++ b/.github/workflows/test_flang_pi.yml @@ -0,0 +1,89 @@ +name: Test Flang on Raspberry Pi + +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 16 4-31/5 * *' + # 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 Flang tests + runs-on: [self-hosted, ARM64, pi64] + continue-on-error: true + strategy: + fail-fast: false + matrix: + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + testdim: [small, 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 Flang + run: bash .github/scripts/install_flang + + - name: Miscellaneous setup + run: bash .github/scripts/misc_setup + + - name: Conduct the test + run: | + cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint -f && bash ./mlint -f + export FFLAGS=${{ matrix.fflags }} + export TESTDIM=${{ matrix.testdim }} + cd "$ROOT_DIR"/fortran/tests && make ftest_${{ matrix.ikind }}.${{ matrix.solver }} + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make ftest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + 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 }} diff --git a/.github/workflows/test_g95.yml b/.github/workflows/test_g95.yml new file mode 100644 index 0000000000..e9393ee40e --- /dev/null +++ b/.github/workflows/test_g95.yml @@ -0,0 +1,71 @@ +name: Test g95 + +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 5 * * *' + # 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 g95 tests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + + 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 g95 + run: bash .github/scripts/install_g95 + + - name: Miscellaneous setup + run: bash .github/scripts/misc_setup + + - name: Conduct the test + run: | + # No need to test in parallel, as 9test compiles without running (identical to 9test_c). + cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint --all && bash ./mlint --all + cd "$ROOT_DIR"/fortran/tests && make 9test_c.${{ matrix.solver }} + # 20211012: make 9test_newuoa will not work, because, for some unknown reason, 9test_c is + # remade when making 9test even though 9test_c has been made and up to date. Since the + # making of 9test is in parallel, 9test_c will also be triggered in parallel, which leads + # to problems like un-found modules. Not yet observed for other tests. + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + 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 }} diff --git a/.github/workflows/test_gfortran_O12.yml b/.github/workflows/test_gfortran_O12.yml new file mode 100644 index 0000000000..a6b8556ba1 --- /dev/null +++ b/.github/workflows/test_gfortran_O12.yml @@ -0,0 +1,111 @@ +name: Test gfortran, -O1, -O2 + +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 16 3-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 gfortran tests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + compiler: [gcc] + version: [11, 13] # Too expensive to test all versions + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + testdim: [small] + exclude: + - os: windows-latest + version: 13 # gfortran-13 is not available on Windows as of 20230904 + + steps: + - name: Clone Repository (Latest) + uses: actions/checkout@v4 + if: github.event.inputs.git-ref == '' + with: + submodules: recursive + # ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + # As of 230425, checkout with ssh fails frequently on Windows runners. + - name: Clone Repository (Custom Ref) + uses: actions/checkout@v4 + if: github.event.inputs.git-ref != '' + with: + ref: ${{ github.event.inputs.git-ref }} + submodules: recursive + # ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + # As of 230425, checkout with ssh fails frequently on Windows runners. + + - name: Setup Fortran + id: setup_fortran + uses: awvwgk/setup-fortran@main + with: + compiler: ${{ matrix.compiler }} + version: ${{ matrix.version }} + + - name: Check Fortran compiler + run: | + ${{ env.FC }} --version + ${{ env.CC }} --version + shell: bash + env: + FC: ${{ steps.setup_fortran.outputs.fc }} + CC: ${{ steps.setup_fortran.outputs.cc }} + + - name: Make tools such as grep, make, and git available on Windows + if: runner.os == 'Windows' + run: $env:Path += ";C:\Program Files\Git\usr\bin;C:\Program Files\Git\bin;C:\ProgramData\Chocolatey\bin" + + - name: Miscellaneous setup + shell: bash # Important; otherwise, the following statements do not work on Windows. + run: bash .github/scripts/misc_setup + + - name: Conduct the test + shell: bash # Important; otherwise, `<` will not work on Windows. + # Not sure whether the Makefile has bugs, but on Windows the making of gtest always invokes + # the making of gtest_c twice even if the former is up to date after the first making. It + # may lead to errors due to parallel making. To avoid this, we make gtest_c first. + run: | + # 20221212: We skip the linting and extensive test on Windows due to the following + # reasons. The example will still be tested on Windows. + # 1. Windows does not support the symlink of linux, and hence mlint and flint do not work. + # 2. Makefile.common does not work on Windows for the moment due to quotation marks. + if [[ "$RUNNER_OS" != "Windows" ]] ; then + cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint --all && bash ./mlint --all + export TESTDIM=${{ matrix.testdim }} + export FFLAGS='-O1' + cd "$ROOT_DIR"/fortran/tests && make gtest_${{ matrix.ikind }}_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}.${{ matrix.solver }} + export FFLAGS='-O2' + cd "$ROOT_DIR"/fortran/tests && make gtest_${{ matrix.ikind }}_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}.${{ matrix.solver }} + fi + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make gtest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + # Note that `$TEST_DIR` does not work on Windows, where its equivalent is `$env:TEST_DIR`. + # In the following, we enquire `$TEST_DIR` by using the `env` context, which is platform independent. + with: + 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. + shell: bash # Important; otherwise, `rm -rf` will not work on Windows. + run: rm -rf ${{ env.TEST_DIR }} diff --git a/.github/workflows/test_gfortran_big.yml b/.github/workflows/test_gfortran_big.yml new file mode 100644 index 0000000000..60a0ef90c9 --- /dev/null +++ b/.github/workflows/test_gfortran_big.yml @@ -0,0 +1,122 @@ +name: Test gfortran, big + +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 16 1-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 gfortran tests + runs-on: ${{ matrix.os }} + continue-on-error: true + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + compiler: [gcc] + version: [11, 13] + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, O3, -g, -fast] + 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: Setup Fortran + id: setup_fortran + uses: awvwgk/setup-fortran@main + with: + compiler: ${{ matrix.compiler }} + version: ${{ matrix.version }} + + - name: Check Fortran compiler + run: | + ${{ env.FC }} --version + ${{ env.CC }} --version + shell: bash + env: + FC: ${{ steps.setup_fortran.outputs.fc }} + CC: ${{ steps.setup_fortran.outputs.cc }} + + - name: Make tools such as grep, make, and git available on Windows + if: runner.os == 'Windows' + run: $env:Path += ";C:\Program Files\Git\usr\bin;C:\Program Files\Git\bin;C:\ProgramData\Chocolatey\bin" + + - name: Miscellaneous setup + shell: bash # Important; otherwise, the following statements do not work on Windows. + run: bash .github/scripts/misc_setup + + - name: Conduct the test + shell: bash # Important; otherwise, `<` will not work on Windows. + # Not sure whether the Makefile has bugs, but on Windows the making of gtest always invokes + # the making of gtest_c twice even if the former is up to date after the first making. It + # may lead to errors due to parallel making. To avoid this, we make gtest_c first. + run: | + # 20221212: We skip the linting and extensive test on Windows due to the following + # reasons. The example will still be tested on Windows. + # 1. Windows does not support the symlink of linux, and hence mlint and flint do not work. + # 2. Makefile.common does not work on Windows for the moment due to quotation marks. + if [[ "$RUNNER_OS" != "Windows" ]] ; then + export TESTDIM=${{ matrix.testdim }} + export FFLAGS=${{ matrix.fflags }} + cd "$ROOT_DIR"/fortran/tests + make gtest_${{ matrix.ikind }}_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}.${{ matrix.solver }} + fi + + # - name: Store artifacts + # uses: actions/upload-artifact@v3.1.2 + # if: always() # Always run even if the workflow is canceled manually or due to overtime. + # # Note that `$TEST_DIR` does not work on Windows, where its equivalent is `$env:TEST_DIR`. + # # In the following, we enquire `$TEST_DIR` by using the `env` context, which is platform independent. + # with: + # 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. + shell: bash # Important; otherwise, `rm -rf` will not work on Windows. + 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 ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }} diff --git a/.github/workflows/test_gfortran_fast.yml b/.github/workflows/test_gfortran_fast.yml new file mode 100644 index 0000000000..3b13c2b6ff --- /dev/null +++ b/.github/workflows/test_gfortran_fast.yml @@ -0,0 +1,110 @@ +name: Test gfortran, -fast + +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 16 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 gfortran tests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + compiler: [gcc] + version: [11, 13] # gfortran 9 is buggy wit logical variables when invoked with -Ofast + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + testdim: [small] + exclude: + - os: windows-latest + version: 13 # gfortran-13 is not available on Windows as of 20230904 + + steps: + + - name: Clone Repository (Latest) + uses: actions/checkout@v4 + if: github.event.inputs.git-ref == '' + with: + submodules: recursive + # ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + # As of 230425, checkout with ssh fails frequently on Windows runners. + - name: Clone Repository (Custom Ref) + uses: actions/checkout@v4 + if: github.event.inputs.git-ref != '' + with: + ref: ${{ github.event.inputs.git-ref }} + submodules: recursive + # ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + # As of 230425, checkout with ssh fails frequently on Windows runners. + + - name: Setup Fortran + id: setup_fortran + uses: awvwgk/setup-fortran@main + with: + compiler: ${{ matrix.compiler }} + version: ${{ matrix.version }} + + - name: Check Fortran compiler + run: | + ${{ env.FC }} --version + ${{ env.CC }} --version + shell: bash + env: + FC: ${{ steps.setup_fortran.outputs.fc }} + CC: ${{ steps.setup_fortran.outputs.cc }} + + - name: Make tools such as grep, make, and git available on Windows + if: runner.os == 'Windows' + run: $env:Path += ";C:\Program Files\Git\usr\bin;C:\Program Files\Git\bin;C:\ProgramData\Chocolatey\bin" + + - name: Miscellaneous setup + shell: bash # Important; otherwise, the following statements do not work on Windows. + run: bash .github/scripts/misc_setup + + - name: Conduct the test + shell: bash # Important; otherwise, `<` will not work on Windows. + # Not sure whether the Makefile has bugs, but on Windows the making of gtest always invokes + # the making of gtest_c twice even if the former is up to date after the first making. It + # may lead to errors due to parallel making. To avoid this, we make gtest_c first. + run: | + # 20221212: We skip the linting and extensive test on Windows due to the following + # reasons. The example will still be tested on Windows. + # 1. Windows does not support the symlink of linux, and hence mlint and flint do not work. + # 2. Makefile.common does not work on Windows for the moment due to quotation marks. + if [[ "$RUNNER_OS" != "Windows" ]] ; then + cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint --all && bash ./mlint --all + export TESTDIM=${{ matrix.testdim }} + export FFLAGS='-fast' + cd "$ROOT_DIR"/fortran/tests && make gtest_${{ matrix.ikind }}_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}.${{ matrix.solver }} + fi + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make gtest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + # Note that `$TEST_DIR` does not work on Windows, where its equivalent is `$env:TEST_DIR`. + # In the following, we enquire `$TEST_DIR` by using the `env` context, which is platform independent. + with: + 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. + shell: bash # Important; otherwise, `rm -rf` will not work on Windows. + run: rm -rf ${{ env.TEST_DIR }} diff --git a/.github/workflows/test_gfortran_gO3.yml b/.github/workflows/test_gfortran_gO3.yml new file mode 100644 index 0000000000..fd353fcb99 --- /dev/null +++ b/.github/workflows/test_gfortran_gO3.yml @@ -0,0 +1,108 @@ +name: Test gfortran, -g, -O3 + +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 16 2-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 gfortran tests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + compiler: [gcc] + version: [11, 13] # Too expensive to test all versions + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + testdim: [small] + exclude: + - os: windows-latest + version: 13 # gfortran-13 is not available on Windows as of 20230904 + + steps: + + - name: Clone Repository (Latest) + uses: actions/checkout@v4 + if: github.event.inputs.git-ref == '' + with: + submodules: recursive + # ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + # As of 230425, checkout with ssh fails frequently on Windows runners. + - name: Clone Repository (Custom Ref) + uses: actions/checkout@v4 + if: github.event.inputs.git-ref != '' + with: + ref: ${{ github.event.inputs.git-ref }} + submodules: recursive + # ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + # As of 230425, checkout with ssh fails frequently on Windows runners. + + - name: Setup Fortran + id: setup_fortran + uses: awvwgk/setup-fortran@main + with: + compiler: ${{ matrix.compiler }} + version: ${{ matrix.version }} + + - name: Check Fortran compiler + run: | + ${{ env.FC }} --version + ${{ env.CC }} --version + shell: bash + env: + FC: ${{ steps.setup_fortran.outputs.fc }} + CC: ${{ steps.setup_fortran.outputs.cc }} + + - name: Make tools such as grep, make, and git available on Windows + if: runner.os == 'Windows' + run: $env:Path += ";C:\Program Files\Git\usr\bin;C:\Program Files\Git\bin;C:\ProgramData\Chocolatey\bin" + + - name: Miscellaneous setup + shell: bash # Important; otherwise, the following statements do not work on Windows. + run: bash .github/scripts/misc_setup + + - name: Conduct the test + shell: bash # Important; otherwise, `<` will not work on Windows. + # Not sure whether the Makefile has bugs, but on Windows the making of gtest always invokes + # the making of gtest_c twice even if the former is up to date after the first making. It + # may lead to errors due to parallel making. To avoid this, we make gtest_c first. + run: | + # 20221212: We skip the linting and extensive test on Windows due to the following + # reasons. The example will still be tested on Windows. + # 1. Windows does not support the symlink of linux, and hence mlint and flint do not work. + # 2. Makefile.common does not work on Windows for the moment due to quotation marks. + if [[ "$RUNNER_OS" != "Windows" ]] ; then + cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint --all && bash ./mlint --all + cd "$ROOT_DIR"/fortran/tests && export TESTDIM=${{ matrix.testdim }} && make gtest_${{ matrix.ikind }}_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}.${{ matrix.solver }} + fi + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make gtest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + # Note that `$TEST_DIR` does not work on Windows, where its equivalent is `$env:TEST_DIR`. + # In the following, we enquire `$TEST_DIR` by using the `env` context, which is platform independent. + with: + 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. + shell: bash # Important; otherwise, `rm -rf` will not work on Windows. + run: rm -rf ${{ env.TEST_DIR }} diff --git a/.github/workflows/test_gfortran_kunpeng_big.yml b/.github/workflows/test_gfortran_kunpeng_big.yml new file mode 100644 index 0000000000..3eaeb71b8b --- /dev/null +++ b/.github/workflows/test_gfortran_kunpeng_big.yml @@ -0,0 +1,94 @@ +name: Test gfortran on Kunpeng, big + +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 12 2-31/5 * *' + # 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 gfortran tests + runs-on: [self-hosted, ARM64, kp] + continue-on-error: true + strategy: + fail-fast: false + matrix: + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + 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: Miscellaneous setup + shell: bash + run: bash .github/scripts/misc_setup + + - name: Conduct the test + shell: bash + run: | + #cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint -g && bash ./mlint -g # On Kunpeng, perform lintering only for small tests of gfortran + export FFLAGS=${{ matrix.fflags }} + export TESTDIM=${{ matrix.testdim }} + cd "$ROOT_DIR"/fortran/tests + make gtest_${{ matrix.ikind }}_r4_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r4_d1_tst.${{ matrix.solver }} + make gtest_${{ matrix.ikind }}_r8_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r8_d1_tst.${{ matrix.solver }} + export FS=08 + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make gtest + + # - name: Store artifacts + # uses: actions/upload-artifact@v3.1.2 + # if: always() # Always run even if the workflow is canceled manually or due to overtime. + # # Note that `$TEST_DIR` does not work on Windows, where its equivalent is `$env:TEST_DIR`. + # # In the following, we enquire `$TEST_DIR` by using the `env` context, which is platform independent. + # with: + # 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. + shell: bash # Important; otherwise, `rm -rf` will not work on Windows. + 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 ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }} diff --git a/.github/workflows/test_gfortran_kunpeng_small.yml b/.github/workflows/test_gfortran_kunpeng_small.yml new file mode 100644 index 0000000000..81d6551699 --- /dev/null +++ b/.github/workflows/test_gfortran_kunpeng_small.yml @@ -0,0 +1,75 @@ +name: Test gfortran on Kunpeng, small + +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 12 1-31/5 * *' + # 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 gfortran tests + runs-on: [self-hosted, ARM64, kp] + strategy: + fail-fast: false + matrix: + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + testdim: [small] + + 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: Miscellaneous setup + shell: bash + run: bash .github/scripts/misc_setup + + - name: Conduct the test + shell: bash + run: | + cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint -g && bash ./mlint -g # On Kunpeng, perform lintering only for small tests of gfortran + export FFLAGS=${{ matrix.fflags }} + export TESTDIM=${{ matrix.testdim }} + cd "$ROOT_DIR"/fortran/tests && make gtest_${{ matrix.ikind }}_r4_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r4_d1_tst.${{ matrix.solver }} + cd "$ROOT_DIR"/fortran/tests && make gtest_${{ matrix.ikind }}_r8_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r8_d1_tst.${{ matrix.solver }} + export FS=08 + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make gtest + + # - name: Store artifacts + # uses: actions/upload-artifact@v3.1.2 + # if: always() # Always run even if the workflow is canceled manually or due to overtime. + # # Note that `$TEST_DIR` does not work on Windows, where its equivalent is `$env:TEST_DIR`. + # # In the following, we enquire `$TEST_DIR` by using the `env` context, which is platform independent. + # with: + # 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. + shell: bash # Important; otherwise, `rm -rf` will not work on Windows. + run: rm -rf ${{ env.TEST_DIR }} diff --git a/.github/workflows/test_gfortran_pi32_big.yml b/.github/workflows/test_gfortran_pi32_big.yml new file mode 100644 index 0000000000..f86e70480b --- /dev/null +++ b/.github/workflows/test_gfortran_pi32_big.yml @@ -0,0 +1,94 @@ +name: Test gfortran on Raspberry Pi32, big + +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 16 2-31/2 * *' + # 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 gfortran tests + runs-on: [self-hosted, ARM, pi32] + continue-on-error: true + strategy: + fail-fast: false + matrix: + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + 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: Miscellaneous setup + shell: bash + run: bash .github/scripts/misc_setup + + - name: Conduct the test + shell: bash + run: | + #cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint -g && bash ./mlint -g + export FFLAGS=${{ matrix.fflags }} + export TESTDIM=${{ matrix.testdim }} + cd "$ROOT_DIR"/fortran/tests + make gtest_${{ matrix.ikind }}_r4_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r4_d1_tst.${{ matrix.solver }} + make gtest_${{ matrix.ikind }}_r8_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r8_d1_tst.${{ matrix.solver }} + export FS=18 + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make gtest + + # - name: Store artifacts + # uses: actions/upload-artifact@v3.1.2 + # if: always() # Always run even if the workflow is canceled manually or due to overtime. + # # Note that `$TEST_DIR` does not work on Windows, where its equivalent is `$env:TEST_DIR`. + # # In the following, we enquire `$TEST_DIR` by using the `env` context, which is platform independent. + # with: + # 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. + shell: bash # Important; otherwise, `rm -rf` will not work on Windows. + 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 ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }} diff --git a/.github/workflows/test_gfortran_pi32_small.yml b/.github/workflows/test_gfortran_pi32_small.yml new file mode 100644 index 0000000000..5fcf7834b1 --- /dev/null +++ b/.github/workflows/test_gfortran_pi32_small.yml @@ -0,0 +1,75 @@ +name: Test gfortran on Raspberry Pi32, small + +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 16 1-31/2 * *' + # 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 gfortran tests + runs-on: [self-hosted, ARM, pi32] + strategy: + fail-fast: false + matrix: + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + testdim: [small] + + 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: Miscellaneous setup + shell: bash + run: bash .github/scripts/misc_setup + + - name: Conduct the test + shell: bash + run: | + cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint -g && bash ./mlint -g # On Raspberry Pi, perform lintering only for small tests of gfortran + export FFLAGS=${{ matrix.fflags }} + export TESTDIM=${{ matrix.testdim }} + cd "$ROOT_DIR"/fortran/tests && make gtest_${{ matrix.ikind }}_r4_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r4_d1_tst.${{ matrix.solver }} + cd "$ROOT_DIR"/fortran/tests && make gtest_${{ matrix.ikind }}_r8_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r8_d1_tst.${{ matrix.solver }} + export FS=18 + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make gtest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + # Note that `$TEST_DIR` does not work on Windows, where its equivalent is `$env:TEST_DIR`. + # In the following, we enquire `$TEST_DIR` by using the `env` context, which is platform independent. + with: + 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. + shell: bash # Important; otherwise, `rm -rf` will not work on Windows. + run: rm -rf ${{ env.TEST_DIR }} diff --git a/.github/workflows/test_gfortran_pi64_big.yml b/.github/workflows/test_gfortran_pi64_big.yml new file mode 100644 index 0000000000..e075da2118 --- /dev/null +++ b/.github/workflows/test_gfortran_pi64_big.yml @@ -0,0 +1,93 @@ +name: Test gfortran on Raspberry Pi64, big + +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 16 2-31/5 * *' + # 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 gfortran tests + runs-on: [self-hosted, ARM64, pi64] + continue-on-error: true + strategy: + fail-fast: false + matrix: + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + 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: Miscellaneous setup + shell: bash + run: bash .github/scripts/misc_setup + + - name: Conduct the test + shell: bash + run: | + #cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint -g && bash ./mlint -g + export FFLAGS=${{ matrix.fflags }} + export TESTDIM=${{ matrix.testdim }} + cd "$ROOT_DIR"/fortran/tests + make gtest_${{ matrix.ikind }}_r4_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r4_d1_tst.${{ matrix.solver }} + make gtest_${{ matrix.ikind }}_r8_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r8_d1_tst.${{ matrix.solver }} + export FS=18 + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make gtest + + # - name: Store artifacts + # uses: actions/upload-artifact@v3.1.2 + # if: always() # Always run even if the workflow is canceled manually or due to overtime. + # # Note that `$TEST_DIR` does not work on Windows, where its equivalent is `$env:TEST_DIR`. + # # In the following, we enquire `$TEST_DIR` by using the `env` context, which is platform independent. + # with: + # 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 ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }} diff --git a/.github/workflows/test_gfortran_pi64_small.yml b/.github/workflows/test_gfortran_pi64_small.yml new file mode 100644 index 0000000000..b55deb2940 --- /dev/null +++ b/.github/workflows/test_gfortran_pi64_small.yml @@ -0,0 +1,75 @@ +name: Test gfortran on Raspberry Pi64, small + +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 16 1-31/5 * *' + # 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 gfortran tests + runs-on: [self-hosted, ARM64, pi64] + strategy: + fail-fast: false + matrix: + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + testdim: [small] + + 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: Miscellaneous setup + shell: bash + run: bash .github/scripts/misc_setup + + - name: Conduct the test + shell: bash + run: | + cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint -g && bash ./mlint -g # On Raspberry Pi, perform lintering only for small tests of gfortran + export FFLAGS=${{ matrix.fflags }} + export TESTDIM=${{ matrix.testdim }} + cd "$ROOT_DIR"/fortran/tests && make gtest_${{ matrix.ikind }}_r4_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r4_d1_tst.${{ matrix.solver }} + cd "$ROOT_DIR"/fortran/tests && make gtest_${{ matrix.ikind }}_r8_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r8_d1_tst.${{ matrix.solver }} + export FS=18 + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make gtest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + # Note that `$TEST_DIR` does not work on Windows, where its equivalent is `$env:TEST_DIR`. + # In the following, we enquire `$TEST_DIR` by using the `env` context, which is platform independent. + with: + 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. + shell: bash # Important; otherwise, `rm -rf` will not work on Windows. + run: rm -rf ${{ env.TEST_DIR }} diff --git a/.github/workflows/test_ifort.yml b/.github/workflows/test_ifort.yml new file mode 100644 index 0000000000..4a64a2174e --- /dev/null +++ b/.github/workflows/test_ifort.yml @@ -0,0 +1,101 @@ +name: Test ifort + +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 18 1-31/2 * *' + # 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 ifort tests + runs-on: ${{ matrix.os }} + continue-on-error: true + strategy: + fail-fast: false + matrix: + # Windows does not work. On Windows, the options for ifort/ifx starts with "/" instead of "-". + os: [ubuntu-latest, macos-latest] + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + testdim: [small, big] + exclude: + - os: macos-latest + ikind: i8 + + 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 Intel oneAPI on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/install_oneapi_linux.sh + + - name: Install Intel oneAPI on macOS + if: startsWith(matrix.os, 'macos') + run: bash .github/scripts/install_oneapi_macos.sh + + - name: Miscellaneous setup + shell: bash + run: bash .github/scripts/misc_setup + + - name: Conduct the test + shell: bash + 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 itest_${{ matrix.ikind }}.${{ matrix.solver }} + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make itest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + 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 }} diff --git a/.github/workflows/test_ifx.yml b/.github/workflows/test_ifx.yml new file mode 100644 index 0000000000..dfe1de9e4c --- /dev/null +++ b/.github/workflows/test_ifx.yml @@ -0,0 +1,100 @@ +name: Test ifx + +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 18 2-31/2 * *' + # 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 ifx tests + runs-on: ${{ matrix.os }} + continue-on-error: true + strategy: + fail-fast: false + matrix: + # Windows does not work. On Windows, the options for ifort/ifx starts with "/" instead of "-". + # As of 202301, ifx is not available on macOS. + #os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest] + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + testdim: [small, 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 Intel oneAPI on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/install_oneapi_linux.sh + + - name: Install Intel oneAPI on macOS + if: startsWith(matrix.os, 'macos') + run: bash .github/scripts/install_oneapi_macos.sh + + - name: Miscellaneous setup + shell: bash + run: bash .github/scripts/misc_setup + + - name: Conduct the test + shell: bash + 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 xtest_${{ matrix.ikind }}.${{ matrix.solver }} + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make xtest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + 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 }} diff --git a/.github/workflows/test_matlab.yml b/.github/workflows/test_matlab.yml new file mode 100644 index 0000000000..4d1c907452 --- /dev/null +++ b/.github/workflows/test_matlab.yml @@ -0,0 +1,157 @@ +name: Test MATLAB + +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 1 * * *' + # 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) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + test: + name: Test MATLAB + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04, ubuntu-latest, windows-2019, windows-latest, macos-11, macos-latest] + matlab: [R2020b, R2021a, R2021b, R2022a, R2022b, R2023a, latest] + + exclude: + + # Below R2022a, MEX is extremely slow on macOS + - os: macos-11 + matlab: R2020b + - os: macos-11 + matlab: R2021a + - os: macos-11 + matlab: R2021b + + - os: macos-latest + matlab: R2020b + - os: macos-latest + matlab: R2021a + - os: macos-latest + matlab: R2021b + + # Only R2021a/b and R2022a are available on Windows 2019. + - os: windows-2019 + matlab: R2020b + - os: windows-2019 + matlab: R2022b + - os: windows-2019 + matlab: R2023a + - os: windows-2019 + matlab: latest + + # Below R2022a, MEX does not work on windows-latest due to the version of MS Visual Studio; + # R2022a/b should work according to the documentation of MathWorks and GitHub Actions, but + # they do not as of March 2022 + - os: windows-latest + matlab: R2020a + - os: windows-latest + matlab: R2020b + - os: windows-latest + matlab: R2021a + - os: windows-latest + matlab: R2021b + - os: windows-latest + matlab: R2022a + - os: windows-latest + matlab: R2022b + + steps: + + - name: Clone Repository (Latest) + uses: actions/checkout@v4 + if: github.event.inputs.git-ref == '' + with: + submodules: recursive + # ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + # As of 230425, checkout with ssh fails frequently on Windows runners. + - name: Clone Repository (Custom Ref) + uses: actions/checkout@v4 + if: github.event.inputs.git-ref != '' + with: + ref: ${{ github.event.inputs.git-ref }} + submodules: recursive + # ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + # As of 230425, checkout with ssh fails frequently on Windows runners. + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: | + GFVER=${{ env.GFORTRAN_VERSION }} + if [[ "${{ matrix.os }}" = "ubuntu-20.04" ]] ; then + GFVER=11 + fi + if [[ "${{ matrix.matlab }}" = "R2020b" || "${{ matrix.matlab }}" = "R2021a" || "${{ matrix.matlab }}" = "R2021b" ]] ; then + GFVER=9 + fi + bash .github/scripts/link_gfortran "$GFVER" + + - name: Install Intel oneAPI on macOS + if: startsWith(matrix.os, 'macos') + run: bash .github/scripts/install_oneapi_macos.sh + + - name: Install Intel oneAPI on Windows + if: startsWith(matrix.os, 'windows') + run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat"' + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }} + + - name: Set up MATLAB + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + cd(root_dir); + options = struct(); + options.debug=true; + setup(options); + prima('info') + testprima(false, 1.0e-10, 100); + setup + setup path + prima('info') + testprima(false, 1.0e-10, 100); + setup cobyla + setup uobyqa + setup newuoa + setup bobyqa + setup lincoa + setup prima + setup path + setup clean + setup path + setup uninstall + setup path + setup uninstall + cd(fullfile(root_dir, 'matlab', 'tests')); pdv + cd(root_dir); + setup + prima('info') + cd(fullfile(root_dir, 'matlab', 'examples')); rosenbrock_example diff --git a/.github/workflows/test_nagfor.yml b/.github/workflows/test_nagfor.yml new file mode 100644 index 0000000000..9a984189d8 --- /dev/null +++ b/.github/workflows/test_nagfor.yml @@ -0,0 +1,89 @@ +name: Test nagfor + +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 19 * * *' + # 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 nagfor tests + runs-on: [self-hosted, nagfor] + continue-on-error: true + strategy: + fail-fast: false + matrix: + ikind: [i2] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + testdim: [small, 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: Miscellaneous setup + run: bash .github/scripts/misc_setup + + - name: Conduct the test + run: | + export PATH=$PATH:"~/local/bin" + source ~/local/bin/nag_licensing || echo "\n\nNAG licensing failed.\n\n" + # Use $(( )) rather than $(expr ). See https://unix.stackexchange.com/questions/63166/bash-e-exits-when-let-or-expr-evaluates-to-0 + FFLAGS=-O$(($(date +%-d) % 5)) + FFLAGS=${FFLAGS/O0/g} + FFLAGS=${FFLAGS/O4/fast} + export FFLAGS + export TESTDIM=${{ matrix.testdim }} + cd "$ROOT_DIR"/fortran/tests && make ntest_${{ matrix.ikind }}.${{ matrix.solver }} + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make ntest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + 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 }} diff --git a/.github/workflows/test_nvfortran.yml b/.github/workflows/test_nvfortran.yml new file mode 100644 index 0000000000..10ee578af3 --- /dev/null +++ b/.github/workflows/test_nvfortran.yml @@ -0,0 +1,90 @@ +name: Test nvfortran + +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 3-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 nvfortran 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] + + 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 nvfortran + run: bash .github/scripts/install_nvfortran + + - 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 vtest_${{ matrix.ikind }}.${{ matrix.solver }} + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make vtest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + 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 }} diff --git a/.github/workflows/test_nvfortran_kunpeng.yml b/.github/workflows/test_nvfortran_kunpeng.yml new file mode 100644 index 0000000000..ae1229417e --- /dev/null +++ b/.github/workflows/test_nvfortran_kunpeng.yml @@ -0,0 +1,86 @@ +name: Test nvfortran on Kunpeng + +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 16 3-31/5 * *' + # 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 nvfortran tests + runs-on: [self-hosted, ARM64, kp] + continue-on-error: true + strategy: + fail-fast: false + matrix: + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + testdim: [small, 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: Miscellaneous setup + run: bash .github/scripts/misc_setup + + - name: Conduct the test + run: | + cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint -v && bash ./mlint -v + export FFLAGS=${{ matrix.fflags }} + export TESTDIM=${{ matrix.testdim }} + cd "$ROOT_DIR"/fortran/tests && make vtest_${{ matrix.ikind }}.${{ matrix.solver }} + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make vtest + + # - name: Store artifacts + # uses: actions/upload-artifact@v3.1.2 + # if: always() # Always run even if the workflow is canceled manually or due to overtime. + # with: + # 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 }} diff --git a/.github/workflows/test_nvfortran_pi.yml b/.github/workflows/test_nvfortran_pi.yml new file mode 100644 index 0000000000..b25bbc6f7b --- /dev/null +++ b/.github/workflows/test_nvfortran_pi.yml @@ -0,0 +1,94 @@ +name: Test nvfortran on Raspberry Pi + +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 16 3-31/5 * *' + # 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 nvfortran tests + runs-on: [self-hosted, ARM64, pi64] + continue-on-error: true + strategy: + fail-fast: false + matrix: + ikind: [i2, i8] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + fflags: [-O1, -O2, -O3, -g, -fast] + testdim: [small, 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: Miscellaneous setup + run: bash .github/scripts/misc_setup + + - name: Conduct the test + run: | + # Without the following lines, flint does not invoke vtest. No idea why. + NVDIR="/opt/nvidia/hpc_sdk/Linux_aarch64/" + if [[ -d "$NVDIR" ]] ; then NVBIN=$(find "$NVDIR" -wholename "*compilers/bin" -type d -print | sort | tail -n 1) ; fi + if [[ -n "$NVBIN" ]] ; then export PATH=$PATH:"$NVBIN" ; fi + cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint -v && bash ./mlint -v + # As of nvfortran 23.1, date_and_time() and random_number are not supported on Raspberry Pi + # 4B. Thus we have to disable the extensive tests, trying only the simple example. + #cd "$ROOT_DIR"/fortran/tests && export FFLAGS=${{ matrix.fflags }} && export TESTDIM=${{ matrix.testdim }} && make vtest_${{ matrix.ikind }}.${{ matrix.solver }} + printf "\n\n********************************************************************************" + printf "\nExtensive tests are skipped due to the unavailability of date_and_time() and random_number." + printf "\nSee the comments in the yml file.\nCheck whether they are available now." + printf "\n********************************************************************************\n\n" + cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make vtest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + 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 ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }} diff --git a/.github/workflows/test_sunf95.yml b/.github/workflows/test_sunf95.yml new file mode 100644 index 0000000000..05b87feeb5 --- /dev/null +++ b/.github/workflows/test_sunf95.yml @@ -0,0 +1,94 @@ +name: Test Oracle sunf95 + +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 7 * * *' + - cron: '0 7 * * *' # Reduce the frequency until NORM is fixed. + # 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 sunf95 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] + # As of 20230213, -fast fails often; seems due to stack overflow. How to force sunf95 to use + # heap only? + fflags: [-O1, -O2, -O3, -g] #, -fast] + testdim: [small, 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 Oracle sunf95 + run: bash .github/scripts/install_sunf95 + + - 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 stest_${{ matrix.ikind }}.${{ matrix.solver }} + # sunf95 cannot handle matrix indexing with TRUELOC or allocatable characters. + # cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }} && make stest + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + 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 }} diff --git a/.github/workflows/verify_archiva.yml b/.github/workflows/verify_archiva.yml new file mode 100644 index 0000000000..8f922fb029 --- /dev/null +++ b/.github/workflows/verify_archiva.yml @@ -0,0 +1,143 @@ +name: Verification, archiva + +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 1,9,17 * * *' + - cron: '0 22 * * *' + # Trigger the workflow manually + workflow_dispatch: + inputs: + git-ref: + description: Git Ref (Optional) + required: false + random-seed: + description: Random Seed (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} , seed {1}', inputs.git-ref, inputs.random-seed) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + test: + name: Verify PRIMA. + runs-on: ${{ matrix.os }} + continue-on-error: true + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + dim: [small, big, large] + version: [220208, 220227, 220513, 220531,220601,220616,220819,220926,221105,221128,230108,230305,230430,230509,230614,230804] + exclude: + - solver: lincoa + dim: large # very few problems but takes too much time to run + - solver: newuoa + dim: large # very few problems but takes too much time to run + + steps: + + - 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@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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }} + + - name: Set up MATLAB + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + cd(fullfile(root_dir, '.development/archiva/${{ matrix.version }}/matlab/tests')); + tz = 'Asia/Shanghai'; + dt = datetime('now', 'TimeZone', tz); + DayMonth = day(dt); + options = struct(); + options.verbose = true; + if ~isempty('${{ inputs.random-seed }}') + options.seed = str2num('${{ inputs.random-seed }}'); + else + options.seed = 10000*mod(year(dt), 100) + 100*week(dt) + hour(dt); + end + options.nr = 1; % Since the code will not change along the time, big nr is not needed. + options.no_classical = true; % Starting from 20230212, we do not verify the classical version for the archiva. + options + verify('${{ matrix.solver }}', '${{ matrix.dim }}', 'seq', options); % Zaikun 20230328: Conduct the verification in sequential to avoid the debugging pain. + delete([upper('${{ matrix.solver }}'), '_output.txt']); + delete('fort.6'); + cd(root_dir); setup clean; setup uninstall; + + # 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 ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }} diff --git a/.github/workflows/verify_big.yml b/.github/workflows/verify_big.yml new file mode 100644 index 0000000000..af491771f2 --- /dev/null +++ b/.github/workflows/verify_big.yml @@ -0,0 +1,111 @@ +name: Verification, big + +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 21 * * *' + # Trigger the workflow manually + workflow_dispatch: + inputs: + git-ref: + description: Git Ref (Optional) + required: false + random-seed: + description: Random Seed (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} , seed {1}', inputs.git-ref, inputs.random-seed) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + test: + name: Verify PRIMA. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + dim: [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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }} + + - name: Set up MATLAB + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + cd(fullfile(root_dir, 'matlab/tests')); + options = struct(); + options.verbose = true; + if ~isempty('${{ inputs.random-seed }}') + options.seed = str2num('${{ inputs.random-seed }}'); + else + copyfile('private/year_week.m', cd()); + options.seed = year_week('Asia/Shanghai'); + end + if strcmp('${{ matrix.solver }}', 'bobyqa') || strcmp('${{ matrix.solver }}', 'lincoa'), options.nr = 4; end; + options + verify('${{ matrix.solver }}', '${{ matrix.dim }}', options); + cd(root_dir); setup path; setup clean; setup uninstall % Test that `setup` works properly. + + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/${{ matrix.solver }}_verify_prima/*start* + /tmp/${{ matrix.solver }}_verify_prima/*end* diff --git a/.github/workflows/verify_large.yml b/.github/workflows/verify_large.yml new file mode 100644 index 0000000000..46bbc7456c --- /dev/null +++ b/.github/workflows/verify_large.yml @@ -0,0 +1,113 @@ +name: Verification, large + +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 13 * * *' + # Trigger the workflow manually + workflow_dispatch: + inputs: + git-ref: + description: Git Ref (Optional) + required: false + random-seed: + description: Random Seed (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} , seed {1}', inputs.git-ref, inputs.random-seed) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + test: + name: Verify PRIMA. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + solver: [newuoa, cobyla, bobyqa, uobyqa] # With the blacklist, there is no large problem for lincoa + dim: [large] + + 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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }} + + - name: Set up MATLAB + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + cd(fullfile(root_dir, 'matlab/tests')); + options = struct(); + options.verbose = true; + options.nr = 5; + if strcmp('${{ matrix.solver }}', 'lincoa'), options.nr = 1; end; + options.no_classical = true; % We do not test the classical mode on "large" problems. + if ~isempty('${{ inputs.random-seed }}') + options.seed = str2num('${{ inputs.random-seed }}'); + else + copyfile('private/year_week.m', cd()); + options.seed = year_week('Asia/Shanghai'); + end + options + verify('${{ matrix.solver }}', '${{ matrix.dim }}', options); + cd(root_dir); setup path; setup clean; setup uninstall % Test that `setup` works properly. + + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/${{ matrix.solver }}_verify_prima/*start* + /tmp/${{ matrix.solver }}_verify_prima/*end* diff --git a/.github/workflows/verify_small.yml b/.github/workflows/verify_small.yml new file mode 100644 index 0000000000..baa05f0acf --- /dev/null +++ b/.github/workflows/verify_small.yml @@ -0,0 +1,110 @@ +name: Verification, small + +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 15 * * *' + # Trigger the workflow manually + workflow_dispatch: + inputs: + git-ref: + description: Git Ref (Optional) + required: false + random-seed: + description: Random Seed (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} , seed {1}', inputs.git-ref, inputs.random-seed) || '' }} + +env: + GFORTRAN_VERSION: 13 + +jobs: + test: + name: Verify PRIMA. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + matlab: [latest] + solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa] + dim: [small] + + 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: Clone MatCUTEst + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + repository: matcutest/matcutest_compiled + path: matcutest + + - name: Link gfortran for MATLAB on Linux + if: startsWith(matrix.os, 'ubuntu') + run: bash .github/scripts/link_gfortran ${{ env.GFORTRAN_VERSION }} + + - name: Check MATLAB + id: check_matlab + run: if type 'matlab' &> /dev/null ; then echo "::set-output name=has_matlab::true" ; fi + + - name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September + uses: actions/cache@v3.3.2 + with: + path: ${{ runner.tool_cache }}/MATLAB + key: ${{ matrix.os }}-${{ matrix.matlab }} + + - name: Set up MATLAB + if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }} + uses: matlab-actions/setup-matlab@v2-beta + with: + release: ${{ matrix.matlab }} + + - name: Conduct the test + uses: matlab-actions/run-command@v1.2.1 + with: + command: | + ver; + root_dir = pwd(); + + cd(fullfile(root_dir, 'matcutest')); install(); which macup + + cd(fullfile(root_dir, 'matlab/tests')); + options = struct(); + options.verbose = true; + if ~isempty('${{ inputs.random-seed }}') + options.seed = str2num('${{ inputs.random-seed }}'); + else + copyfile('private/year_week.m', cd()); + options.seed = year_week('Asia/Shanghai'); + end + options + verify('${{ matrix.solver }}', '${{ matrix.dim }}', options); + cd(root_dir); setup path; setup clean; setup uninstall % Test that `setup` works properly. + + + - name: Store artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + path: | + /tmp/${{ matrix.solver }}_verify_prima/*start* + /tmp/${{ matrix.solver }}_verify_prima/*end*