c
c	gsendx.f 1.4 92/07/01 15:20:36
c
c  Copyright 1991 Intel Corporation, Inc.
c  See the "Copyright" file for complete rights and liability information.

      integer*4 iam
      integer*4 nodenums(2), x(10), y(10)

c  Initialize.

      do 1, i = 1, 10
         x(i) = 0
         y(i) = 0
1     continue

c  Identify self.

      iam = mynode()

c  If node 0, then ...

      if (iam .eq. 0) then

         print *, 'Starting ...'

c    Build list to send.

         do 2, i = 1, 10
            x(i) = i
2        continue

c    Specify receiving node numbers.

         nodenums(1) = 1
         nodenums(2) = 3

c    Send list to receiving nodes.

         call gsendx(100, x, 10*4, nodenums, 2)

         write(*, 100) iam, (x(i), i = 1, 10)
100      format('List sent by     Node ', i3, ' is: ', 10i4)

c  If not node 0, then ...

      else

c    Receive the list.

         call crecv(100, y, 10*4)
c         if (iam .ne. 2) call crecv(100, y, 10*4)

c    Display the received list.

         write(*, 200) iam, (y(i), i = 1, 10)
200      format('List received by Node ', i3, ' is: ', 10i4)

      endif

      end
