From a14370019f54ab2c741f78b528501b77f0ccd0dd Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 20 Aug 2023 19:02:13 +0100 Subject: [PATCH] Testing: grib timer --- src/grib_timer.cc | 8 +------- tests/CMakeLists.txt | 2 +- tests/grib_ecc-386.cc | 15 +++++++-------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/grib_timer.cc b/src/grib_timer.cc index 4d41591de..c0b380c00 100644 --- a/src/grib_timer.cc +++ b/src/grib_timer.cc @@ -338,7 +338,7 @@ grib_timer* grib_get_timer(grib_context* c, const char* name, const char* statna { if (!c) c = grib_context_get_default(); - grib_context_log(c, GRIB_LOG_FATAL, "grib_get_timer function not available"); + grib_context_log(c, GRIB_LOG_ERROR, "%s function not available", __func__); return NULL; } @@ -359,24 +359,18 @@ double grib_timer_value(grib_timer* t) void grib_timer_print(grib_timer* t) { - return; } - void grib_timer_partial_rate(grib_timer* t, double start, long total) { - return; } void grib_print_all_timers() { - return; } void grib_reset_all_timers() { - return; } - #endif diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fa4cb5545..cce98f1f1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -456,7 +456,7 @@ if( HAVE_BUILD_TOOLS ) # Performance test. Must have -DENABLE_TIMER=ON ecbuild_add_test( TARGET eccodes_t_grib_ecc-386 TYPE SCRIPT - CONDITION ENABLE_EXTRA_TESTS AND ENABLE_TIMER + CONDITION ENABLE_EXTRA_TESTS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_ecc-386.sh TEST_DEPENDS eccodes_download_gribs ) else() diff --git a/tests/grib_ecc-386.cc b/tests/grib_ecc-386.cc index 70c430f97..d4e238c4f 100644 --- a/tests/grib_ecc-386.cc +++ b/tests/grib_ecc-386.cc @@ -21,7 +21,6 @@ static void usage(const char* prog) exit(1); } -#ifdef ECCODES_TIMER int main(int argc, char** argv) { grib_timer* tes = grib_get_timer(0, "decoding", 0, 0); @@ -32,7 +31,7 @@ int main(int argc, char** argv) double* values = NULL; double duration_actual = 0; const double duration_max = 3.6; /* seconds */ - const int num_repetitions = 1000; + const int num_repetitions = 100; if (argc < 2) usage(argv[0]); @@ -73,9 +72,9 @@ int main(int argc, char** argv) fclose(in); return 0; } -#else -int main(int argc, char** argv) -{ - return 0; -} -#endif + +// int main(int argc, char** argv) +// { +// return 0; +// } +// #endif