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


c
c     menu program for reading in global data
c
c      program main

c      real a
c      integer N, dimension, processors, PanelSize

c      call menu (N, dimension, processors, PanelSize)
c      end

      subroutine menu ( N, M, dimension, processors, PanelSize,fname)


      integer N, M, processors, PanelSize, RepFactor,i
      integer dimension,strategy
      character c
      character*50 fname

      processors = 3
      PanelSize = 2
      RepFactor = 2
      strategy = 0
      

c     repeat
 100  continue


         do i=3,1,-1
            if ((i**2) .ge. processors ) then
               dimension = i
            end if
         end do

         M = RepFactor * Processors * PanelSize
         N = M
#ifdef SAXPY
         call MakeFilename (fname,"Trace.saxpy",m,n,
     $    Processors,PanelSize)
#else
         call MakeFilename (fname,"Trace.gaxpy",m,n,
     $    Processors,PanelSize)
#endif

c         if (N .gt. LDA) then
c            print *, ' ERROR : LDA = ', LDA, ' is to small!'
c         end if
         print *, ' LU - Factorization '
         print *

         write ( *, * ) '(p)rocessors (2-8):', processors
         write ( *, * ) '    cube dimension:', dimension

#ifdef SAXPY
         write ( *, * ) '       algorithm:  SAXPY'
#else
         write ( *, * ) '       algorithm:  GAXPY'
#endif

         print *, N,'x',N,' Matrix    '

         write ( *, * ) ' (R)epeat Factor  : ',RepFactor
         write ( *, * ) ' (S)ize of Panel  : ',PanelSize
         print *
         write ( *, * ) ' Tracefile        : ', fname
         read (*, *) c
         if (c.eq.'p') then
            print *, ' Enter the number of Processors: '
            read  *, processors
         end if
         if (c.eq.'a') then
            strategy = mod (strategy + 1, 2)
         end if

         if (c.eq.'r') then
            print *, ' Enter number of rtepetition steps of colums: '
            read  *, RepFactor
         end if
         if (c.eq.'s') then
            print *, ' Enter number of culomns in panel: '
            read  *, PanelSize
         end if

         if (c.ne.'q') then
           goto 100
        end if

c     until c != q

      return
c
c     End of menu

      end
