Skip to content

Commit a89bef5

Browse files
committed
ci:oneapi: use cache
ci:oneapi: need perm
1 parent 94bc6d8 commit a89bef5

File tree

5 files changed

+72
-14
lines changed

5 files changed

+72
-14
lines changed

.github/workflows/oneapi-linux.yml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
name: intel-oneapi
1+
name: oneapi-linux
22

33
env:
4-
CC: icc
5-
FC: ifx
4+
LINUX_CPP_COMPONENTS: intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
5+
LINUX_FORTRAN_COMPONENTS: intel-oneapi-compiler-fortran
6+
LINUX_MKL_COMPONENTS: "intel-oneapi-mkl intel-oneapi-mkl-devel"
7+
LINUX_MPI_COMPONENTS: "intel-oneapi-mpi intel-oneapi-mpi-devel"
8+
# https://github.com/oneapi-src/oneapi-ci/blob/master/.github/workflows/build_all.yml
9+
CTEST_NO_TESTS_ACTION: error
610

711
on:
812
push:
913
paths:
14+
- "**.c"
15+
- "**.f"
16+
- "**.F"
1017
- "**.f90"
1118
- "**.F90"
1219
- "**.cmake"
@@ -16,33 +23,53 @@ on:
1623

1724
jobs:
1825

19-
linux-intel-oneapi:
26+
linux:
2027
runs-on: ubuntu-latest
2128
timeout-minutes: 10
2229

2330
steps:
2431
- uses: actions/checkout@v4
2532

26-
- name: Intel Apt repository
27-
timeout-minutes: 1
33+
- name: cache install oneAPI
34+
id: cache-install
35+
uses: actions/cache@v3
36+
with:
37+
path: |
38+
/opt/intel/oneapi
39+
key: install-apt
40+
41+
- name: non-cache install oneAPI
42+
if: steps.cache-install.outputs.cache-hit != 'true'
43+
timeout-minutes: 10
2844
run: |
2945
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
3046
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
3147
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
3248
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
3349
sudo apt-get update
3450
35-
- name: Install Intel oneAPI
36-
timeout-minutes: 5
37-
run: sudo apt-get install intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-mpi intel-oneapi-mpi-devel ninja-build
51+
- name: non-cache install oneAPI
52+
if: steps.cache-install.outputs.cache-hit != 'true'
53+
timeout-minutes: 10
54+
run: |
55+
sh -c .github/workflows/oneapi_setup_apt_repo_linux.sh
56+
sudo apt install ${{ env.LINUX_CPP_COMPONENTS }} ${{ env.LINUX_FORTRAN_COMPONENTS }} ${{ env.LINUX_MPI_COMPONENTS }}
3857
3958
- name: Setup Intel oneAPI environment
4059
run: |
4160
source /opt/intel/oneapi/setvars.sh
4261
printenv >> $GITHUB_ENV
4362
44-
- name: Debug workflow
63+
- name: install Ninja
64+
run: sudo apt install ninja-build
65+
# install ninja needs to be own step as not cached by design
66+
67+
- name: Release workflow
4568
run: cmake --workflow --preset debug
4669

4770
- name: Release workflow
4871
run: cmake --workflow --preset release
72+
73+
- name: exclude unused files from cache
74+
if: steps.cache-install.outputs.cache-hit != 'true'
75+
run: sh -c .github/workflows/oneapi_cache_exclude_linux.sh
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# SPDX-FileCopyrightText: 2020 Intel Corporation
4+
#
5+
# SPDX-License-Identifier: MIT
6+
7+
#shellcheck disable=SC2010
8+
LATEST_VERSION=$(ls -1 /opt/intel/oneapi/compiler/ | grep -v latest | sort | tail -1)
9+
10+
sudo rm -rf /opt/intel/oneapi/compiler/"$LATEST_VERSION"/linux/compiler/lib/ia32_lin
11+
sudo rm -rf /opt/intel/oneapi/compiler/"$LATEST_VERSION"/linux/bin/ia32
12+
sudo rm -rf /opt/intel/oneapi/compiler/"$LATEST_VERSION"/linux/lib/emu
13+
sudo rm -rf /opt/intel/oneapi/compiler/"$LATEST_VERSION"/linux/lib/oclfpga
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# SPDX-FileCopyrightText: 2020 Intel Corporation
4+
#
5+
# SPDX-License-Identifier: MIT
6+
7+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
8+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
9+
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
10+
sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/oneAPI.list" -o APT::Get::List-Cleanup="0"

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ Build and self-test:
1717
cmake --workflow --preset default
1818
```
1919

20+
or step-by-step
21+
22+
```sh
23+
cmake -Bbuild
24+
25+
cmake --build build
26+
27+
ctest --test-dir build -V
28+
```
29+
2030
This repo also gives an example of a workaround for OpenMPI 4.x and mpiexec race condition with large CPU count by setting TMPDIR to a short path name so as not to exceed 100 characters for UNIX sockets.
2131

2232
## Message Passing
@@ -25,7 +35,7 @@ Pass data between two MPI threads.
2535
In this usage, MPI_Recv blocks waiting for MPI_Send
2636

2737
```sh
28-
mpirun -np 2 mpi/mpi_pass
38+
mpiexec -np 2 mpi/mpi_pass
2939
```
3040

3141
## Notes

cmake/compilers.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@ message(STATUS "MPI compile flags: ${MPI_Fortran_COMPILER_FLAGS}")
1717
message(STATUS "MPI link flags: ${MPI_Fortran_LINK_FLAGS}")
1818

1919
if(NOT mpi_f08_mod)
20-
message(FATAL_ERROR "Fortran MPI ${MPI_Fortran_VERSION} doesn't have MPI-3 Fortran mpi_f08.mod, searched using ${MPI_Fortran_INCLUDE_DIRS}")
20+
message(WARNING "Fortran MPI ${MPI_Fortran_VERSION} doesn't have MPI-3 Fortran mpi_f08.mod, searched using ${MPI_Fortran_INCLUDE_DIRS}")
2121
endif()
2222

2323
include(${CMAKE_CURRENT_LIST_DIR}/openmpi.cmake)
2424

2525
set(CMAKE_REQUIRED_INCLUDES ${MPI_Fortran_INCLUDE_DIRS})
2626
set(CMAKE_REQUIRED_LIBRARIES ${MPI_Fortran_LIBRARIES})
2727

28-
29-
3028
# sometimes factory FindMPI.cmake doesn't define this
3129
check_source_compiles(Fortran
3230
[=[

0 commit comments

Comments
 (0)