process ID to Node ID:Processor ID mapping

process ID to Node ID:Processor ID mapping

Post by alim » Sun, 28 Jul 2002 09:02:43



Hi,

 MPI_Get_processor_name gets the name of the node on which the process is
running, but how to find which processor on the node the process is running
on? I am running the application on a beowulf cluster with 2-processor smp
nodes.

Thanks

Ali

 
 
 

process ID to Node ID:Processor ID mapping

Post by Georg Bisselin » Tue, 30 Jul 2002 17:14:20



>  MPI_Get_processor_name gets the name of the node on which the process is
> running, but how to find which processor on the node the process is running
> on? I am running the application on a beowulf cluster with 2-processor smp
> nodes.

There is no way to get this information with an MPI call because
this information is too platform dependant.

Most SMP machines (better their operating systems) move processes
between the CPUs at will. Some allow to specify a fixed CPU for a
process (processor sets in Solaris),  some don't (standard Linux,
I think).

Someone who knows if "beowulf" means a new scheduler or has the
ability to assign CPUs to processes might be able to help you.

Regards
Georg

 
 
 

process ID to Node ID:Processor ID mapping

Post by David Turlan » Tue, 30 Jul 2002 21:55:14




>> MPI_Get_processor_name gets the name of the node on which the process is
>>running, but how to find which processor on the node the process is running
>>on? I am running the application on a beowulf cluster with 2-processor smp
>>nodes.

> There is no way to get this information with an MPI call because
> this information is too platform dependant.

> Most SMP machines (better their operating systems) move processes
> between the CPUs at will. Some allow to specify a fixed CPU for a
> process (processor sets in Solaris),  some don't (standard Linux,
> I think).

> Someone who knows if "beowulf" means a new scheduler or has the
> ability to assign CPUs to processes might be able to help you.

> Regards
> Georg

have a look at

include/linux/smp.h

convenient looking preprocessor macro

smp_processor_id()

which may return a CPU-dependant value or may always just return 0

David Turland

 
 
 

process ID to Node ID:Processor ID mapping

Post by David Turlan » Tue, 30 Jul 2002 22:32:58




>> MPI_Get_processor_name gets the name of the node on which the process is
>>running, but how to find which processor on the node the process is running
>>on? I am running the application on a beowulf cluster with 2-processor smp
>>nodes.

> There is no way to get this information with an MPI call because
> this information is too platform dependant.

> Most SMP machines (better their operating systems) move processes
> between the CPUs at will. Some allow to specify a fixed CPU for a
> process (processor sets in Solaris),  some don't (standard Linux,
> I think).

> Someone who knows if "beowulf" means a new scheduler or has the
> ability to assign CPUs to processes might be able to help you.

> Regards
> Georg

 > Most SMP machines (better their operating systems) move processes
 > between the CPUs at will.

Is this true? I can imagine proceses and threads are dynamically
assigned to CPUs in an intelligent way on creation but reassigning them
to a different CPU during their lifetime?

how could a kernel imagine a CPU was overloaded and one of its processes
should be resssigned. Surely the most a CPU can be is 100% loaded which
is surely the 'optimum' load for a CPU. why would the process manager(?)
want to change that?

As you may have noticed I haven't considered this reassigning thing
before. Any pointers to (idiots') guides to process scheduling or
management welcome...

David T

 
 
 

process ID to Node ID:Processor ID mapping

Post by Patrick Geoffra » Wed, 31 Jul 2002 00:07:20




>  > Most SMP machines (better their operating systems) move processes
>  > between the CPUs at will.

> Is this true? I can imagine proceses and threads are dynamically
> assigned to CPUs in an intelligent way on creation but reassigning them
> to a different CPU during their lifetime?

Yes, a process can migrate between processors at any time in Linux.
Imagine, you create 4 tasks, and they are allocated
initially on 2 processors, 2 tasks per CPU. The 2 tasks on CPU 0 finish
quickly and the 2 others on CPU 1 are still running. It's a good thing
that one of the 2 remaining tasks migrate from CPU 1 to CPU 0 if CPU 0
is idle.

A such mechanism is also usefull to keep the processors busy when processes
or threads are blocked in I/O.

The scheduler tries to keep a task on the same CPU, to maximize the
cache hits on L1, but sometimes a migration is just more efficient.

Patrick

 
 
 

process ID to Node ID:Processor ID mapping

Post by David Turlan » Wed, 31 Jul 2002 04:54:21


more than I needed to know about this is expressed at

http://www.oreilly.com/catalog/linuxkernel/chapter/ch10.html




>>  > Most SMP machines (better their operating systems) move processes
>>  > between the CPUs at will.

>> Is this true? I can imagine proceses and threads are dynamically
>> assigned to CPUs in an intelligent way on creation but reassigning
>> them to a different CPU during their lifetime?

> Yes, a process can migrate between processors at any time in Linux.
> Imagine, you create 4 tasks, and they are allocated
> initially on 2 processors, 2 tasks per CPU. The 2 tasks on CPU 0 finish
> quickly and the 2 others on CPU 1 are still running. It's a good thing
> that one of the 2 remaining tasks migrate from CPU 1 to CPU 0 if CPU 0
> is idle.

> A such mechanism is also usefull to keep the processors busy when processes
> or threads are blocked in I/O.

> The scheduler tries to keep a task on the same CPU, to maximize the
> cache hits on L1, but sometimes a migration is just more efficient.

> Patrick