c
c pihost.F 9.2 92/07/01 14:45:35
c
c Copyright 1991 Intel Corporation, Inc.
c See the "Copyright" file for complete rights and liability information.
c
      program pihost
c     include '/vol/local/rhost3.3/include/fcube.h'
#include "fcube.h"
      double precision pi
      integer*4 n,m

      integer intsiz, dblsiz
      data intsiz, dblsiz /4,8/

      print *,' About to load'
      call setpid(100)
      call load('pinode',-1,0)
      print *,' Loaded'

1     print *, ' Enter number of rectangles '
      read(*,*, end=100) n
      m = n
      print *,'n = ',n

      if(n .le. 0) goto 100
      call HTOCL(n,1)
      call csend(100,n,intsiz,0,0)
      call crecv(200,pi,dblsiz)
      call CTOHD(pi,1)

c The reason m is needed: after the byte swapping calls, the
c value of n is unreliaable.  Need to store the right value in m.

      print *,' The value of pi for ',m,' rectangles is ',pi
      goto 1

100   call killcube(-1, 0)
      print *,''

      end
