Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-14 Thread Jeff Squyres
On Dec 10, 2010, at 11:00 AM, Prentice Bisbal wrote: >> Would it make sense to implement this as an MPI extension, and then >> perhaps propose something to the Forum for this purpose? > > I think that makes sense. As core and socket counts go up, I imagine the need > for this information will be

Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-10 Thread Terry Dontje
On 12/10/2010 03:24 PM, David Mathog wrote: Ashley Pittman wrote: For a much simpler approach you could also use these two environment variables, this is on my current system which is 1.5 based, YMMV of course. OMPI_COMM_WORLD_LOCAL_RANK OMPI_COMM_WORLD_LOCAL_SIZE However that doesn't really

Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-10 Thread Ralph Castain
Sorry - guess I had misunderstood. Yes, if all you want is the local rank of your own process, then this will work. My suggestion was if you wanted the list of local procs, or to know the local rank of your peers. On Dec 10, 2010, at 1:24 PM, David Mathog wrote: > Ashley Pittman wrote: > >>

Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-10 Thread David Mathog
Ashley Pittman wrote: > For a much simpler approach you could also use these two environment variables, this is on my current system which is 1.5 based, YMMV of course. > > OMPI_COMM_WORLD_LOCAL_RANK > OMPI_COMM_WORLD_LOCAL_SIZE That is simpler. It works on OMPI 1.4.3 too: cat >/usr/common/bin

Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-10 Thread Ashley Pittman
For a much simpler approach you could also use these two environment variables, this is on my current system which is 1.5 based, YMMV of course. OMPI_COMM_WORLD_LOCAL_RANK OMPI_COMM_WORLD_LOCAL_SIZE Actually orte seems to set both OMPI_COMM_WORLD_LOCAL_RANK and OMPI_COMM_WORLD_NODE_RANK, I can

Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-10 Thread Gus Correa
Hi David For what it is worth, the method suggested by Terry Dontje and Richard Troutmann is what is used in several generations of climate coupled models that we've been using for the past 8+ years. The goals are slightly different from yours: they cut across logical boundaries (i.e. who's at

Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-10 Thread Ralph Castain
There are no race conditions in this data. It is determined by mpirun prior to launch, so all procs receive the data during MPI_Init and it remains static throughout the life of the job. It isn't dynamically updated at this time (will change in later versions), so it won't tell you if a process

Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-10 Thread David Mathog
> The answer is yes - sort of... > > In OpenMPI, every process has information about not only its own local rank, but the local rank of all its peers regardless of what node they are on. We use that info internally for a variety of things. > > Now the "sort of". That info isn't exposed via an MPI

Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-10 Thread Prentice Bisbal
On 12/10/2010 07:55 AM, Ralph Castain wrote: Ick - I agree that's portable, but truly ugly. Would it make sense to implement this as an MPI extension, and then perhaps propose something to the Forum for this purpose? I think that makes sense. As core and socket counts go up, I imagine the n

Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-10 Thread Eugene Loh
Terry Dontje wrote: On 12/10/2010 09:19 AM, Richard Treumann wrote: It seems to me the MPI_Get_processor_name description is too ambiguous to make this 100% portable.  I assume most MPI implementations simply use the hostname so all processes on the same host will return the same string.

Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-10 Thread Terry Dontje
ghkeepsie, NY 12601 Tele (845) 433-7846 Fax (845) 433-8363 From: Ralph Castain To: Open MPI Users Date: 12/10/2010 08:00 AM Subject: Re: [OMPI users] Method for worker to determine its "rank" on asingle machine? Sent by:

Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-10 Thread Richard Treumann
/10/2010 08:00 AM Subject: Re: [OMPI users] Method for worker to determine its "rank" on a single machine? Sent by: users-boun...@open-mpi.org Ick - I agree that's portable, but truly ugly. Would it make sense to implement this as an MPI extension, and then perhaps propose so

Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-10 Thread Ralph Castain
Ick - I agree that's portable, but truly ugly. Would it make sense to implement this as an MPI extension, and then perhaps propose something to the Forum for this purpose? Just hate to see such a complex, time-consuming method when the info is already available on every process. On Dec 10, 201

Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-10 Thread Terry Dontje
A more portable way of doing what you want below is to gather each processes processor_name given by MPI_Get_processor_name, have the root who gets this data assign unique numbers to each name and then scatter that info to the processes and have them use that as the color to a MPI_Comm_split ca

Re: [OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-09 Thread Ralph Castain
The answer is yes - sort of... In OpenMPI, every process has information about not only its own local rank, but the local rank of all its peers regardless of what node they are on. We use that info internally for a variety of things. Now the "sort of". That info isn't exposed via an MPI API at

[OMPI users] Method for worker to determine its "rank" on a single machine?

2010-12-09 Thread David Mathog
Is it possible through MPI for a worker to determine: 1. how many MPI processes are running on the local machine 2. within that set its own "local rank" ? For instance, a quad core with 4 processes might be hosting ranks 10, 14, 15, 20, in which case the "local ranks" would be 1,2,3,4. Th