Newsgroups: comp.parallel.mpi
From: Greg Morrow <gmorrow>
Subject: Re: New communicator question
Organization: Intel SSD
Date: 25 Oct 1995 20:47:12 GMT
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <46m7og$7kn@news.ssd.intel.com>

impellus@ames.ucsd.edu (Tom Impelluso) wrote:
>Hi, 
>I am trying to create a new communicator group.
>Then I am trying to rank JUST those in the group.
>Then I am trying to send data to the first element of the new group.
>
>Could someone tell me why I cannot do this?
>I have reduced the code to a core (which is meaningless out
>of context, but still shows the error).
>
>
>
>        include "mpif.h"
>        integer stat(MPI_STATUS_SIZE), irank(3)
>        master = 0
>        idata = 1
>c       initialize, get size,rank
>        call MPI_INIT(ierr)
>        call MPI_COMM_SIZE(MPI_COMM_WORLD, numprocs, ierr)
>        call MPI_COMM_RANK(MPI_COMM_WORLD, mygid, ierr)
>c       create a global group = iwgrp
>        call MPI_COMM_GROUP(MPI_COMM_WORLD, iwgrp,ierr)
>
>c       exclude: 0,1,2; include: 3,4,5 and so on
>        irank(1) = 0
>        irank(2) = 1
>        irank(3) = 2
>        call MPI_GROUP_EXCL(iwgrp, 3, irank, isgrp, ierr)
>        call MPI_COMM_CREATE(MPI_COMM_WORLD, isgrp, isend, ierr)
>
>        if(mygid.ge.3) call MPI_COMM_RANK(isend,mysid,ierr)
>
>        if(mygid.eq.master) call MPI_SEND(idata,1,MPI_INTEGER,0,0,isend,ierr)

The send is called by the process with global rank = 0, which is
not a member of the communicator "isend".  Both the sender and
receiver must be in the same communicator.

>
>        if(mygid.ge.4.and.mysid.eq.0) call MPI_RECV(i, 1, MPI_INTEGER, master,
>     &                                 MPI_ANY_TAG, MPI_COMM_WORLD,stat, ierr)
>

I wonder about the above line.  It seems to me that the process with mysid=0 
has mygid = 3, in which case no process will call a receive.

>        call MPI_FINALIZE(ierr)
>        END
>
>
>
>This is the error message when I run with over 8 processors:
>
>0 - Error in MPI_SEND : Invalid communicator
>T3D  0: Aborting with error code = 28
>For a reason I do not understand, "isend" is not a valid communicator.
>


-- 
_______________________________________________________________________
Greg Morrow                                       gmorrow@ssd.intel.com

These are my views, not Intel's.
-----------------------------------------------------------------------


