On Apr 22, 2007, at 5:47 PM, Bert Wesarg wrote:
>> I'm not sure what you mean -- can you give a concrete example?
>
> I think that was mine thinking error. The current one to one mapping
> between the processor id and the (socket, core) tuple is perfectly
> fine.
> What I mean with the NUMA node id, is to add the node id as an
> attribute
> to the processor_id. That can be queried by the api. But to support
> SMT,
> it would be necessary to extend it to a (socket,core,thread) tuple.
I still don't understand this last statement.
> I have implement the node attribute and changed/extended the API as
> follow:
>
> /* node_id can be NULL */
> int PLPA_NAME(map_to_processor_id)
> (int socket, int core, int *processor_id, int *node_id);
Taking a step back, it seems like given any one of the three
following entities (bear with me -- I'm thinking out loud):
- (socket,core) tuple
- processor ID
- node ID
You want to be able to query for the other two. It seems like we
should be able to have a very small number of functions to be able to
query for all of these. But it's unfortunately a little more complex
than this because:
- one-to-one: (socket,core) -> processor ID
- one-to-one: (socket,core) -> node ID
- one-to-one: processor ID -> (socket,core)
- one-to-one: processor ID -> node ID
- one-to-many: node ID -> (socket,core)
- one-to-many: node ID -> processor ID
I see two possibilities:
1. Have 1 function and define a struct for input and output,
something like this: ...never mind, I wrote it out and it was really
ugly.
2. Have 3 functions (assuming we delete the 2 current plpa_map_to_*()
functions):
- have (socket,core), want processor ID and/or node ID
plpa_map_from_socket_core(int socket, int core, int *processor_id,
int *node_id);
processor_id can be NULL or node_id can be NULL, but not both.
- have processor ID, want (socket,core) and/or node ID
plpa_map_from_processor(int processor_id, int *socket, int *core,
int *node_id);
(socket,core) can be NULL or node_id can be NULL, but not both.
- have node ID, want a list of processor IDs and/or a list of
(socket,core) tuples
plpa_map_from_node(int node_id, int *socket, int *core, int
*processor_id);
(socket,core) can be NULL or processor_id can be NULL, but not both.
How does this sound?
> /* this name is not perfect, node_id is a attribute of processor_id */
> int PLPA_NAME(map_to_node_id)(int processor_id, int *node_id);
>
> int PLPA_NAME(max_node_id)(int *max_node_id);
>
> The one think that is maybe missing is a function to query the
> number of
> sockets in a NUMA node.
If you create a "non trivial" patch, I'll need to have an OMPI 3rd
party contribution agreement from you. It's unfortunately necessary
in today's legal software climate. :-(
But if you can describe to me the stuff I need to parse in /sys to
get node mappings, I'm happy to add this functionality myself.
--
Jeff Squyres
Cisco Systems
|