-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Intel tests to devel branch (#1547)
Add the configuration files to run tests with an Intel compiler. Add an environment variable `PYCCEL_DEFAULT_COMPILER` which specifies the default compiler. There are 3 failing tests due to: - passing NaN as an argument - #1540 Additionally some array tests were modified to use `isclose` for comparisons instead of `np.all_equal` these tests all involve divisions and should have been using `isclose` anyway. This is related to #542 but does not fully fix the issue as it only adds Intel. --------- Co-authored-by: Yaman Güçlü <yaman.guclu@gmail.com>
- Loading branch information
1 parent
58bcff4
commit 17c6819
Showing
13 changed files
with
202 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: 'Intel installation commands' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: update the package list | ||
run: | ||
sudo apt-get update | ||
shell: bash | ||
- name: Restore cached Intel | ||
id: cache-intel-restore | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
/opt/intel/oneapi/ | ||
key: ${{ runner.os }}-intel-2023 | ||
restore-keys: | | ||
${{ runner.os }}-intel- | ||
- name: Install Intel OneAPI | ||
if: steps.cache-intel-restore.outputs.cache-hit != 'true' | ||
run: | | ||
# See https://github.com/oneapi-src/oneapi-ci | ||
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | ||
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | ||
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | ||
sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/oneAPI.list" -o APT::Get::List-Cleanup="0" | ||
sudo apt-get install -y intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-openmp intel-oneapi-mkl intel-oneapi-mpi-devel | ||
shell: bash | ||
- name: Save Intel environment variables | ||
run: | | ||
source /opt/intel/oneapi/setvars.sh | ||
echo "$PATH" > $GITHUB_PATH | ||
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV | ||
echo "LIBRARY_PATH=$LIBRARY_PATH" >> $GITHUB_ENV | ||
echo "ONEAPI_ROOT=$ONEAPI_ROOT" >> $GITHUB_ENV | ||
echo "MANPATH=$MANPATH" >> $GITHUB_ENV | ||
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV | ||
echo "CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH" >> $GITHUB_ENV | ||
echo "TBB_ROOT=$TBB_ROOT" >> $GITHUB_ENV | ||
echo "ONEAPI_ROOT=$ONEAPI_ROOT" >> $GITHUB_ENV | ||
echo "ACL_BOARD_VENDOR_PATH=$ACL_BOARD_VENDOR_PATH" >> $GITHUB_ENV | ||
echo "FPGA_VARS_DIR=$FPGA_VARS_DIR" >> $GITHUB_ENV | ||
echo "I_MPI_ROOT=$I_MPI_ROOT" >> $GITHUB_ENV | ||
echo "FI_PROVIDER_PATH=$FI_PROVIDER_PATH" >> $GITHUB_ENV | ||
echo "DIAGUTIL_PATH=$DIAGUTIL_PATH" >> $GITHUB_ENV | ||
echo "GDB_INFO=$GDB_INFO" >> $GITHUB_ENV | ||
echo "CMPLR_ROOT=$CMPLR_ROOT" >> $GITHUB_ENV | ||
echo "INFOPATH=$INFOPATH" >> $GITHUB_ENV | ||
echo "OCL_ICD_FILENAMES=$OCL_ICD_FILENAMES" >> $GITHUB_ENV | ||
echo "CLASSPATH=$CLASSPATH" >> $GITHUB_ENV | ||
echo "INTELFPGAOCLSDKROOT=$INTELFPGAOCLSDKROOT" >> $GITHUB_ENV | ||
echo "MKLROOT=$MKLROOT" >> $GITHUB_ENV | ||
echo "NLSPATH=$NLSPATH" >> $GITHUB_ENV | ||
echo "INTEL_PYTHONHOME=$INTEL_PYTHONHOME" >> $GITHUB_ENV | ||
echo "CPATH=$CPATH" >> $GITHUB_ENV | ||
mpicc --version | ||
shell: bash | ||
- name: Save Intel Cache | ||
id: cache-intel-save | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: | | ||
/opt/intel/oneapi/ | ||
key: ${{ steps.cache-intel-restore.outputs.cache-primary-key }} | ||
- name: Install Valgrind | ||
run: | ||
sudo apt-get install valgrind | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: Intel unit tests | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
python_version: | ||
required: true | ||
type: string | ||
ref: | ||
required: false | ||
type: string | ||
check_run_id: | ||
required: false | ||
type: string | ||
pr_repo: | ||
required: false | ||
type: string | ||
push: | ||
branches: devel | ||
|
||
env: | ||
COMMIT: ${{ inputs.ref || github.event.ref }} | ||
PEM: ${{ secrets.BOT_PEM }} | ||
GITHUB_RUN_ID: ${{ github.run_id }} | ||
GITHUB_CHECK_RUN_ID: ${{ inputs.check_run_id }} | ||
PR_REPO: ${{ inputs.pr_repo || github.repository }} | ||
PYCCEL_DEFAULT_COMPILER: 'intel' | ||
|
||
jobs: | ||
Python_version_picker: | ||
runs-on: ubuntu-latest | ||
if: github.event_name != 'push' || github.repository == 'pyccel/pyccel' | ||
outputs: | ||
python_version: ${{ steps.set-python_version.outputs.python_version }} | ||
steps: | ||
- if: github.event_name == 'push' | ||
run: | | ||
echo "version=3.9" >> $GITHUB_ENV | ||
shell: bash | ||
- id: dispatch-matrix | ||
if: github.event_name == 'workflow_dispatch' | ||
run: | | ||
echo "version=${{ inputs.python_version }}" >> $GITHUB_ENV | ||
shell: bash | ||
- id: set-python_version | ||
run: | | ||
echo "python_version=$version" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
Intel: | ||
|
||
runs-on: ubuntu-latest | ||
name: Unit tests | ||
needs: Python_version_picker | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.COMMIT }} | ||
repository: ${{ env.PR_REPO }} | ||
- name: Set up Python ${{ needs.Python_version_picker.outputs.python_version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ needs.Python_version_picker.outputs.python_version }} | ||
- name: "Setup" | ||
id: token | ||
run: | | ||
pip install jwt requests | ||
python ci_tools/setup_check_run.py | ||
- name: Install dependencies | ||
uses: ./.github/actions/intel_install | ||
- name: Install Pyccel with tests | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install .[test] | ||
shell: bash | ||
- name: Coverage install | ||
uses: ./.github/actions/coverage_install | ||
- name: Fortran/C tests with pytest | ||
id: f_c_pytest | ||
timeout-minutes: 60 | ||
uses: ./.github/actions/pytest_run | ||
- name: Python tests with pytest | ||
id: python_pytest | ||
timeout-minutes: 20 | ||
uses: ./.github/actions/pytest_run_python | ||
- name: Parallel tests with pytest | ||
id: parallel | ||
timeout-minutes: 20 | ||
uses: ./.github/actions/pytest_parallel | ||
- name: Test with valgrind for memory leaks | ||
id: valgrind | ||
uses: ./.github/actions/valgrind_run | ||
- name: Collect coverage information | ||
continue-on-error: True | ||
uses: ./.github/actions/coverage_collection | ||
- name: Save code coverage report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage-artifact | ||
path: .coverage | ||
retention-days: 1 | ||
- name: "Post completed" | ||
if: always() | ||
run: | ||
python ci_tools/complete_check_run.py ${{ steps.f_c_pytest.outcome }} ${{ steps.python_pytest.outcome }} ${{ steps.parallel.outcome }} ${{ steps.valgrind.outcome }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters