Subject: About Adlib-1.12

From: Zheng Gengbin <[email-masked]>
Date: Sun, 15 Jun 1997 10:06:47 +0800 (EAT)

I am concerned with if our Adlib-1.12 can be run on LINUX . 
The test result of the test0.C in test/kernel have this problem:

p2_4465:  p4_error: interrupt SIGSEGV: 11
rm_l_1862270976_4466:  p4_error: interrupt SIGINT: 2
p0_4454:  p4_error: Found a dead connection while looking for messages: 2
rm_l_1712390144_4461:  p4_error: interrupt SIGINT: 2
bm_list_4455:  p4_error: interrupt SIGINT: 2
p1_4460:  p4_error: interrupt SIGINT: 2
p3_4470:  p4_error: interrupt SIGINT: 2
rm_l_1862270976_4471:  p4_error: interrupt SIGINT: 2

	As I guess , the problem may be in the remap . I don't know if  there 
is also anything I must be careful about the machine dependent 
configuration ( as I understand in platform.h ).

	In fact I think cuurrent problem exists in any platform compiled by gcc ,
g++ and g77 .  But still Using these environment , in previous version , the 
Adlib do can run normally on our LINUX . 

Gengbin

---

From: Zheng Gengbin <[email-masked]>
Date: Mon, 16 Jun 1997 10:54:02 +0800 (EAT)

On Sun, 15 Jun 1997, Bryan Carpenter wrote:

