Skip to content

Commit

Permalink
set conditions to run mkl test in mkl action file
Browse files Browse the repository at this point in the history
  • Loading branch information
iulusoy committed Mar 28, 2024
1 parent be008ef commit 99c8b3b
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 39 deletions.
24 changes: 20 additions & 4 deletions .github/actions/test-mkl/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,25 @@ runs:
working-directory: test
shell: bash
run: |
if [[ "${{ inputs.compiler }}" =~ "intel" ]] && [[ "${{ inputs.install_mkl }}" == "true" ]] && ([[ "${{ inputs.version }}" != "2021.5" ]] && [[ "$runner.os" != "macOS" ]]); then
# check settings if mkl tests should be run
# mkl cannot be installed for 2021.5 on macos;
# and for macos-14 also not 2021.6-2021.9
mkl_tests=true
echo "$RUNNER_OS"
if [[ "${{ inputs.compiler }}" =~ "gcc" ]]; then mkl_tests=false; fi
if [[ "${{ inputs.install_mkl }}" == "false" ]]; then mkl_tests=false; fi
if [[ "${{ inputs.version }}" == "2021.5" ]] && [[ "$RUNNER_OS" == "macOS" ]]; then mkl_tests=false; fi
if [[ "$RUNNER_OS" == "macOS" ]]; then
macos_version=$(sw_vers | grep "ProductVersion")
echo "$macos_version"
if [[ "$macos_version" =~ "14." ]] && [[ "${{ inputs.version }}" == '2021.6' || "${{ inputs.version }}" == '2021.7' || "${{ inputs.version }}" == '2021.7.1' || "${{ inputs.version }}" == '2021.8' ]]; then
mkl_tests=false
fi
fi
# # now we know if we should, run the tests
if $mkl_tests; then
if [ "$RUNNER_OS" == "macOS" ]; then
# required for macOS 11, intel-classic 2021.1-2021.10
# required for macOS 12, intel-classic 2021.1, 2021.4, 2021.6, 2021.10
# for all others, setting DYLD path through environment works correctly
MKLLIB="$MKLROOT/lib"
export DYLD_LIBRARY_PATH="$MKLLIB:$DYLD_LIBRARY_PATH"
elif [ "$RUNNER_OS" == "Linux" ]; then
Expand All @@ -35,4 +49,6 @@ runs:
output=$(./hw_mkl '2>&1')
[[ "$output" == *"hello world 9.00000000000000"* ]] && echo "$output" || (echo "Unexpected Fortran program 'hw_mkl' output: $output"; exit 1)
rm hw_mkl
else
echo "Skipping MKL tests"
fi
13 changes: 1 addition & 12 deletions .github/compat/long_compat.csv
Original file line number Diff line number Diff line change
@@ -1,13 +1,2 @@
runner,compiler,version,support
macos-14,intel-classic,2021.1.2,
macos-14,intel-classic,2021.1,✓
macos-14,intel-classic,2021.10,✓
macos-14,intel-classic,2021.2,✓
macos-14,intel-classic,2021.3,✓
macos-14,intel-classic,2021.4,✓
macos-14,intel-classic,2021.5,✓
macos-14,intel-classic,2021.6,✓
macos-14,intel-classic,2021.7.1,✓
macos-14,intel-classic,2021.7,✓
macos-14,intel-classic,2021.8,✓
macos-14,intel-classic,2021.9,✓
macos-14,intel-classic,2021.10,✓
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ jobs:
version: ${{ matrix.toolchain.version }}

- name: Test MKL libraries
if: steps.setup-fortran.outcome == 'success' && runner.os != 'windows'
# we could also exclude 2021.5 for all macos versions here
# this needs refactoring at some point - should the install
# fail if no mkl version exists?
if: steps.setup-fortran.outcome == 'success' && runner.os != 'windows'
uses: ./.github/actions/test-mkl
with:
compiler: ${{ matrix.toolchain.compiler }}
Expand Down
55 changes: 33 additions & 22 deletions setup-fortran.sh
Original file line number Diff line number Diff line change
Expand Up @@ -295,20 +295,39 @@ intel_version_map_m()
mkl_version_map_m()
{
local intel_version=$1
case $intel_version in
2021.1.0 | 2021.2.0 | 2021.3.0 | 2021.4.0 | 2022.2.0 | 2022.3.0 | 2022.3.1 | 2023.0.0 )
mkl_version=2022.2.0
;;
2022.1.0)
mkl_version=""
;;
2023.1.0)
mkl_version=2023.1.0
;;
*)
mkl_version=2023.2.0
;;
esac
macos_version=$(sw_vers | grep "ProductVersion")
echo "Found macos version $macos_version"
if [[ "$macos_version" == *"14"* ]]; then
echo "MacOS 14 requires different basekit versions to work"
case $intel_version in
# compiler versions 2021.1, 2021.2, 2021.3, 2021.4, 2021.10 work with latest basekit
2021.1.0 | 2021.2.0 | 2021.3.0 | 2021.4.0 | 2023.2.0)
mkl_version=2023.2.0
;;
# compiler versions 2021.5, 2021.6, 2021.7, 2021.7.1, 2021.8, 2021.9 work with other basekits
2023.1.0)
mkl_version=2022.2.0
;;
*)
mkl_version=""
;;
esac
else
case $intel_version in
2021.1.0 | 2021.2.0 | 2021.3.0 | 2021.4.0 | 2022.2.0 | 2022.3.0 | 2022.3.1 | 2023.0.0 )
mkl_version=2022.2.0
;;
2022.1.0)
mkl_version=""
;;
2023.1.0)
mkl_version=2023.1.0
;;
*)
mkl_version=2023.2.0
;;
esac
fi
}

intel_version_map_w()
Expand Down Expand Up @@ -445,14 +464,6 @@ install_intel_dmg()
;;
esac

# for mac-os 14, use only the latest basekit
macos_version = $(sw_vers)
echo "Found macos version $macos_version"
if [[ $macos_version == *"14"* ]]; then
echo "setting latest basekit for macos 14"
mkl_version="2023.2.0"
fi

case $mkl_version in
2022.2.0)
MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18675/m_BaseKit_p_2022.2.0.226_offline.dmg
Expand Down

0 comments on commit 99c8b3b

Please sign in to comment.