diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-07-20 22:51:23 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-07-20 22:51:23 +0200 |
| commit | f64a5a67a37015bd5066efd9b1edb6ac3e0b7a97 (patch) | |
| tree | 52984e67e1cde946c58a8e266a88a0dafe85419a /tools | |
| parent | 5727f06c5694a4831881322876e3ba4d8ce3b743 (diff) | |
| download | nissy-core-f64a5a67a37015bd5066efd9b1edb6ac3e0b7a97.tar.gz nissy-core-f64a5a67a37015bd5066efd9b1edb6ac3e0b7a97.zip | |
Fixed gendata tool and cleaned up some stuff
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/gendata_h48/gendata_h48.c (renamed from tools/01_gendata_h48/benchmark_gendata_h48.c) | 16 | ||||
| -rw-r--r-- | tools/stats_tables_h48/stats_tables_h48.c (renamed from tools/02_stats_tables_h48/stats_tables_h48.c) | 1 | ||||
| -rw-r--r-- | tools/timerun.h | 12 |
3 files changed, 21 insertions, 8 deletions
diff --git a/tools/01_gendata_h48/benchmark_gendata_h48.c b/tools/gendata_h48/gendata_h48.c index efb6f6f..c8a6d12 100644 --- a/tools/01_gendata_h48/benchmark_gendata_h48.c +++ b/tools/gendata_h48/gendata_h48.c | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | #include "../timerun.h" | 1 | #include "../timerun.h" |
| 2 | #include "../../src/cube.h" | 2 | #include "../../src/cube.h" |
| 3 | 3 | ||
| 4 | #define MAXDEPTH 10 | 4 | #define MAXDEPTH 20 |
| 5 | #define HVALUE 2 | 5 | #define HVALUE 0 |
| 6 | #define OPTIONS "2;10" | 6 | #define OPTIONS "0;20" |
| 7 | #define LONGOPTIONS "h = 2, max depth = 10" | 7 | #define LONGOPTIONS "h = 0, max depth = 20" |
| 8 | 8 | ||
| 9 | #define COCSEPSIZE 1119792 | 9 | #define COCSEPSIZE 1119792 |
| 10 | #define ETABLESIZE(h) (((3393 * 495 * 70) >> 1) << (size_t)(h)) | 10 | #define ETABLESIZE(h) (((3393 * 495 * 70) >> 1) << (size_t)(h)) |
| @@ -16,7 +16,7 @@ void run(void) { | |||
| 16 | int i; | 16 | int i; |
| 17 | int64_t s; | 17 | int64_t s; |
| 18 | 18 | ||
| 19 | s = nissy_gendata("H48", OPTIONS, buf); | 19 | s = nissy_gendata("h48", OPTIONS, buf); |
| 20 | 20 | ||
| 21 | if (s == -1) { | 21 | if (s == -1) { |
| 22 | printf("Error generating table\n"); | 22 | printf("Error generating table\n"); |
| @@ -28,10 +28,12 @@ void run(void) { | |||
| 28 | } | 28 | } |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | int main() { | 31 | int main(void) { |
| 32 | int64_t size; | 32 | int64_t size; |
| 33 | 33 | ||
| 34 | size = nissy_datasize("H48", OPTIONS); | 34 | nissy_setlogger(log_stderr); |
| 35 | |||
| 36 | size = nissy_datasize("h48", OPTIONS); | ||
| 35 | if (size == -1) { | 37 | if (size == -1) { |
| 36 | printf("gendata_h48 benchmark: error in datasize\n"); | 38 | printf("gendata_h48 benchmark: error in datasize\n"); |
| 37 | return 1; | 39 | return 1; |
diff --git a/tools/02_stats_tables_h48/stats_tables_h48.c b/tools/stats_tables_h48/stats_tables_h48.c index 7c6bc3c..7118992 100644 --- a/tools/02_stats_tables_h48/stats_tables_h48.c +++ b/tools/stats_tables_h48/stats_tables_h48.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include <pthread.h> | 1 | #include <pthread.h> |
| 2 | #include <stdarg.h> | ||
| 3 | #include <time.h> | 2 | #include <time.h> |
| 4 | #include "../timerun.h" | 3 | #include "../timerun.h" |
| 5 | #include "../../src/cube.h" | 4 | #include "../../src/cube.h" |
diff --git a/tools/timerun.h b/tools/timerun.h index dabfde0..58a8e7a 100644 --- a/tools/timerun.h +++ b/tools/timerun.h | |||
| @@ -1,9 +1,21 @@ | |||
| 1 | #include <stdarg.h> | ||
| 1 | #include <stdbool.h> | 2 | #include <stdbool.h> |
| 2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
| 3 | #include <stdio.h> | 4 | #include <stdio.h> |
| 4 | #include <stdlib.h> | 5 | #include <stdlib.h> |
| 5 | #include <time.h> | 6 | #include <time.h> |
| 6 | 7 | ||
| 8 | void | ||
| 9 | log_stderr(const char *str, ...) | ||
| 10 | { | ||
| 11 | va_list args; | ||
| 12 | |||
| 13 | va_start(args, str); | ||
| 14 | vfprintf(stderr, str, args); | ||
| 15 | va_end(args); | ||
| 16 | } | ||
| 17 | |||
| 18 | |||
| 7 | double | 19 | double |
| 8 | timerun(void (*run)(void), char *name) | 20 | timerun(void (*run)(void), char *name) |
| 9 | { | 21 | { |
