Skip to content

Commit

Permalink
Merge branch 'release/0.9.0'
Browse files Browse the repository at this point in the history
* release/0.9.0:
  Version 0.9.0
  Add ecbuild search hint parallel to source dir
  FCKIT-29 Migrate to ecbuild-3.4
  Fix mpi_info_null when eckit is compiled with MPI, but using serial backend
  • Loading branch information
wdeconinck committed Oct 14, 2020
2 parents 4cd749f + 62ec805 commit 9cd993a
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 55 deletions.
32 changes: 7 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@
############################################################################################
# FCKIT

cmake_minimum_required( VERSION 3.6 FATAL_ERROR )
if( POLICY CMP0074 )
cmake_policy( SET CMP0074 NEW )
# This policy allows to search for packages with <package>_ROOT variables
# (only supported with CMake 3.12 and above)
# This policy can be removed once cmake_minimum_required( VERSION 3.12 ) is used
endif()
cmake_minimum_required( VERSION 3.12 FATAL_ERROR )

find_package( ecbuild 3.0.0 REQUIRED )
find_package( ecbuild 3.0.0 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild )

project( fckit LANGUAGES C CXX Fortran )

Expand Down Expand Up @@ -80,7 +74,7 @@ if( NOT fckit_HAVE_FINAL )
set( FCKIT_FINAL_BROKEN_FOR_AUTOMATIC_ARRAY 0 )
endif()

ecbuild_find_package( NAME eckit VERSION 0.21.0 QUIET )
ecbuild_find_package( NAME eckit VERSION 1.5 QUIET )
ecbuild_add_option( FEATURE ECKIT
DESCRIPTION "Wrap ecKit functionality"
CONDITION eckit_FOUND )
Expand All @@ -91,31 +85,19 @@ endif()
## MPI
set( fckit_HAVE_ECKIT_MPI_PARALLEL 0 )
if( fckit_HAVE_ECKIT )
if( NOT ECKIT_HAVE_MPI )
set( fckit_HAVE_ECKIT_MPI_PARALLEL 0 )
set( HAVE_MPI 0 )
else()
if( eckit_HAVE_MPI OR ECKIT_HAVE_MPI )
set( fckit_HAVE_ECKIT_MPI_PARALLEL 1 )
set( HAVE_MPI 1 )
else()
set( fckit_HAVE_ECKIT_MPI_PARALLEL 0 )
set( HAVE_MPI 0 )
endif()
endif()
set( fckit_HAVE_MPI ${HAVE_MPI} )
if( fckit_HAVE_ECKIT AND NOT fckit_HAVE_MPI )
ecbuild_warn("ecKit has been compiled without MPI. This causes fckit to not be able to run parallel executables.")
endif()

if( eckit_VERSION VERSION_LESS "0.25" )
set( ECKIT_IMPROVED_MPI 0 )
if( fckit_HAVE_ECKIT )
ecbuild_warn( "eckit version does not allow support for"
"- fckit_mpi_comm%set_default()"
"- fckit_mpi_comm%name()"
"- fckit_mpi_comm%delete()" )
endif()
else()
set( ECKIT_IMPROVED_MPI 1 )
endif()

################################################################################################
# export package info

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Simply add following line to your project's CMakeLists.txt
```
ecbuild_add_option( FEATURE FCTEST DEFAULT ${ENABLE_TESTS}
DESCRIPTION "Fortran Unit Testing Framework"
REQUIRED_PACKAGES "PROJECT fckit" )
REQUIRED_PACKAGES "NAME fckit" )
```

See src/examples folder how to add and create the unit-tests.
Expand Down
3 changes: 2 additions & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
0.8.0
0.9.0

2 changes: 1 addition & 1 deletion bamboo/CLANG-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ module unload libemos
module unload metview
module unload netcdf4

module load cmake/3.10.2
module load cmake/3.16.5

module switch gnu clang
2 changes: 1 addition & 1 deletion bamboo/GCC-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ module unload libemos
module unload metview
module unload netcdf4

module load cmake/3.10.2
module load cmake/3.16.5
2 changes: 1 addition & 1 deletion bamboo/INTEL-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ module unload libemos
module unload metview
module unload netcdf4

module load cmake/3.10.2
module load cmake/3.16.5

