Newsgroups: comp.parallel.mpi
From: campbell@alpha.brooks.af.mil
Subject: Problem MPI program using Sun and PC machines
Organization: 648th CCSS/SC - Brooks AFB
Date: 11 Oct 1996 14:28:17 GMT
Message-ID: <53lli1$mrg@xenon.brooks.af.mil>

  I am having a problem with an MPI program. The following program runs ok when it is run on a network
of machines which are all Sun computers. However when I run it on a Sun and a PC using Solaris86 wih the
command: mpirun -arch solaris -np 1 -arch solaris86 -np 1 tst.%a gives an error. The program is just sending
an array to the second process and printing it. When run, element A(1,1) doesn't contain the correct
value, here is a run I made:

mpirun -arch solaris -np 1 -arch solaris86 -np 1 tst.%a

 Received A
 A(1,1) =   (  0.,  0.) A(1,2) =   (    1.00000,  2.00000)
 A(2,1) =   (  2.00000,  1.00000) A(2,2) =   (    2.00000,  2.00000)

  I am using MPICH v. 1.00.13. Any ideas what could be causing this error?

Ted Campbell - campbell@delta.brooks.af.mil



     INCLUDE 'mpif.h'
     
      INTEGER*4 LDA
      PARAMETER (LDA=2)
      INTEGER*4 myid,IERR,NPROCS
      COMPLEX A(2,2)
 
      CALL MPI_INIT(IERR)
      CALL MPI_COMM_RANK(MPI_COMM_WORLD,myid,IERR)
      CALL MPI_COMM_SIZE(MPI_COMM_WORLD,NPROCS,IERR)

      J0 = 1
      J1 = 2

      IF (myid .EQ. 0) THEN
         A(1,1) = CMPLX(1,1)
         A(2,1) = CMPLX(2,1)
         A(1,2) = CMPLX(1,2)
         A(2,2) = CMPLX(2,2)
         CALL MPI_SEND(A(1,1),LDA*(J1-J0+1),MPI_COMPLEX,1,
     +                 0,MPI_COMM_WORLD,IERR)
      ELSE      
         CALL MPI_RECV(A(1,1),LDA*(J1-J0+1),MPI_COMPLEX,
     +             0,MPI_ANY_TAG,MPI_COMM_WORLD,stat,IERR)
         print *,'Received A'
         print *,'A(1,1) = ',A(1,1),' A(1,2) = ',A(1,2)
         print *,'A(2,1) = ',A(2,1),' A(2,2) = ',A(2,2)
      ENDIF

      CALL MPI_FINALIZE(IERR) 

      stop
      end



