Newsgroups: comp.parallel.mpi
From: csv@parcom.ernet.in (Chaman Singh Verma)
Subject: PROBLEM IN MPI_COMM_FREE,GROUP_FREE
Organization: Centre for Development of Advanced Computing (C-DAC), Pune, INDIA.
Date: Tue, 18 Jul 1995 13:24:58 GMT
Message-ID: <DBwyLt.6p7@parcom.ernet.in>


1.   Problem with MPI_Comm_Free, MPI_Group_Free

Desciption  :    
     I have written a very simple program to verify that there is some
     problem with these calls. This program is written in Fortran 90.
     IF I don't use Free Subroutines then there is no problem. IF
     we use them there is "Segmentation fault"
   


PROGRAM Example3     

include 'mpif.h'       ! Changed for fortran 90

Implicit None

integer		:: Ierror,MPI_Comm_WORKER, Myid, Myidlocal, Numprocs,	&
                   World_Group, Worker_Group
integer		:: Number


 Call MPI_INIT(Ierror)
 Call MPI_Comm_Rank(MPI_Comm_World, Myid, Ierror)
 Call MPI_Comm_Size(MPI_Comm_World, Numprocs, Ierror)

!----------------------------------------------------------------------
!       Exclude the master from communication :
!----------------------------------------------------------------------
 Call MPI_Comm_Group(MPI_Comm_World, World_Group, Ierror)
 Call MPI_Group_Excl(World_Group, 1, 0, Worker_Group, Ierror)
 call MPI_Comm_Create(MPI_Comm_World, Worker_Group, MPI_Comm_Worker, Ierror)
!----------------------------------------------------------------------             

 IF( Myid == 0) Then
     WRITE(*,*) " I am master "
 ELSE
     number = 10
     Call MPI_Bcast(number, 1, MPI_Integer, 0, MPI_Comm_Worker, Ierror)
     print*, " I am worker number ", Myid, Myidlocal, number
 ENDIF

 Call MPI_Comm_Free(MPI_Comm_Worker, Ierror)
 Call MPI_Group_free(Worker_Group, Ierror)
 Call MPI_Group_free(World_Group, Ierror)

 Call MPI_Finalize(ierror)

 Stop
 END PROGRAM Example3
****************************************************************************

Thanx 

Chaman SIngh Verma

C-DAC Pune INDIA
 
csv@parcom.ernet.in

