cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 
c Gregor von Laszewski * North East Parallel Architectures Center
c                      * Center for Computational Science, Syracuse University
c                      * 111 College Place * Syracuse, NY 13244-4100
c                      * (315) 443-4883 * gregor@npac.syr.edu 
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

      PROGRAM HOSTprg

#include "lu_const.f"


c      integer iseed(4) 
c      real a(1:MAX_LDA,1:MAX_LDA),aold(1:MAX_LDA,1:MAX_LDA)
c      integer ipiv (1:MAX_LDA)
c      integer info

      double precision x,xmin
      integer N, M, processors, PanelSize
      integer dimension

      integer msg(6)
      integer msgLength, msgtype

      integer me, host
      character*50 tracefile


      call menu (N, M, dimension, processors, PanelSize,tracefile)

      call open0 ( processors, me, host )
      print *, ' loading ...'
      call load0 ( 'node', -1)
      print *, '  loading complete ...'
      call setarc0 (nodes, 3, 0, 1)
      write(*,*) ' Topology:  unidiractional ring'
      write(*,*) ' Tracefile: ', tracefile

#ifdef DEBUG
      call traceenable (tracefile,0)
#endif

      msg(1) = m
      msg(2) = n
      msg(3) = m
      msg(4) = processors
      msg(5) = PanelSize

      call SizeInteger (MsgLength)
      MsgLength = MsgLength  * 5

      MsgType = HostInitMsg


      call bcast0 (msg,MsgLength,MsgType,host)

      call SizeDouble (MsgLength)
      xmin = 0.0
      do i=1,processors
         call recv0 (x, MsgLength, 3)
         if (xmin .lt. x) then
      	    xmin = x
         end if
      end do
      print *, 'Result: ', n, Processors,PanelSize, xmin

      call close0(1)

      stop

      end

