Skip to content

Commit

Permalink
Merge branch 'release/0.13.0'
Browse files Browse the repository at this point in the history
* release/0.13.0: (355 commits)
  Remove warning
  enabled test_transgeneral to run when trans library is not available
  Fix compilation without gridtools-storage
  more cleanup
  Change more ifdefs and cleanup include order
  Change #ifdef ATLAS_HAVE_EIGEN to #if ATLAS_HAVE_EIGEN
  Change #ifdef ATLAS_HAVE_FORTRAN to #if ATLAS_HAVE_FORTRAN
  Change #ifdef ATLAS_ARRAYVIEW_BOUNDS_CHECKING to #if ATLAS_ARRAYVIEW_BOUNDS_CHECKING
  Change #ifdef ATLAS_HAVE_ACC to #if ATLAS_HAVE_ACC
  Change #ifdef ATLAS_HAVE_OMP to #if ATLAS_HAVE_OMP
  more cleanup
  some cleanup in the local transform
  Fix comment wrap
  Turn on the barrier_timeout again for atlas c++ tests
  Fix application of clang-format to fortran include
  WARNING: Applied clangformat for first time. All files touched
  Edit clang-format configuration
  ATLAS-148 Fix mesh-generator for 3D RegularLonLat grids
  Fix atlas with GridTools-CUDA backend
  Fix insane sanity checks
  ...
  • Loading branch information
wdeconinck committed Feb 16, 2018
2 parents 0599b8a + 1d18723 commit be3e70e
Show file tree
Hide file tree
Showing 602 changed files with 56,550 additions and 67,201 deletions.
106 changes: 104 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,4 +1,106 @@
---
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: true
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
AccessModifierOffset: -2
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: false
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: true
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 4
UseTab: Never
...
104 changes: 53 additions & 51 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) Copyright 1996-2017 ECMWF.
# (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.
Expand Down Expand Up @@ -31,15 +31,9 @@ ecbuild_declare_project()

### eckit

ecbuild_use_package( PROJECT eckit VERSION 0.17 REQUIRED )
ecbuild_use_package( PROJECT eckit VERSION 0.18.1 REQUIRED )
ecbuild_debug( " ECKIT_FEATURES : [${ECKIT_FEATURES}]" )

set( ECKIT_HAVE_TESTING ON )
if( ECKIT_VERSION VERSION_LESS 0.18 )
set( ECKIT_HAVE_TESTING OFF )
ecbuild_warn("Atlas C++ unit tests are disabled because (eckit version < 0.18)")
endif()

# options & dependencies

ecbuild_add_cxx11_flags()
Expand All @@ -50,7 +44,8 @@ ecbuild_find_python()

ecbuild_add_option( FEATURE FORTRAN
DESCRIPTION "Provide Fortran bindings"
REQUIRED_PACKAGES "PROJECT fckit VERSION 0.4" )
REQUIRED_PACKAGES "PROJECT fckit VERSION 0.5" )

if( ATLAS_HAVE_FORTRAN )

if( FCKIT_HAVE_ECKIT )
Expand All @@ -71,9 +66,11 @@ if( ATLAS_HAVE_FORTRAN )
ecbuild_warn( "In order to compile atlas_f, fckit is required to be compiled with eckit. Turning off fortran." )
set( HAVE_FORTRAN 0 )
set( ATLAS_HAVE_FORTRAN 0 )
unset( FCKIT_LIBRARIES )

endif()

else()
unset( FCKIT_LIBRARIES )
endif()

### MPI ...
Expand Down Expand Up @@ -116,7 +113,7 @@ ecbuild_add_option( FEATURE TESSELATION
DESCRIPTION "Support for unstructured mesh generation"
REQUIRED_PACKAGES "CGAL QUIET" "Boost 1.45.0" )

if( HAVE_TESSELATION )
if( ATLAS_HAVE_TESSELATION )
list( APPEND CGAL_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} )
if ( TARGET CGAL::CGAL )
list( APPEND CGAL_LIBRARIES CGAL::CGAL ${CGAL_3RD_PARTY_LIBRARIES} ${GMP_LIBRARIES} ${MPFR_LIBRARIES} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} )
Expand All @@ -125,50 +122,54 @@ if( HAVE_TESSELATION )
endif()
endif()

### FIND GRIDTOOLS STORAGE
### GridTools storage module

ecbuild_add_option(
FEATURE GRIDTOOLS_STORAGE
DESCRIPTION "Arrays internally use GridTools storage layer"
REQUIRED_PACKAGES "gridtools_storage" )
FEATURE GRIDTOOLS_STORAGE
DESCRIPTION "Arrays internally use GridTools storage layer"
REQUIRED_PACKAGES "PROJECT gridtools_storage" )

if( ATLAS_HAVE_GRIDTOOLS_STORAGE )

set( ENABLE_GPU "OFF" CACHE BOOL "Compile with GPU support (CUDA)" )

