Skip to content

Commit

Permalink
Merge branch 'release/0.39.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
wdeconinck committed Sep 18, 2024
2 parents 51e389e + f411efa commit 59efc06
Show file tree
Hide file tree
Showing 92 changed files with 3,408 additions and 586 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ jobs:

- name: macos
# Xcode compiler requires empty environment variables, so we pass null (~) here
os: macos-12
compiler: clang-14
os: macos-14
compiler: clang-15
compiler_cc: ~
compiler_cxx: ~
compiler_fc: gfortran-11
compiler_fc: gfortran-13
caching: true
coverage: false
cmake_options: -DMPI_SLOTS=4
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html

## [Unreleased]

## [0.39.0] - 2024-09-18

### Added
- Add HIC abstraction layer for HIP and CUDA by @wdeconinck in https://github.com/ecmwf/atlas/pull/219
- Support for HIP via HIC
- Add regional interpolation by @benjaminmenetrier in https://github.com/ecmwf/atlas/pull/215
- Pack vector components into higher-rank vector fields. by @odlomax in https://github.com/ecmwf/atlas/pull/218

### Fixed
- Fix missing header in FieldImpl.h by @tehrengruber in https://github.com/ecmwf/atlas/pull/214
- Bug fixes to vector interpolation with StructuredColumns and spherical vector interpolation by @MarekWlasak in https://github.com/ecmwf/atlas/pull/222


## [0.38.1] - 2024-07-15

### Fixed
Expand Down Expand Up @@ -551,6 +564,7 @@ Fix StructuredInterpolation2D with retry for failed stencils
## 0.13.0 - 2018-02-16

[Unreleased]: https://github.com/ecmwf/atlas/compare/master...develop
[0.39.0]: https://github.com/ecmwf/atlas/compare/0.38.1...0.39.0
[0.38.1]: https://github.com/ecmwf/atlas/compare/0.38.0...0.38.1
[0.38.0]: https://github.com/ecmwf/atlas/compare/0.37.0...0.38.0
[0.37.0]: https://github.com/ecmwf/atlas/compare/0.36.0...0.37.0
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ ecbuild_add_option( FEATURE ECKIT_DEVELOP
DESCRIPTION "Used to enable new features or API depending on eckit develop branch, not yet in a tagged release"
DEFAULT OFF )

add_subdirectory( hic )
find_package(hic)


include( features/BOUNDSCHECKING )
include( features/FORTRAN )
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.38.1
0.39.0
1 change: 1 addition & 0 deletions cmake/atlas-import.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if( atlas_HAVE_FORTRAN )
endif()

find_dependency( atlas_io HINTS ${CMAKE_CURRENT_LIST_DIR}/../atlas_io @atlas_io_DIR@ @atlas_io_BINARY_DIR@ )
find_dependency( hic HINTS ${CMAKE_CURRENT_LIST_DIR}/../hic @hic_DIR@ @hic_BINARY_DIR@ )

## Eigen3
set( Eigen3_HINT @Eigen3_DIR@ )
Expand Down
5 changes: 3 additions & 2 deletions cmake/atlas_compile_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

if( CMAKE_CXX_COMPILER_ID MATCHES Cray )


ecbuild_add_cxx_flags("-hnomessage=3140" NAME atlas_cxx_disable_warnings ) # colon separated numbers
if( NOT CMAKE_CXX_COMPILER_ID MATCHES CrayClang )
ecbuild_add_cxx_flags("-hnomessage=3140" NAME atlas_cxx_disable_warnings ) # colon separated numbers
endif()
ecbuild_add_fortran_flags("-hnomessage=3140" NAME atlas_fortran_disable_warnings ) # colon separated numbers

# CC-3140 crayc++: WARNING File = atlas/functionspace/NodeColumns.cc, Line = 1, Column = 1
Expand Down
28 changes: 17 additions & 11 deletions cmake/atlas_host_device.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# granted to it by virtue of its status as an intergovernmental organisation nor
# does it submit to any jurisdiction.

function( create_cuda_wrapper variable )
function( create_hic_wrapper variable )
set( options "" )
set( single_value_args SOURCE )
set( multi_value_args "" )
Expand All @@ -17,18 +17,24 @@ function( create_cuda_wrapper variable )
get_filename_component(name ${_PAR_SOURCE} NAME)
get_filename_component(abspath ${_PAR_SOURCE} ABSOLUTE)

if( HAVE_CUDA )
set( extension "cu" )
elseif( HAVE_HIP )
set( extension "hip" )
endif()

if( directory )
set(cuda_wrapper ${CMAKE_CURRENT_BINARY_DIR}/${directory}/${base}.cu)
set(hic_wrapper ${CMAKE_CURRENT_BINARY_DIR}/${directory}/${base}.${extension})
else()
set(cuda_wrapper ${CMAKE_CURRENT_BINARY_DIR}/${base}.cu)
set(hic_wrapper ${CMAKE_CURRENT_BINARY_DIR}/${base}.${extension})
endif()
set(${variable} ${cuda_wrapper} PARENT_SCOPE)
set(${variable} ${hic_wrapper} PARENT_SCOPE)
set(content
"
#include \"atlas/${directory}/${name}\"
")
if( ${abspath} IS_NEWER_THAN ${cuda_wrapper} )
file(WRITE ${cuda_wrapper} "${content}")
if( ${abspath} IS_NEWER_THAN ${hic_wrapper} )
file(WRITE ${hic_wrapper} "${content}")
endif()
endfunction()

Expand All @@ -40,12 +46,12 @@ function( atlas_host_device srclist )
set( multi_value_args SOURCES )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${ARGN} )

