Skip to content

Commit

Permalink
Merge branch 'release/0.24.0'
Browse files Browse the repository at this point in the history
* release/0.24.0: (93 commits)
  Update Changelog
  Version 0.24.0
  clang-format
  ATLAS-323 atlas-io: Reduce too aggressive optimization of Cray compiler
  ATLAS-323 atlas-io: Avoid false positive clang-tidy errors
  ATLAS-323 atlas-io: Fix RecordPrinter and add test
  ATLAS-323 atlas-io: Support for data type 'unsigned long long'
  Workaround strange problem with the Fedora32 Docker image
  clang-format
  Require eckit 1.16 to support atlas-io
  Fix compilation with Cray
  ATLAS-323 atlas-io: unit test for scalars and strings
  ATLAS-323 atlas-io: DataType 'byte'
  ATLAS-323 atlas-io: Implement encoding of simple values and strings
  ATLAS-323 atlas-io: Support encoding of values without data section
  ATLAS-323 atlas-io: Compilation of GridToolsArrayView
  ATLAS-323 atlas-io: Compilation with intel 17 compiler (more recent was working)
  ATLAS-323 atlas-io: First version 0.1.0
  ATLAS-323 atlas-io: util::Config::remove() and ordered util::Config::keys()
  ATLAS-323 atlas-io: convenience functions for atlas::vector and argument disambiguation
  ...
  • Loading branch information
wdeconinck committed Mar 19, 2021
2 parents e55e9c7 + e81cc35 commit 071bbb1
Show file tree
Hide file tree
Showing 233 changed files with 12,339 additions and 749 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html

## [Unreleased]

## [0.24.0] - 2021-03-19
### Fixed
- Fixed hang in band distribution for L160000x8000 grid
- Fixes to Spectral functionspace and TransIFS regarding vertical levels

### Changed
- Requires eckit 1.16

### Added
- atlas-io first version, not for operational use
- Spec registry for grids

## [0.23.0] - 2021-01-19
### Fixed
- Structured interpolation method interpolating to area straddling Greenwich.
- Fixes when compiling with ATLAS_BITS_LOCAL=64

### Changed
- Possibility to link to alternative open-source version of IFS trans library.

### Added
- Caching mechanism for interpolation

## [0.22.1] - 2020-10-22
### Fixed
- Installation of PGI compilers via tools/install-pgi.sh
Expand Down Expand Up @@ -250,6 +273,8 @@ 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.24.0]: https://github.com/ecmwf/atlas/compare/0.23.0...0.24.0
[0.23.0]: https://github.com/ecmwf/atlas/compare/0.22.1...0.23.0
[0.22.1]: https://github.com/ecmwf/atlas/compare/0.22.0...0.22.1
[0.22.0]: https://github.com/ecmwf/atlas/compare/0.21.0...0.22.0
[0.21.0]: https://github.com/ecmwf/atlas/compare/0.20.2...0.21.0
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set( ATLAS_BITS_LOCAL 32 CACHE STRING "bits used to define a local index (atlas
################################################################################
# Required packages

ecbuild_find_package( NAME eckit VERSION 1.4.0 REQUIRED )
ecbuild_find_package( NAME eckit VERSION 1.16 REQUIRED )
ecbuild_debug( " eckit_FEATURES : [${eckit_FEATURES}]" )

################################################################################
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.22.1
0.24.0
36 changes: 27 additions & 9 deletions cmake/atlas-import.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ endif()

## transi
if( atlas_HAVE_TRANS AND atlas_REQUIRES_PRIVATE_DEPENDENCIES )
find_dependency( transi HINTS ${CMAKE_CURRENT_LIST_DIR}/../transi @transi_DIR@ @transi_BINARY_DIR@ )
set( transi_DIR @transi_DIR@ )
if( transi_DIR )
find_dependency( transi HINTS ${CMAKE_CURRENT_LIST_DIR}/../transi @transi_DIR@ )
else()
find_dependency( trans COMPONENTS transi double HINTS ${CMAKE_CURRENT_LIST_DIR}/../trans @trans_DIR@ )
endif()
endif()

## CGAL
Expand All @@ -86,11 +91,11 @@ set( @PROJECT_NAME@_DIR ${CMAKE_CURRENT_LIST_DIR} CACHE STRING "" )
function( atlas_create_plugin name )

set( options )
set( single_value_args VERSION )
set( multi_value_args LIBRARY )
set( single_value_args VERSION LIBRARY URL NAMESPACE)
set( multi_value_args )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )

