Skip to content

Commit

Permalink
Merge branch 'release/0.36.0'
Browse files Browse the repository at this point in the history
* release/0.36.0: (25 commits)
  Update Changelog
  Version 0.36.0
  Add atlas_Redistribution to atlas_module
  Performance improvement in EqualAreaPartitioner for StructuredGrid
  Add EqualAreaPartitioner which is geometry based compared to EqualRegionsPartitioner which is loadbalanced
  Add fallback mechanism to MatchingMeshPartitionerLonLatPolygon
  Fix MatchingMeshPartitionerBruteForce
  Fix MDPI_gulfstream: 180 degrees phase shift corrected
  Feature/fortran api init functions (#165)
  Fix failing tests for IntelLLVM Release builds
  GHA: Install intel-oneapi with mpi-devel for access to MPI headers and Fortran modules
  Fix intel compiler version in github actions, and add IntelLLVM
  Add compile flag -fno-finite-math-only for Intel LLVM compiler (icx, icpx)
  Add Fortran API for functionspace::CellColumns (#164)
  Cleanup
  Fix logic
  Fix interpolation warnings
  Add Fortran interface for Redistribution (#160)
  Add atlas_TriangularMeshBuilder with Fortran interface for serial meshes
  Reduce header dependency on atlas_io to prepare for eckit_codec adaptor library
  ...
  • Loading branch information
wdeconinck committed Dec 11, 2023
2 parents 177f0ce + 7fd018d commit 24d175a
Show file tree
Hide file tree
Showing 52 changed files with 2,261 additions and 356 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
- linux clang-12
# - linux nvhpc-22.11
- linux intel
- linux intel-classic
- macos

include:
Expand Down Expand Up @@ -102,7 +103,16 @@ jobs:

- name : linux intel
os: ubuntu-20.04
compiler: intel-oneapi
compiler: intel
compiler_cc: icx
compiler_cxx: icpx
compiler_fc: ifx
caching: true
coverage: false

- name : linux intel-classic
os: ubuntu-20.04
compiler: intel-classic
compiler_cc: icc
compiler_cxx: icpc
compiler_fc: ifort
Expand Down Expand Up @@ -179,7 +189,7 @@ jobs:
${ATLAS_TOOLS}/install-intel-oneapi.sh
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
echo "CACHE_SUFFIX=$(icc -dumpversion)" >> $GITHUB_ENV
echo "CACHE_SUFFIX=$CC-$($CC -dumpversion)" >> $GITHUB_ENV
- name: Install MPI
shell: bash -eux {0}
Expand Down Expand Up @@ -220,6 +230,19 @@ jobs:
# Add mpirun to path for testing
[ -z ${MPI_HOME+x} ] || echo "${MPI_HOME}/bin" >> $GITHUB_PATH
if [[ "${{matrix.compiler}}" == intel-classic ]]; then
echo "CFLAGS=-diag-disable=10441" >> $GITHUB_ENV
echo "CXXFLAGS=-diag-disable=10441" >> $GITHUB_ENV
echo "FCFLAGS=-diag-disable=10441" >> $GITHUB_ENV
echo "FFLAGS=-diag-disable=10441" >> $GITHUB_ENV
fi
if [[ "${{matrix.compiler}}" == intel ]]; then
echo "CFLAGS=-Rno-debug-disables-optimization" >> $GITHUB_ENV
echo "CXXFLAGS=-Rno-debug-disables-optimization" >> $GITHUB_ENV
fi
- name: Build & Test
id: build-test
Expand Down
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html

## [Unreleased]

## [0.35.1] - 2023-24-10
## [0.36.0] - 2023-12-11
### Added
- Add TriangularMeshBuilder with Fortran API, so far for serial meshes only
- Add Fortran API for CellCollumns functionspace
- Add EqualAreaPartitioner which is geometry based rather than loadbalanced like EqualRegionsPartitioner

### Fixed
- Compilation with Intel LLVM compiler
- Fix 180 degrees phase shift error in MDPI_gulfstream function

### Changed
- Update install scripts
- Preparation for using eckit::codec as backend for atlas_io

## [0.35.1] - 2023-10-24
### Added
- Don't output with output::Gmsh the triangle elements with wrong orientation when coordinates are "lonlat"
- Add control to skip Gmsh-output of triangles with too large edge length ratio
Expand Down Expand Up @@ -500,6 +514,7 @@ Fix StructuredInterpolation2D with retry for failed stencils
## 0.13.0 - 2018-02-16

[Unreleased]: https://github.com/ecmwf/atlas/compare/master...develop
[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
[0.34.0]: https://github.com/ecmwf/atlas/compare/0.33.0...0.34.0
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.35.1
0.36.0
8 changes: 4 additions & 4 deletions atlas_io/src/atlas_io/detail/Defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ namespace atlas {
namespace io {
namespace defaults {

static std::string checksum_algorithm() {
[[maybe_unused]] static std::string checksum_algorithm() {
static std::string checksum =
eckit::Resource<std::string>("atlas.io.checksum.algorithm;$ATLAS_IO_CHECKSUM", "xxh64");
return checksum;
}

static bool checksum_read() {
[[maybe_unused]] static bool checksum_read() {
static bool checksum = eckit::Resource<bool>("atlas.io.checksum.read;$ATLAS_IO_CHECKSUM_READ", true);
return checksum;
}

static bool checksum_write() {
[[maybe_unused]] static bool checksum_write() {
static bool checksum = eckit::Resource<bool>("atlas.io.checksum.write;$ATLAS_IO_CHECKSUM_WRITE", true);
return checksum;
}

static const std::string& compression_algorithm() {
[[maybe_unused]] static const std::string& compression_algorithm() {
static std::string compression = eckit::Resource<std::string>("atlas.io.compression;$ATLAS_IO_COMPRESSION", "none");
return compression;
}
Expand Down
9 changes: 8 additions & 1 deletion cmake/atlas_compile_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,11 @@ endif()
if( CMAKE_CXX_COMPILER_ID MATCHES NVHPC )
ecbuild_add_cxx_flags("--diag_suppress declared_but_not_referenced --display_error_number" NAME atlas_cxx_disable_warnings )
# For all the variables with side effects (constructor/dectructor functionality)
endif()
endif()

if( CMAKE_CXX_COMPILER_ID MATCHES IntelLLVM )
# Turn off -ffinite-math-only which gets included by some optimisation levels which assumes values can never be NaN.
# Then results in std::isnan(value) always retrun false.
ecbuild_add_cxx_flags("-fno-finite-math-only")
endif()

2 changes: 1 addition & 1 deletion src/apps/atlas-grid-points.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Program::Program(int argc, char** argv): AtlasTool(argc, argv) {
add_option(new SimpleOption<std::string>("field","Field to output. [\"lonlat\"(D),\"index\",\"partition\"]"));
add_option(new Separator("Advanced"));
add_option(new SimpleOption<std::string>("partitioner.type",
"Partitioner [equal_regions,checkerboard,equal_bands,regular_bands]"));
"Partitioner [equal_regions,equal_area,checkerboard,equal_bands,regular_bands]"));
add_option(new SimpleOption<long>("partition", "partition [0:partitions-1]"));
add_option(new SimpleOption<long>("partitions", "Number of partitions"));
add_option(new SimpleOption<long>("json.precision", "Number of digits after decimal in output"));
Expand Down
8 changes: 8 additions & 0 deletions src/atlas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ grid/detail/partitioner/CubedSpherePartitioner.cc
grid/detail/partitioner/CubedSpherePartitioner.h
grid/detail/partitioner/EqualBandsPartitioner.cc
grid/detail/partitioner/EqualBandsPartitioner.h
grid/detail/partitioner/EqualAreaPartitioner.cc
grid/detail/partitioner/EqualAreaPartitioner.h
grid/detail/partitioner/EqualRegionsPartitioner.cc
grid/detail/partitioner/EqualRegionsPartitioner.h
grid/detail/partitioner/MatchingMeshPartitioner.h
Expand Down Expand Up @@ -364,6 +366,8 @@ mesh/detail/MeshImpl.cc
mesh/detail/MeshImpl.h
mesh/detail/MeshIntf.cc
mesh/detail/MeshIntf.h
mesh/detail/MeshBuilderIntf.cc
mesh/detail/MeshBuilderIntf.h
mesh/detail/PartitionGraph.cc
mesh/detail/PartitionGraph.h
mesh/detail/AccumulateFacets.h
Expand Down Expand Up @@ -498,6 +502,8 @@ functionspace/detail/BlockStructuredColumns.h
functionspace/detail/BlockStructuredColumns.cc
functionspace/detail/BlockStructuredColumnsInterface.h
functionspace/detail/BlockStructuredColumnsInterface.cc
functionspace/detail/CellColumnsInterface.h
functionspace/detail/CellColumnsInterface.cc
functionspace/detail/FunctionSpaceImpl.h
functionspace/detail/FunctionSpaceImpl.cc
functionspace/detail/FunctionSpaceInterface.h
Expand Down Expand Up @@ -691,6 +697,8 @@ linalg/dense/MatrixMultiply_EckitLinalg.cc
list (APPEND atlas_redistribution_srcs
redistribution/Redistribution.h
redistribution/Redistribution.cc
redistribution/detail/RedistributionInterface.h
redistribution/detail/RedistributionInterface.cc
redistribution/detail/RedistributionImpl.h
redistribution/detail/RedistributionImpl.cc
redistribution/detail/RedistributionImplFactory.h
Expand Down
155 changes: 155 additions & 0 deletions src/atlas/functionspace/detail/CellColumnsInterface.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
/*
* (C) Copyright 2013 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 <cstring>

#include "CellColumnsInterface.h"
#include "atlas/field/FieldSet.h"
#include "atlas/field/detail/FieldImpl.h"
#include "atlas/runtime/Exception.h"

namespace atlas {
namespace functionspace {
namespace detail {

using atlas::FieldSet;
using atlas::field::FieldImpl;
using atlas::field::FieldSetImpl;

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

extern "C" {
const CellColumns* atlas__CellsFunctionSpace__new(Mesh::Implementation* mesh, const eckit::Configuration* config) {
ATLAS_ASSERT(mesh);
Mesh m(mesh);
return new CellColumns(m, *config);
}

void atlas__CellsFunctionSpace__delete(CellColumns* This) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
delete (This);
}

int atlas__CellsFunctionSpace__nb_cells(const CellColumns* This) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
return This->nb_cells();
}

const Mesh::Implementation* atlas__CellsFunctionSpace__mesh(const CellColumns* This) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
return This->mesh().get();
}

const mesh::HybridElements* atlas__CellsFunctionSpace__cells(const CellColumns* This) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
return &This->cells();
}

void atlas__CellsFunctionSpace__halo_exchange_fieldset(const CellColumns* This, field::FieldSetImpl* fieldset) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
ATLAS_ASSERT(fieldset != nullptr, "Cannot access uninitialised atlas_FieldSet");
FieldSet f(fieldset);
This->haloExchange(f);
}

void atlas__CellsFunctionSpace__halo_exchange_field(const CellColumns* This, field::FieldImpl* field) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
ATLAS_ASSERT(field != nullptr, "Cannot access uninitialised atlas_Field");
Field f(field);
This->haloExchange(f);
}

const parallel::HaloExchange* atlas__CellsFunctionSpace__get_halo_exchange(const CellColumns* This) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
return &This->halo_exchange();
}

void atlas__CellsFunctionSpace__gather_fieldset(const CellColumns* This, const field::FieldSetImpl* local,
field::FieldSetImpl* global) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
ATLAS_ASSERT(local != nullptr, "Cannot access uninitialised local atlas_FieldSet");
ATLAS_ASSERT(global != nullptr, "Cannot access uninitialised global atlas_FieldSet");
const FieldSet l(local);
FieldSet g(global);
This->gather(l, g);
}

void atlas__CellsFunctionSpace__gather_field(const CellColumns* This, const field::FieldImpl* local,
field::FieldImpl* global) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
ATLAS_ASSERT(local != nullptr, "Cannot access uninitialised local atlas_Field");
ATLAS_ASSERT(global != nullptr, "Cannot access uninitialised global atlas_Field");
const Field l(local);
Field g(global);
This->gather(l, g);
}

const parallel::GatherScatter* atlas__CellsFunctionSpace__get_gather(const CellColumns* This) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
return &This->gather();
}

const parallel::GatherScatter* atlas__CellsFunctionSpace__get_scatter(const CellColumns* This) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
return &This->scatter();
}

void atlas__CellsFunctionSpace__scatter_fieldset(const CellColumns* This, const field::FieldSetImpl* global,
field::FieldSetImpl* local) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
ATLAS_ASSERT(local != nullptr, "Cannot access uninitialised local atlas_FieldSet");
ATLAS_ASSERT(global != nullptr, "Cannot access uninitialised global atlas_FieldSet");
const FieldSet g(global);
FieldSet l(local);
This->scatter(g, l);
}

void atlas__CellsFunctionSpace__scatter_field(const CellColumns* This, const field::FieldImpl* global,
field::FieldImpl* local) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
ATLAS_ASSERT(local != nullptr, "Cannot access uninitialised local atlas_Field");
ATLAS_ASSERT(global != nullptr, "Cannot access uninitialised global atlas_Field");
const Field g(global);
Field l(local);
This->scatter(g, l);
}

const parallel::Checksum* atlas__CellsFunctionSpace__get_checksum(const CellColumns* This) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
return &This->checksum();
}

void atlas__CellsFunctionSpace__checksum_fieldset(const CellColumns* This, const field::FieldSetImpl* fieldset,
char*& checksum, int& size, int& allocated) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
ATLAS_ASSERT(fieldset != nullptr, "Cannot access uninitialised atlas_FieldSet");
std::string checksum_str(This->checksum(fieldset));
size = static_cast<int>(checksum_str.size());
checksum = new char[size + 1];
allocated = true;
std::strncpy(checksum, checksum_str.c_str(), size + 1);
}

void atlas__CellsFunctionSpace__checksum_field(const CellColumns* This, const field::FieldImpl* field, char*& checksum,
int& size, int& allocated) {
ATLAS_ASSERT(This != nullptr, "Cannot access uninitialised atlas_functionspace_CellColumns");
ATLAS_ASSERT(field != nullptr, "Cannot access uninitialised atlas_Field");
std::string checksum_str(This->checksum(field));
size = static_cast<int>(checksum_str.size());
checksum = new char[size + 1];
allocated = true;
std::strncpy(checksum, checksum_str.c_str(), size + 1);
}

} // extern C

} // namespace detail
} // namespace functionspace
} // namespace atlas
59 changes: 59 additions & 0 deletions src/atlas/functionspace/detail/CellColumnsInterface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* (C) Copyright 2013 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 "atlas/functionspace/CellColumns.h"
#include "atlas/mesh/Mesh.h"

namespace atlas {
namespace field {
class FieldSetImpl;
class FieldImpl;
} // namespace field
} // namespace atlas

namespace atlas {
namespace functionspace {
namespace detail {

extern "C" {
const CellColumns* atlas__CellsFunctionSpace__new(Mesh::Implementation* mesh, const eckit::Configuration* config);
void atlas__CellsFunctionSpace__delete(CellColumns* This);
int atlas__CellsFunctionSpace__nb_cells(const CellColumns* This);
const Mesh::Implementation* atlas__CellsFunctionSpace__mesh(const CellColumns* This);
const mesh::HybridElements* atlas__CellsFunctionSpace__cells(const CellColumns* This);

void atlas__CellsFunctionSpace__halo_exchange_fieldset(const CellColumns* This, field::FieldSetImpl* fieldset);
void atlas__CellsFunctionSpace__halo_exchange_field(const CellColumns* This, field::FieldImpl* field);
const parallel::HaloExchange* atlas__CellsFunctionSpace__get_halo_exchange(const CellColumns* This);

void atlas__CellsFunctionSpace__gather_fieldset(const CellColumns* This, const field::FieldSetImpl* local,
field::FieldSetImpl* global);
void atlas__CellsFunctionSpace__gather_field(const CellColumns* This, const field::FieldImpl* local,
field::FieldImpl* global);
const parallel::GatherScatter* atlas__CellsFunctionSpace__get_gather(const CellColumns* This);

void atlas__CellsFunctionSpace__scatter_fieldset(const CellColumns* This, const field::FieldSetImpl* global,
field::FieldSetImpl* local);
void atlas__CellsFunctionSpace__scatter_field(const CellColumns* This, const field::FieldImpl* global,
field::FieldImpl* local);
const parallel::GatherScatter* atlas__CellsFunctionSpace__get_scatter(const CellColumns* This);

void atlas__CellsFunctionSpace__checksum_fieldset(const CellColumns* This, const field::FieldSetImpl* fieldset,
char*& checksum, int& size, int& allocated);
void atlas__CellsFunctionSpace__checksum_field(const CellColumns* This, const field::FieldImpl* field, char*& checksum,
int& size, int& allocated);
const parallel::Checksum* atlas__CellsFunctionSpace__get_checksum(const CellColumns* This);
}

} // namespace detail
} // namespace functionspace
} // namespace atlas
Loading

0 comments on commit 24d175a

Please sign in to comment.