Skip to content

Commit

Permalink
Merge branch 'release/0.33.0'
Browse files Browse the repository at this point in the history
* release/0.33.0:
  Version 0.33.0
  Add MDPI functions from Valcke et al (2022) paper for gauging the quality of Atlas interpolations
  Avoid some compiler warnings with nvhpc
  Fix compilation with nvidia/22.1
  Fix StructuredInterpolation2D with retry for failed stencils
  Add test for StructuredInterpolation2D to show normalisation issue
  Add PartitionPolygon::json() function
  Add support for StructuredPartitionPolygon with halo > 0
  Support formatting for Config::json()
  Avoid failing atlas_test_interpolation_structured2D_to_unstructured with more than 2 MPI tasks
  atlas --info removal of unnecessary header
  atlas --info shows if built with PROJ
  Fix `More processors requested than permitted` error on HPC (#118)
  Enable CI on self-hosted runners (#117)
  Fix modernisation warning
  Workaround compiler bugs in aocc/4.0.0
  Add missing prefix to test
  Modernise, using make_unique, and auto return type for detail return types
  C++17 is now a requirement
  • Loading branch information
wdeconinck committed Apr 3, 2023
2 parents f367722 + c85c9f4 commit 3ba1bed
Show file tree
Hide file tree
Showing 53 changed files with 1,202 additions and 289 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: ci

on:
# Trigger the workflow on push to master or develop, except tag creation
push:
branches:
- 'master'
- 'develop'
tags-ignore:
- '**'

# Trigger the workflow on pull request
pull_request: ~

# Trigger the workflow manually
workflow_dispatch: ~

# Trigger after public PR approved for CI
pull_request_target:
types: [labeled]

jobs:
# Run CI including downstream packages on self-hosted runners
downstream-ci:
name: downstream-ci
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci.yml@main
with:
atlas: ecmwf/atlas@${{ github.event.pull_request.head.sha || github.sha }}
secrets: inherit

# Run CI of private downstream packages on self-hosted runners
private-downstream-ci:
name: private-downstream-ci
needs: [downstream-ci]
if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Dispatch private downstream CI
uses: ecmwf-actions/dispatch-private-downstream-ci@v1
with:
token: ${{ secrets.GH_REPO_READ_TOKEN }}
owner: ecmwf-actions
repository: private-downstream-ci
event_type: downstream-ci
payload: '{"atlas": "ecmwf/atlas@${{ github.event.pull_request.head.sha || github.sha }}"}'

# Build downstream packages on HPC
downstream-ci-hpc:
name: downstream-ci-hpc
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci-hpc.yml@main
with:
atlas: ecmwf/atlas@${{ github.event.pull_request.head.sha || github.sha }}
secrets: inherit

# Run CI of private downstream packages on HPC
private-downstream-ci-hpc:
name: private-downstream-ci-hpc
needs: [downstream-ci-hpc]
if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Dispatch private downstream CI
uses: ecmwf-actions/dispatch-private-downstream-ci@v1
with:
token: ${{ secrets.GH_REPO_READ_TOKEN }}
owner: ecmwf-actions
repository: private-downstream-ci
event_type: downstream-ci-hpc
payload: '{"atlas": "ecmwf/atlas@${{ github.event.pull_request.head.sha || github.sha }}"}'
10 changes: 10 additions & 0 deletions .github/workflows/label-public-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Manage labels of pull requests that originate from forks
name: label-public-pr

on:
pull_request_target:
types: [opened, synchronize]

jobs:
label:
uses: ecmwf-actions/reusable-workflows/.github/workflows/label-pr.yml@v2
29 changes: 29 additions & 0 deletions .github/workflows/reusable-ci-hpc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: reusable-ci-hpc

on:
workflow_call:
inputs:
atlas:
required: false
type: string
eckit:
required: false
type: string
jobs:
ci-hpc:
name: ci-hpc
uses: ecmwf-actions/reusable-workflows/.github/workflows/ci-hpc.yml@v2
with:
name-prefix: atlas-
build-inputs: |
--package: ${{ inputs.atlas || 'ecmwf/atlas@develop' }}
--modules: |
ecbuild
ninja
--modules-package: |
fftw
eigen
--dependencies: |
${{ inputs.eckit || 'ecmwf/eckit@develop' }}
--parallel: 64
secrets: inherit
28 changes: 28 additions & 0 deletions .github/workflows/reusable-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: reusable-ci

on:
workflow_call:
inputs:
atlas:
required: false
type: string
eckit:
required: false
type: string

jobs:
ci:
name: atlas-ci
uses: ecmwf-actions/reusable-workflows/.github/workflows/ci.yml@v2
with:
repository: ${{ inputs.atlas || 'ecmwf/atlas@develop' }}
name_prefix: atlas-
build_package_inputs: |
repository: ${{ inputs.atlas || 'ecmwf/atlas@develop' }}
self_coverage: true
dependencies: |
ecmwf/ecbuild
${{ inputs.eckit || 'ecmwf/eckit' }}
dependency_branch: develop
parallelism_factor: 8
secrets: inherit
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html

## [Unreleased]

## [0.33.0] - 2023-04-03
### Added
- Add support for StructuredPartitionPolygon with halo > 0
- Add information on atlas having PROJ support

### Changed
- C++17 standard is now a requirement

### Fixed
Fix StructuredInterpolation2D with retry for failed stencils

## [0.32.1] - 2023-02-09
### Added
- Added (lon, lat) to (alpha, beta) transforms to cubed sphere projection
Expand Down Expand Up @@ -432,6 +443,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
## 0.13.0 - 2018-02-16

[Unreleased]: https://github.com/ecmwf/atlas/compare/master...develop
[0.33.0]: https://github.com/ecmwf/atlas/compare/0.32.1...0.33.0
[0.32.1]: https://github.com/ecmwf/atlas/compare/0.32.0...0.32.1
[0.32.0]: https://github.com/ecmwf/atlas/compare/0.31.1...0.32.0
[0.31.1]: https://github.com/ecmwf/atlas/compare/0.31.0...0.31.1
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ include( features/INCLUDE_WHAT_YOU_USE )
include( features/INIT_SNAN )
include( features/DOCS )
include( features/ATLAS_RUN )
include( features/CXX17 )

################################################################################
# sources
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.32.1
0.33.0
6 changes: 1 addition & 5 deletions atlas_io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@ ecbuild_debug( " eckit_FEATURES : [${eckit_FEATURES}]" )
################################################################################
# Features that can be enabled / disabled with -DENABLE_<FEATURE>

ecbuild_add_option( FEATURE CXX17
DESCRIPTION "Use C++17 standard"
DEFAULT OFF )

################################################################################
# sources

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

check_cxx_source_compiles( "#include <cxxabi.h>\n int main() { char * type; int status; char * r = abi::__cxa_demangle(type, 0, 0, &status); }"
Expand Down
4 changes: 1 addition & 3 deletions atlas_io/src/atlas_io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,4 @@ ecbuild_add_library( TARGET atlas_io
${CMAKE_CURRENT_BINARY_DIR}/detail/defines.h
)

target_compile_features( atlas_io PUBLIC
cxx_std_11
$<${HAVE_CXX17}:cxx_std_17> )
target_compile_features( atlas_io PUBLIC cxx_std_17 )
2 changes: 1 addition & 1 deletion atlas_io/src/atlas_io/types/scalar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#endif

// GNU C++ compiler (version 11) should not try to optimize this code
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__NVCOMPILER)
#pragma GCC optimize("O0")
#endif

Expand Down
17 changes: 7 additions & 10 deletions atlas_io/tests/test_io_encoding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@ struct EncodedArray<std::byte> {
std::vector<std::byte> in;
};


// -------------------------------------------------------------------------------------------------------

CASE("Decoding to std::vector") {
Expand Down Expand Up @@ -570,18 +569,16 @@ CASE("Encode/Decode byte array") {
auto validate = [&]() {
EXPECT(out == encoded);

auto str = [](std::byte byte) {
std::bitset<8> bitset(reinterpret_cast<unsigned char&>(byte));
return bitset.to_string();
auto to_byte = []( const char* str) {
return std::byte(std::bitset<8>(str).to_ulong());
};
EXPECT_EQ(str(out[0]), "00000001");
EXPECT_EQ(str(out[1]), "00000011");
EXPECT_EQ(str(out[2]), "00000111");
EXPECT_EQ(str(out[3]), "00001111");
EXPECT_EQ(str(out[4]), "00011111");
EXPECT(out[0] == to_byte("00000001"));
EXPECT(out[1] == to_byte("00000011"));
EXPECT(out[2] == to_byte("00000111"));
EXPECT(out[3] == to_byte("00001111"));
EXPECT(out[4] == to_byte("00011111"));
};


SECTION("decode directly") {
EXPECT_NO_THROW(decode(encoded.metadata, encoded.data, out));
validate();
Expand Down
2 changes: 1 addition & 1 deletion cmake/atlas_compile_flags.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.

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if( CMAKE_CXX_COMPILER_ID MATCHES Cray )
Expand Down
5 changes: 0 additions & 5 deletions cmake/features/CXX17.cmake

This file was deleted.

6 changes: 6 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ else()
set( atlas_HAVE_TESSELATION 0 )
endif()

if( atlas_HAVE_PROJ )
set( atlas_HAVE_PROJ 1 )
else()
set( atlas_HAVE_PROJ 0 )
endif()

if( atlas_HAVE_FORTRAN )
set( atlas_HAVE_FORTRAN 1 )
else()
Expand Down
2 changes: 2 additions & 0 deletions src/atlas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,8 @@ util/detail/BlackMagic.h
util/detail/Cache.h
util/detail/Debug.h
util/detail/KDTree.h
util/function/MDPI_functions.h
util/function/MDPI_functions.cc
util/function/SolidBodyRotation.h
util/function/SolidBodyRotation.cc
util/function/SphericalHarmonic.h
Expand Down
6 changes: 3 additions & 3 deletions src/atlas/array/gridtools/GridToolsArray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ArrayT_impl {
static_assert(sizeof...(UInts) > 0, "1");
auto gt_storage = create_gt_storage<Value, typename default_layout_t<sizeof...(dims)>::type>(dims...);
using data_store_t = typename std::remove_pointer<decltype(gt_storage)>::type;
array_.data_store_ = std::unique_ptr<ArrayDataStore>(new GridToolsDataStore<data_store_t>(gt_storage));
array_.data_store_ = std::unique_ptr<GridToolsDataStore<data_store_t>>(gt_storage);
array_.spec_ = make_spec(gt_storage, dims...);
}

Expand All @@ -77,7 +77,7 @@ class ArrayT_impl {
auto gt_storage = create_gt_storage<Value, typename default_layout_t<sizeof...(dims)>::type,
::gridtools::alignment<Alignment>>(dims...);
using data_store_t = typename std::remove_pointer<decltype(gt_storage)>::type;
array_.data_store_ = std::unique_ptr<ArrayDataStore>(new GridToolsDataStore<data_store_t>(gt_storage));
array_.data_store_ = std::make_unique<GridToolsDataStore<data_store_t>>(gt_storage);
array_.spec_ = make_spec(gt_storage, dims...);
}

Expand Down Expand Up @@ -230,7 +230,7 @@ class ArrayT_impl {
void construct_with_layout(UInts... dims) {
auto gt_data_store_ptr = create_gt_storage<Value, Layout>(dims...);
using data_store_t = typename std::remove_pointer<decltype(gt_data_store_ptr)>::type;
array_.data_store_ = std::unique_ptr<ArrayDataStore>(new GridToolsDataStore<data_store_t>(gt_data_store_ptr));
array_.data_store_ = std::make_unique<GridToolsDataStore<data_store_t>>(gt_data_store_ptr);
array_.spec_ = make_spec(gt_data_store_ptr, dims...);
}

Expand Down
18 changes: 9 additions & 9 deletions src/atlas/array/native/NativeArray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,27 @@ ArrayT<Value>::ArrayT(ArrayDataStore* ds, const ArraySpec& spec) {
template <typename Value>
ArrayT<Value>::ArrayT(idx_t dim0) {
spec_ = ArraySpec(make_shape(dim0));
data_store_ = std::unique_ptr<ArrayDataStore>(new native::DataStore<Value>(spec_.size()));
data_store_ = std::make_unique<native::DataStore<Value>>(spec_.size());
}
template <typename Value>
ArrayT<Value>::ArrayT(idx_t dim0, idx_t dim1) {
spec_ = ArraySpec(make_shape(dim0, dim1));
data_store_ = std::unique_ptr<ArrayDataStore>(new native::DataStore<Value>(spec_.size()));
data_store_ = std::make_unique<native::DataStore<Value>>(spec_.size());
}
template <typename Value>
ArrayT<Value>::ArrayT(idx_t dim0, idx_t dim1, idx_t dim2) {
spec_ = ArraySpec(make_shape(dim0, dim1, dim2));
data_store_ = std::unique_ptr<ArrayDataStore>(new native::DataStore<Value>(spec_.size()));
data_store_ = std::make_unique<native::DataStore<Value>>(spec_.size());
}
template <typename Value>
ArrayT<Value>::ArrayT(idx_t dim0, idx_t dim1, idx_t dim2, idx_t dim3) {
spec_ = ArraySpec(make_shape(dim0, dim1, dim2, dim3));
data_store_ = std::unique_ptr<ArrayDataStore>(new native::DataStore<Value>(spec_.size()));
data_store_ = std::make_unique<native::DataStore<Value>>(spec_.size());
}
template <typename Value>
ArrayT<Value>::ArrayT(idx_t dim0, idx_t dim1, idx_t dim2, idx_t dim3, idx_t dim4) {
spec_ = ArraySpec(make_shape(dim0, dim1, dim2, dim3, dim4));
data_store_ = std::unique_ptr<ArrayDataStore>(new native::DataStore<Value>(spec_.size()));
data_store_ = std::make_unique<native::DataStore<Value>>(spec_.size());
}

template <typename Value>
Expand All @@ -146,28 +146,28 @@ ArrayT<Value>::ArrayT(const ArrayShape& shape) {
for (size_t j = 0; j < shape.size(); ++j) {
size *= size_t(shape[j]);
}
data_store_ = std::unique_ptr<ArrayDataStore>(new native::DataStore<Value>(size));
data_store_ = std::make_unique<native::DataStore<Value>>(size);
spec_ = ArraySpec(shape);
}

template <typename Value>
ArrayT<Value>::ArrayT(const ArrayShape& shape, const ArrayAlignment& alignment) {
spec_ = ArraySpec(shape, alignment);
data_store_ = std::unique_ptr<ArrayDataStore>(new native::DataStore<Value>(spec_.allocatedSize()));
data_store_ = std::make_unique<native::DataStore<Value>>(spec_.allocatedSize());
}

template <typename Value>
ArrayT<Value>::ArrayT(const ArrayShape& shape, const ArrayLayout& layout) {
spec_ = ArraySpec(shape);
data_store_ = std::unique_ptr<ArrayDataStore>(new native::DataStore<Value>(spec_.size()));
data_store_ = std::make_unique<native::DataStore<Value>>(spec_.size());
for (size_t j = 0; j < layout.size(); ++j) {
ATLAS_ASSERT(spec_.layout()[j] == layout[j]);
}
}

template <typename Value>
ArrayT<Value>::ArrayT(ArraySpec&& spec): Array(std::move(spec)) {
data_store_ = std::unique_ptr<ArrayDataStore>(new native::DataStore<Value>(spec_.allocatedSize()));
data_store_ = std::make_unique<native::DataStore<Value>>(spec_.allocatedSize());
}

template <typename Value>
Expand Down
Loading

0 comments on commit 3ba1bed

Please sign in to comment.