c
c	gxprod.f 1.4 92/07/01 15:21:09
c
c  Copyright 1991 Intel Corporation, Inc.
c  See the "Copyright" file for complete rights and liability information.
c
c  Performs global multiplication on a vector across all nodes.
c
c  The gdprod() and gsprod() calls work similarly to giprod().

      integer*4 iam, size, seed
      parameter (size = 5)
      integer   list(size), work(size)

c  Identify self.

      iam = mynode()
      if(iam .eq. 0) print *, 'Starting ...'

c  Create list of random integers in the range 0..10.

      seed = (2 * mclock()/(iam+1)) + 1
      do 1, i = 1, size
         list(i) = int(10 * ran(seed))
1     continue

      write(*, 100) iam, (list(i), i = 1, size)
100   format('List for node ', i3, ' is: ', 5i6)

c  Perform multiplication across all nodes.

      call giprod(list, size, work)

c  If node 0, display resulting vector.

      if(iam .eq. 0) write(*, 200) (list(i), i = 1, size)
200   format('Resulting list is:    ', 5i6)

      end
