PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

MPI SSend Recv pair

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
adityaks



Joined: 02 Oct 2012
Posts: 8

PostPosted: Sun Oct 14, 2012 6:30 am    Post subject: MPI SSend Recv pair Reply with quote

Hi All,

I've written the following piece of MPI code that would enforce a temporal order on a section of it. It should print 'Hello' in any order, and 'Hello Again' in order by rank. But it is ending up crashing with a signal 11 segmentation fault.

ppinit and ppexit do MPI_Init and MPI_Finalize
me=rank
nvp=size

rest are integer variables.

Code:

  call ppinit
  write(*,*)"Hello from rank ",me,"of",nvp

  if ( me .ne. 0 ) then
     call MPI_RECV(zstart, 1, MPI_INTEGER, 0, 0, MPI_COMM_WORLD, ierr)
  else
     zstart = 1
  end if

  if (zstart .eq. 1) then
     write(*,*)"Hello Again from rank ",me,"of",nvp
     zdone = 1
  else
     zdone = 0
  end if

  if ( me .ne. (nvp-1)) then
     call MPI_SSEND(zdone, 1, MPI_INTEGER, 1, 0 , MPI_COMM_WORLD, ierr)
  end if

  call ppexit



Would appreciate if any MPI users help debug where I am going wrong.

- Aditya
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group