From ae19339660002b722febe096f3406b38c7752b2e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 6 Jan 2021 17:49:43 +0000 Subject: [PATCH] ECC-1189: CMake: Rename option GRIB_TIMER to ECCODES_TIMER --- CMakeLists.txt | 8 ++++---- configure.ac | 4 ++-- eccodes_config.h.in | 2 +- src/grib_api_internal.h | 2 +- src/grib_timer.c | 2 +- tests/CMakeLists.txt | 4 ++-- tests/grib_ccsds_perf.c | 2 +- tests/grib_ecc-386.c | 4 ++-- tests/gribex_perf.c | 2 +- tests/jpeg_perf.c | 2 +- tests/laplacian.c | 2 +- tests/png_perf.c | 2 +- tests/so_perf.c | 2 +- tests/timing.c | 2 +- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 118c15f90..514cbf4f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,7 +181,7 @@ ecbuild_add_option( FEATURE INSTALL_ECCODES_SAMPLES ecbuild_add_option( FEATURE MEMORY_MANAGEMENT DESCRIPTION "Enable memory management" DEFAULT OFF ADVANCED ) ecbuild_add_option( FEATURE ALIGN_MEMORY DESCRIPTION "Enable memory alignment" DEFAULT OFF ADVANCED ) -ecbuild_add_option( FEATURE GRIB_TIMER DESCRIPTION "Enable timer" DEFAULT OFF ADVANCED ) +ecbuild_add_option( FEATURE ECCODES_TIMER DESCRIPTION "Enable timer" DEFAULT OFF ADVANCED ) ecbuild_add_option( FEATURE ECCODES_THREADS DESCRIPTION "Enable POSIX threads" DEFAULT OFF ADVANCED ) ecbuild_add_option( FEATURE ECCODES_OMP_THREADS DESCRIPTION "Enable OMP threads" DEFAULT OFF ADVANCED ) ecbuild_add_option( FEATURE EXTRA_TESTS DESCRIPTION "Enable extended regression testing" DEFAULT OFF ADVANCED ) @@ -240,10 +240,10 @@ endif() ############################################################################### # other options -if( HAVE_GRIB_TIMER ) - set( GRIB_TIMER 1 ) +if( HAVE_ECCODES_TIMER ) + set( ECCODES_TIMER 1 ) else() - set( GRIB_TIMER 0 ) + set( ECCODES_TIMER 0 ) endif() set( IS_BIG_ENDIAN 0 ) diff --git a/configure.ac b/configure.ac index 2962312c4..cdbc47c19 100755 --- a/configure.ac +++ b/configure.ac @@ -332,9 +332,9 @@ AC_ARG_ENABLE([timer], [AS_HELP_STRING([--enable-timer],[enable timer [by default disabled]])], [with_timer=${enableval}], [with_timer=no]) if test "x${with_timer}" = xyes; then - AC_DEFINE(GRIB_TIMER,1,1->Timer on 0->Timer off) + AC_DEFINE(ECCODES_TIMER,1,1->Timer on 0->Timer off) else - AC_DEFINE(GRIB_TIMER,0,1->Timer on 0->Timer off) + AC_DEFINE(ECCODES_TIMER,0,1->Timer on 0->Timer off) fi diff --git a/eccodes_config.h.in b/eccodes_config.h.in index 534c9bf23..9d5d35edd 100644 --- a/eccodes_config.h.in +++ b/eccodes_config.h.in @@ -36,7 +36,7 @@ #define ECCODES_SAMPLES_PATH "@ECCODES_SAMPLES_PATH@" -#define GRIB_TIMER @GRIB_TIMER@ +#define ECCODES_TIMER @ECCODES_TIMER@ /* headers */ diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index 5c0a78bf4..3b8fae3ca 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -1541,7 +1541,7 @@ struct grib_smart_table }; -#if GRIB_TIMER +#if ECCODES_TIMER typedef struct grib_timer { struct timeval start_; diff --git a/src/grib_timer.c b/src/grib_timer.c index d7667e7ea..4d41591de 100644 --- a/src/grib_timer.c +++ b/src/grib_timer.c @@ -10,7 +10,7 @@ #include "grib_api_internal.h" -#if GRIB_TIMER +#if ECCODES_TIMER #ifndef ECCODES_ON_WINDOWS #include diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 727a92449..3dae75a54 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -351,10 +351,10 @@ if( HAVE_BUILD_TOOLS ) COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bufr_split_by_rdbSubtype.sh TEST_DEPENDS eccodes_download_bufrs ) - # Performance test. Must have -DENABLE_GRIB_TIMER=ON + # Performance test. Must have -DENABLE_ECCODES_TIMER=ON ecbuild_add_test( TARGET eccodes_t_grib_ecc-386 TYPE SCRIPT - CONDITION ENABLE_EXTRA_TESTS AND ENABLE_GRIB_TIMER + CONDITION ENABLE_EXTRA_TESTS AND ENABLE_ECCODES_TIMER COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_ecc-386.sh TEST_DEPENDS eccodes_download_gribs ) else() diff --git a/tests/grib_ccsds_perf.c b/tests/grib_ccsds_perf.c index e3c2c235f..880b487f2 100644 --- a/tests/grib_ccsds_perf.c +++ b/tests/grib_ccsds_perf.c @@ -10,7 +10,7 @@ #include "grib_api_internal.h" -#if GRIB_TIMER +#if ECCODES_TIMER void usage(char* prog) { diff --git a/tests/grib_ecc-386.c b/tests/grib_ecc-386.c index d2b166866..7e99423d8 100644 --- a/tests/grib_ecc-386.c +++ b/tests/grib_ecc-386.c @@ -21,7 +21,7 @@ static void usage(const char* prog) exit(1); } -#ifdef GRIB_TIMER +#ifdef ECCODES_TIMER int main(int argc, char** argv) { grib_timer* tes = grib_get_timer(0, "decoding", 0, 0); @@ -31,7 +31,7 @@ int main(int argc, char** argv) size_t values_len = 0; double* values = NULL; double duration_actual = 0; - const double duration_max = 3; /* seconds */ + const double duration_max = 3.6; /* seconds */ const int num_repetitions = 1000; if (argc < 2) usage(argv[0]); diff --git a/tests/gribex_perf.c b/tests/gribex_perf.c index 53d6e8199..a229dcf02 100644 --- a/tests/gribex_perf.c +++ b/tests/gribex_perf.c @@ -17,7 +17,7 @@ #define BUFF_SIZE 50000000 #ifdef HAVE_LIBEMOS -#if GRIB_TIMER +#if ECCODES_TIMER #define TEST_OK #endif #endif diff --git a/tests/jpeg_perf.c b/tests/jpeg_perf.c index adad04820..729b9dde4 100644 --- a/tests/jpeg_perf.c +++ b/tests/jpeg_perf.c @@ -10,7 +10,7 @@ #include "grib_api_internal.h" -#if GRIB_TIMER +#if ECCODES_TIMER void usage(char* prog) { diff --git a/tests/laplacian.c b/tests/laplacian.c index 43b70881f..dd2da174f 100644 --- a/tests/laplacian.c +++ b/tests/laplacian.c @@ -17,7 +17,7 @@ #define BUFF_SIZE 50000000 #ifdef HAVE_LIBEMOS -#if GRIB_TIMER +#if ECCODES_TIMER #define TEST_OK #endif #endif diff --git a/tests/png_perf.c b/tests/png_perf.c index f39e36c43..5210953f8 100644 --- a/tests/png_perf.c +++ b/tests/png_perf.c @@ -10,7 +10,7 @@ #include "grib_api_internal.h" -#if GRIB_TIMER +#if ECCODES_TIMER void usage(char* prog) { diff --git a/tests/so_perf.c b/tests/so_perf.c index d985471b1..d87b255ea 100644 --- a/tests/so_perf.c +++ b/tests/so_perf.c @@ -17,7 +17,7 @@ #define BUFF_SIZE 10000000 #ifdef HAVE_LIBEMOS -#if GRIB_TIMER +#if ECCODES_TIMER #define TEST_OK #endif #endif diff --git a/tests/timing.c b/tests/timing.c index ae3e5f1da..28b72599b 100644 --- a/tests/timing.c +++ b/tests/timing.c @@ -16,7 +16,7 @@ #define NUMBER(a) (sizeof(a)/sizeof(a[0])) #ifdef HAVE_LIBEMOS -#if GRIB_TIMER +#if ECCODES_TIMER extern void grsrnd_(flong*); extern void gribex_(flong*, flong*, flong*, double*, flong*, double*, flong*, double*,