set( ATLAS_GRIDTOOLS_STORAGE_BACKEND_HOST 1 )
set( ATLAS_GRIDTOOLS_STORAGE_BACKEND_CUDA 0 )
set( ATLAS_GRIDTOOLS_STORAGE_BACKEND_HOST 1 )
set( ATLAS_GRIDTOOLS_STORAGE_BACKEND_CUDA 0 )

if(ENABLE_GPU)
set( CUDA_USE_STATIC_CUDA_RUNTIME OFF )
find_package(CUDA REQUIRED)
if( GRIDTOOLS_HAVE_CUDA )
ecbuild_info( "Gridtools found with CUDA support" )
set( ATLAS_GRIDTOOLS_STORAGE_BACKEND_HOST 0 )
set( ATLAS_GRIDTOOLS_STORAGE_BACKEND_CUDA 1 )
endif()

string(REPLACE "." "" CUDA_VERSION ${CUDA_VERSION})
else()

add_definitions(-D_FORCE_INLINES) # Question to Carlos: Is this needed for nvcc only?
set( ATLAS_GRIDTOOLS_STORAGE_BACKEND_HOST 0 )
set( ATLAS_GRIDTOOLS_STORAGE_BACKEND_CUDA 0 )

set(CUDA_PROPAGATE_HOST_FLAGS ON)
set(CUDA_NVCC_FLAGS "--std=c++11" "--relaxed-constexpr" "${CUDA_NVCC_FLAGS}")
if( NOT ${CUDA_VERSION} VERSION_GREATER "60")
message(FATAL_ERROR "CUDA 6.0 or lower does not support C++11 (disabling)")
endif()
endif()

set( CUDA_ARCH "sm_35" CACHE STRING "Compute capability for CUDA" )
set( CUDA_SEPARABLE_COMPILATION ON)

include_directories(SYSTEM ${CUDA_INCLUDE_DIRS})
### OpenACC

set(CUDA_SEPARABLE_COMPILATION ON)
# adding the additional nvcc flags
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" "-arch=${CUDA_ARCH}" "-Xcudafe" "--diag_suppress=dupl_calling_convention")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" "-Xcudafe" "--diag_suppress=code_is_unreachable" "-Xcudafe")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" "--diag_suppress=implicit_return_from_non_void_function" "-Xcudafe")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" "--diag_suppress=calling_convention_not_allowed" "-Xcudafe")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" "--diag_suppress=conflicting_calling_conventions")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" "-Xcompiler" "-fPIC")
set( ATLAS_ACC_CAPABLE FALSE )
if( ATLAS_GRIDTOOLS_STORAGE_BACKEND_CUDA )
if( CMAKE_Fortran_COMPILER_ID MATCHES "PGI" )
set( ATLAS_ACC_CAPABLE TRUE )
endif()
endif()

set( ATLAS_GRIDTOOLS_STORAGE_BACKEND_HOST 0 )
set( ATLAS_GRIDTOOLS_STORAGE_BACKEND_CUDA 1 )
ecbuild_add_option( FEATURE ACC
DESCRIPTION "OpenACC capable data structures"
CONDITION ATLAS_ACC_CAPABLE )

if( ATLAS_HAVE_ACC )
if( CMAKE_Fortran_COMPILER_ID MATCHES "PGI" )
set( ACC_Fortran_FLAGS -acc -ta=tesla,cuda${CUDA_VERSION},nordc )
set( ACC_C_FLAGS ${ACC_Fortran_FLAGS} )
find_program( ACC_C_COMPILER NAMES pgcc HINTS ${PGI_DIR} ENV PGI_DIR PATH_SUFFIXES bin )
if( NOT ACC_C_COMPILER )
ecbuild_error( "Could not find OpenACC capable C compiler" )
endif()
endif()
endif()

### Eigen
Expand Down Expand Up @@ -238,6 +239,7 @@ if( CMAKE_Fortran_COMPILER_ID MATCHES "PGI" AND
endif()

include_directories( ${ATLAS_INCLUDE_DIRS} ${ATLAS_EXTRA_INCLUDE_DIRS} )
include(CompileFlags)
add_subdirectory( src )

################################################################################
Expand All @@ -249,18 +251,18 @@ set( ATLAS_DESCRIPTION "Atlas framework for parallel mesh datastructures" )
ecbuild_pkgconfig()

ecbuild_pkgconfig(
NAME atlas-c++
LANGUAGES CXX
LIBRARIES atlas
NAME atlas-c++
LANGUAGES CXX
LIBRARIES atlas
)

if( ATLAS_HAVE_FORTRAN )
ecbuild_pkgconfig(
NAME atlas-fortran
LANGUAGES Fortran
LIBRARIES atlas_f
NO_PRIVATE_INCLUDE_DIRS
)
ecbuild_pkgconfig(
NAME atlas-fortran
LANGUAGES Fortran
LIBRARIES atlas_f
NO_PRIVATE_INCLUDE_DIRS
)
endif()

################################################################################
Expand Down
Loading

0 comments on commit be3e70e

Please sign in to comment.