> 
> 
> It's a bid difficult for us to check this at the moment because we
> don't have a LINUX installation (I hope we will get one set up for
> testing before making the final release of the software).
> 
> The only `remap' in `test0' is in `aprintf'.  Does the problem go away
> if you comment out the call to `aprintf'?
>

	Yes, if I comment out the line , it is ok.
 
> The current mechanism for initializing MPI (I hope we can improve this
> before making the release) involves a bad Fortran compiler-dependency in
> `_AdlibInit' in `pcrcFortran/pcrc.C'.  If you use a new Fortran
> compiler, you generally have to make some extension in that file.
> I don't remember doing this for g77.
> 
> What ``-D'' flags appear on the compiler command line when this file
> is compiled by `make'?

	I have modified the configure.in in order to support the LINUX
platform . I set the flag as -DEPC .

	Here , I attach my configure.in.

gengbin

dnl ####################################################################
dnl #   Copyright (c)
dnl #
dnl #   You may copy, distribute, and modify it freely as long as you  #
dnl #   preserve distribute, and modify it freely as long as you       # 
dnl #   preserve this copyright and permission notice.                 #
dnl #                                                                  #
dnl #
dnl ####################################################################
dnl 
dnl Process this file and acconfig.h by autoconf to produce a configure script.
dnl 

AC_INIT(./configure)

AC_PREFIX_DEFAULT(`pwd`)

AC_CONFIG_AUX_DIR(./config)

AC_CONFIG_HEADER(./src/include/config.h)

AC_CANONICAL_SYSTEM

AC_ARG_PROGRAM

AC_HEADER_STDC

dnl AC_CHECK_TYPE(u_short,unsigned short)

AC_HEADER_SYS_WAIT

AC_PROG_RANLIB

VERSION=1.09
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(VERSION)

dnl current working directory

CWD=`pwd`
AC_SUBST(CWD)

dnl deciding mpi package

AC_MSG_CHECKING(the MPI package)

MPI=

AC_ARG_WITH(MPI, [
--with-MPI=mpich          Using mpich MPI (the defualt setting)
--with-MPI=chimp          Using chimp MPI 
--with-MPI=sp2            Using sp2 MPI from IBM ], MPI=${withval}, MPI=mpich )

AC_CACHE_VAL(adlib_cv_mpipackage, adlib_cv_mpipackage=$MPI) 

AC_MSG_RESULT(as $adlib_cv_mpipackage)

MPI=$adlib_cv_mpipackage

AC_SUBST(MPI)

case "$MPI" in
  mpich )

  dnl check if mpi installed.
  if test ! -x `which mpirun`
  then 
    echo "Please install mpich first ..."
    exit
  fi

  dnl decide whether there is MPICC

  AC_CHECK_PROG(MPICC, mpCC, yes, no)

  dnl deciding compiler and linker

  if [[ "$MPICC" = "yes" ]]
  then
    CXX=mpCC
    AC_SUBST(CXX)

    LIBKEY=
  else
    dnl    AC_PROG_CC
    dnl    AC_PROG_CPP

    AC_PROG_CXX

    dnl deciding lib according to machine.

    LIBKEY="-lmpi"

    case $target in

      *ibm* )
        LIBKEY=$LIBKEY
        ;;

      *solaris* )
        LIBKEY="$LIBKEY -lsocket -lnsl" 
        ;;

      *dec* )
        if [[ $CXX = c++ ]]
        then
          LIBKEY="$LIBKEY"
        else
          LIBKEY="$LIBKEY -lcomplex -lm" 
        fi

        ;;

      *linux* )
        LIBKEY=$LIBKEY
        ;;

      * ) 
        echo "C++ compiler on $target is not supported yet"
        exit
        ;; 

    esac

  fi

  AC_SUBST(LIBKEY)

  dnl get mpi prefix

  AC_MSG_CHECKING(MPI include dir)

  MPI_PREFIX=`which mpirun | sed 's%/bin/mpirun%%'`
  if [[ ! -f $MPI_PREFIX/include/mpi.h ]]
  then 
    echo "Please input the mpich install prefix:"
  read MPI_PREFIX
  fi  

  if [[ ! -f $MPI_PREFIX/include/mpi.h ]]
  then 
    echo "Please install mpich first ..."
    exit
  fi

  MPI_INC=$MPI_PREFIX/include/

  AC_CACHE_VAL(adlib_cv_mpi_inc, adlib_cv_mpi_inc=$MPI_INC) 

  AC_MSG_RESULT($adlib_cv_mpi_inc)

  MPI_INC=-I$adlib_cv_mpi_inc

  AC_SUBST(MPI_INC)

  dnl get mpich exec_prefix

  AC_MSG_CHECKING(MPI lib dir)

  ARCH=`tarch`

  DEVICE=`tdevice $ARCH`

  dnl use prefix here, not quite good
  MPI_LIB=$MPI_PREFIX/lib/$ARCH/$DEVICE

  AC_CACHE_VAL(adlib_cv_mpi_lib, adlib_cv_mpi_lib=$MPI_LIB) 

  AC_MSG_RESULT($adlib_cv_mpi_lib)

  MPI_LIB=-L$adlib_cv_mpi_lib

  AC_SUBST(MPI_LIB) 

  ;;

  chimp )

  echo Not supported 
  ;;

  sp2 )

  AC_CHECK_PROG(MPICC, mpCC, yes, no)

  if [[ "$MPICC" = "yes" ]]
  then 
    CXX=mpCC
  fi

  if [[ "$CXX" = "" ]]
  then
    echo "Please install SP2 mpCC first ..."
    exit
  fi

  MPI_INC=
  AC_SUBST(MPI_INC)

  MPI_LIB=
  AC_SUBST(MPI_LIB) 

  LIBKEY=
  AC_SUBST(LIBKEY)
  ;;

  * )

  echo The package does not support MPI=$MPI.
  exit
  ;;

esac

dnl compiler option

AC_MSG_CHECKING(compiler option)

COMPILER_OPT=

AC_ARG_ENABLE(STRONG, 
--enable-STRONG           Package building flag (default as disabled),
COMPILER_OPT=-Dstrong,
COMPILER_OPT= )

AC_MSG_RESULT(as $COMPILER_OPT)
AC_SUBST(COMPILER_OPT)

dnl when we want better performance

AC_MSG_CHECKING(optimize option)

OPTIMIZE=

AC_ARG_ENABLE(OPTIMIZE, 
--enable-OPTIMIZE         Package building flag (default as disabled),
OPTIMIZE=-O,
OPTIMIZE= )

AC_MSG_RESULT(as $OPTIMIZE)
AC_SUBST(OPTIMIZE)

dnl

PERL=`which perl`

if [[ "$PERL" = "" ]]
then
  echo "Need perl to install the package"
  exit 1
fi

AC_SUBST(PERL)

dnl for Fortran interface

case $target in
	
  *ibm* )

  if [[ $MPICC = yes ]]
  then
    AC_CHECK_PROG(FCL, mpxlf, mpxlf)
  fi
  if [[ "$FCL" = "" ]]
  then 
    AC_CHECK_PROG(FCL, xlf, xlf)
  fi
  if [[ "$FCL" = "" ]]
  then 
    AC_CHECK_PROG(FCL, f77, f77)
  fi
  if [[ "$FCL" != "" ]]
  then 
    FC_OPT=
  fi
  PLATFORM="-DAIX"
  ;;

  *dec* )

  AC_CHECK_PROG(FCL, f90, f90)
  if [[ "$FCL" = "" ]]
  then 
    AC_CHECK_PROG(FCL, f77, f77)
  fi
  PLATFORM="-DDEC"
  ;;

  *solaris* )

  AC_CHECK_PROG(FCL, f90, f90)
  if [[ "$FCL" = "" ]]
  then
    AC_CHECK_PROG(FCL, f77, f77)
  fi
  PLATFORM="-DSOLARIS"
  ;;

  *linux*)

  AC_CHECK_PROG(FCL, f90, f90)
  if [[ "$FCL" = "" ]]
  then
    AC_CHECK_PROG(FCL, g77, g77)
  fi
  PLATFORM="-DEPC"
  ;;

  * ) 
  AC_CHECK_PROG(FCL, f77, f77)
  PLATFORM=  
  ;; 

esac

if [ test "$FCL" != "" ]
then
  dnl decide tailing underscore

  AC_MSG_CHECKING(subrotine name used by Fortran compiler)
  AC_CACHE_VAL(adlib_cv_tail,   
  cat > conftest.f <<EOF
      SUBROUTINE PCRC_FOO
      END
EOF

  $FCL -c conftest.f > /dev/null 2> /dev/null

  NAME=`nm conftest.o | grep "foo__"`
  if [[ test "$NAME" != "" ]]  
  then
    adlib_cv_tail=TWOSCORE
  else
    NAME=`nm conftest.o | grep "foo_"`
    if [[ test "$NAME" != "" ]]  
    then
      adlib_cv_tail=ONESCORE
    else
      NAME=`nm conftest.o | grep "foo"`
      if [[ test "$NAME" != "" ]]  
      then
        adlib_cv_tail=NONSCORE
      else
        echo "FORTRAM compiler generated name not supported yet"
        exit 1 
      fi
    fi
  fi

  rm -f conftest.f conftest.o
  )

  AC_MSG_RESULT(as $adlib_cv_tail)
  
  if [[ "$adlib_cv_tail" = TWOSCORE ]]
  then
    SUFFIX=__
  fi

  if [[ "$adlib_cv_tail" = ONESCORE ]]
  then
    SUFFIX=_
  fi

  if [[ "$adlib_cv_tail" = NONSCORE ]]
  then
    SUFFIX=
  fi

  AC_SUBST(SUFFIX)

  dnl decide how to link C++ library from Fortran

  if [[ "$CXX" = "c++" ]]
  then
    dnl CXXLIBKEY is not a good name here!
    CXXLIBKEY=`c++ -print-libgcc-file-name`
  else
    case $target in

    *ibm* )
    CXXLIBKEY="-lC"
    ;;

    *dec* )
    CXXLIBKEY="-lcxx"

    ;;

    *)
    echo C++ not tested on $target yet.
    ;;

    esac
  fi

  pcrcFortran=pcrcFortran
else
  pcrcFortran=
fi

AC_SUBST(FC_OPT)
AC_SUBST(PLATFORM)
AC_SUBST(CXXLIBKEY)
AC_SUBST(pcrcFortran)

AC_OUTPUT(
Makefile 
src/Makefile 
src/include/Makefile src/kernel/Makefile src/script/Makefile src/pcrcFortran/Makefile
man/Makefile
man/man1/Makefile
test/Makefile test/kernel/Makefile test/pcrcFortran/Makefile
src/script/ad++:src/script/ad++.in
src/script/prun:src/script/prun.in
src/pcrcFortran/pcrcf:src/pcrcFortran/pcrcf.in 
src/pcrcFortran/extname.h:src/pcrcFortran/extname.h.in
test/kernel/runtests:test/kernel/runtests.in
test/pcrcFortran/runtests:test/pcrcFortran/runtests.in
)

chmod a+x src/script/ad++
chmod a+x src/script/prun
chmod a+x test/kernel/runtests
chmod a+x test/pcrcFortran/runtests
if [[ "$pcrcFortran" != "" ]]
then
  chmod a+x src/pcrcFortran/pcrcf
fi

echo Done!

---

From: Zheng Gengbin <[email-masked]>
Date: Tue, 17 Jun 1997 10:16:35 +0800 (EAT)

On Mon, 16 Jun 1997, Bryan Carpenter wrote:

> I'm not sure why this is the right thing to do.  Have you checked
> that you pick up the command line arguments correctly if you do that?
>

	I got this just by trial . Only if I set the flag as -DEPC ,
the compliation is sucessful.
	I think this flag is good and have no relation to the current
remap problem , because in previous version it is ok with this flag .

	My fortran compiler is GNU's g77 . You can try this .
 
> Adlib initialization needs the command line arguments because MPICH 
> initialization needs the command line arguments.  The main program is
> Fortran, and I'm not aware of a completely portable way to get those
> arguments.  In general if you try to make an installation with a new
> Fortran compiler you have to investigate this problem and modify
> `pcrc.C' accordingly.  We will sort this out at some time in the
> not-too-distant future, but if you are in a hurry I'm you'll probably
> have to investigate this yourself.
> 