set( _plugin_file share/atlas/plugins/${name}.yml )
set( _plugin_file share/plugins/${name}.yml )

if( NOT DEFINED _PAR_VERSION )
set( _version ${${PROJECT_NAME}_VERSION} )
Expand All @@ -102,10 +107,23 @@ function( atlas_create_plugin name )
else()
set( _library "${_PAR_LIBRARY}" )
endif()
file( WRITE ${CMAKE_BINARY_DIR}/${_plugin_file} "name: ${name}\n" )
file( APPEND ${CMAKE_BINARY_DIR}/${_plugin_file} "version: ${_version}\n" )
file( APPEND ${CMAKE_BINARY_DIR}/${_plugin_file} "library: ${_library}" )
install( FILES ${CMAKE_BINARY_DIR}/${_plugin_file} DESTINATION share/atlas/plugins )
if( NOT DEFINED _PAR_URL )
set( _url "http://www.ecmwf.int" )
else()
set( _url ${_PAR_URL} )
endif()
if( NOT DEFINED _PAR_NAMESPACE )
set( _namespace "int.ecmwf" )
else()
set( _namespace ${_PAR_NAMESPACE} )
endif()

endfunction()
file( WRITE ${CMAKE_BINARY_DIR}/${_plugin_file} "plugin:\n" )
file( APPEND ${CMAKE_BINARY_DIR}/${_plugin_file} " name: ${name}\n" )
file( APPEND ${CMAKE_BINARY_DIR}/${_plugin_file} " namespace: ${_namespace}\n" )
file( APPEND ${CMAKE_BINARY_DIR}/${_plugin_file} " url: ${_url}\n" )
file( APPEND ${CMAKE_BINARY_DIR}/${_plugin_file} " version: ${_version}\n" )
file( APPEND ${CMAKE_BINARY_DIR}/${_plugin_file} " library: ${_library}\n" )

install( FILES ${CMAKE_BINARY_DIR}/${_plugin_file} DESTINATION share/plugins )
endfunction()
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") # colon separated numbers
ecbuild_add_fortran_flags("-hnomessage=3140") # colon separated numbers

ecbuild_add_cxx_flags("-hnomessage=3140" NAME atlas_cxx_disable_warnings ) # colon separated numbers
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
# The IPA optimization level was changed to "1" due to the presence of OMP
Expand Down
2 changes: 1 addition & 1 deletion cmake/features/CLANG_TIDY.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ if (HAVE_CLANG_TIDY)
)
set( CLANG_TIDY_CHECKS "${CLANG_TIDY_CHECKS},${_clang_tidy_check}" )
endforeach()
set( CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-checks=${CLANG_TIDY_CHECKS};-header-filter='${CMAKE_SOURCE_DIR}/*'${CLANG_TIDY_FIXIT}" )
set( CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-checks=${CLANG_TIDY_CHECKS};-extra-arg-before=-D__clang_analyzer__;-header-filter='${CMAKE_SOURCE_DIR}/*'${CLANG_TIDY_FIXIT}" )
endif()
6 changes: 2 additions & 4 deletions cmake/features/DOCS.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
################################################################################
# documentation
if( ENABLE_DOCS )
find_package(LATEX COMPONENTS PDFLATEX BIBTEX OPTIONAL_COMPONENTS MAKEINDEX HTLATEX)
endif()

ecbuild_add_option( FEATURE DOCS
DESCRIPTION "Atlas documentation"
DEFAULT OFF
CONDITION LATEX_FOUND )
REQUIRED_PACKAGES "LATEX COMPONENTS PDFLATEX BIBTEX OPTIONAL_COMPONENTS MAKEINDEX HTLATEX" )
3 changes: 1 addition & 2 deletions cmake/features/FFTW.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
### FFTW ...

find_package(FFTW COMPONENTS double QUIET )
ecbuild_add_option( FEATURE FFTW
DESCRIPTION "Support for fftw"
CONDITION FFTW_FOUND )
REQUIRED_PACKAGES "FFTW COMPONENTS double QUIET" )
3 changes: 1 addition & 2 deletions cmake/features/FORTRAN.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
### Fortran ...

