-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various fixes for single-precision and switch to new FIELD_API #4
Changes from all commits
da039d3
670196c
b391d88
b8424d2
4aadea6
2c68e29
12abb3d
70a369c
f6e9889
313d1db
86dd918
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
|
||
KEY=GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | ||
version=2023.2.0 | ||
KEY=GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | ||
wget https://apt.repos.intel.com/intel-gpg-keys/$KEY | ||
sudo apt-key add $KEY | ||
rm $KEY | ||
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | ||
sudo apt-get update | ||
sudo apt-get install \ | ||
intel-oneapi-compiler-fortran \ | ||
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic \ | ||
intel-oneapi-mpi \ | ||
intel-oneapi-mpi-devel \ | ||
intel-oneapi-mkl | ||
intel-oneapi-compiler-fortran-$version \ | ||
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-$version \ | ||
intel-oneapi-mpi-devel-2021.10.0 \ | ||
intel-oneapi-mkl-$version |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# (C) Copyright 2020- ECMWF. | ||
# | ||
# This software is licensed under the terms of the Apache Licence Version 2.0 | ||
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
# In applying this licence, ECMWF does not waive the privileges and immunities | ||
# granted to it by virtue of its status as an intergovernmental organisation | ||
# nor does it submit to any jurisdiction. | ||
|
||
|
||
ecbuild_find_package(NAME field_api QUIET) | ||
set(clone_field_api TRUE) | ||
|
||
## Test if field_api was cloned by ecWAM | ||
if(field_api_FOUND) | ||
cmake_path(RELATIVE_PATH field_api_DIR BASE_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_VARIABLE path_var) | ||
cmake_path(GET path_var PARENT_PATH parent_path) | ||
string(FIND ${parent_path} "../" result_var) | ||
|
||
# If field_api is found but was not cloned by ecWAM, clone_field_api is set to FALSE | ||
string(COMPARE EQUAL ${result_var} "-1" clone_field_api) | ||
endif() | ||
|
||
if( clone_field_api ) | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
field_api | ||
GIT_REPOSITORY https://github.com/ecmwf-ifs/field_api.git | ||
GIT_TAG v0.2.1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [no action] Eventually we might want a mechanism to define this in the top-level CMakeLists.txt, but not needed for this PR, I think |
||
OVERRIDE_FIND_PACKAGE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This requires CMake version 3.24 i.e. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks a lot for pointing this out! FIELD_API itself requires CMake 3.25 for fixes to the cmake There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the dependency on 3.25 is only due to the OpenACC fixes, I'd argue it would be better to simply add the following workaround and make that a less strict requirement: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think 3.24 is my current preference, using @reuterbal 's suggestion to adapt FIELD_API, as Leonardo currently uses cmake 3.24 as latest version. Both LUMI and our own HPC have 3.25 however. |
||
) | ||
|
||
set(FIELD_API_ENABLE_TESTS OFF) | ||
set(FIELD_API_ENABLE_ACC OFF) | ||
FetchContent_MakeAvailable(field_api) | ||
endif() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Source me to get the correct configure/build/run environment | ||
|
||
# Store tracing and disable (module is *way* too verbose) | ||
{ tracing_=${-//[^x]/}; set +x; } 2>/dev/null | ||
|
||
module_load() { | ||
echo "+ module load $*" | ||
module load $* | ||
} | ||
module_unload() { | ||
echo "+ module unload $*" | ||
module unload $* | ||
} | ||
module_purge() { | ||
echo "+ module purge" | ||
module purge | ||
} | ||
|
||
# Delete existing modules | ||
module_purge | ||
|
||
# Load modules | ||
module_load prgenv/nvidia | ||
module_load nvidia/22.11 | ||
module_load cmake/3.25.2 | ||
module_load python3/3.10.10-01 | ||
module_load hpcx-openmpi/2.10.0 | ||
|
||
# Restore tracing to stored setting | ||
{ if [[ -n "$tracing_" ]]; then set -x; else set +x; fi } 2>/dev/null | ||
|
||
export ECBUILD_TOOLCHAIN="./toolchain.cmake" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# (C) Copyright 2022- ECMWF. | ||
# | ||
# This software is licensed under the terms of the Apache Licence Version 2.0 | ||
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
# In applying this licence, ECMWF does not waive the privileges and immunities | ||
# granted to it by virtue of its status as an intergovernmental organisation | ||
# nor does it submit to any jurisdiction. | ||
|
||
#################################################################### | ||
# OpenMP FLAGS | ||
#################################################################### | ||
|
||
# Note: OpenMP_Fortran_FLAGS gets overwritten by the FindOpenMP module | ||
# unless its stored as a cache variable | ||
set( OpenMP_Fortran_FLAGS "-mp=bind,allcores,numa" CACHE STRING "" FORCE) | ||
|
||
#################################################################### | ||
# COMMON FLAGS | ||
#################################################################### | ||
|
||
set(ECBUILD_Fortran_FLAGS "-Mframe") | ||
set(ECBUILD_Fortran_FLAGS "${ECBUILD_Fortran_FLAGS} -Mbyteswapio") | ||
set(ECBUILD_Fortran_FLAGS "${ECBUILD_Fortran_FLAGS} -Mstack_arrays") | ||
set(ECBUILD_Fortran_FLAGS "${ECBUILD_Fortran_FLAGS} -Mrecursive") | ||
set(ECBUILD_Fortran_FLAGS "${ECBUILD_Fortran_FLAGS} -Kieee") | ||
set(ECBUILD_Fortran_FLAGS "${ECBUILD_Fortran_FLAGS} -Mdaz") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we build ecWAM and run
FetchContent
on FIELD_API, the cache variablefield_api_FOUND
is set to TRUE. If we then runmake clean
and re-configure the build without deleting the CMake cache,field_api_FOUND
will still be true but the FIELD_API builddir will be empty and the build will fail at compile-time when trying to uselibfield_api
.If on the other hand
field_api_FOUND
is TRUE not because ecWAM cloned FIELD_API but because it is coming from a bundle or system installation, then the above mechanism ensures we don't runFetchContent
on FIELD_API.