Newsgroups: comp.parallel.mpi
From: Peter Biechele <peter.biechele@physik.uni-freiburg.de>
Subject: Newbie Question about Groups and Communicators ?!
Organization: =?iso-8859-1?Q?Universit=E4t?= Freiburg,  ?iso-8859-1?Q?Fakult=E4t=20f=FCr?= Physik
Date: Thu, 04 Dec 1997 00:06:14 +0100
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <3485E5E6.50CC926A@physik.uni-freiburg.de>

How can I create two communicators with the followibng structure:
(5 Processors in MPI_COMM_WORLD)

first communicator: Process 0 , 1 and 3
second communicator: Process 0, 2 and 4

I am trying to use the following code in Fortran 90:

  CALL MPI_Init(MPI_COMM_WORLD,ierr)
  CALL MPI_COMM_RANK(MPI_COMM_WORLD,myrank,ierr)
  PRINT *,' This is processor ',myrank

  CALL MPI_COMM_GROUP(MPI_COMM_WORLD,group_world,ierr)
  ranks3=(/ 0,1,3 /)
  ranks4=(/ 0,2,4 /)

  SELECT CASE (myrank)
  CASE(0)
     CALL MPI_GROUP_INCL(group_world,3,ranks3,group3,ierr)
     CALL MPI_GROUP_INCL(group_world,3,ranks4,group4,ierr)

     CALL MPI_COMM_CREATE(MPI_COMM_WORLD,group3,intra_comm3,ierr)
     CALL MPI_COMM_CREATE(MPI_COMM_WORLD,group4,intra_comm4,ierr)
  CASE(1,3)
     CALL MPI_GROUP_INCL(group_world,3,ranks3,group3,ierr)

     CALL MPI_COMM_CREATE(MPI_COMM_WORLD,group3,intra_comm3,ierr)
     CALL MPI_COMM_CREATE(MPI_COMM_WORLD,group4,intra_comm4,ierr)
  CASE(2,4)
     CALL MPI_GROUP_INCL(group_world,3,ranks4,group4,ierr)

     CALL MPI_COMM_CREATE(MPI_COMM_WORLD,group3,intra_comm3,ierr)
     CALL MPI_COMM_CREATE(MPI_COMM_WORLD,group4,intra_comm4,ierr)
  END SELECT

What is wrong ?? I always get

  1:ERROR: 0032-105 Invalid group handle  (-192652824) in MPI_Comm_create, task 1
  3:ERROR: 0032-105 Invalid group handle  (-192595480) in MPI_Comm_create, task 3
ERROR: 0031-250  task 0: Terminated
ERROR: 0031-250  task 1: Terminated
ERROR: 0031-250  task 2: Terminated
ERROR: 0031-250  task 3: Terminated
ERROR: 0031-250  task 4: Terminated
  0:  This is processor  0
  1:  This is processor  1
  2:  This is processor  2
  3:  This is processor  3
  4:  This is processor  4

Thanks for any advices!

Peter Biechele

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Dipl. Phys. Peter Biechele, Uni Freiburg, Fakultaet fuer Physik, Abt. Honerkamp,
Tel. (0761) 203-5875,  EMail: peter.biechele@physik.uni-freiburg.de
FAX: (0761) 203-5967, WWW: http://phym1.physik.uni-freiburg.de/~pebi
Privat: Stefan-Meier-Str. 86, 79104 Freiburg, 0761 / 50 87 20




