Skip to content

Commit 9cd993a

Browse files
committed
Merge branch 'release/0.9.0'
* 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
2 parents 4cd749f + 62ec805 commit 9cd993a

File tree

12 files changed

+23
-55
lines changed

12 files changed

+23
-55
lines changed

CMakeLists.txt

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,9 @@
99
############################################################################################
1010
# FCKIT
1111

12-
cmake_minimum_required( VERSION 3.6 FATAL_ERROR )
13-
if( POLICY CMP0074 )
14-
cmake_policy( SET CMP0074 NEW )
15-
# This policy allows to search for packages with <package>_ROOT variables
16-
# (only supported with CMake 3.12 and above)
17-
# This policy can be removed once cmake_minimum_required( VERSION 3.12 ) is used
18-
endif()
12+
cmake_minimum_required( VERSION 3.12 FATAL_ERROR )
1913

20-
find_package( ecbuild 3.0.0 REQUIRED )
14+
find_package( ecbuild 3.0.0 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild )
2115

2216
project( fckit LANGUAGES C CXX Fortran )
2317

@@ -80,7 +74,7 @@ if( NOT fckit_HAVE_FINAL )
8074
set( FCKIT_FINAL_BROKEN_FOR_AUTOMATIC_ARRAY 0 )
8175
endif()
8276

83-
ecbuild_find_package( NAME eckit VERSION 0.21.0 QUIET )
77+
ecbuild_find_package( NAME eckit VERSION 1.5 QUIET )
8478
ecbuild_add_option( FEATURE ECKIT
8579
DESCRIPTION "Wrap ecKit functionality"
8680
CONDITION eckit_FOUND )
@@ -91,31 +85,19 @@ endif()
9185
## MPI
9286
set( fckit_HAVE_ECKIT_MPI_PARALLEL 0 )
9387
if( fckit_HAVE_ECKIT )
94-
if( NOT ECKIT_HAVE_MPI )
95-
set( fckit_HAVE_ECKIT_MPI_PARALLEL 0 )
96-
set( HAVE_MPI 0 )
97-
else()
88+
if( eckit_HAVE_MPI OR ECKIT_HAVE_MPI )
9889
set( fckit_HAVE_ECKIT_MPI_PARALLEL 1 )
9990
set( HAVE_MPI 1 )
91+
else()
92+
set( fckit_HAVE_ECKIT_MPI_PARALLEL 0 )
93+
set( HAVE_MPI 0 )
10094
endif()
10195
endif()
10296
set( fckit_HAVE_MPI ${HAVE_MPI} )
10397
if( fckit_HAVE_ECKIT AND NOT fckit_HAVE_MPI )
10498
ecbuild_warn("ecKit has been compiled without MPI. This causes fckit to not be able to run parallel executables.")
10599
endif()
106100

107-
if( eckit_VERSION VERSION_LESS "0.25" )
108-
set( ECKIT_IMPROVED_MPI 0 )
109-
if( fckit_HAVE_ECKIT )
110-
ecbuild_warn( "eckit version does not allow support for"
111-
"- fckit_mpi_comm%set_default()"
112-
"- fckit_mpi_comm%name()"
113-
"- fckit_mpi_comm%delete()" )
114-
endif()
115-
else()
116-
set( ECKIT_IMPROVED_MPI 1 )
117-
endif()
118-
119101
################################################################################################
120102
# export package info
121103

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Simply add following line to your project's CMakeLists.txt
2929
```
3030
ecbuild_add_option( FEATURE FCTEST DEFAULT ${ENABLE_TESTS}
3131
DESCRIPTION "Fortran Unit Testing Framework"
32-
REQUIRED_PACKAGES "PROJECT fckit" )
32+
REQUIRED_PACKAGES "NAME fckit" )
3333
```
3434

3535
See src/examples folder how to add and create the unit-tests.

VERSION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
0.8.0
1+
0.9.0
2+

bamboo/CLANG-env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ module unload libemos
2020
module unload metview
2121
module unload netcdf4
2222

