Re: [OMPI users] random MPI_UNIVERSE_SIZE and inter-commicator created by MPI_Comm_spawn

2010-02-19 Thread Mathieu Gontier





George,

Thank you very much for you well argumented answer. Indeed, I missed
something because I used MPI_Comm_remote_size in my spawned application.

Mathieu

  
George Bosilca wrote:
  
Mathieu,

Your MPI_COMM_UNIVERSE is a inter-communicator, and therefore the MPI_Comm_size and MPI_Comm_rank return the size, respectively the rank, in the local group. There is a special accessor for getting the remote group size (MPI_Comm_remote_size).

Now regarding the previous question (about the attribute MPI_UNIVERSE_SIZE), your answer is in the MPI standard 2.2 page 346 line 35. The MPI_UNIVERSE_SIZE is not set in Open MPI.

  george.

On Feb 18, 2010, at 10:18 , Mathieu Gontier wrote:

  

  Another question on the same example.

When I ask the size on the inter-communitator (MPI_COMM_UNIVERSE in the example) between the spaner/parent and the spawned/children processes, the same number of processes than in MPI_COMM_WORLD is returned. I do not really understand because I expected my MPI_COMM_UNIVERSE be a higher communicator including here the group of MPI_COMM_SELF and the group of MPI_COMM_WORLD of my spawned application (./worker).
I think I missed something. Does someone can help me?

Thank you.

Mathieu Gontier wrote:

  
Hello,

I am trying to use MPI_Comm_spawn (MPI-2 standard only) and I have an problem when I use MPI_UNIVERSE_SIZE. Here my code:

int main( int argc, char *argv[] )
{
 int wsize=0, wrank=-1 ;
 int usize=0, urank=-1 ;
 int ier ;
 int usize_attr=0, flag=0 ;
 MPI_Comm MPI_COMM_UNIVERSE;
 ier = MPI_Init( &argc, &argv ) ;
 ier = MPI_Comm_size( MPI_COMM_WORLD, &wsize ) ;
 ier = MPI_Comm_rank( MPI_COMM_WORLD, &wrank ) ;
 ier = MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, (void*) &usize_attr, &flag ) ;
 if ( !flag ) { printf( "[manager][error] This MPI does not support MPI_UNIVERSE_SIZE.\n" ) ; return 1 ; }
 if( wrank==0 ) {
 ier = MPI_Comm_spawn( "./worker", argv, ( wsize/2 > 2 ? wsize/2 : 2 ), MPI_INFO_NULL, 0, MPI_COMM_SELF, &MPI_COMM_UNIVERSE, MPI_ERRCODES_IGNORE);
 ier = MPI_Comm_size( MPI_COMM_UNIVERSE, &usize ) ;
 ier = MPI_Comm_rank( MPI_COMM_UNIVERSE, &urank ) ;
 }
 printf( "[manager] I am the process %d on %d in world (universe attr size: %d) and  %d on %d in universe\n", wrank, wsize, usize_attr, urank, usize ) ;
 MPI_Finalize();
 return 0;
}

When I call MPI_Comm_get_attr() with MPI_UNIVERSE_SIZE, my variable u_size_attr is random. Any idea?

Thank you.


___
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users

  
  
  ___
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users




___
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users

  
  






Re: [OMPI users] Segmentation fault with plenty of RAM

2010-02-19 Thread George Bosilca
Chris,

