Revert "[update] ftest : add omp and omp_get_wtime"

This reverts commit 8223eba81b.
This commit is contained in:
2026-06-24 22:09:26 +02:00
parent 8223eba81b
commit ed63c6ea25
+11 -18
View File
@@ -208,7 +208,6 @@ void bar_progress_stop(void);
//#include <unistd.h> //#include <unistd.h>
#include <sys/ioctl.h> /* to have size of screen, for progress bar */ #include <sys/ioctl.h> /* to have size of screen, for progress bar */
#include <omp.h>
#define DEFAULT_K "\033[0m" /*Resets the text to default color*/ #define DEFAULT_K "\033[0m" /*Resets the text to default color*/
#define GREEN_K "\033[0;32m" #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)\ #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);\ 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) [bench omp:%lf s]\n\n",count_pass_local,fun_ame, diff_timespec_nanoseconds(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)\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) [bench omp:%lf s]\n\n",count_pass_local,fun_ame, diff_timespec_milliseconds(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)\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*) * need to separate num type and ptr type because of (void*)
@@ -3379,17 +3378,15 @@ append_func(void (*run)(void), char *name){ \
++count_tests; \ ++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); \ 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); \ PRINT_HK_C(colors_f[k_GREEN],tab_hk_f[hk_RN]," %s\n", fun_ame); \
count_pass_local = 0; \ count_pass_local = 0; \
count_fail_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); \ struct timespec end_t; clock_gettime(CLOCK_REALTIME, &end_t); \
double end_d = omp_get_wtime();\
if(count_fail_local){ \ if(count_fail_local){ \
INCREMENT(count_fail_global); /*++count_fail_global*/ \ INCREMENT(count_fail_global); /*++count_fail_global*/ \
append_failed_list(&failed_l, fun_ame); \ 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){ \ void execute_all(struct func *fun){ \
struct func *tmp = fun; \ struct func *tmp = fun; \
struct timespec start_t; \ struct timespec start_t; \
double start_d;\
size_t num_f; \ size_t num_f; \
char *name_test=NULL; \ char *name_test=NULL; \
bool exec_test=0; \ bool exec_test=0; \
@@ -3475,9 +3471,9 @@ void execute_all(struct func *fun){ \
current_fn = tmp; \ current_fn = tmp; \
CHECK_IF_SELECTED_TEST(tmp->name) \ CHECK_IF_SELECTED_TEST(tmp->name) \
if(exec_test){ \ if(exec_test){ \
begin_execute_func(tmp->name, &start_t, &start_d); \ begin_execute_func(tmp->name, &start_t); \
tmp->run(); \ tmp->run(); \
end_execute_func(tmp->name, start_t, start_d); \ end_execute_func(tmp->name, start_t); \
} \ } \
tmp = tmp->next; \ 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); \ 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); \ 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); \ 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); \ 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); \ 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]){ \ 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){ \ void execute_test_parallel(size_t id_thrd){ \
\ \
struct timespec start_t; \ struct timespec start_t; \
double start_d;\
struct func *tmp; \ struct func *tmp; \
size_t num_f; \ size_t num_f; \
char *name_test=NULL; \ char *name_test=NULL; \
@@ -3625,9 +3618,9 @@ void execute_test_parallel(size_t id_thrd){ \
CHECK_IF_SELECTED_TEST(tmp->name) \ CHECK_IF_SELECTED_TEST(tmp->name) \
if(exec_test){ \ if(exec_test){ \
PRINT_DEBUG(" *** thread[%ld], func_name = %s *** \n", id_thrd, tmp->name); \ 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(); \ 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{ \ else{ \