Gengbin

---

From: Zheng Gengbin <[email-masked]>
Date: Fri, 20 Jun 1997 20:29:43 +0800 (EAT)

On Tue, 17 Jun 1997, Bryan Carpenter wrote:

> 
> OK.  It looks as if, by coincidence, g77 uses the same external names
> for the arguments as the EPC compilar (`xargc' and `xargv').
> 
> I'll make enquiries about getting access to a LINUX installation here,
> but that may take a little while.  Meanwhile, if you are able to
> isolate the problem better I may be able to make suggestions.
> 

	I don't know what kind of information you need , this is the output
of test0.C . I added some debug information in the kernels .

Remap::execute:here before gather .
BlockMessSchedule::gather--gather before run.
BlockMessSchedule :: run : MPI_Irecv:before blockBase.
BlockMessSchedule :: run : MPI_Irecv:after blockBase.
Remap::execute:here before gather .
BlockMessSchedule::gather--gather before run.
BlockMessSchedule :: run : before while(sndServer.active().
BlockMessSchedule :: run : after while(sndServer.active(). 
p2_2549:  p4_error: interrupt SIGSEGV: 11
rm_l_1862270976_2550:  p4_error: interrupt SIGINT: 2
p0_2539:  p4_error: Found a dead connection while looking for messages: 2
p3_2554:  p4_error: interrupt SIGINT: 2
rm_l_-351731712_2545:  p4_error: interrupt SIGINT: 2
rm_l_1862270976_2555:  p4_error: interrupt SIGINT: 2
bm_list_2540:  p4_error: interrupt SIGINT: 2
p1_2544:  p4_error: interrupt SIGINT: 2

	Of course these outputs is random between runs .

Gengbin