c
c	killcube1.f 1.3 92/07/01 15:22:56
c
c  Copyright 1991 Intel Corporation, Inc.
c  See the "Copyright" file for complete rights and liability information.

      integer      iam, mtime
      character*80 indent
      data         indent/' '/

c  Identify self.

      iam = mynode()

c  If node 0, then ...

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

c    Waste some time.

         mtime = mclock()
1        continue
         if(mclock() .lt. mtime+50) goto 1

c    Kill the process on node 1.

         call killcube(1, 0)
         print *, 'Node 1 killed.'

c    Waste some more time.

         mtime = mclock()
2        continue
         if(mclock() .lt. mtime+50) goto 2

c    Kill the process on node 2.

         call killcube(2, 0)
         print *, 'Node 2 killed.'

c    Waste still more time.

         mtime = mclock()
3        continue
         if(mclock() .lt. mtime+50) goto 3

c    Kill all remaining processes (including self).

         call killcube(-1, 0)
         print *, 'Remaining nodes killed.'

c  If not node 0, then display node number in infinite loop.

      else

10       continue
         write(*, 100) indent(1:3*iam), iam
100      format(a, 'Node ', i2, '.')
         goto 10

      endif

      end