I'm puzzled by the fact that the problem might come from the gfortran compiler. 
I use it daily on my MAC, with LAPACK and BLAS, and so far I didn't has any 
strange problems. If it can help I use the gfortran precompiler compiler from 
MAC HPC (http://hpc.sourceforge.net/).

I might have another hint on this. I had similar errors in the past, due to a 
mismatch between the version of Open MPI used for linking and the one used at 
runtime. The MAC compiler don't play by the same rules as the normal gcc. The 
order in which the libraries are linked in your application is slightly 
different (system libraries have priority). As all 10.5 version Leopard contain 
a version of Open MPI you have to make sure that the Open MPI library you 
compile against is the one used at runtime. For this purpose you can use the 
"otool -L" (similar to ldd on Linux) to see which Open MPI library you linked 
against (the one you compiler or the one provided by the OS), and then check 
your $PATH to make sure you use the corresponding executables (mpicc, mpirun 
and orted).

  george.

On Feb 16, 2010, at 22:40 , Christopher O'Brien wrote:

> Trent,
> Thanks for the prompt reply and advice. 
> I had made a similar post similar on the Quantum-Espresso help forum and 
> received some helpful advice. It turns out that the problem is not in 
> libSystem.B.dylib (this a Mac system library); The cause of the error was due 
> to using the Mac system LAPACK and BLAS shared libraries. I had to build my 
> own and link to those. It may have to do with using GFORTRAN to compile the 
> program rather than Mac's GCC (which does not have FORTRAN support). 
> 
> Oh well, I guess I leaned much more about making programs on BSD today...
> 
> Regards,
> Chris
> 
> On Feb 16, 2010, at 5:23 PM, Trent Creekmore wrote:
> 
>> Christopher,
>> 
>> Segmentation faults has nothing to do with amount of memory you have in your
>> system.
>> Rather is has to do with memory access. A segmentation fault occurs as a
>> result of the program trying to access outside the bounds of memory
>> locations that have been set aside for storage at compile time.
>> 
>> These are usually caused by programmer error in the code. libSystem.B.dylib
>> could possibly have a bug in it, in which the developers of it either know
>> and about and have fixed it, in the process of fixing it, or need to know
>> about it. You may want to try to get the latest version of it before you
>> look further. Though I am new to OpenMPI myself and really have not had a
>> chance to really dig into it yet, the problem could be elsewhere besides in
>> libSystem.B.dylib.
>> 
>> But hopefully someone else here has had similar experience and knows exactly
>> what to do. 
>> 
>> If you had a shortage of memory, the OS would start doing more and page
>> swaps on the "swap drive" and you would notice this by the system getting
>> painfully slow.
>> 
>> 
>> Trent
>> 
>> 
>> 
>> 
>> -Original Message-
>> From: users-boun...@open-mpi.org [mailto:users-boun...@open-mpi.org] On
>> Behalf Of Christopher O'Brien
>> Sent: Tuesday, February 16, 2010 8:33 AM
>> To: us...@open-mpi.org
>> Subject: [OMPI users] Segmentation fault with plenty of RAM
>> 
>> To all,
>> I am trying to start work with Quantum Espresso (www.quantum_espresso.org)
>> on my MacBook Pro (running 10.6.2 with 64-bit kernel extensions enabled)
>> using 2GB of ram and an Intel Core2 Duo. Keep in mind that I am not really
>> an expert and I have a very bad track record in compiling applications.
>> 
>> I received no errors when compiling the latest versions of FFTW, openmpi,
>> and lapack (which were found by QE's configure program). I ran the basic
>> Openmpi tests included with the distribution, and found no problems. I have
>> modified my path to use the MPI compiler wrappers that I compiled, as Mac's
>> built in openmpi does not have F90/F77 support.
>> 
>> Someone reported a similar problem to the error reported below on this forum
>> (http://www.open-mpi.org/community/lists/users/2008/08/6348.php) but it may
>> or not be relevant. The problem does not seem to be in one executable of the
>> package ('bands.x') exclusively, but libSystem.B.dylib always seems to be in
>> the middle of things.  However, I tracked the memory usage but the example
>> never used more than 40MB.
>> 
>> The error message resulting from "example01" follows:
>> running the symmetry analysis for Si bands...[schrodingersdog:00322] ***
>> Process received signal ***
>> [schrodingersdog:00322] Signal: Segmentation fault (11)
>> [schrodingersdog:00322] Signal code: Address not mapped (1)
>> [schrodingersdog:00322] Failing at address: 0x698d3230
>> [schrodingersdog:00322] [ 0] 2   libSystem.B.dylib
>> 0x7fff87248eaa _sigtramp + 26
>> [schrodingersdog:00322] [ 1] 3   ???
>> 0x0001013fc080 0x0 + 4315922560
>> [schrodingersdog:00322] [ 2] 4   bands.x
>> 0x00010003d3ed sym_band_ + 7597
>> [schrodingersdog:00322] [ 3] 5   bands.x
>> 0x000114f5 

[OMPI users] password-less ssh

2010-02-19 Thread Eugene Loh

This is with regards to http://www.open-mpi.org/faq/?category=rsh#ssh-keys

It says to check if you have an ssh-agent running.  How are you supposed 
to do that?  I've tried "ps -u myusername | grep ssh-agent", but didn't 
know if that's the proper thing to do.


Also, it appears that I do *NOT* have an ssh-agent running automatically 
for me.  How often do I have to start one up?  It appears that if I 
start one up and log out and then log back in again, the old ssh-agent 
is still there but not usable.  I have to start up a new one.  So, do I 
have to start an ssh-agent each time I log in?


Or, I could use no DSA passphrase, but that seems to be frowned upon.


Re: [OMPI users] password-less ssh

2010-02-19 Thread Kenneth Yoshimoto


After you start up ssh-agent once, check env for
SSH_AUTH_SOCK

If you start a new session and the old ssh-agent is still running,
try setting SSH_AUTH_SOCK.

I think there are more refined utilities out there to handle this
situation...

Kenneth

On Fri, 19 Feb 2010, Eugene Loh wrote:


Date: Fri, 19 Feb 2010 13:19:13 -0800
From: Eugene Loh 
Reply-To: Open MPI Users 
To: Open MPI Users 
Subject: [OMPI users] password-less ssh

This is with regards to http://www.open-mpi.org/faq/?category=rsh#ssh-keys

It says to check if you have an ssh-agent running.  How are you supposed to 
do that?  I've tried "ps -u myusername | grep ssh-agent", but didn't know if 
that's the proper thing to do.


Also, it appears that I do *NOT* have an ssh-agent running automatically for 
me.  How often do I have to start one up?  It appears that if I start one up 
and log out and then log back in again, the old ssh-agent is still there but 
not usable.  I have to start up a new one.  So, do I have to start an 
ssh-agent each time I log in?


Or, I could use no DSA passphrase, but that seems to be frowned upon.
___
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users



Re: [OMPI users] password-less ssh

2010-02-19 Thread Eugene Loh
Okay, yes, setting SSH_AUTH_SOCK is the right thing to do, but this 
strikes me as clumsy.  I'm trying to understand how things should be set 
up so that I don't have to take special action each time I log in.  Do I 
do some .login/.logout magic?


Or, why not just go without a DSA passphrase?  The passphrase only 
protects me from root, before whom I am rather powerless anyhow.


Also, the OMPI FAQ says authorized_keys should have 644 protection.  Out 
on the web, it appears people advise 600, which doesn't make sense to me 
since it just has public keys in it anyhow.  (My head is starting to spin.)


Kenneth Yoshimoto wrote:


After you start up ssh-agent once, check env for SSH_AUTH_SOCK

If you start a new session and the old ssh-agent is still running, try 
setting SSH_AUTH_SOCK.


I think there are more refined utilities out there to handle this 
situation...


On Fri, 19 Feb 2010, Eugene Loh wrote:


Date: Fri, 19 Feb 2010 13:19:13 -0800
From: Eugene Loh 
Reply-To: Open MPI Users 
To: Open MPI Users 
Subject: [OMPI users] password-less ssh

This is with regards to 
http://www.open-mpi.org/faq/?category=rsh#ssh-keys


It says to check if you have an ssh-agent running.  How are you 
supposed to do that?  I've tried "ps -u myusername | grep ssh-agent", 
but didn't know if that's the proper thing to do.


Also, it appears that I do *NOT* have an ssh-agent running 
automatically for me.  How often do I have to start one up?  It 
appears that if I start one up and log out and then log back in 
again, the old ssh-agent is still there but not usable.  I have to 
start up a new one.  So, do I have to start an ssh-agent each time I 
log in?


Or, I could use no DSA passphrase, but that seems to be frowned upon. 






Re: [OMPI users] password-less ssh

2010-02-19 Thread Reuti

Hi,

Am 20.02.2010 um 00:11 schrieb Eugene Loh:

Okay, yes, setting SSH_AUTH_SOCK is the right thing to do, but this  
strikes me as clumsy.  I'm trying to understand how things should  
be set up so that I don't have to take special action each time I  
log in.  Do I do some .login/.logout magic?


Or, why not just go without a DSA passphrase?  The passphrase only  
protects me from root, before whom I am rather powerless anyhow.


you mean, that root could use your ssh-key? When you are having an  
agent running, root can hijack the created socket in /tmp. A good  
explanation you can find here:


http://unixwiz.net/techtips/ssh-agent-forwarding.html

KDE and Gnome start the agent automatically, once you use ssh-add  
(sometimes the graphical ssh-askpass is missing and must be  
installed). I have somewhere a small script to recover a saved agent  
configuration once it was started even for non-graphical based  
sessions. I'll post it later.


But there is more to dicuss. Some even suggest to encrypt the ~/.ssh/ 
know_hosts file, so that noone would know where you used to log in  
once he intruded your account. But most likely it's in the bash  
history anyway, so there would be a HOSTIGNORE="ssh*:scp*" necessary  
in bash. And as a next step, any convenient setting in ~/.ssh/config  
can't be used to abbreviate the logins... But it's good to use  
passphrase anyway, although it can be cracked locally by an attempt  
to change it with `ssh-keygen -y` - no delay by failed login attempt,  
so it could be really fast...



I also suggest to follow the complete thread starting with:

http://ftp.beowulf.org/archive/2009-September/026424.html

from

http://ftp.beowulf.org/archive/2009-September/thread.html

which ended in using hostbased authentication inside a cluster.


Also, the OMPI FAQ says authorized_keys should have 644  
protection.  Out on the web, it appears people advise 600, which  
doesn't make sense to me since it just has public keys in it  
anyhow.  (My head is starting to spin.)


Correct, 644 is fine.

-- Reuti



Kenneth Yoshimoto wrote:


After you start up ssh-agent once, check env for SSH_AUTH_SOCK

If you start a new session and the old ssh-agent is still running,  
try setting SSH_AUTH_SOCK.


I think there are more refined utilities out there to handle this  
situation...


On Fri, 19 Feb 2010, Eugene Loh wrote:


Date: Fri, 19 Feb 2010 13:19:13 -0800
From: Eugene Loh 
Reply-To: Open MPI Users 
To: Open MPI Users 
Subject: [OMPI users] password-less ssh

This is with regards to http://www.open-mpi.org/faq/? 
category=rsh#ssh-keys


It says to check if you have an ssh-agent running.  How are you  
supposed to do that?  I've tried "ps -u myusername | grep ssh- 
agent", but didn't know if that's the proper thing to do.


Also, it appears that I do *NOT* have an ssh-agent running  
automatically for me.  How often do I have to start one up?  It  
appears that if I start one up and log out and then log back in  
again, the old ssh-agent is still there but not usable.  I have  
to start up a new one.  So, do I have to start an ssh-agent each  
time I log in?


Or, I could use no DSA passphrase, but that seems to be frowned  
upon.




___
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users