Testing: grib timer

This commit is contained in:
Shahram Najm 2023-08-20 19:02:13 +01:00
parent b5b4e9a651
commit a14370019f
3 changed files with 9 additions and 16 deletions

View File

@ -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

View File

@ -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()

View File

@ -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