#!/bin/csh
#
#    compile and execute the test program, using existing libddi.a
#    this script only deals with TCP/IP communications.
#
#    You will want to paste in the same type of FORTRAN command
#    line that 'compddi.log' shows for building the test program,
#    and modify the kickoff command to suit your situation.
#
if (-e ../ddi_test.x) rm ../ddi_test.x
#
echo Compiling the test program...
#
#    ibm64
xlf -q64 -qintsize=8 -o ../ddi_test.x ddi_test.f -L../ -lddi -lpthread
#    ibm64-sp
#--mpxlf_r -q64 -qintsize=8 -o ddi_test.x ddi_test.f \
#--     ../libddi.a -llapi_r -lpthread
#--exit
#    axp64
#--f77 -i8 -v -o ../ddi_test.x ddi_test.f -L../ -lddi -lpthread
#    hpux64
#--f90 +DD64 +O2 +i8 +noppu -o ../ddi_test.x ddi_test.f -L../ -lddi \
#--        -ldld +U77 -lpthread
#    linux64, using gfortran
#--gfortran -O2 -m64 -fdefault-integer-8 -std=legacy -o ../ddi_test.x \
#--         ddi_test.f -L../ -lddi -lpthread
#    linux-ia64
#--ifort -O2 -i8 -o ../ddi_test.x ddi_test.f -L../ -lddi -lpthread
#    mac32
#--gfortran -O2 -std=legacy -o ../ddi_test.x ddi_test.f -L../ -lddi -lpthread
#    mac64
#--gfortran -O2 -m64 -fdefault-integer-8 -std=legacy -o ../ddi_test.x \
#-          ddi_test.f -L../ -lddi -lpthread
#    sun32
#--f77 -fast -O4 -xarch=v8plus            -o ../ddi_test.x ddi_test.f \
#--           -L../ -lddi -lsocket -lnsl -lposix4 -lpthread
#    sun64 on Sparc
#--f90 -xarch=v9 -O2 -xtypemap=integer:64 -o ../ddi_test.x ddi_test.f \
#--           -L../ -lddi -lsocket -lnsl -lrt     -lpthread
#    sun64 on Opteron
#--f90 -m64 -O2 -xtypemap=integer:64      -o ../ddi_test.x ddi_test.f \
#--           -L../ -lddi -lsocket -lnsl -lrt     -lpthread
#
#      You need to choose between old-fashioned rsh or the more
#      secure 'ssh' remote command launcher.  The former requires
#      setting up .rhosts files, the latter requires ssh keys exist.
#
#      below are a lot of host names used at Iowa State University,
#      undoubtedly the 'elements' of your cluster are different.
#
if (-x ../ddi_test.x) then
   echo Executing the test program...
   #      select remote shell from ssh, rsh, remsh(HP-UX's rsh)
   setenv DDI_RSH rsh
   /u1/mike/ddi/working/ddikick.x \
   /u1/mike/ddi/working/ddi_test.x dummyarg \
      -ddi 2  4 si:cpus=2 ti:cpus=2                     -scr /tmp
#     -ddi 2  8 ge:cpus=4 ga:cpus=4                     -scr /tmp
#     -ddi 1  4 br:cpus=4                               -scr /tmp
#     -ddi 2  4 se:cpus=2 sb:cpus=2                     -scr /tmp
#     -ddi 2  4 zr:cpus=2 nb:cpus=2                     -scr /tmp
#     -ddi 1  2 te:cpus=2                               -scr /tmp
#     -ddi 1  4 as:cpus=4                               -scr /tmp
#     -ddi 2  4 hf:cpus=2 ta:cpus=2                     -scr /tmp
#     -ddi 4 16 cu:cpus=4 pt:cpus=4 pd:cpus=4 ag:cpus=4 -scr /tmp
#     -ddi 2  4 in:cpus=2 sn:cpus=2                     -scr /tmp
#     -ddi 1  4 sc:cpus=4                               -scr /tmp
#     -ddi 3  6 po:cpus=2 bi:cpus=2 pb:cpus=2           -scr /tmp
else
   echo oops, booboo time
endif