if( ATLAS_GRIDTOOLS_STORAGE_BACKEND_CUDA )
set( use_cuda_srclist ${_PAR_SOURCES} )
if( HAVE_GPU )
set( use_hic_srclist ${_PAR_SOURCES} )

foreach( src ${use_cuda_srclist} )
create_cuda_wrapper( cuda_wrapper SOURCE ${src} )
list( APPEND ${srclist} ${cuda_wrapper} )
foreach( src ${use_hic_srclist} )
create_hic_wrapper( hic_wrapper SOURCE ${src} )
list( APPEND ${srclist} ${hic_wrapper} )
ecbuild_list_exclude_pattern( LIST ${srclist} REGEX ${src} )
endforeach()

Expand Down
10 changes: 9 additions & 1 deletion cmake/features/ACC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
if( atlas_HAVE_ATLAS_FIELD )

set( ATLAS_ACC_CAPABLE FALSE )
if( HAVE_CUDA )
if( HAVE_GPU )
if( CMAKE_Fortran_COMPILER_ID MATCHES "PGI|NVHPC" )
set( ATLAS_ACC_CAPABLE TRUE )
else()
find_package(OpenACC COMPONENTS C Fortran)
if(OpenACC_Fortran_FOUND AND OpenACC_C_FOUND)
set( ATLAS_ACC_CAPABLE TRUE )
endif()
endif()
endif()

Expand All @@ -22,6 +27,9 @@ if( atlas_HAVE_ACC )
if( NOT ACC_C_COMPILER )
ecbuild_error( "Could not find OpenACC capable C compiler" )
endif()
else()
set( ACC_Fortran_FLAGS ${OpenACC_Fortran_FLAGS} )
set( ACC_C_FLAGS ${OpenACC_C_FLAGS} )
endif()
endif()

Expand Down
42 changes: 32 additions & 10 deletions cmake/features/CUDA.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@

ecbuild_add_option( FEATURE CUDA
DESCRIPTION "Enable CUDA support"
DEFAULT OFF
)
# ecbuild_add_option( FEATURE CUDA
# DESCRIPTION "Enable CUDA support"
# DEFAULT OFF
# )
# ecbuild_add_option( FEATURE HIP
# DESCRIPTION "Enable CUDA support"
# DEFAULT OFF
# )

if( HAVE_CUDA )

enable_language( CUDA )
ecbuild_info( "CUDA language enabled" )

find_package( CUDAToolkit REQUIRED )
set( atlas_HAVE_CUDA 0 )
set( atlas_HAVE_HIP 0 )
set( atlas_HAVE_GPU 0 )

if( hic_HAVE_CUDA )
enable_language( CUDA )
ecbuild_info( "CUDA language enabled" )
find_package(CUDAToolkit REQUIRED)
set( atlas_HAVE_CUDA 1 )
set( atlas_HAVE_GPU 1 )
elseif( hic_HAVE_HIP )
enable_language( HIP )
ecbuild_info( "HIP language enabled" )
find_package(hip CONFIG REQUIRED)
set( atlas_HAVE_HIP 1 )
set( atlas_HAVE_GPU 1 )
endif()

set( HAVE_CUDA ${atlas_HAVE_CUDA} )
set( HAVE_HIP ${atlas_HAVE_HIP} )
set( HAVE_GPU ${atlas_HAVE_GPU} )

if( HAVE_GPU )
ecbuild_info("GPU support enabled")
else()
ecbuild_info("GPU support not enabled")
endif()
4 changes: 2 additions & 2 deletions cmake/project_summary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ if( atlas_HAVE_GRIDTOOLS_STORAGE )

else()

if( NOT atlas_HAVE_CUDA )
if( NOT atlas_HAVE_GPU )
ecbuild_info( "Array storage backend: Native [HOST]" )
else()
ecbuild_info( "Array storage backend: Native [CUDA]" )
ecbuild_info( "Array storage backend: Native [GPU]" )
endif()

endif()
Expand Down
8 changes: 8 additions & 0 deletions hic/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Authors
=======

- Willem Deconinck

Thanks for contributions from
=============================

Empty file added hic/CHANGELOG.md
Empty file.
56 changes: 56 additions & 0 deletions hic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# (C) Copyright 2024- 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.

############################################################################################
# hic

cmake_minimum_required( VERSION 3.18 FATAL_ERROR )

find_package( ecbuild 3.4 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild ${CMAKE_CURRENT_SOURCE_DIR}/../../ecbuild )

################################################################################
# Initialise project

if( NOT DEFINED atlas_VERSION )
set( atlas_VERSION 0.0.0 )
endif()

project( hic VERSION ${atlas_VERSION} LANGUAGES CXX )

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

################################################################################
# Features that can be enabled / disabled with -DENABLE_<FEATURE>

ecbuild_add_option( FEATURE CUDA DESCRIPTION "Use CUDA as backend to HIC" DEFAULT OFF )
ecbuild_add_option( FEATURE HIP DESCRIPTION "Use HIP as backend to HIC" DEFAULT OFF )

if( HAVE_CUDA )
find_package(CUDAToolkit REQUIRED)
elseif( HAVE_HIP )
find_package(hip CONFIG REQUIRED)
endif()

add_subdirectory( src )
add_subdirectory( tests )

################################################################################
# Export and summarize

ecbuild_add_resources(
TARGET hic-others
SOURCES_PACK
README.md
CHANGELOG.md
LICENSE
)

ecbuild_install_project( NAME hic )
ecbuild_print_summary()

Loading

0 comments on commit 59efc06

Please sign in to comment.