diff options
author | Leandro Pereira <leandro@hardinfo.org> | 2021-02-21 12:02:23 -0800 |
---|---|---|
committer | Leandro Pereira <leandro@hardinfo.org> | 2021-02-21 12:05:43 -0800 |
commit | 903e85283e33fedb639ba93f9d152eddb3ebfa78 (patch) | |
tree | 29d09d5d745c7d684e40d94f9d8616f32ccfebe6 /modules/benchmark/bench_results.c | |
parent | d5a97bb0e19fdac034246f7277410b7ec86231e0 (diff) |
Add support for NUMA nodes
Related to #599.
Diffstat (limited to 'modules/benchmark/bench_results.c')
-rw-r--r-- | modules/benchmark/bench_results.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/benchmark/bench_results.c b/modules/benchmark/bench_results.c index 40345aa5..6ba475ed 100644 --- a/modules/benchmark/bench_results.c +++ b/modules/benchmark/bench_results.c @@ -40,6 +40,7 @@ typedef struct { int processors; int cores; int threads; + int nodes; char *mid; int ptr_bits; /* 32, 64... BENCH_PTR_BITS; 0 for unspecified */ int is_su_data; /* 1 = data collected as root */ @@ -183,7 +184,7 @@ bench_machine *bench_machine_this() m->machine_type = module_call_method("computer::getMachineType"); free(tmp); - cpu_procs_cores_threads(&m->processors, &m->cores, &m->threads); + cpu_procs_cores_threads_nodes(&m->processors, &m->cores, &m->threads, &m->nodes); gen_machine_id(m); } return m; @@ -355,6 +356,11 @@ bench_result *bench_result_benchmarkjson(const gchar *bench_name, json_get_string(machine, "UserNote")); filter_invalid_chars(b->bvalue.user_note); + int nodes = json_get_int(machine, "NumNodes"); + + if (nodes == 0) + nodes = 1; + b->machine = bench_machine_new(); *b->machine = (bench_machine){ .board = json_get_string_dup(machine, "Board"), @@ -367,6 +373,7 @@ bench_result *bench_result_benchmarkjson(const gchar *bench_name, .processors = json_get_int(machine, "NumCpus"), .cores = json_get_int(machine, "NumCores"), .threads = json_get_int(machine, "NumThreads"), + .nodes = nodes, .mid = json_get_string_dup(machine, "MachineId"), .ptr_bits = json_get_int(machine, "PointerBits"), .is_su_data = json_get_boolean(machine, "DataFromSuperUser"), |