diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-05-14 13:43:55 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-05-14 13:43:55 +0200 |
commit | 4052d7b4c0e1a59419f07642b9a33088f5745d28 (patch) | |
tree | 23fb0907d1ffad55331e0e8fcf71ac2d876f4851 /BFS/include/params.h | |
parent | aed00e149b8a3677a89416eaa112ea6c5249150b (diff) |
BFS: AspectC++ (and behaviour model) support
Diffstat (limited to 'BFS/include/params.h')
-rw-r--r-- | BFS/include/params.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/BFS/include/params.h b/BFS/include/params.h new file mode 100644 index 0000000..f9169bc --- /dev/null +++ b/BFS/include/params.h @@ -0,0 +1,67 @@ + +#ifndef _PARAMS_H_ +#define _PARAMS_H_ + +#include "common.h" +#include "utils.h" + +static void usage() +{ + PRINT("\nUsage: ./program [options]" + "\n" + "\nBenchmark-specific options:" + "\n -f <F> input matrix file name (default=data/roadNet-CA.txt)" + "\n" + "\nGeneral options:" + "\n -v <V> verbosity" "\n -h help" "\n\n"); +} + +typedef struct Params { + const char *fileName; + unsigned int verbosity; +#if NUMA + struct bitmask *bitmask_in; + int numa_node_cpu; +#endif +} Params; + +static struct Params input_params(int argc, char **argv) +{ + struct Params p; + p.fileName = "data/roadNet-CA.txt"; + p.verbosity = 0; +#if NUMA + p.bitmask_in = NULL; + p.numa_node_cpu = -1; +#endif + int opt; + while ((opt = getopt(argc, argv, "f:v:hA:C:")) >= 0) { + switch (opt) { + case 'f': + p.fileName = optarg; + break; + case 'v': + p.verbosity = atoi(optarg); + break; +#if NUMA + case 'A': + p.bitmask_in = numa_parse_nodestring(optarg); + break; + case 'C': + p.numa_node_cpu = atoi(optarg); + break; +#endif + case 'h': + usage(); + exit(0); + default: + PRINT_ERROR("Unrecognized option!"); + usage(); + exit(0); + } + } + + return p; +} + +#endif |