aboutsummaryrefslogtreecommitdiff
path: root/tools/100_checkdata
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-10-10 14:30:39 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-10-10 14:30:39 +0200
commitf8d247c53c3c3bd94fed645b5b47a9096cadc123 (patch)
tree7a62cc7322ea8175a7df9b655d4a9d5e026a004a /tools/100_checkdata
parent2e93de4ad102973961cb24d5b91f0c299763299f (diff)
downloadnissy-core-f8d247c53c3c3bd94fed645b5b47a9096cadc123.tar.gz
nissy-core-f8d247c53c3c3bd94fed645b5b47a9096cadc123.zip
Removed "options" from solver selection
Now the solver name fully determines the solver (and options) to be used. For example, now one must specify "h48h0k4" as the name of the solver. This PR also fixes a couple of things in tools.
Diffstat (limited to 'tools/100_checkdata')
-rw-r--r--tools/100_checkdata/checkdata.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/100_checkdata/checkdata.c b/tools/100_checkdata/checkdata.c
index 502925f..695a4dd 100644
--- a/tools/100_checkdata/checkdata.c
+++ b/tools/100_checkdata/checkdata.c
@@ -1,15 +1,15 @@
1#include "../tool.h" 1#include "../tool.h"
2#include "../expected_distributions.h" 2#include "../expected_distributions.h"
3 3
4char *solver, *options, *filename; 4char *solver, *filename;
5 5
6static void 6static void
7run(void) { 7run(void) {
8 int64_t size; 8 int64_t size, result;
9 char *buf; 9 char *buf;
10 FILE *f; 10 FILE *f;
11 11
12 size = nissy_datasize(solver, options); 12 size = nissy_datasize(solver);
13 13
14 if (size <= 0) { 14 if (size <= 0) {
15 fprintf(stderr, "Error in datasize\n"); 15 fprintf(stderr, "Error in datasize\n");
@@ -24,22 +24,23 @@ run(void) {
24 buf = malloc(size); 24 buf = malloc(size);
25 fread(buf, size, 1, f); 25 fread(buf, size, 1, f);
26 fclose(f); 26 fclose(f);
27 nissy_checkdata(solver, options, buf); 27 result = nissy_checkdata(solver, buf);
28 free(buf); 28 free(buf);
29 29
30 printf("checkdata %s\n", result == 0 ? "succeeded" : "failed");
31
30 /* TODO: cross-check with expected distributions? */ 32 /* TODO: cross-check with expected distributions? */
31} 33}
32 34
33int main(int argc, char **argv) { 35int main(int argc, char **argv) {
34 if (argc < 4) { 36 if (argc < 3) {
35 fprintf(stderr, "Error: not enough arguments. " 37 fprintf(stderr, "Error: not enough arguments. "
36 "A solver, its options and a file name must be given.\n"); 38 "A solver and a file name must be given.\n");
37 return 1; 39 return 1;
38 } 40 }
39 41
40 solver = argv[1]; 42 solver = argv[1];
41 options = argv[2]; 43 filename = argv[2];
42 filename = argv[3];
43 nissy_setlogger(log_stderr); 44 nissy_setlogger(log_stderr);
44 45
45 timerun(run); 46 timerun(run);

Generated with cgit - Back to sebastiano.tronto.net