ecbuild_find_package( NAME fckit VERSION 0.6.2 COMPONENTS ECKIT )
ecbuild_add_option( FEATURE FORTRAN
DESCRIPTION "Provide Fortran bindings"
CONDITION fckit_FOUND )
REQUIRED_PACKAGES "fckit VERSION 0.6.2 COMPONENTS ECKIT" )

if( atlas_HAVE_FORTRAN )

Expand Down
12 changes: 5 additions & 7 deletions cmake/features/OMP.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
### OMP ...
if( "${CMAKE_VERSION}" VERSION_LESS "3.11" )
if( ENABLE_OMP )
ecbuild_warn( "OpenMP only supported with CMake 3.11 onwards" )
endif()
else()
find_package( OpenMP COMPONENTS CXX ${Fortran} )

if( ENABLE_OMP OR NOT DEFINED ENABLE_OMP )
find_package( OpenMP COMPONENTS CXX ${Fortran} )
endif()

ecbuild_add_option( FEATURE OMP
DESCRIPTION "support for OpenMP shared memory parallelism"
CONDITION OpenMP_Fortran_FOUND OR OpenMP_CXX_FOUND )
Expand Down Expand Up @@ -56,4 +54,4 @@ if( HAVE_OMP_CXX )
endif()
endif()

endif()
endif()
6 changes: 3 additions & 3 deletions cmake/features/TESSELATION.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

set(Boost_USE_MULTITHREADED ON )

ecbuild_find_package( NAME CGAL QUIET)
ecbuild_find_package( NAME Boost VERSION 1.45.0 QUIET )
ecbuild_add_option( FEATURE TESSELATION
DESCRIPTION "Support for unstructured mesh generation"
CONDITION CGAL_FOUND AND Boost_FOUND )
REQUIRED_PACKAGES
"CGAL QUIET"
"Boost VERSION 1.45.0 QUIET" )

if( atlas_HAVE_TESSELATION )
list( APPEND CGAL_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} )
Expand Down
19 changes: 17 additions & 2 deletions cmake/features/TRANS.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
### trans ...

ecbuild_find_package( NAME transi VERSION 0.4.4 QUIET )
if( ENABLE_TRANS OR NOT DEFINED ENABLE_TRANS )
find_package( trans 47.2 COMPONENTS transi double QUIET )
if( TARGET transi_dp )
set( transi_FOUND TRUE )
if( NOT TARGET transi )
get_target_property( transi_dp_IMPORTED transi_dp IMPORTED )
if( transi_dp_IMPORTED )
set_target_properties( transi_dp PROPERTIES IMPORTED_GLOBAL TRUE) # required for aliasing imports
endif()
add_library( transi ALIAS transi_dp )
endif()
else()
find_package( transi 0.8 QUIET )
endif()
endif()

ecbuild_add_option( FEATURE TRANS
DESCRIPTION "Support for spectral transforms"
DESCRIPTION "Support for IFS spectral transforms"
CONDITION transi_FOUND )
4 changes: 2 additions & 2 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )

endif()

endif()


if( NOT DEFINED ATLAS_DOC_VERSION )
set( ATLAS_DOC_VERSION ${ATLAS_VERSION_STR} )
Expand Down Expand Up @@ -100,3 +98,5 @@ add_custom_target(
)

set_property(TARGET atlas_doxygen PROPERTY EXCLUDE_FROM_ALL TRUE)

endif()
2 changes: 1 addition & 1 deletion doc/example-projects/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Usage:

