Skip to content

Commit

Permalink
Merge branch 'release/0.37.0'
Browse files Browse the repository at this point in the history
* release/0.37.0: (23 commits)
  Update Changelog
  Version 0.37.0
  Projection base implementation derivatives performance/encapsulation … (#185)
  atlas_io is an adaptor library when eckit_codec is available (#181)
  Fix build for configuration setting ATLAS_BITS_LOCAL=64 (#184)
  Revert "Avoid linker warnings on macOS about 'ld: warning: could not create compact unwind for ...'"
  Cosmetic: readability braces
  Initialize std::array values to zero because valgrind complains, even though c++ standard mandates it should be default-initialized to zero
  Fix bug in TraceT caused by typo where the title was wrong
  Avoid linker warnings on macOS about 'ld: warning: could not create compact unwind for ...'
  Use new LocalConfiguration baseclass functions in util::Config and util::Metadata instead of eckit::Value backdoor
  Removed leftover code missed in PR #175
  Update `SphericalVector` to work with StructuredColumns as source functionspace. (#175)
  Bugfix for regional grids with ny > nx
  Refactoring of interpolation::method::SphericalVector and implementation of adjoint methods. (#168)
  Added test with empty integer sequence.
  Added arrayForEachDim method.
  Add docs build workflow
  Github Actions: Fix macOS MPI slots
  Fix for elements that might have unassigned partition via parallel Delaunay meshgenerator
  ...
  • Loading branch information
wdeconinck committed Apr 9, 2024
2 parents 24d175a + d6f45e7 commit 986938e
Show file tree
Hide file tree
Showing 52 changed files with 2,015 additions and 281 deletions.
14 changes: 14 additions & 0 deletions .github/docs-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# note: each step is executed in own process
build-steps:
- git clone --depth 1 https://github.com/ecmwf/atlas-docs.git $RUNNER_TEMP/atlas-docs
- sudo apt install -y -q doxygen texlive-full
- |
cd $RUNNER_TEMP/atlas-docs
make PUBLIC=1 WITH_ECKIT=1 WITH_DOXYGEN=1 ATLAS_SOURCE_DIR=$GITHUB_WORKSPACE clean html
echo "DOC_BUILD_PATH=$RUNNER_TEMP/atlas-docs/build/html" >> "$GITHUB_ENV"
hosts:
ecmwf-sites:
space: docs
name: atlas

15 changes: 15 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: docs

on:
push:
tags:
- '**'

workflow_dispatch: ~

jobs:
publish:
uses: ecmwf-actions/reusable-workflows/.github/workflows/cd-docs.yml@v2
secrets: inherit
with:
config: .github/docs-config.yml
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.37.0] - 2024-04-09
### Added
- Add SphericalVector interpolation method using parallel transport (#163)
- Added arrayForEachDim method

### Fixed
- Bugfix for regional grids with ny > nx
- Fix build for configuration setting ATLAS_BITS_LOCAL=64

### Changed
- Use new LocalConfiguration baseclass functions in util::Config and util::Metadata instead of eckit::Value backdoor
- atlas_io is an adaptor library when eckit_codec is available (#181)

## [0.36.0] - 2023-12-11
### Added
- Add TriangularMeshBuilder with Fortran API, so far for serial meshes only
Expand Down Expand Up @@ -514,6 +527,7 @@ Fix StructuredInterpolation2D with retry for failed stencils
## 0.13.0 - 2018-02-16

[Unreleased]: https://github.com/ecmwf/atlas/compare/master...develop
[0.37.0]: https://github.com/ecmwf/atlas/compare/0.36.0...0.37.0
[0.36.0]: https://github.com/ecmwf/atlas/compare/0.35.1...0.36.0
[0.35.1]: https://github.com/ecmwf/atlas/compare/0.35.0...0.35.1
[0.35.0]: https://github.com/ecmwf/atlas/compare/0.34.0...0.35.0
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.36.0
0.37.0
22 changes: 20 additions & 2 deletions atlas_io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ ecbuild_debug( " eckit_FEATURES : [${eckit_FEATURES}]" )
################################################################################
# Features that can be enabled / disabled with -DENABLE_<FEATURE>

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 )

set( eckit_HAVE_ECKIT_CODEC 0 )
if( TARGET eckit_codec )
set( eckit_HAVE_ECKIT_CODEC 1 )
endif()

ecbuild_add_option( FEATURE ECKIT_CODEC
DEFAULT ON
DESCRIPTION "Use eckit::codec with adaptor"
CONDITION eckit_HAVE_ECKIT_CODEC )

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

Expand All @@ -47,8 +61,12 @@ else()
set( ATLAS_IO_LITTLE_ENDIAN 1 )
endif()


add_subdirectory( src )
if( HAVE_ECKIT_CODEC )
ecbuild_info("atlas_io is configured to be an adaptor library which delegates calls to eckit_codec")
add_subdirectory(eckit_codec_adaptor)
else()
add_subdirectory( src )
endif()
add_subdirectory( tests )

################################################################################
Expand Down
1 change: 1 addition & 0 deletions atlas_io/eckit_codec_adaptor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(src)
2 changes: 2 additions & 0 deletions atlas_io/eckit_codec_adaptor/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_subdirectory(atlas_io)

19 changes: 19 additions & 0 deletions atlas_io/eckit_codec_adaptor/src/atlas_io/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

ecbuild_add_library( TARGET atlas_io

INSTALL_HEADERS ALL
HEADER_DESTINATION include/atlas_io
PUBLIC_LIBS eckit_codec
PUBLIC_INCLUDES
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/eckit_codec_adaptor/src>

SOURCES
atlas-io.h
Trace.cc
Trace.h
detail/BlackMagic.h
LINKER_LANGUAGE CXX
)

target_compile_features( atlas_io PUBLIC cxx_std_17 )

43 changes: 43 additions & 0 deletions atlas_io/eckit_codec_adaptor/src/atlas_io/Trace.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* (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.
*/

#include "Trace.h"

#include "eckit/log/CodeLocation.h"

namespace atlas {
namespace io {

atlas::io::Trace::Trace(const eckit::CodeLocation& loc) {
for (size_t id = 0; id < TraceHookRegistry::size(); ++id) {
if (TraceHookRegistry::enabled(id)) {
hooks_.emplace_back(TraceHookRegistry::hook(id)(loc, loc.func()));
}
}
}

Trace::Trace(const eckit::CodeLocation& loc, const std::string& title) {
for (size_t id = 0; id < TraceHookRegistry::size(); ++id) {
if (TraceHookRegistry::enabled(id)) {
hooks_.emplace_back(TraceHookRegistry::hook(id)(loc, title));
}
}
}

Trace::Trace(const eckit::CodeLocation& loc, const std::string& title, const Labels& labels) {
for (size_t id = 0; id < TraceHookRegistry::size(); ++id) {
if (TraceHookRegistry::enabled(id)) {
hooks_.emplace_back(TraceHookRegistry::hook(id)(loc, title));
}
}
}

} // namespace io
} // namespace atlas
77 changes: 77 additions & 0 deletions atlas_io/eckit_codec_adaptor/src/atlas_io/Trace.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* (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.
*/

#pragma once


#include <functional>
#include <memory>
#include <string>
#include <vector>
#include <limits>

namespace eckit {
class CodeLocation;
}

namespace atlas {
namespace io {

struct TraceHook {
TraceHook() = default;
virtual ~TraceHook() = default;
};

struct TraceHookRegistry {
using TraceHookBuilder = std::function<std::unique_ptr<TraceHook>(const eckit::CodeLocation&, const std::string&)>;
std::vector<TraceHookBuilder> hooks;
std::vector<int> enabled_;
static TraceHookRegistry& instance() {
static TraceHookRegistry instance;
return instance;
}
static size_t add(TraceHookBuilder&& hook) {
instance().hooks.emplace_back(hook);
instance().enabled_.emplace_back(true);
return instance().hooks.size() - 1;
}
static size_t add(const TraceHookBuilder& hook) {
instance().hooks.emplace_back(hook);
instance().enabled_.emplace_back(true);
return instance().hooks.size() - 1;
}
static void enable(size_t id) { instance().enabled_[id] = true; }
static void disable(size_t id) { instance().enabled_[id] = false; }
static bool enabled(size_t id) { return instance().enabled_[id]; }
static size_t size() { return instance().hooks.size(); }
static TraceHookBuilder& hook(size_t id) { return instance().hooks[id]; }
static size_t invalidId() { return std::numeric_limits<size_t>::max(); }

private:
TraceHookRegistry() = default;
};

struct Trace {
using Labels = std::vector<std::string>;
Trace(const eckit::CodeLocation& loc);
Trace(const eckit::CodeLocation& loc, const std::string& title);
Trace(const eckit::CodeLocation& loc, const std::string& title, const Labels& labels);

private:
std::vector<std::unique_ptr<TraceHook>> hooks_;
};

} // namespace io
} // namespace atlas

#include "atlas_io/detail/BlackMagic.h"

#define ATLAS_IO_TRACE(...) __ATLAS_IO_TYPE(::atlas::io::Trace, Here() __ATLAS_IO_COMMA_ARGS(__VA_ARGS__))
#define ATLAS_IO_TRACE_SCOPE(...) __ATLAS_IO_TYPE_SCOPE(::atlas::io::Trace, Here() __ATLAS_IO_COMMA_ARGS(__VA_ARGS__))
99 changes: 99 additions & 0 deletions atlas_io/eckit_codec_adaptor/src/atlas_io/atlas-io.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
* (C) Copyright 2023- 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.
*/

#pragma once

#include "eckit/codec/codec.h"

namespace atlas::io {

// Encoding/Decoding
using Metadata = ::eckit::codec::Metadata;
using DataType = ::eckit::codec::DataType;
using Data = ::eckit::codec::Data;
using Encoder = ::eckit::codec::Encoder;
using Decoder = ::eckit::codec::Decoder;

// Record
using Record = ::eckit::codec::Record;
using RecordWriter = ::eckit::codec::RecordWriter;
using RecordPrinter = ::eckit::codec::RecordPrinter;
using RecordItemReader = ::eckit::codec::RecordItemReader;
using RecordReader = ::eckit::codec::RecordReader;

// I/O
using Session = ::eckit::codec::Session;
using Mode = ::eckit::codec::Mode;
using Stream = ::eckit::codec::Stream;
using FileStream = ::eckit::codec::FileStream;
using InputFileStream = ::eckit::codec::InputFileStream;
using OutputFileStream = ::eckit::codec::OutputFileStream;

// Array
using ArrayReference = ::eckit::codec::ArrayReference;
using ArrayMetadata = ::eckit::codec::ArrayMetadata;
using ArrayShape = ::eckit::codec::ArrayShape;

// Exceptions
using Exception = ::eckit::codec::Exception;
using NotEncodable = ::eckit::codec::NotEncodable;
using NotDecodable = ::eckit::codec::NotDecodable;
using InvalidRecord = ::eckit::codec::InvalidRecord;
using DataCorruption = ::eckit::codec::DataCorruption;
using WriteError = ::eckit::codec::WriteError;

// Type traits
template <class T, class A>
static constexpr bool is_interpretable() {
return ::eckit::codec::is_interpretable<T,A>();
}
template <typename T>
static constexpr bool is_encodable() {
return ::eckit::codec::is_encodable<T>();
}
template <typename T>
static constexpr bool is_decodable() {
return ::eckit::codec::is_decodable<T>();
}
template <typename T>
static constexpr bool can_encode_metadata() {
return ::eckit::codec::can_encode_metadata<T>();
}
template <typename T>
static constexpr bool can_encode_data() {
return ::eckit::codec::can_encode_metadata<T>();
}

namespace tag {
using disable_static_assert = ::eckit::codec::tag::disable_static_assert;
using enable_static_assert = ::eckit::codec::tag::enable_static_assert;
}

// Functions
using ::eckit::codec::ref;
using ::eckit::codec::copy;
using ::eckit::codec::encode;
using ::eckit::codec::decode;
using ::eckit::codec::interprete;
using ::eckit::codec::link;
using ::eckit::codec::make_datatype;
// template <typename DATATYPE>
// using make_datatype = eckit::codec::make_datatype<DATATYPE>;

namespace defaults {
using ::eckit::codec::defaults::compression_algorithm;
using ::eckit::codec::defaults::checksum_algorithm;
using ::eckit::codec::defaults::checksum_read;
using ::eckit::codec::defaults::checksum_write;
}
}

#define ATLAS_IO_ASSERT(X) ASSERT(X)
#define ATLAS_IO_ASSERT_MSG(X, M) ASSERT_MSG(X, M)
Loading

0 comments on commit 986938e

Please sign in to comment.