Commit 18177375 authored by Philippe SWARTVAGHER's avatar Philippe SWARTVAGHER
Browse files

Fix error when --bind_memory_comp is not given

parent ba033659
......@@ -125,7 +125,9 @@ static int memset_init()
#pragma omp parallel for
for (int i = 0; i < nb_threads; i++)
{
a[i] = data_malloc(array_size*sizeof(MEMSET_TYPE), get_numa_node_comp_for_id(i % params.memory_comp_numa_nodes_nb));
a[i] = data_malloc(
array_size*sizeof(MEMSET_TYPE),
params.memory_comp_numa_nodes_nb == 0 ? -1 : get_numa_node_comp_for_id(i % params.memory_comp_numa_nodes_nb));
for (int j = 0; j < array_size; j++)
{
......@@ -298,7 +300,10 @@ static void memset_release()
{
for (int i = 0; i < nb_threads; i++)
{
data_free(a[i], array_size*sizeof(MEMSET_TYPE), get_numa_node_comp_for_id(i % params.memory_comp_numa_nodes_nb));
data_free(
a[i],
array_size*sizeof(MEMSET_TYPE),
params.memory_comp_numa_nodes_nb == 0 ? -1 : get_numa_node_comp_for_id(i % params.memory_comp_numa_nodes_nb));
}
free(a);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment