From ed63c6ea25947238284daa64e57cf6725c3a0f0a Mon Sep 17 00:00:00 2001 From: fanasina Date: Wed, 24 Jun 2026 22:09:26 +0200 Subject: [PATCH] Revert "[update] ftest : add omp and omp_get_wtime" This reverts commit 8223eba81b3ae1065316afe9b9274f5a51893a45. --- y_test_h.h | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/y_test_h.h b/y_test_h.h index 21bc332..eee47e2 100644 --- a/y_test_h.h +++ b/y_test_h.h @@ -208,7 +208,6 @@ void bar_progress_stop(void); //#include #include /* to have size of screen, for progress bar */ -#include #define DEFAULT_K "\033[0m" /*Resets the text to default color*/ #define GREEN_K "\033[0;32m" @@ -2630,9 +2629,9 @@ bool expected_array_##OP##_name_##type(type *var1, long int sz1, type *var2, lon #define PRINT_TIMESTAMP_STAT(color)\ - if(SECOND) PRINT_HK_C(color,tab_hk_f[hk_DN]," %lu tests passed from %s (%lf s) [bench omp:%lf s]\n\n",count_pass_local,fun_ame, diff_timespec_seconds(end_t, start_t),end_d-start_d);\ - else if(NANOSECOND) PRINT_HK_C(color,tab_hk_f[hk_DN]," %lu tests passed from %s (%ld ns) [bench omp:%lf s]\n\n",count_pass_local,fun_ame, diff_timespec_nanoseconds(end_t, start_t),end_d-start_d);\ - else PRINT_HK_C(color,tab_hk_f[hk_DN]," %lu tests passed from %s (%lf ms) [bench omp:%lf s]\n\n",count_pass_local,fun_ame, diff_timespec_milliseconds(end_t, start_t),end_d-start_d);\ + if(SECOND) PRINT_HK_C(color,tab_hk_f[hk_DN]," %lu tests passed from %s (%lf s)\n\n",count_pass_local,fun_ame, diff_timespec_seconds(end_t, start_t));\ + else if(NANOSECOND) PRINT_HK_C(color,tab_hk_f[hk_DN]," %lu tests passed from %s (%ld ns)\n\n",count_pass_local,fun_ame, diff_timespec_nanoseconds(end_t, start_t));\ + else PRINT_HK_C(color,tab_hk_f[hk_DN]," %lu tests passed from %s (%lf ms)\n\n",count_pass_local,fun_ame, diff_timespec_milliseconds(end_t, start_t)); /* * need to separate num type and ptr type because of (void*) @@ -3379,17 +3378,15 @@ append_func(void (*run)(void), char *name){ \ ++count_tests; \ } \ \ -void begin_execute_func(char *fun_ame, struct timespec *start_t, double *start_d){ \ +void begin_execute_func(char *fun_ame, struct timespec *start_t){ \ clock_gettime(CLOCK_REALTIME, start_t); \ - *start_d = omp_get_wtime();\ PRINT_HK_C(colors_f[k_GREEN],tab_hk_f[hk_RN]," %s\n", fun_ame); \ count_pass_local = 0; \ count_fail_local = 0; \ } \ \ -void end_execute_func(char *fun_ame, struct timespec start_t, double start_d){ \ +void end_execute_func(char *fun_ame, struct timespec start_t){ \ struct timespec end_t; clock_gettime(CLOCK_REALTIME, &end_t); \ - double end_d = omp_get_wtime();\ if(count_fail_local){ \ INCREMENT(count_fail_global); /*++count_fail_global*/ \ append_failed_list(&failed_l, fun_ame); \ @@ -3462,7 +3459,6 @@ void extract_name_test_from_name(char *name_org, char **name_f){ \ void execute_all(struct func *fun){ \ struct func *tmp = fun; \ struct timespec start_t; \ - double start_d;\ size_t num_f; \ char *name_test=NULL; \ bool exec_test=0; \ @@ -3475,9 +3471,9 @@ void execute_all(struct func *fun){ \ current_fn = tmp; \ CHECK_IF_SELECTED_TEST(tmp->name) \ if(exec_test){ \ - begin_execute_func(tmp->name, &start_t, &start_d); \ + begin_execute_func(tmp->name, &start_t); \ tmp->run(); \ - end_execute_func(tmp->name, start_t, start_d); \ + end_execute_func(tmp->name, start_t); \ } \ tmp = tmp->next; \ } \ @@ -3574,15 +3570,13 @@ stat_end_all_parallel_run(size_t ntst, struct timespec start_t){ \ \ \ \ -void begin_execute_func_parallel(char *fun_ame, struct timespec *start_t, size_t id_thrd, double *start_d){ \ +void begin_execute_func_parallel(char *fun_ame, struct timespec *start_t, size_t id_thrd){ \ clock_gettime(CLOCK_REALTIME, start_t); \ - *start_d = omp_get_wtime();\ PRINT_HK_C(colors_f[k_GREEN],tab_hk_f[hk_RN]," %s on thread[%ld]\n", fun_ame, id_thrd); \ } \ \ -void end_execute_func_parallel(char *fun_ame, struct timespec start_t, size_t id_thrd, double start_d){ \ +void end_execute_func_parallel(char *fun_ame, struct timespec start_t, size_t id_thrd){ \ struct timespec end_t; clock_gettime(CLOCK_REALTIME, &end_t); \ - double end_d = omp_get_wtime();\ size_t num_test = extract_num__f(fun_ame); \ PRINT_DEBUG(" ... thread[%ld], count_fail_test[%ld] = %ld ... %s\n", id_thrd, num_test, count_fail_test[num_test],fun_ame); \ if(count_fail_test[num_test]){ \ @@ -3606,7 +3600,6 @@ void end_execute_func_parallel(char *fun_ame, struct timespec start_t, size_t id void execute_test_parallel(size_t id_thrd){ \ \ struct timespec start_t; \ - double start_d;\ struct func *tmp; \ size_t num_f; \ char *name_test=NULL; \ @@ -3625,9 +3618,9 @@ void execute_test_parallel(size_t id_thrd){ \ CHECK_IF_SELECTED_TEST(tmp->name) \ if(exec_test){ \ PRINT_DEBUG(" *** thread[%ld], func_name = %s *** \n", id_thrd, tmp->name); \ - begin_execute_func_parallel(tmp->name, &start_t, id_thrd, &start_d); \ + begin_execute_func_parallel(tmp->name, &start_t, id_thrd); \ tmp->run(); \ - end_execute_func_parallel(tmp->name, start_t, id_thrd, start_d); \ + end_execute_func_parallel(tmp->name, start_t, id_thrd); \ } \ } \ else{ \