Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

Subject: Re: [OMPI users] random MPI_UNIVERSE_SIZE and inter-commicator created by MPI_Comm_spawn
From: Mathieu Gontier (mg.mailing-list_at_[hidden])
Date: 2010-02-18 10:18:52


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
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users
>