atlas_DIR=<path-to-install-or-build-tree> ./build_hello_world.sh
atlas_ROOT=<path-to-install-or-build-tree> ./build_hello_world.sh

2 changes: 1 addition & 1 deletion doc/example-projects/project_hello_world/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

project( hello_world VERSION 0.0.0 LANGUAGES CXX )

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

project( hello_world VERSION 0.0.0 LANGUAGES Fortran )

Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ if( CMAKE_BUILD_TYPE MATCHES "Debug" )
set( atlas_BUILD_TYPE_DEBUG 1 )
endif()

ecbuild_parse_version( ${eckit_VERSION} PREFIX ATLAS_ECKIT )
math( EXPR ATLAS_ECKIT_VERSION_INT "( 10000 * ${ATLAS_ECKIT_VERSION_MAJOR} ) + ( 100 * ${ATLAS_ECKIT_VERSION_MINOR} ) + ${ATLAS_ECKIT_VERSION_PATCH}" )

add_subdirectory( atlas_acc_support )

add_subdirectory( atlas )
Expand Down
5 changes: 5 additions & 0 deletions src/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ ecbuild_add_executable(
SOURCES atlas-gaussian-latitudes.cc
LIBS atlas )

ecbuild_add_executable(
TARGET atlas-io-list
SOURCES atlas-io-list.cc
LIBS atlas )

108 changes: 108 additions & 0 deletions src/apps/atlas-io-list.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
* (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 <iostream>
#include <string>


#include "eckit/filesystem/PathName.h"

#include "atlas/io/Exceptions.h"
#include "atlas/io/RecordPrinter.h"
#include "atlas/io/print/Bytes.h"
#include "atlas/runtime/AtlasTool.h"

namespace atlas {


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

struct AtlasIOList : public atlas::AtlasTool {
bool serial() override { return true; }
int execute( const Args& args ) override;
std::string briefDescription() override { return "Inspection of atlas-io files"; }
std::string usage() override { return name() + " <file> [OPTION]... [--help,-h]"; }
std::string longDescription() override {
return "Inspection of atlas-io files\n"
"\n"
" <file>: path to atlas-io file";
}

AtlasIOList( int argc, char** argv ) : AtlasTool( argc, argv ) {
add_option( new SimpleOption<std::string>( "format", "Output format" ) );
add_option( new SimpleOption<bool>( "version", "Print version of records" ) );
add_option( new SimpleOption<bool>( "details", "Print detailed information" ) );
}
};

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

int AtlasIOList::execute( const Args& args ) {
auto return_code = success();

using namespace atlas;

// User sanity checks
if ( args.count() == 0 ) {
Log::error() << "No file specified." << std::endl;
help( std::cout );
return failed();
}

// Configuration
util::Config config;
config.set( "format", args.getString( "format", "table" ) );
config.set( "details", args.getBool( "details", false ) );

// Loop over files
for ( size_t f = 0; f < args.count(); ++f ) {
eckit::PathName file( args( f ) );
if ( !file.exists() ) {
Log::error() << "File does not exist: " << file << std::endl;
return failed();
}
auto filesize = size_t( file.size() );

io::Session session;

std::uint64_t pos = 0;
try {
while ( pos < filesize ) {
auto uri = io::Record::URI{file, pos};
auto record = io::RecordPrinter{uri, config};

std::stringstream out;
out << "\n# " << uri.path << " [" << uri.offset << "] "
<< "{ size: " << atlas::io::Bytes{record.size()}.str( 0 ) << ", version: " << record.version()
<< ", created: " << record.time() << " }";
out << '\n' << ( config.getString( "format" ) == "table" ? "" : "---" ) << '\n';
out << record << std::endl;

std::cout << out.str();

pos += record.size();
}
}
catch ( const io::Exception& e ) {
Log::error() << " ATLAS-IO-ERROR: " << e.what() << std::endl;
return_code = failed();
}
}
return return_code;
}

} // namespace atlas

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

int main( int argc, char** argv ) {
atlas::AtlasIOList tool( argc, argv );
return tool.start();
}
Loading

0 comments on commit 071bbb1

Please sign in to comment.