diff --git a/src/benchmarks/zellularautomat/c/ca_common.c b/src/benchmarks/zellularautomat/c/ca_common.c index b004ce8aeb2edde403a1e8424ed8759e7d7cd503..4793064d68fa932062cd0bf86ca03a4b21fe2989 100644 --- a/src/benchmarks/zellularautomat/c/ca_common.c +++ b/src/benchmarks/zellularautomat/c/ca_common.c @@ -61,9 +61,9 @@ static char* ca_buffer_to_hex_str(const uint8_t* buf, size_t buf_size) return retval; } -static void ca_print_hash_and_time(const char *hash, const double time) +static void ca_print_hash(const char *hash) { - printf("hash: %s\ttime: %.3f s\n", (hash ? hash : "ERROR"), time); + printf("hash: %s\n", (hash ? hash : "ERROR")); } static void ca_clean_ghost_zones(line_t *buf, int lines) @@ -74,7 +74,7 @@ static void ca_clean_ghost_zones(line_t *buf, int lines) } } -void ca_hash_and_report(line_t *buf, int lines, double time_in_s) +void ca_hash_and_report(line_t *buf, int lines) { uint8_t hash[MD5_DIGEST_LENGTH]; uint32_t md_len; @@ -87,7 +87,7 @@ void ca_hash_and_report(line_t *buf, int lines, double time_in_s) EVP_DigestFinal_ex(ctx, hash, &md_len); char* hash_str = ca_buffer_to_hex_str(hash, MD5_DIGEST_LENGTH); - ca_print_hash_and_time(hash_str, time_in_s); + ca_print_hash(hash_str); free(hash_str); EVP_MD_CTX_free(ctx); diff --git a/src/benchmarks/zellularautomat/c/ca_common.h b/src/benchmarks/zellularautomat/c/ca_common.h index 6ec6a889ef6dd8744ad22ec2477040b793ad28ce..532da415ec6735872292d09ef61bf9eb0af7650b 100644 --- a/src/benchmarks/zellularautomat/c/ca_common.h +++ b/src/benchmarks/zellularautomat/c/ca_common.h @@ -3,7 +3,6 @@ #include <stdint.h> #include <stddef.h> -#include <time.h> /* a: pointer to array; x,y: coordinates; result: n-th element of anneal, where n is the number of neighbors */ @@ -12,14 +11,6 @@ (a)[(y)-1][(x) ] + (a)[(y)][(x) ] + (a)[(y)+1][(x) ] +\ (a)[(y)-1][(x)+1] + (a)[(y)][(x)+1] + (a)[(y)+1][(x)+1]]) -#define TIME_GET(timer) \ - struct timespec timer; \ - clock_gettime(CLOCK_MONOTONIC, &timer) - -#define TIME_DIFF(timer1, timer2) \ - ((timer2.tv_sec * 1.0E+9 + timer2.tv_nsec) - \ - (timer1.tv_sec * 1.0E+9 + timer1.tv_nsec)) / 1.0E+9 - #ifdef __cplusplus extern "C" { @@ -35,7 +26,7 @@ typedef cell_state_t line_t[XSIZE + 2]; void ca_init(int argc, char** argv, int *lines, int *its); void ca_init_config(line_t *buf, int lines, int skip_lines); -void ca_hash_and_report(line_t *buf, int lines, double time_in_s); +void ca_hash_and_report(line_t *buf, int lines); #ifdef __cplusplus } diff --git a/src/benchmarks/zellularautomat/c/ca_openmp.c b/src/benchmarks/zellularautomat/c/ca_openmp.c index b42fc1ea21fde492edbf34d157066129360ae95b..ad9166fbac4a8ca328485f25456c1bc34faec4b5 100644 --- a/src/benchmarks/zellularautomat/c/ca_openmp.c +++ b/src/benchmarks/zellularautomat/c/ca_openmp.c @@ -33,7 +33,7 @@ static void boundary(line_t *buf, int lines) for (int y = 0; y <= lines + 1; y++) { /* copy rightmost column to the buffer column 0 */ buf[y][0] = buf[y][XSIZE]; - + /* copy leftmost column to the buffer column XSIZE + 1 */ buf[y][XSIZE + 1] = buf[y][1]; } @@ -43,7 +43,7 @@ static void boundary(line_t *buf, int lines) for (int x = 0; x <= XSIZE + 1; x++) { /* copy bottommost row to buffer row 0 */ buf[0][x] = buf[lines][x]; - + /* copy topmost row to buffer row lines + 1 */ buf[lines + 1][x] = buf[1][x]; } @@ -77,7 +77,6 @@ int main(int argc, char** argv) ca_init_config(from, lines, 0); - TIME_GET(sim_start); for (int i = 0; i < its; i++) { boundary(from, lines); simulate(from, to, lines); @@ -86,9 +85,8 @@ int main(int argc, char** argv) from = to; to = temp; } - TIME_GET(sim_stop); - ca_hash_and_report(from + 1, lines, TIME_DIFF(sim_start, sim_stop)); + ca_hash_and_report(from + 1, lines); free(from); free(to); diff --git a/src/benchmarks/zellularautomat/c/meson.build b/src/benchmarks/zellularautomat/c/meson.build index 056fd2cf6ef260624d1a802eb221264693de5a73..f3642e62f6b3724a8b3c8001b8784ab15587d423 100644 --- a/src/benchmarks/zellularautomat/c/meson.build +++ b/src/benchmarks/zellularautomat/c/meson.build @@ -8,7 +8,6 @@ sources = [ dependencies = [ dependency('openmp'), cc.find_library('crypto'), - cc.find_library('rt'), ] options = [