module switch gnu intel/17.0.3
2 changes: 1 addition & 1 deletion doc/ford.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Simply add following line to your project's CMakeLists.txt
```
ecbuild_add_option( FEATURE FCTEST DEFAULT ${ENABLE_TESTS}
DESCRIPTION "Fortran Unit Testing Framework"
REQUIRED_PACKAGES "PROJECT fckit" )
REQUIRED_PACKAGES "NAME fckit" )
```

See src/examples folder how to add and create the unit-tests.
Expand Down
1 change: 0 additions & 1 deletion src/fckit/Libfckit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <algorithm>
#include <string>

#include "eckit/eckit_version.h"
#include "fckit/Libfckit.h"
#include "fckit/fckit.h"

Expand Down
2 changes: 0 additions & 2 deletions src/fckit/fckit.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ does not compile
#define FCKIT_ALLOCATE_CHARACTER( VARIABLE, SIZE ) allocate( character(len=(SIZE),kind=c_char) :: VARIABLE )
#endif

#define ECKIT_IMPROVED_MPI @ECKIT_IMPROVED_MPI@

#if 0
// clang-format on
#endif
Expand Down
6 changes: 0 additions & 6 deletions src/fckit/module/fckit_configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@
#include "eckit/exception/Exceptions.h"
#include "eckit/filesystem/PathName.h"

#include "eckit/eckit_version.h"
#if 10000 * ECKIT_MAJOR_VERSION + 100 * ECKIT_MINOR_VERSION < 10400
#include "eckit/parser/JSON.h"
#else
#include "eckit/log/JSON.h"
#endif
//#include "eckit/parser/JSONParser.h"

using eckit::CodeLocation;
using eckit::Configuration;
Expand Down
22 changes: 9 additions & 13 deletions src/fckit/module/fckit_mpi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,31 +76,19 @@ void fckit__mpi__setCommDefault_name( const char* name ) {
}

void fckit__mpi__comm_set_default( Comm* comm ) {
#if ECKIT_IMPROVED_MPI
eckit::mpi::setCommDefault( comm->name().c_str() );
#else
throw eckit::NotImplemented( "eckit::mpi::Comm::name() not implemented in used version of eckit", Here() );
#endif
}

void fckit__mpi__comm_name( Comm* comm, char*& name, int32& size ) {
#if ECKIT_IMPROVED_MPI
std::string s = ( comm ? comm->name() : eckit::mpi::comm().name() );
size = int32( s.size() ) + 1;
name = new char[size];
std::strcpy( name, s.c_str() );
#else
throw eckit::NotImplemented( "eckit::mpi::Comm::name() not implemented in used version of eckit", Here() );
#endif
}

void fckit__mpi__comm_delete( Comm* comm ) {
if ( comm ) {
#if ECKIT_IMPROVED_MPI
eckit::mpi::deleteComm( comm->name().c_str() );
#else
throw eckit::NotImplemented( "eckit::mpi::deleteComm() not implemented in used version of eckit", Here() );
#endif
}
}

Expand Down Expand Up @@ -612,8 +600,16 @@ void fckit__mpi__wait( const Comm* comm, int32 request, int32* status ) {

int32 fckit__mpi__mpi_info_null() {
#if FCKIT_HAVE_ECKIT_MPI_PARALLEL
return MPI_Info_c2f( MPI_INFO_NULL );
int mpi_initialized;
if ( MPI_Initialized( &mpi_initialized ) == MPI_SUCCESS ) {
if ( mpi_initialized ) {
return MPI_Info_c2f( MPI_INFO_NULL );
}
}
// The case when eckit is compiled with MPI support, but using "serial" MPI backend
return 0;
#else
// The case when eckit is not compiled with MPI support
return 0;
#endif
}
Expand Down
2 changes: 0 additions & 2 deletions src/tests/test_mpi.F90
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,6 @@
END_TEST

TEST( test_split_comm_delete )
#if ECKIT_IMPROVED_MPI
use fckit_mpi_module
use, intrinsic :: iso_c_binding
implicit none
Expand Down Expand Up @@ -684,7 +683,6 @@
enddo

endif
#endif
END_TEST

TEST( test_mpi_info_null )
Expand Down

0 comments on commit 9cd993a

Please sign in to comment.