c
c	eseek.f 1.4 92/07/01 15:19:06
c
c  Copyright 1991 Intel Corporation, Inc.
c  See the "Copyright" file for complete rights and liability information.
c
c  Creates 4G-byte file and sets file pointer to end-of-file.
c
c  Can run on a multi-node cube, but only node 0 does anything.

      integer      etime, stime
      integer      newpos(2), newsize(2), offset(2)
      character*10 position, size

c  Node 0 does all the work.

      if(mynode() .eq. 0) then

         stime = mclock()

         print *,'Starting ...'

c    Open the file /cfs/mydata.

         open(unit = 12, file = '/cfs/mydata', status = 'unknown',
     1        form = 'unformatted')

c    Set file size to 4,294,967,297 bytes (4G bytes).

c         offset(1) = 1
c         offset(2) = 1
         call stoe('4294967297 ', offset)
         call esize(12, offset, 0, newsize)

         call etos(newsize, size)
         write(*, 100) size
100      format('New file size is:        ', a10)

c    Move read/write pointer to end of file.

c         offset(1) = 0
c         offset(2) = 0
         call stoe('0 ', offset)
         call eseek(12, offset, 2, newpos)

         call etos(newpos, position)
         write(*, 200) position
200      format('New pointer position is: ', a10)

c    Close the file /cfs/mydata.

         close(unit = 12, file = '/cfs/mydata', status = 'keep')

         etime = (mclock() - stime)/1000
         write(*, 300) etime
300      format('Elapsed time is:         ', i10, ' seconds.')

      endif

      end
