Hi!
> We added numa_helper library to be able to get number of nodes, as well
> as list of nodes (with memory, cpu or both). numa_max_node() > 0 doesn't
> tell you how many nodes you have.
>
> Here's sample use to get just node count:
> ----------------------------------------------------------------
> #include <stdio.h>
> #include "numa_helper.h"
>
> const char *TCID="test";
> int main()
> {
> int num_nodes;
> int ret = get_allowed_nodes_arr(NH_MEMS | NH_CPUS, &num_nodes, NULL);
> printf("ret: %d, nodes:%d\n", ret, num_nodes);
> return 0;
> }
> ----------------------------------------------------------------
>
> We could add a simple function to numa_helper, but I'm not sure what
> it would return as default, some tests care about nodes with memory.
Maybe we misunderstand about what I see as a problem here. This patch
adds integer variable to the lib/mem.c library and that variable is then
only used within the tests. That just looks like wrong desing to me.
The code snippet "numa_max_node() > 0" was take from one of the tests
that initializes the variable in question (the pattern seems to repeat
in them). So I wasn't proposing any functional changes in the code just
requesting cleaner desing.
--
Cyril Hrubis
[email protected]
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list