23-
module load cmake/3.10.2
23+
module load cmake/3.16.5
2424

2525
module switch gnu clang

bamboo/GCC-env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ module unload libemos
1515
module unload metview
1616
module unload netcdf4
1717

18-
module load cmake/3.10.2
18+
module load cmake/3.16.5

bamboo/INTEL-env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ module unload libemos
1515
module unload metview
1616
module unload netcdf4
1717

18-
module load cmake/3.10.2
18+
module load cmake/3.16.5
1919

2020
module switch gnu intel/17.0.3

doc/ford.md.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Simply add following line to your project's CMakeLists.txt
7070
```
7171
ecbuild_add_option( FEATURE FCTEST DEFAULT ${ENABLE_TESTS}
7272
DESCRIPTION "Fortran Unit Testing Framework"
73-
REQUIRED_PACKAGES "PROJECT fckit" )
73+
REQUIRED_PACKAGES "NAME fckit" )
7474
```
7575

7676
See src/examples folder how to add and create the unit-tests.

src/fckit/Libfckit.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <algorithm>
1212
#include <string>
1313

14-
#include "eckit/eckit_version.h"
1514
#include "fckit/Libfckit.h"
1615
#include "fckit/fckit.h"
1716

src/fckit/fckit.h.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ does not compile
6767
#define FCKIT_ALLOCATE_CHARACTER( VARIABLE, SIZE ) allocate( character(len=(SIZE),kind=c_char) :: VARIABLE )
6868
#endif
6969

70-
#define ECKIT_IMPROVED_MPI @ECKIT_IMPROVED_MPI@
71-
7270
#if 0
7371
// clang-format on
7472
#endif

src/fckit/module/fckit_configuration.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,7 @@
2121
#include "eckit/exception/Exceptions.h"
2222
#include "eckit/filesystem/PathName.h"
2323

24-
#include "eckit/eckit_version.h"
25-
#if 10000 * ECKIT_MAJOR_VERSION + 100 * ECKIT_MINOR_VERSION < 10400
26-
#include "eckit/parser/JSON.h"
27-
#else
2824
#include "eckit/log/JSON.h"
29-
#endif
30-
//#include "eckit/parser/JSONParser.h"
3125

3226
using eckit::CodeLocation;
3327
using eckit::Configuration;

src/fckit/module/fckit_mpi.cc

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,31 +76,19 @@ void fckit__mpi__setCommDefault_name( const char* name ) {
7676
}
7777

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

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

9789
void fckit__mpi__comm_delete( Comm* comm ) {
9890
if ( comm ) {
99-
#if ECKIT_IMPROVED_MPI
10091
eckit::mpi::deleteComm( comm->name().c_str() );
101-
#else
102-
throw eckit::NotImplemented( "eckit::mpi::deleteComm() not implemented in used version of eckit", Here() );
103-
#endif
10492
}
10593
}
10694

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

613601
int32 fckit__mpi__mpi_info_null() {
614602
#if FCKIT_HAVE_ECKIT_MPI_PARALLEL
615-
return MPI_Info_c2f( MPI_INFO_NULL );
603+
int mpi_initialized;
604+
if ( MPI_Initialized( &mpi_initialized ) == MPI_SUCCESS ) {
605+
if ( mpi_initialized ) {
606+
return MPI_Info_c2f( MPI_INFO_NULL );
607+
}
608+
}
609+
// The case when eckit is compiled with MPI support, but using "serial" MPI backend
610+
return 0;
616611
#else
612+
// The case when eckit is not compiled with MPI support
617613
return 0;
618614
#endif
619615
}

src/tests/test_mpi.F90

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,6 @@
656656
END_TEST
657657

658658
TEST( test_split_comm_delete )
659-
#if ECKIT_IMPROVED_MPI
660659
use fckit_mpi_module
661660
use, intrinsic :: iso_c_binding
662661
implicit none
@@ -684,7 +683,6 @@
684683
enddo
685684

686685
endif
687-
#endif
688686
END_TEST
689687

690688
TEST( test_mpi_info_null )

0 commit comments

Comments
 (0)