Newsgroups: comp.parallel.mpi
From: impellus@ames.ucsd.edu (Tom Impelluso)
Subject: New communicator question
Organization: UC San Diego, AMES Department
Date: 23 Oct 1995 23:20:55 GMT
Message-ID: <46h80n$k9d@soenews.ucsd.edu>

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)

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

        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.


