diff --git a/code/setup/symlink_Code.py b/code/setup/symlink_Code.py index 04b3be3aa..b8592777b 100755 --- a/code/setup/symlink_Code.py +++ b/code/setup/symlink_Code.py @@ -8,7 +8,7 @@ bin_link = { \ ], } -MarcReleases =[2011,2012,2013] +MarcReleases =[2011,2012,2013,2013.1] damaskEnv = damask.Environment('../../') # script location relative to root baseDir = damaskEnv.relPath('code/') diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask new file mode 100644 index 000000000..2d144b8a4 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask @@ -0,0 +1,52 @@ +#!/bin/ksh +# 1st arg: $DIR +# 2nd arg: $DIRJOB +# 3rd arg: $user +# 4th arg: $program +DIR=$1 +user=$3 +program=$4 +usernoext=$user +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + +# add BLAS options for linking + BLAS="%BLAS%" + +. $DIR/tools/include +DIRJOB=$2 +cd $DIRJOB +echo "Compiling and linking user subroutine $user on host `hostname`" +echo "program: $program" + $DFORTRAN $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ + $DIR/lib/blkdta.o $DIR/lib/comm?.o \ + ${userobj-} \ + $DIR/lib/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ../lib/mdsrc.a \ + ../lib/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS || \ + { + echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj + /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_h b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_h new file mode 100644 index 000000000..01464f095 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_h @@ -0,0 +1,52 @@ +#!/bin/ksh +# 1st arg: $DIR +# 2nd arg: $DIRJOB +# 3rd arg: $user +# 4th arg: $program +DIR=$1 +user=$3 +program=$4 +usernoext=$user +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + +# add BLAS options for linking + BLAS="%BLAS%" + +. $DIR/tools/include +DIRJOB=$2 +cd $DIRJOB +echo "Compiling and linking user subroutine $user on host `hostname`" +echo "program: $program" + $DFORTHIGH $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ + $DIR/lib/blkdta.o $DIR/lib/comm?.o \ + ${userobj-} \ + $DIR/lib/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ../lib/mdsrc.a \ + ../lib/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS || \ + { + echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj + /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_hmp b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_hmp new file mode 100644 index 000000000..36ced6543 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_hmp @@ -0,0 +1,52 @@ +#!/bin/ksh +# 1st arg: $DIR +# 2nd arg: $DIRJOB +# 3rd arg: $user +# 4th arg: $program +DIR=$1 +user=$3 +program=$4 +usernoext=$user +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + +# add BLAS options for linking + BLAS="%BLAS%" + +. $DIR/tools/include +DIRJOB=$2 +cd $DIRJOB +echo "Compiling and linking user subroutine $user on host `hostname`" +echo "program: $program" + $DFORTHIGHMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ + $DIR/lib/blkdta.o $DIR/lib/comm?.o \ + ${userobj-} \ + $DIR/lib/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ../lib/mdsrc.a \ + ../lib/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS || \ + { + echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj + /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_l b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_l new file mode 100644 index 000000000..31b5cd175 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_l @@ -0,0 +1,52 @@ +#!/bin/ksh +# 1st arg: $DIR +# 2nd arg: $DIRJOB +# 3rd arg: $user +# 4th arg: $program +DIR=$1 +user=$3 +program=$4 +usernoext=$user +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + +# add BLAS options for linking + BLAS="%BLAS%" + +. $DIR/tools/include +DIRJOB=$2 +cd $DIRJOB +echo "Compiling and linking user subroutine $user on host `hostname`" +echo "program: $program" + $DFORTLOW $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ + $DIR/lib/blkdta.o $DIR/lib/comm?.o \ + ${userobj-} \ + $DIR/lib/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ../lib/mdsrc.a \ + ../lib/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS || \ + { + echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj + /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_lmp b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_lmp new file mode 100644 index 000000000..8a0c1255d --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_lmp @@ -0,0 +1,52 @@ +#!/bin/ksh +# 1st arg: $DIR +# 2nd arg: $DIRJOB +# 3rd arg: $user +# 4th arg: $program +DIR=$1 +user=$3 +program=$4 +usernoext=$user +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + +# add BLAS options for linking + BLAS="%BLAS%" + +. $DIR/tools/include +DIRJOB=$2 +cd $DIRJOB +echo "Compiling and linking user subroutine $user on host `hostname`" +echo "program: $program" + $DFORTRANLOWMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ + $DIR/lib/blkdta.o $DIR/lib/comm?.o \ + ${userobj-} \ + $DIR/lib/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ../lib/mdsrc.a \ + ../lib/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS || \ + { + echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj + /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_mp b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_mp new file mode 100644 index 000000000..986d9ae04 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_mp @@ -0,0 +1,52 @@ +#!/bin/ksh +# 1st arg: $DIR +# 2nd arg: $DIRJOB +# 3rd arg: $user +# 4th arg: $program +DIR=$1 +user=$3 +program=$4 +usernoext=$user +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + +# add BLAS options for linking + BLAS="%BLAS%" + +. $DIR/tools/include +DIRJOB=$2 +cd $DIRJOB +echo "Compiling and linking user subroutine $user on host `hostname`" +echo "program: $program" + $DFORTRANMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ + $DIR/lib/blkdta.o $DIR/lib/comm?.o \ + ${userobj-} \ + $DIR/lib/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ../lib/mdsrc.a \ + ../lib/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS || \ + { + echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj + /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_user.org b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_user.org new file mode 100644 index 000000000..8679bb041 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_user.org @@ -0,0 +1,41 @@ +#!/bin/ksh +# 1st arg: $DIR +# 2nd arg: $DIRJOB +# 3rd arg: $user +# 4th arg: $program +DIR=$1 +user=$3 +program=$4 +. $DIR/tools/include +DIRJOB=$2 +cd $DIRJOB +echo "Compiling and linking user subroutine $user.f on host `hostname`" +echo "program: $program" + $FORTRAN $user.f || \ + { + echo "$0: compile failed for $user.f" + exit 1 + } + /bin/rm $program 2>/dev/null + userobj=$user.o + + + $LOAD ${program} $DIR/lib/main.o\ + $DIR/lib/blkdta.o $DIR/lib/comm?.o \ + ${userobj-} \ + $DIR/lib/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ../lib/mdsrc.a \ + ../lib/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $SYSLIBS || \ + { + echo "$0: link failed for $user.o on host `hostname`" + exit 1 + } + /bin/rm $userobj diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/include_linux64 b/installation/mods_MarcMentat/2013.1/Marc_tools/include_linux64 new file mode 100644 index 000000000..ae4e13b30 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/include_linux64 @@ -0,0 +1,726 @@ +# +# General definitions for the Marc 2011 version +# +# EM64T +# ( LP64 - i4 version) +# (ILP64 - i8 version) +# +# Linux RedHat 5.4 +# +# 64 bit MPI version +# +# Intel(R) Fortran Compiler +# Version 12.0.4 +# +# Intel(R) C Compiler +# Version 12.0.4 +# +# DATE +# +# To check the O/S level, type: +# uname -a +# +# Distributed parallel MPI libraries: +# 1) HP MPI 2.3 +# To check the mpi version, type: +# mpirun -version +# 2) Intel MPI 4.0.1.007 +# To check the mpi version, type: +# mpirun -version +# +# MKL Libraries: +# Intel(R) MKL 10.3.0.084 +# +# To check the Compiler level, type using the compiler +# installation path: +# ifort -V +# icc -V +# +# REMARKS : This file contains the definitions of variables used during +# compilation loading and use of the MARC programmes . The +# current machine type is identified by means of the variable +# MACHINE , defined below. +# +# +# MPI_ROOT: root directory in which mpi shared libraries, etc. are located +# DIRJOB : directory in which spawned jobs should look for Marc input +# MPI_ARCH: system architecture +# MPI_EPATH: path where executable resides +# + +REVISION="VERSION, BUILD" +HOSTNAME=`hostname` + +# find available memory in Mbyte on the machine +# can be set explicitly +MEMLIMIT=`free -m | awk '/Mem:/ {print $2}'` + +# set _OEM_NASTRAN to 1 for MD Nastran build +# override _OEM_NASTRAN setting with MARC_MD_NASTRAN environment variable +_OEM_NASTRAN="${MARC_MD_NASTRAN:-0}" + +# uncomment the following line for an autoforge build +#AUTOFORGE=1 +AUTOFORGE=0 +export AUTOFORGE + +# integer size +if test "$MARC_INTEGER_SIZE" = "" ; then + INTEGER_PATH= +else + INTEGER_PATH=/$MARC_INTEGER_SIZE +fi + +FCOMP=ifort + +# +# settings for Metis +# +METIS="-I$METIS_SOURCE" +METISLIBS="$MARC_LIB/metis.a " + +# +# settings for MPI +# +# RCP and RSH are used for parallel network runs +# replace with similar commands like rsh if needed +RCP=/usr/bin/scp +RSH=/usr/bin/ssh +# + + +MPI_DEFAULT=intelmpi +MPI_OTHER=hpmpi + +MPITYPE=$MPI_DEFAULT + +if test $AUTOFORGE +then + if test $AUTOFORGE = 1 + then + MPITYPE=none + fi +fi + + +# overrule MPITYPE setting with environmental variable MARC_MPITYPE +if test $MARC_MPITYPE +then + MPITYPE=$MARC_MPITYPE +fi + +# always set MPITYPE to none for MD Nastran +if test "$_OEM_NASTRAN" -ne 0 +then + MPITYPE=none +fi + +# Edit following lines to build with GPGPU version of BCS Solver for +# NVIDIA platforms +#BCSGPUSOLVER=NONE +BCSGPUSOLVER=BCSGPU + +SOLVERFLAGS= +if test "$BCSGPUSOLVER" = BCSGPU +then + SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" + BCS_DIR=bcsgpusolver + export PATH=$MARC_CUDA/bin:$MARC_CUDA/nvvm:$PATH + export LD_LIBRARY_PATH=$MARC_CUDA/lib64:$LD_LIBRARY_PATH +else + BCS_DIR=bcssolver +fi +# +# settings for MPI +# +DDM= +if test $MPITYPE != none +then + if test $MPITYPE = hpmpi + then + FCOMPMPI=mpif90 + export MPI_ROOT=$MARC_HPMPI + export MPI_REMSH=$RSH + export MPI_F77=$FCOMP + ARCHITECTURE=linux_amd64 + DDM="-I$MPI_ROOT/include/64 -DDDM -DHPMPI" + MPI_CLEAN= + export MPI_EPATH=$MARC_BIN + export LD_LIBRARY_PATH=$MPI_ROOT/lib/$ARCHITECTURE:$MARC_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH + export MPIHPSPECIAL="-e MPI_FLAGS=E,T,y1" +# Below line is moved in run_marc file +# export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + export MPIHPSPECIAL="$MPIHPSPECIAL -e BINDIR=$MARC_BIN" + if test -n "$MSC_LICENSE_FILE" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e MSC_LICENSE_FILE=$MSC_LICENSE_FILE" + fi + if test -n "$LM_LICENSE_FILE" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LM_LICENSE_FILE=$LM_LICENSE_FILE" + fi + export MPIHPSPECIAL="$MPIHPSPECIAL -e MPI_LIC_CHECKER=$MPI_ROOT/bin/licensing/amd64_s8/lichk.x" + RUN_JOB2="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -f " + RUN_JOB1="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -w $MPIHPSPECIAL -np " + RUN_JOB0= + fi + if test $MPITYPE = intelmpi + then + INTELMPI_VERSION=HYDRA + FCOMPMPI=mpiifort + MPI_ROOT=$MARC_INTELMPI + DDM="-I${MPI_ROOT}/include64 -DDDM" + PATH=$MPI_ROOT/bin64:$PATH + export PATH + LD_LIBRARY_PATH=$MPI_ROOT/lib64:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + if test $INTELMPI_VERSION = HYDRA + then + RUN_JOB1="${MPI_ROOT}/bin64/mpiexec.hydra -genvall -n " + RUN_JOB2="${MPI_ROOT}/bin64/mpiexec.hydra -genvall" + else + RUN_JOB1="${MPI_ROOT}/bin64/mpiexec -n " + RUN_JOB2="${MPI_ROOT}/bin64/mpiexec -configfile " + fi + RUN_JOB0= + MPI_CLEAN= + MPI_EPATH=$MARC_BIN + MPIR_HOME=$MPI_ROOT + MPICH_F77=$FCOMP + MPICH_F77LINKER=$FCOMP + export MPI_ROOT MPI_EPATH MPIR_HOME MPICH_F77 MPICH_F77LINKER + I_MPI_PIN_DOMAIN=node + export I_MPI_PIN_DOMAIN + fi +else + MPI_ROOT=$MARC_DUMMYMPI + export MPI_ROOT=$MARC_DUMMYMPI + DDM="-I$MPI_ROOT/include" +fi + +# +# variables for the "maintain" script +# + +MACHINENAME=LINUX +MACHINE64BIT=yes +MACHINE=Linux_EM64T +DEV=/dev/tape +GETLOG="whoami" +CLEAR="clear" +MY_UNAME=`uname -a` + +# Edit following 2 lines to build with VKI Solver +#VKISOLVER=VKI +VKISOLVER=NONE + +# Edit following 2 lines to build with CASI Solver +CASISOLVER=CASI +#CASISOLVER=NONE + +# Edit following 2 lines to build with MF2 Solver +MF2SOLVER=NONE +#MF2SOLVER=SERIAL +#MF2SOLVER=MF2PARALLEL + +# Edit following lines to build with Intel(c) Multithreaded solver (PARDISO) +#INTELSOLVER=NONE +INTELSOLVER=PARDISO + +# Edit following lines to build with MUMPS +if test "$MARC_INTEGER_SIZE" = "i4" ; then + #MUMPSSOLVER=NONE + MUMPSSOLVER=MUMPS +else + #MUMPSSOLVER=NONE + MUMPSSOLVER=MUMPS +fi + +# Edit following 2 lines to build MARC dynamic shared library +MARC_DLL=MARC_DLL +MARC_DLL=NONE + +# always set VKISOLVER, CASISOLVER, BCSGPUSOLVER, and MARC_DLL to NONE for MD Nastran +if test "$_OEM_NASTRAN" -ne 0 +then + VKISOLVER=NONE + CASISOLVER=NONE + MF2SOLVER=NONE + INTELSOLVER=NONE + MUMPSSOLVER=NONE + BCSGPUSOLVER=NONE + MARC_DLL=NONE +fi + +# +# define Fortran and C compile syntax +# +if test "$VKISOLVER" = VKI +then + SOLVERFLAGS="$SOLVERFLAGS -DVKI" +fi + +if test "$CASISOLVER" = CASI +then + SOLVERFLAGS="$SOLVERFLAGS -DCASI" +fi + +if test "$MF2SOLVER" = MF2PARALLEL +then + SOLVERFLAGS="$SOLVERFLAGS -DMF2PARALLEL" +fi +if test "$MF2SOLVER" = MF2SERIAL +then + SOLVERFLAGS="$SOLVERFLAGS -DMF2SERIAL" +fi + +if test "$INTELSOLVER" = PARDISO +then + SOLVERFLAGS="$SOLVERFLAGS -DPARDISO" +fi + +if test "$MUMPSSOLVER" = MUMPS +then + SOLVERFLAGS="$SOLVERFLAGS -DMUMPS" +fi + + +if test "$MARC_DLL" = MARC_DLL +then + SOLVERFLAGS="$SOLVERFLAGS -DMARC_DLL" +fi + +LINK_OPT= +DEBUG_OPT= +C_DEBUG_OPT= + +#Uncomment following line to build Marc in debuggable mode +MARCDEBUG= +#MARCDEBUG="ON" + +if test "$MARCDEBUG" = "ON" +then + LINK_OPT="-debug -traceback" + DEBUG_OPT="-debug -traceback" + C_DEBUG_OPT="-debug -traceback" +fi + + +MARCCHECK= +#MARCCHECK="ON" +if test "$MARCCHECK" = "ON" +then + DEBUG_OPT="$DEBUG_OPT -fpe0 -fp-stack-check -check all -ftrapuv " + C_DEBUG_OPT="$C_DEBUG_OPT -fp-stack-check -check-uninit -Wformat -ftrapuv " +fi + +MARCCODECOV= +#MARCCODECOV="ON" + +if test "$MARC_INTEGER_SIZE" = "i4" ; then + I8FFLAGS="-real-size 64 -integer-size 32" + I8DEFINES="-DFLOAT=8 -DINT=4" + I8CDEFINES= + I8CASIDEFS= +else + I8FFLAGS="-i8 -real-size 64 -integer-size 64" + I8DEFINES="-DI64 -DFLOAT=8 -DINT=8" + I8CDEFINES="-U_DOUBLE -D_SINGLE" + I8CASIDEFS="-DCASI_64BIT_INT=1" +fi + +MTHREAD=OPENMP +if test "$MARC_OPENMP" = "NONE" ; then + MTHREAD=NONE +fi +#MTHREAD=NONE +if test "$_OEM_NASTRAN" -ne 0 +then +MTHREAD=NONE +fi + +OMP_COMPAT=NO +OMP_COMPAT=YES +if test "$MTHREAD" = "NONE" +then +OMP_COMPAT=NO +fi + +CDEFINES= +FDEFINES= + +if test "$_OEM_NASTRAN" -ne 0 +then + CDEFINES="$CDEFINES -D_OEM_NASTRAN" + FDEFINES="$FDEFINES -D_OEM_NASTRAN" +fi + +FDEFINES="$FDEFINES -D_IMPLICITNONE" + +if test "$_OEM_NASTRAN" -eq 0 +then + FDEFINES="$FDEFINES -DMKL -DOPENMP" +fi + +if test "$OMP_COMPAT" = "YES" +then + FDEFINES="$FDEFINES -DOMP_COMPAT" +fi + +# -D_MSCMARC +FDEFINES="$FDEFINES -D_MSCMARC $DEBUG_OPT" +CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES" + +CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS" +if test "$_OEM_NASTRAN" -ne 0 +then + CINCL="$CINCL -I../../include" +fi + +CC="icc -c -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " +CCLOW="icc -c -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " +CCHIGH="icc -c -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " + +if test "$MARCDEBUG" = "ON" +then + CC="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " + CCLOW="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " + CCHIGH="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " +fi + +LOAD_CC="icc -O1 -DLinux -DLINUX -DLinux_intel" +CCT="$CC" +CCTLOW="$CCLOW" +CCTHIGH="$CCHIGH" + +CC_CASI="$CC -c99 $I8CASIDEFS" +CCLOW_CASI="$CCLOW -c99 $I8CASIDEFS" +CCHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" + +CCT_CASI="$CCT -c99 $I8CASIDEFS" +CCTLOW_CASI="$CCLOW -c99 $I8CASIDEFS" +CCTHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" + +#PROFILE="-Mprof=func" +#PROFILE="-Mprof=lines" +#PROFILE="-Mprof=func,mpi" +PROFILE= +if test "$MARCCODECOV" = "ON" +then +PROFILE="-prof-gen=srcpos" +fi + +FORT_OPT="-c -assume byterecl -safe_cray_ptr -mp1 -WB" +if test "$MTHREAD" = "OPENMP" +then + FORT_OPT=" $FORT_OPT -openmp" + if test "$OMP_COMPAT" = "YES" + then + FORT_OPT=" $FORT_OPT -openmp-threadprivate=compat" + fi +else +# FORT_OPT=" $FORT_OPT -auto " + FORT_OPT=" $FORT_OPT -save -zero" +fi + +FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +FORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" + +# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3 +DFORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +DFORTLOWMP="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 \ + -openmp -openmp_report2 -openmp-threadprivate=compat\ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +DFORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +DFORTRANMP="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 \ + -openmp -openmp_report2 -openmp-threadprivate=compat\ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +DFORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O2 $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +DFORTHIGHMP="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -zero -mp1 -WB -fno-alias -O2 $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 \ + -openmp -openmp_report2 -openmp-threadprivate=compat\ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + +if test "$MARCDEBUG" = "ON" +then + FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + FORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + FORTNA="$FCOMP $FORT_OPT -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" + +# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3 + DFORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + DFORTLOWMP="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 \ + -openmp -openmp_report2 -openmp-threadprivate=compat\ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + DFORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + DFORTRANMP="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 \ + -openmp -openmp_report2 -openmp-threadprivate=compat\ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + DFORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + DFORTHIGHMP="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 \ + -openmp -openmp_report2 -openmp-threadprivate=compat\ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + +fi + +FORTLOWT="$FORTLOW" +FORTRANT="$FORTRAN" +FORTHIGHT="$FORTHIGH" + +FORTRANMNF="$FCOMP -c $FDEFINES " +CCMNF="icc -c -O1 -DLinux -DLINUX -DLinux_intel -Dport2egcs -I$MARC_SOURCE/marctoadams/mnf/include -D_LARGEFILE64_SOURCE" + +FORTRANMUMPS="$FCOMP -fpp $FORT_OPT $PROFILE -fno-alias -O1 -fp-model precise $FDEFINES -D_IMPLICITNONE $I8FFLAGS $I8DEFINES $DDM -I$MARC_SOURCE/mumpssolver/include -Dintel_ -DALLOW_NON_INIT -Dmetis -nofor_main" +CCMUMPS="icc -c -DAdd_ -Dmetis -I$MARC_SOURCE/mumpssolver/include" + + +BCSCC="icc -c -O3 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_csrc $CDEFINES $CINCL" +NVCC="nvcc -c -O3 -arch sm_20 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_cuda/include -I${MARC_CUDA}/include -I$MARC_SOURCE/mdsrc $I8DEFINES -Xcompiler -fvisibility=hidden -Xcompiler -fPIC $I8DEFINES " +NVCCLIB="ar rvl" +NVCCLD=icc +BCSFORTLOW="$FORTLOW -I${MARC_SOURCE}/${BCS_DIR}/common" +BCSFORTRAN="$FORTRAN -I${MARC_SOURCE}/${BCS_DIR}/common" +BCSFORTHIGH="$FORTHIGH -I${MARC_SOURCE}/${BCS_DIR}/common" +BCSFORT90HIGH="$BCSFORTHIGH" +if test "$MARCDEBUG" = "ON" +then + BCSFORTRAN=$BCSFORTLOW + BCSFORTHIGH=$BCSFORTLOW + BCSFORT90HIGH=$BCSFORTLOW +fi + +if test $MPITYPE != none +then + if test $MPITYPE = hpmpi + then + LOAD="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " + LOADT="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " + fi +# Uncomment the following lines to turn on the tracer and commnet out the next 5 lines +# if test $MPITYPE = intelmpi +# then +# INCLUDEMPI="-I$MPI_ROOT/include64 -I$VT_ROOT/include" +# LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " +# LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " +# fi + if test $MPITYPE = intelmpi + then + LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " + LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " + fi +else + LOAD="$FCOMP $LINK_OPT -o " + LOADT="$FCOMP $LINK_OPT -o " +fi + +if test "$MARC_DLL" = MARC_DLL +then + FORTLOW="$FORTLOW -fpp -fPIC" + FORTRAN="$FORTRAN -fpp -fPIC" + FORTHIGH="$FORTHIGH -fpp -fPIC" + FORTRANMNF="$FORTRANMNF -fpp -fPIC" + CC="$CC -fPIC" + CCMNF="$CCMNF -fPIC" + CC_CASI="$CC_CASI -fPIC" + CCLOW_CASI="$CCLOW_CASI -fPIC" + CCHIGH_CASI="$CCHIGH_CASI -fPIC" + LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide -lpthread" + LINK_MARC_DLL="-shared -fPIC" + LOAD_DLL=$LOAD + LOADT_DLL=$LOADT + EXT_DLL="so" +fi + + +XLIBS="-L/usr/X11/lib -lX11 " + +# +# define archive and ranlib syntax +# + +ARC="ar rvl" +ARD="ar dvl" +ARX="ar xl" +RAN="" + +# +# choose which libraries you want to use ( e.g. blas ) +# + +if test "$VKISOLVER" = VKI +then + VKISOLVERLIBS="$MARC_LIB/vkisolver.a" +else + VKISOLVERLIBS= +fi + +if test "$CASISOLVER" = CASI +then + CASISOLVERLIBS="$MARC_LIB/casilib.a" +else + CASISOLVERLIBS= +fi + +MF2SOLVERLIBS= +if test "$MF2SOLVER" = MF2PARALLEL +then + MF2SOLVERLIBS="$MARC_LIB/mf2parallel/libseq.a \ + $MARC_LIB/mf2parallel/libsym.a \ + $MARC_LIB/mf2parallel/libmet.a \ + $MARC_LIB/mf2parallel/libmf2.a \ + $MARC_LIB/mf2parallel/libgauss.a \ + $MARC_LIB/mf2parallel/libmf2.a \ + $MARC_LIB/mf2parallel/libgauss.a \ + $MARC_LIB/mf2parallel/libnum.a \ + $MARC_LIB/mf2parallel/libutl.a \ + $MARC_LIB/mf2parallel/libr8.a \ + $MARC_LIB/mf2parallel/libz.a " +fi + +if test "$INTELSOLVER" = PARDISO +then + if test "$MARC_INTEGER_SIZE" = "i4" ; then + INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_lp64.a" + else + INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_ilp64.a" + fi +else + INTELSOLVERLIBS= +fi + +if test "$MUMPSSOLVER" = MUMPS +then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + if test $MPITYPE = none + then + MUMPSSOLVERLIBS2= + echo hello > /dev/null + fi + if test $MPITYPE = intelmpi + then + if test "$MARC_INTEGER_SIZE" = "i4" ; then + MUMPSSOLVERLIBS2=" -lmkl_blacs_intelmpi_lp64" + else + MUMPSSOLVERLIBS2=" -lmkl_blacs_intelmpi_ilp64" + fi + fi + if test $MPITYPE = hpmpi + then + if test "$MARC_INTEGER_SIZE" = "i4" ; then + MUMPSSOLVERLIBS2=" -lmkl_blacs_lp64" + else + MUMPSSOLVERLIBS2=" -lmkl_blacs_ilp64" + fi + fi +else + MUMPSSOLVERLIBS= + MUMPSSOLVERLIBS2= +fi + +if test "$BCSGPUSOLVER" = BCSGPU +then + BCSSOLVERLIBS="${MARC_LIB}/bcsgpulib.a " + MARCCUDALIBS1="-L${MARC_LIB}/cuda_dummy -lmarccuda " + MARCCUDALIBS2="-L${MARC_LIB}/cuda -lmarccuda " + MARCCUDALIBS=$MARCCUDALIBS1 + CUDALIBS="-L$MARC_CUDA/lib64 -lcudart -lcublas -L/usr/lib64 -lcuda " +else + BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " +fi + +if test "$MARC_INTEGER_SIZE" = "i4" ; then + MKLLIB="$MARC_MKL/libmkl_blacs_lp64.a -L$MARC_MKL -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core " +else + MKLLIB="$MARC_MKL/libmkl_blacs_ilp64.a -L$MARC_MKL -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core " +fi + +SECLIBS="-L$MARC_LIB -llapi" + +SOLVERLIBS="${BCSSOLVERLIBS} \ + ${INTELSOLVERLIBS} ${MF2SOLVERLIBS} -Wl,--start-group $MKLLIB ${MUMPSSOLVERLIBS2} \ + -liomp5 -Wl,--end-group \ + $MARC_LIB/blas_src.a ${VKISOLVERLIBS} ${CASISOLVERLIBS} " +SOLVERLIBS_DLL=${SOLVERLIBS} + +MRCLIBS="$MARC_LIB/clib.a ${CASISOLVERLIBS}" +MRCLIBSPAR="$MARC_LIB/clib.a" +STUBS="$MARC_LIB/stubs.a " +MNFLIBS="$MARC_LIB/libmnf.a" +MDUSER="$MARC_LIB/md_user.a" + +OPENMP="-openmp" + +SYSLIBS=" $OPENMP -lpthread " + +# Uncomment the following lines to turn on the trace and comment out the next 4 lines +# if test $MPITYPE = intelmpi +# then +# SYSLIBS="-L${VT_ROOT}/lib -lVT -ldwarf -lelf -lm -lpthread \ +# -L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt" +# fi +if test $MPITYPE = intelmpi +then + SYSLIBS="-L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt $OPENMP -threads -lpthread" +fi + +SYSLIBSPAR=" " + +MARC_DLL_CODES="runmarc.f" + + +BLAS_SRC="dzero.f icopy.f izero.f" +if test "$_OEM_NASTRAN" -ne 0 +then + if test "$MARC_INTEGER_SIZE" = "i4" ; then + BLAS_SRC="$BLAS_SRC dsctr.f zsctr.f dzasum.f daxpyi.f zaxpyi.f dgthr.f zgthr.f" + else + BLAS_SRC="ALL" + fi +fi + +LOW_OPT_CODES="are163.f contro.f ndext.f omarc.f omarca.f omarcb.f omarcc.f \ + omars.f fixbc.f triang.f bet049.f norst3.f eldata.f \ + elec*.f elct*.f fmeig.f oada00.f ogeig.f updtrbe2.f cycrota.f \ + cordef.f ogpk.f ogtan.f eldam.f formrbe3.f \ + inertie.f em_sso072.f cn_fol3d_qpatch6.f" +if test "$MARC_INTEGER_SIZE" = "i8" ; then + LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" +fi +LOW_OPT_CODES_CASI="" + +HIGH_OPT_CODES="dpsmsa1.f dpsmsa2.f dpsmsa3.f dpsmsa4.f dpsmsa5.f dpsmsa6.f \ + dpsmsa7.f dpsmsa8.f dpsmsa9.f dpsmsa10.f dpsmsa11.f dpsmsa12.f \ + dpsmsa13.f dpsmsa14.f dpsmsa15.f dpsmsa16.f " + + +HIGH_OPT_CODES_CASI="arithkernels.c blockedroutines.c blockedroutines_fd.c elemmatgenkernels.c longvecroutines.c sfmultutils.c solvewithbd.c" + +MAXNUM=1000000 diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/include_linux64.org b/installation/mods_MarcMentat/2013.1/Marc_tools/include_linux64.org new file mode 100644 index 000000000..d76bd3df6 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/include_linux64.org @@ -0,0 +1,679 @@ +# +# General definitions for the Marc 2011 version +# +# EM64T +# ( LP64 - i4 version) +# (ILP64 - i8 version) +# +# Linux RedHat 5.4 +# +# 64 bit MPI version +# +# Intel(R) Fortran Compiler +# Version 12.0.4 +# +# Intel(R) C Compiler +# Version 12.0.4 +# +# DATE +# +# To check the O/S level, type: +# uname -a +# +# Distributed parallel MPI libraries: +# 1) HP MPI 2.3 +# To check the mpi version, type: +# mpirun -version +# 2) Intel MPI 4.0.1.007 +# To check the mpi version, type: +# mpirun -version +# +# MKL Libraries: +# Intel(R) MKL 10.3.0.084 +# +# To check the Compiler level, type using the compiler +# installation path: +# ifort -V +# icc -V +# +# REMARKS : This file contains the definitions of variables used during +# compilation loading and use of the MARC programmes . The +# current machine type is identified by means of the variable +# MACHINE , defined below. +# +# +# MPI_ROOT: root directory in which mpi shared libraries, etc. are located +# DIRJOB : directory in which spawned jobs should look for Marc input +# MPI_ARCH: system architecture +# MPI_EPATH: path where executable resides +# + +REVISION="VERSION, BUILD" +HOSTNAME=`hostname` + +# find available memory in Mbyte on the machine +# can be set explicitly +MEMLIMIT=`free -m | awk '/Mem:/ {print $2}'` + +# set _OEM_NASTRAN to 1 for MD Nastran build +# override _OEM_NASTRAN setting with MARC_MD_NASTRAN environment variable +_OEM_NASTRAN="${MARC_MD_NASTRAN:-0}" + +# uncomment the following line for an autoforge build +#AUTOFORGE=1 +AUTOFORGE=0 +export AUTOFORGE + +# integer size +if test "$MARC_INTEGER_SIZE" = "" ; then + INTEGER_PATH= +else + INTEGER_PATH=/$MARC_INTEGER_SIZE +fi + +FCOMP=ifort + +# +# settings for Metis +# +METIS="-I$METIS_SOURCE" +METISLIBS="$MARC_LIB/metis.a " + +# +# settings for MPI +# +# RCP and RSH are used for parallel network runs +# replace with similar commands like rsh if needed +RCP=/usr/bin/scp +RSH=/usr/bin/ssh +# + + +MPI_DEFAULT=intelmpi +MPI_OTHER=hpmpi + +MPITYPE=$MPI_DEFAULT + +if test $AUTOFORGE +then + if test $AUTOFORGE = 1 + then + MPITYPE=none + fi +fi + + +# overrule MPITYPE setting with environmental variable MARC_MPITYPE +if test $MARC_MPITYPE +then + MPITYPE=$MARC_MPITYPE +fi + +# always set MPITYPE to none for MD Nastran +if test "$_OEM_NASTRAN" -ne 0 +then + MPITYPE=none +fi + +# Edit following lines to build with GPGPU version of BCS Solver for +# NVIDIA platforms +#BCSGPUSOLVER=NONE +BCSGPUSOLVER=BCSGPU + +SOLVERFLAGS= +if test "$BCSGPUSOLVER" = BCSGPU +then + SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" + BCS_DIR=bcsgpusolver + export PATH=$MARC_CUDA/bin:$MARC_CUDA/nvvm:$PATH + export LD_LIBRARY_PATH=$MARC_CUDA/lib64:$LD_LIBRARY_PATH +else + BCS_DIR=bcssolver +fi +# +# settings for MPI +# +DDM= +if test $MPITYPE != none +then + if test $MPITYPE = hpmpi + then + FCOMPMPI=mpif90 + export MPI_ROOT=$MARC_HPMPI + export MPI_REMSH=$RSH + export MPI_F77=$FCOMP + ARCHITECTURE=linux_amd64 + DDM="-I$MPI_ROOT/include/64 -DDDM -DHPMPI" + MPI_CLEAN= + export MPI_EPATH=$MARC_BIN + export LD_LIBRARY_PATH=$MPI_ROOT/lib/$ARCHITECTURE:$MARC_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH + export MPIHPSPECIAL="-e MPI_FLAGS=E,T,y1" +# Below line is moved in run_marc file +# export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + export MPIHPSPECIAL="$MPIHPSPECIAL -e BINDIR=$MARC_BIN" + if test -n "$MSC_LICENSE_FILE" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e MSC_LICENSE_FILE=$MSC_LICENSE_FILE" + fi + if test -n "$LM_LICENSE_FILE" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LM_LICENSE_FILE=$LM_LICENSE_FILE" + fi + export MPIHPSPECIAL="$MPIHPSPECIAL -e MPI_LIC_CHECKER=$MPI_ROOT/bin/licensing/amd64_s8/lichk.x" + RUN_JOB2="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -f " + RUN_JOB1="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -w $MPIHPSPECIAL -np " + RUN_JOB0= + fi + if test $MPITYPE = intelmpi + then + INTELMPI_VERSION=HYDRA + FCOMPMPI=mpiifort + MPI_ROOT=$MARC_INTELMPI + DDM="-I${MPI_ROOT}/include64 -DDDM" + PATH=$MPI_ROOT/bin64:$PATH + export PATH + LD_LIBRARY_PATH=$MPI_ROOT/lib64:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + if test $INTELMPI_VERSION = HYDRA + then + RUN_JOB1="${MPI_ROOT}/bin64/mpiexec.hydra -genvall -n " + RUN_JOB2="${MPI_ROOT}/bin64/mpiexec.hydra -genvall" + else + RUN_JOB1="${MPI_ROOT}/bin64/mpiexec -n " + RUN_JOB2="${MPI_ROOT}/bin64/mpiexec -configfile " + fi + RUN_JOB0= + MPI_CLEAN= + MPI_EPATH=$MARC_BIN + MPIR_HOME=$MPI_ROOT + MPICH_F77=$FCOMP + MPICH_F77LINKER=$FCOMP + export MPI_ROOT MPI_EPATH MPIR_HOME MPICH_F77 MPICH_F77LINKER + I_MPI_PIN_DOMAIN=node + export I_MPI_PIN_DOMAIN + fi +else + MPI_ROOT=$MARC_DUMMYMPI + export MPI_ROOT=$MARC_DUMMYMPI + DDM="-I$MPI_ROOT/include" +fi + +# +# variables for the "maintain" script +# + +MACHINENAME=LINUX +MACHINE64BIT=yes +MACHINE=Linux_EM64T +DEV=/dev/tape +GETLOG="whoami" +CLEAR="clear" +MY_UNAME=`uname -a` + +# Edit following 2 lines to build with VKI Solver +#VKISOLVER=VKI +VKISOLVER=NONE + +# Edit following 2 lines to build with CASI Solver +CASISOLVER=CASI +#CASISOLVER=NONE + +# Edit following 2 lines to build with MF2 Solver +MF2SOLVER=NONE +#MF2SOLVER=SERIAL +#MF2SOLVER=MF2PARALLEL + +# Edit following lines to build with Intel(c) Multithreaded solver (PARDISO) +#INTELSOLVER=NONE +INTELSOLVER=PARDISO + +# Edit following lines to build with MUMPS +if test "$MARC_INTEGER_SIZE" = "i4" ; then + #MUMPSSOLVER=NONE + MUMPSSOLVER=MUMPS +else + #MUMPSSOLVER=NONE + MUMPSSOLVER=MUMPS +fi + +# Edit following 2 lines to build MARC dynamic shared library +MARC_DLL=MARC_DLL +MARC_DLL=NONE + +# always set VKISOLVER, CASISOLVER, BCSGPUSOLVER, and MARC_DLL to NONE for MD Nastran +if test "$_OEM_NASTRAN" -ne 0 +then + VKISOLVER=NONE + CASISOLVER=NONE + MF2SOLVER=NONE + INTELSOLVER=NONE + MUMPSSOLVER=NONE + BCSGPUSOLVER=NONE + MARC_DLL=NONE +fi + +# +# define Fortran and C compile syntax +# +if test "$VKISOLVER" = VKI +then + SOLVERFLAGS="$SOLVERFLAGS -DVKI" +fi + +if test "$CASISOLVER" = CASI +then + SOLVERFLAGS="$SOLVERFLAGS -DCASI" +fi + +if test "$MF2SOLVER" = MF2PARALLEL +then + SOLVERFLAGS="$SOLVERFLAGS -DMF2PARALLEL" +fi +if test "$MF2SOLVER" = MF2SERIAL +then + SOLVERFLAGS="$SOLVERFLAGS -DMF2SERIAL" +fi + +if test "$INTELSOLVER" = PARDISO +then + SOLVERFLAGS="$SOLVERFLAGS -DPARDISO" +fi + +if test "$MUMPSSOLVER" = MUMPS +then + SOLVERFLAGS="$SOLVERFLAGS -DMUMPS" +fi + + +if test "$MARC_DLL" = MARC_DLL +then + SOLVERFLAGS="$SOLVERFLAGS -DMARC_DLL" +fi + +LINK_OPT= +DEBUG_OPT= +C_DEBUG_OPT= + +#Uncomment following line to build Marc in debuggable mode +MARCDEBUG= +#MARCDEBUG="ON" + +if test "$MARCDEBUG" = "ON" +then + LINK_OPT="-debug -traceback" + DEBUG_OPT="-debug -traceback" + C_DEBUG_OPT="-debug -traceback" +fi + + +MARCCHECK= +#MARCCHECK="ON" +if test "$MARCCHECK" = "ON" +then + DEBUG_OPT="$DEBUG_OPT -fpe0 -fp-stack-check -check all -ftrapuv " + C_DEBUG_OPT="$C_DEBUG_OPT -fp-stack-check -check-uninit -Wformat -ftrapuv " +fi + +MARCCODECOV= +#MARCCODECOV="ON" + +if test "$MARC_INTEGER_SIZE" = "i4" ; then + I8FFLAGS= + I8DEFINES= + I8CDEFINES= + I8CASIDEFS= +else + I8FFLAGS="-i8" + I8DEFINES="-DI64" + I8CDEFINES="-U_DOUBLE -D_SINGLE" + I8CASIDEFS="-DCASI_64BIT_INT=1" +fi + +MTHREAD=OPENMP +if test "$MARC_OPENMP" = "NONE" ; then + MTHREAD=NONE +fi +#MTHREAD=NONE +if test "$_OEM_NASTRAN" -ne 0 +then +MTHREAD=NONE +fi + +OMP_COMPAT=NO +OMP_COMPAT=YES +if test "$MTHREAD" = "NONE" +then +OMP_COMPAT=NO +fi + +CDEFINES= +FDEFINES= + +if test "$_OEM_NASTRAN" -ne 0 +then + CDEFINES="$CDEFINES -D_OEM_NASTRAN" + FDEFINES="$FDEFINES -D_OEM_NASTRAN" +fi + +FDEFINES="$FDEFINES -D_IMPLICITNONE" + +if test "$_OEM_NASTRAN" -eq 0 +then + FDEFINES="$FDEFINES -DMKL -DOPENMP" +fi + +if test "$OMP_COMPAT" = "YES" +then + FDEFINES="$FDEFINES -DOMP_COMPAT" +fi + +# -D_MSCMARC +FDEFINES="$FDEFINES -D_MSCMARC $DEBUG_OPT" +CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES" + +CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS" +if test "$_OEM_NASTRAN" -ne 0 +then + CINCL="$CINCL -I../../include" +fi + +CC="icc -c -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " +CCLOW="icc -c -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " +CCHIGH="icc -c -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " + +if test "$MARCDEBUG" = "ON" +then + CC="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " + CCLOW="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " + CCHIGH="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " +fi + +LOAD_CC="icc -O1 -DLinux -DLINUX -DLinux_intel" +CCT="$CC" +CCTLOW="$CCLOW" +CCTHIGH="$CCHIGH" + +CC_CASI="$CC -c99 $I8CASIDEFS" +CCLOW_CASI="$CCLOW -c99 $I8CASIDEFS" +CCHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" + +CCT_CASI="$CCT -c99 $I8CASIDEFS" +CCTLOW_CASI="$CCLOW -c99 $I8CASIDEFS" +CCTHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" + +#PROFILE="-Mprof=func" +#PROFILE="-Mprof=lines" +#PROFILE="-Mprof=func,mpi" +PROFILE= +if test "$MARCCODECOV" = "ON" +then +PROFILE="-prof-gen=srcpos" +fi + +FORT_OPT="-c -assume byterecl -safe_cray_ptr -mp1 -WB" +if test "$MTHREAD" = "OPENMP" +then + FORT_OPT=" $FORT_OPT -openmp" + if test "$OMP_COMPAT" = "YES" + then + FORT_OPT=" $FORT_OPT -openmp-threadprivate=compat" + fi +else +# FORT_OPT=" $FORT_OPT -auto " + FORT_OPT=" $FORT_OPT -save -zero" +fi + +FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +FORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" + +if test "$MARCDEBUG" = "ON" +then + FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + FORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + FORTNA="$FCOMP $FORT_OPT -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" +fi + +FORTLOWT="$FORTLOW" +FORTRANT="$FORTRAN" +FORTHIGHT="$FORTHIGH" + +FORTRANMNF="$FCOMP -c $FDEFINES " +CCMNF="icc -c -O1 -DLinux -DLINUX -DLinux_intel -Dport2egcs -I$MARC_SOURCE/marctoadams/mnf/include -D_LARGEFILE64_SOURCE" + +FORTRANMUMPS="$FCOMP -fpp $FORT_OPT $PROFILE -fno-alias -O1 -fp-model precise $FDEFINES -D_IMPLICITNONE $I8FFLAGS $I8DEFINES $DDM -I$MARC_SOURCE/mumpssolver/include -Dintel_ -DALLOW_NON_INIT -Dmetis -nofor_main" +CCMUMPS="icc -c -DAdd_ -Dmetis -I$MARC_SOURCE/mumpssolver/include" + + +BCSCC="icc -c -O3 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_csrc $CDEFINES $CINCL" +NVCC="nvcc -c -O3 -arch sm_20 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_cuda/include -I${MARC_CUDA}/include -I$MARC_SOURCE/mdsrc $I8DEFINES -Xcompiler -fvisibility=hidden -Xcompiler -fPIC $I8DEFINES " +NVCCLIB="ar rvl" +NVCCLD=icc +BCSFORTLOW="$FORTLOW -I${MARC_SOURCE}/${BCS_DIR}/common" +BCSFORTRAN="$FORTRAN -I${MARC_SOURCE}/${BCS_DIR}/common" +BCSFORTHIGH="$FORTHIGH -I${MARC_SOURCE}/${BCS_DIR}/common" +BCSFORT90HIGH="$BCSFORTHIGH" +if test "$MARCDEBUG" = "ON" +then + BCSFORTRAN=$BCSFORTLOW + BCSFORTHIGH=$BCSFORTLOW + BCSFORT90HIGH=$BCSFORTLOW +fi + +if test $MPITYPE != none +then + if test $MPITYPE = hpmpi + then + LOAD="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " + LOADT="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " + fi +# Uncomment the following lines to turn on the tracer and commnet out the next 5 lines +# if test $MPITYPE = intelmpi +# then +# INCLUDEMPI="-I$MPI_ROOT/include64 -I$VT_ROOT/include" +# LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " +# LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " +# fi + if test $MPITYPE = intelmpi + then + LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " + LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " + fi +else + LOAD="$FCOMP $LINK_OPT -o " + LOADT="$FCOMP $LINK_OPT -o " +fi + +if test "$MARC_DLL" = MARC_DLL +then + FORTLOW="$FORTLOW -fpp -fPIC" + FORTRAN="$FORTRAN -fpp -fPIC" + FORTHIGH="$FORTHIGH -fpp -fPIC" + FORTRANMNF="$FORTRANMNF -fpp -fPIC" + CC="$CC -fPIC" + CCMNF="$CCMNF -fPIC" + CC_CASI="$CC_CASI -fPIC" + CCLOW_CASI="$CCLOW_CASI -fPIC" + CCHIGH_CASI="$CCHIGH_CASI -fPIC" + LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide -lpthread" + LINK_MARC_DLL="-shared -fPIC" + LOAD_DLL=$LOAD + LOADT_DLL=$LOADT + EXT_DLL="so" +fi + + +XLIBS="-L/usr/X11/lib -lX11 " + +# +# define archive and ranlib syntax +# + +ARC="ar rvl" +ARD="ar dvl" +ARX="ar xl" +RAN="" + +# +# choose which libraries you want to use ( e.g. blas ) +# + +if test "$VKISOLVER" = VKI +then + VKISOLVERLIBS="$MARC_LIB/vkisolver.a" +else + VKISOLVERLIBS= +fi + +if test "$CASISOLVER" = CASI +then + CASISOLVERLIBS="$MARC_LIB/casilib.a" +else + CASISOLVERLIBS= +fi + +MF2SOLVERLIBS= +if test "$MF2SOLVER" = MF2PARALLEL +then + MF2SOLVERLIBS="$MARC_LIB/mf2parallel/libseq.a \ + $MARC_LIB/mf2parallel/libsym.a \ + $MARC_LIB/mf2parallel/libmet.a \ + $MARC_LIB/mf2parallel/libmf2.a \ + $MARC_LIB/mf2parallel/libgauss.a \ + $MARC_LIB/mf2parallel/libmf2.a \ + $MARC_LIB/mf2parallel/libgauss.a \ + $MARC_LIB/mf2parallel/libnum.a \ + $MARC_LIB/mf2parallel/libutl.a \ + $MARC_LIB/mf2parallel/libr8.a \ + $MARC_LIB/mf2parallel/libz.a " +fi + +if test "$INTELSOLVER" = PARDISO +then + if test "$MARC_INTEGER_SIZE" = "i4" ; then + INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_lp64.a" + else + INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_ilp64.a" + fi +else + INTELSOLVERLIBS= +fi + +if test "$MUMPSSOLVER" = MUMPS +then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + if test $MPITYPE = none + then + MUMPSSOLVERLIBS2= + echo hello > /dev/null + fi + if test $MPITYPE = intelmpi + then + if test "$MARC_INTEGER_SIZE" = "i4" ; then + MUMPSSOLVERLIBS2=" -lmkl_blacs_intelmpi_lp64" + else + MUMPSSOLVERLIBS2=" -lmkl_blacs_intelmpi_ilp64" + fi + fi + if test $MPITYPE = hpmpi + then + if test "$MARC_INTEGER_SIZE" = "i4" ; then + MUMPSSOLVERLIBS2=" -lmkl_blacs_lp64" + else + MUMPSSOLVERLIBS2=" -lmkl_blacs_ilp64" + fi + fi +else + MUMPSSOLVERLIBS= + MUMPSSOLVERLIBS2= +fi + +if test "$BCSGPUSOLVER" = BCSGPU +then + BCSSOLVERLIBS="${MARC_LIB}/bcsgpulib.a " + MARCCUDALIBS1="-L${MARC_LIB}/cuda_dummy -lmarccuda " + MARCCUDALIBS2="-L${MARC_LIB}/cuda -lmarccuda " + MARCCUDALIBS=$MARCCUDALIBS1 + CUDALIBS="-L$MARC_CUDA/lib64 -lcudart -lcublas -L/usr/lib64 -lcuda " +else + BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " +fi + +if test "$MARC_INTEGER_SIZE" = "i4" ; then + MKLLIB="$MARC_MKL/libmkl_blacs_lp64.a -L$MARC_MKL -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core " +else + MKLLIB="$MARC_MKL/libmkl_blacs_ilp64.a -L$MARC_MKL -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core " +fi + +SECLIBS="-L$MARC_LIB -llapi" + +SOLVERLIBS="${BCSSOLVERLIBS} \ + ${INTELSOLVERLIBS} ${MF2SOLVERLIBS} -Wl,--start-group $MKLLIB ${MUMPSSOLVERLIBS2} \ + -liomp5 -Wl,--end-group \ + $MARC_LIB/blas_src.a ${VKISOLVERLIBS} ${CASISOLVERLIBS} " +SOLVERLIBS_DLL=${SOLVERLIBS} + +MRCLIBS="$MARC_LIB/clib.a ${CASISOLVERLIBS}" +MRCLIBSPAR="$MARC_LIB/clib.a" +STUBS="$MARC_LIB/stubs.a " +MNFLIBS="$MARC_LIB/libmnf.a" +MDUSER="$MARC_LIB/md_user.a" + +OPENMP="-openmp" + +SYSLIBS=" $OPENMP -lpthread " + +# Uncomment the following lines to turn on the trace and comment out the next 4 lines +# if test $MPITYPE = intelmpi +# then +# SYSLIBS="-L${VT_ROOT}/lib -lVT -ldwarf -lelf -lm -lpthread \ +# -L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt" +# fi +if test $MPITYPE = intelmpi +then + SYSLIBS="-L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt $OPENMP -threads -lpthread" +fi + +SYSLIBSPAR=" " + +MARC_DLL_CODES="runmarc.f" + + +BLAS_SRC="dzero.f icopy.f izero.f" +if test "$_OEM_NASTRAN" -ne 0 +then + if test "$MARC_INTEGER_SIZE" = "i4" ; then + BLAS_SRC="$BLAS_SRC dsctr.f zsctr.f dzasum.f daxpyi.f zaxpyi.f dgthr.f zgthr.f" + else + BLAS_SRC="ALL" + fi +fi + +LOW_OPT_CODES="are163.f contro.f ndext.f omarc.f omarca.f omarcb.f omarcc.f \ + omars.f fixbc.f triang.f bet049.f norst3.f eldata.f \ + elec*.f elct*.f fmeig.f oada00.f ogeig.f updtrbe2.f cycrota.f \ + cordef.f ogpk.f ogtan.f eldam.f formrbe3.f \ + inertie.f em_sso072.f cn_fol3d_qpatch6.f" +if test "$MARC_INTEGER_SIZE" = "i8" ; then + LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" +fi +LOW_OPT_CODES_CASI="" + +HIGH_OPT_CODES="dpsmsa1.f dpsmsa2.f dpsmsa3.f dpsmsa4.f dpsmsa5.f dpsmsa6.f \ + dpsmsa7.f dpsmsa8.f dpsmsa9.f dpsmsa10.f dpsmsa11.f dpsmsa12.f \ + dpsmsa13.f dpsmsa14.f dpsmsa15.f dpsmsa16.f " + + +HIGH_OPT_CODES_CASI="arithkernels.c blockedroutines.c blockedroutines_fd.c elemmatgenkernels.c longvecroutines.c sfmultutils.c solvewithbd.c" + +MAXNUM=1000000 diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask new file mode 100644 index 000000000..ea36f070b --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask @@ -0,0 +1,4053 @@ +#!/bin/ksh +############################################################################## +# # +# run_marc - run a marc job # +# ------------------------- # +# # +# usage: run_marc -j jid { options } # +# # +# where standard options are: required: defaults: # +# -------------------------- # +# # +# -j* jid job id number. ** YES ** . # +# -pr* prog program name. . marc # +# -v* y|n do or do not verify inputs. . yes # +# -q* s|l|v|b|f batch queue name or background, . short # +# foreground. # +# -b* as alternative to option -q* # +# # +# ( batch queues only : # +# -pq* intra queue priority. . . # +# -at DATE/TIME delay start of job. . . # +# format : January,1,1990,12:31 # +# or : today,5pm # +# -cpu* secs job CPU limit . . ) # +# # +# -r* rid restart file job id. . . # +# -si* sid substructure file id. . . # +# -pi* post post file job id. . . # +# -de* did defaults file . no # +# -vf vid viewfactor . no # +# # +# -u* user user subroutine. . . # +# -obj obj user objects or libraries. . . # +# -sa* y|n do or do not save load module. . no # +# -autorst auto restart flag for auto forge . no # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo selects i4 or i8 version # +# default: i4 or via defaults file run_marc_defaults # +# the -mo option will override # +# -mpi selects MPI version # +# each platform has a default MPI version and some # +# have an alternative version. see the include file # +# for the respective platform # +# MPI_DEFAULT defines the default MPI version # +# MPI_OTHER defines versions one can switch to # +# -dcoup for contact decoupling # +# currently not supported # +# -dir directory where the job i/o should take place. # +# defaults to current directory. # +# -sdir directory where scratch files are created # +# defaults to current directory. # +# # +# -alloc only perform memory allocation test, no analysis # +# -list y only list options in the input file, no analysis # +# -fe num set feature number "num" for the run. only one allowed # +# -dytran flag to switch from Dytran to Marc # +# dytran = 0, program will run w/o Marc-Dytran Switch # +# = 1, program will restart Marc after Dytran run # +# >= 2, Not supported yet. # +# currently not supported # +# -ou force analysis to use out-of-core control # +# =0, not used # +# =1, element storage out-of-core # +# -dll run marc using shared library libmarc.so and exe_marc # +# =1, used # +# =2, do not free streaming input memory # +# =3, run with marc input deck # +# -trk run marc for post-tracking # +# -gpuid run marc using GPGPU capability # +# specify gpuid on to be used in the analysis. Multiple # +# IDs may be assigned for DDM runs. # +# Separate a list of IDs with a colon. Each DMP # +# process will be assigned a GPU ID in round robin fastion# +# = 0 # +# = 0:1 etc... # +# # +# where parallel options are: # +# -------------------------- # +# # +# itree, host, and comp options are available for the domain # +# decomposition only. # +# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # +# # +# # +# -nprocd number of domains. # +# defaults to single domain solution. # +# -nprocds number of domains if single input file. # +# defaults to single domain solution. # +# -nps same as -nprocds. # +# -nsolver number of solver tasks for solver types 12 and 13 # +# these are distributed tasks operating via MPI # +# -nthread_elem number of threads for element assembly and recovery # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by element assembly # +# recovery. # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_elem option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_elem specified. # +# -nthread_solver number of threads for solver types 6, 8, and 11 # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by 6, 8, and 11 # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_solver option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_solver specified. # +# -nthread Same as -nthread_solver. # +# -itree message passing tree type for domain decomposition. # +# for debugging purposes; should not normally be used. # +# -host hostfile name for distributed execution on network. # +# defaults to no hostfile, unless jobid.defhost exists. # +# if jobid.defhost exists, only -np(s) necessary # +# -comp* y|n to be used with user routines on a network of # +# incompatible machines. # +# if set to no, a separate executable will be created # +# for each machine on the network. # +# if set to yes, the executable located on the machine # +# from which marc is started will be used on all machines.# +# defaults to no if O/S versions different on machines. # +# # +# -ci y|n copy input files to remote hosts (default: yes) # +# if "yes", input files are automatically copied to # +# remote hosts for a network run if necessary. # +# -cr y|n copy post files from remote hosts (default: yes) # +# if "yes", post files are automatically copied back from # +# remote hosts for a network run if necessary. # +############################################################################## +# set DIR to the directory in which this script is +REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" +DIR=`dirname $REALCOM` +# make sure DIR has an absolute path +case $DIR in + \/*) + ;; + *) + DIR=`pwd`/$DIR + ;; +esac +DIRSCRIPT=$DIR +AWK=awk +ARCH=`uname -a | cut -f 1 -d " "` +# Sun has a bad awk, use nawk instead +if test $ARCH = "SunOS" +then + AWK=nawk +fi +BASENAME=basename +# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists +if test $ARCH = "SunOS" +then + if test -x /usr/ucb/basename + then + BASENAME=/usr/ucb/basename + fi +fi + +# echo command line in the case of ECHO_COMMAND is true +if test "$ECHO_COMMAND" = true ; then + echo command "$0" "$@" +fi + +# +# "mode" selects version, i4 or i8 +# default is i4 +# this can be changed by a file run_marc_defaults +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MODE i8 +# it can also be set by the environmental variable MARC_INTEGER_SIZE +# and by the command line option "-mo" +# +mode= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + mode=i4 + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -f $HOME/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + mode=i4 + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -n "$MARC_INTEGER_SIZE" ; then + mode=$MARC_INTEGER_SIZE +fi +if test -z "$mode" ; then + mode=i8 +fi +case $mode in + i4) + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "error, version mode must be i4 or i8" + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i4 or i8" + echo " " + echo " use -mo i4 or -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + setmode=true + fi + if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + fi + if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +done + +# set to i4 version for 32 bit Linux +if test "`uname -s`" = "Linux"; then + if test "`uname -m`" = "i686"; then + mode=i4 + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +fi + + +. "$DIR/getarch" + +. $MARC_INCLUDE +# + +# +# Dynamically determine the echo syntax +# + +case "`echo '\c'`" in + '\c') + ECHO='echo -n' + ECHOTXT=' ' + ;; + *) + ECHO='echo' + ECHOTXT=' \c' + ;; +esac + +# +# Variables for the MARC environment +# + +PRODUCT="Marc" +EXITMSG=$MARC_TOOLS/MESSAGES +export EXITMSG +FLEXDIR=$DIR/../flexlm/licenses +export FLEXDIR +TIMCHK=3600 +export TIMCHK +BINDIR=$MARC_BIN +export BINDIR +AFMATDAT=$MARC_RUNTIME/AF_flowmat/ +export AFMATDAT +# +# define directory path to global unified material database +# +MATFILE= +export MATFILE + +# +# define memory limit +# first set to MEMLIMIT from include +# -ml option overrules if specified +memlimit=$MEMLIMIT +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +# +if test $MACHINENAME = "HP" +then + SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH + export SHLIB_PATH +fi +# the one for IBM is defined futher down + +LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH +LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH +export LD_LIBRARY_PATH +export LD_LIBRARY64_PATH +export LD_LIBRARYN32_PATH + +atexit() { +kill -15 $$ +# +if test $MPITYPE = "myrinet" +then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi +fi +} + +trap "atexit" 2 + +# +# defaults +# + +prog=marc +exefile=marc +jid= +rid= +pid= +sid= +did= +vid= +user= +usernoext= +objs= +qid=background +cpu= +priority= +att= +trk= +verify=yes +prgsav=no +rmdll=no +cpdll=no +progdll= +pathdll= +error= +nprocd=0 +nprocdddm=1 +nprocdddmprint= +icreated=0 +nprocdarg= +nsolver=0 +nsolverarg=-ns +if test $nprocds +then + if test $nprocds -gt 1 + then + nprocdddm=$nprocds + nprocdddmprint=$nprocds + icreated=1 + nprocdarg=-nprocds + fi +fi +ntprint=0 +nt=-1 +nte=-1 +nts=-1 +ntarg=-nt +ntearg=-nte +ntsarg=-nts +nteprint= +ntsprint= +gpuids= +nauto=0 +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +link= +trkrun=0 +DIRJOB=`pwd` +DIRSCR=$DIRJOB +DIRSCRSET= +autoforge=0 +dotdat=.dat +dotdefhost=.defhost +host= +numhost= +mfile= +userhost= +makebdf= +cpinput=yes +cpresults=yes +marcdll=libmarc.$EXT_DLL +# define hostname and strip off extensions (alpha.aaa.com) +thishost=`hostname` +thishost=${thishost%%.*} +compatible=unknown +numfield=1 +justlist= +feature= +mpioption=false +MDSRCLIB=$MARC_LIB/mdsrc.a +# +# check run_marc_defaults file for default MPI setting +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MPI +# +value= +file= +if test -f $DIRSCRIPT/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$DIRSCRIPT/run_marc_defaults + fi +fi +if test -f $HOME/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$HOME/run_marc_defaults + fi +fi +if test -n "$value"; then + MARC_MPITYPE=$value + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + echo " " + echo " error, incorrect option for MARC_MPI" + echo " defined in $file: $MARC_MPITYPE" + echo " valid options: $MPI_DEFAULT $MPI_OTHER" + echo " " + exit + fi + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + fi +fi +# +# +# allow scratch directory to be specified with environmental variable +# MARCSCRATCH +if test $MARCSCRATCH +then + if test -d $MARCSCRATCH + then + DIRSCR=$MARCSCRATCH + else + echo "error, scratch directory '$MARCSCRATCH'" + echo " specified via environmental variable MARCSCRATCH does not exist" + exit + fi +fi +# +############################################################################## +# parse input - arguments always come in pairs # +############################################################################## + +arg=$1 +if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + shift + arg=$1 +fi +while [ -n "$arg" ] +do + shift + value=$1 + case $arg in + -al* | -AL*) + LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + $MARC_BIN/marc -alloc 1 + exit + ;; + -li* | -LI*) + justlist=yes + ;; + -fe* | -FE*) + feature=$value + ;; + -pr* | -PR*) + if test `dirname $value` = '.' + then + prog=`$BASENAME $value .marc` + progdll=`$BASENAME $value` + else + prog=`dirname $value`/`$BASENAME $value .marc` + progdll=`dirname $value`/`$BASENAME $value` + fi + prdir=`dirname $value` + case $prdir in + \/*) + ;; + *) + prog=`pwd`/$prdir/$prog + ;; + esac + ;; + -j* | -J*) + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + ;; + -r* | -R*) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + -si* | -SI*) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + -pi* | -PI*) + if test -f $value.t19 + then + pid=`$BASENAME $value .t19` + else + pid=`$BASENAME $value .t16` + fi + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + -bdf | -BDF) + makebdf=1 + ;; + -de* | -DE*) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + -vf | -VF) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + -u* | -U*) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -at | -AT) + att=$value + ;; + -cpu* | -CPU*) + cpu=$value + ;; + -pq | -PQ*) + priority=$value + ;; + -v* | -V*) + verify=$value + ;; + -sa* | -SA*) + prgsav=$value + ;; + -np* | -NP*) + nprocdddm=$value + nprocdddmprint=$value + case $arg in + -nps* | -NPS* | -nprocds* | -NPROCDS*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + case $arg in + -np | -NP | -nprocd | -NPROCD) + icreated=0 + nprocdarg=-nprocd + ;; + esac + ;; + -ns* | -NS*) + nsolver=$value + ;; + -nt* | -NT*) + case $arg in + -nte | -NTE | -nthread_e* | -NTHREAD_E*) + nte=$value + ;; + esac + case $arg in + -nts | -NTS | -nthread_s* | -NTHREAD_S*) + nts=$value + ;; + esac + case $arg in + -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) + nt=$value + ;; + esac + ;; + -gp* | -GP*) + gpuids=$value + ;; + -it* | -IT*) + itree=$value + ;; + -iam | -IAM) + iam=$value + ;; + -au* | -AU*) + nauto=$value + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -me | -ME ) + mesh=$value + ;; + -ml | -ML ) + memlimit=$value + ;; + -mo | -MO ) + ;; + -mpi | -MPI ) + mpioption=true + MARC_MPITYPE=$value + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + fi + fi + ;; + -dir* | -DIR*) + DIRJOB=$value + case $DIRJOB in + \/*) + ;; + *) + DIRJOB=`pwd`/$DIRJOB + ;; + esac + if test -z "$DIRSCRSET" + then + DIRSCR=$DIRJOB + fi + ;; + -sd* | -SD*) + DIRSCR=$value + DIRSCRSET=yes + case $DIRSCR in + \/*) + ;; + *) + DIRSCR=`pwd`/$DIRSCR + ;; + esac + ;; + -ho* | -HO*) + host=$value + ;; + -co* | -CO*) + compatible=$value + ;; + -ci* | -CI*) + cpinput=$value + ;; + -cr* | -CR*) + cpresults=$value + ;; + *) + error="$error +$arg: invalid option" + break + ;; + esac + case $value in + -*) + error="$error +$arg: invalid name $value" + break + ;; + esac + shift + arg=$1 + if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + shift + arg=$1 + fi +done +argc=`expr $# % 2` +if test $argc -eq 1 +then +# +# odd number of arguments +# + error="$error +argument list incomplete" +fi + +if test $nprocdddm -gt 0 +then +nprocd=$nprocdddm +fi + +if test $nsolver -gt 0 +then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi +fi +# Set defaults +if test $nt -eq -1 +then +nt=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nt -lt 0 +then +nt=0 +fi +if test $nte -eq -1 +then +nte=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nte -lt 0 +then +nte=0 +fi +if test $nts -eq -1 +then +nts=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nts -lt 0 +then +nts=0 +fi +# +# set number of element loop threads +# +ntprint=$nt +nteprint=$nte +# copy from -nprocd[s] +if test $nprocdddm -gt 1 +then + nteprint=$nprocdddm +fi +# override with -nthread_elem option +if test $nte -ne 0 +then +nteprint=$nte +fi +# check for minimum 1 threads per processes for DDM +if test $nprocdddm -gt 1 +then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi +fi +nte=$nteprint +# +# set number of Solver threads +# +ntsprint=$nts +# copy from -nthread or -nprocd[s] +if test $ntprint -ne 0 +then + ntsprint=$ntprint +else + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +fi +# override with -nthread_solver option +if test $nts -ne 0 +then + ntsprint=$nts +fi +# check for minimum 1 threads per solver process. +if test $nsolver -lt $nprocdddm +then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi +else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi +fi +if test $ntsprint -eq 1 +then + set ntsprint=0 +fi +nts=$ntsprint + +# set stack size for multi-threading. +export KMP_MONITOR_STACKSIZE=7M +export OMP_STACKSIZE=7M + +# +# deprecate -nthread option at arugment of marc +nt=0 +# Reset nprocdddmm, nsolver and threads if not given. +if test $nprocdddm -eq 0 +then + nprocdarg= +fi +if test $nprocdddm -eq 0 +then + nprocdddmprint= +fi +if test $nprocdddm -eq 0 +then + nprocdddm= +fi + +if test $nsolver -eq 0 +then + nsolverprint= +fi +# end of threads setting. +gpuoption= +if test "$gpuids" = "" ; then + gpuoption= +else + gpuoption="-gp $gpuids" +fi + +if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH +else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH +fi +# Linux 64 + HPMPI, Below code is taken from include_linux64 +if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" +then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +fi + +if test $nprocd -gt 1; then + if test -f $jid$dotdefhost; then + if test "$host" = ""; then + host=$jid$dotdefhost + fi + fi + if test -f hostfile_qa_$nprocd; then + if test "$host" = ""; then + host=hostfile_qa_$nprocd + fi + fi +fi + +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then + dotdat=.inp + fi + + if test "$progdll"; then + /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll + rmdll=yes + pathdll=yes + progdll=${progdll}_$marcdll + else + progdll=$marcdll + fi + + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + pathdll=yes + fi +fi + +############################################################################## +# check parameter validity # +############################################################################## + +while test forever; do + +# +# check for input file existence +# +if test $nprocdddm -gt 1 -a $icreated -eq 0; then + if test ! -f $DIRJID/1$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/1$jid$dotdat not accessible" + fi + fi +else + if test ! -f $DIRJID/$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/$jid$dotdat not accessible" + fi + fi +fi + if test $nprocd -gt 1; then + if test "$host" ; then + if test ! -f $host; then + error="$error +host name file $host not accessible" + fi + fi + fi + +# +# check if the job is already running in the background +# +if test -f $DIRJOB/$jid.pid; then + error="$error +job is already running (the file $jid.pid exists)" +fi + +# +# if the program name is other than marc, then +# assume that this is a program in the users local directory +# + +bd=$MARC_BIN/ + +case $prog in + marc | MARC | $exefile) + program=$exefile + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + if test ! -f $user + then + error="$error +user subroutine file $user not accessible" + fi + fi + if test "$objs" + then + missingobjs= + for o in $objs + do + if test ! -f "$o" + then + if test -z "$missingobjs" + then + missingobjs="$o" + else + missingobjs="$missingobjs $o" + fi + fi + done + if test -n "$missingobjs" + then + error="$error +user object/library file(s) $missingobjs not accessible" + fi + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$vid" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRVID/1$vid.vfs + then + error="$error +view factor file $DIRVID/1$vid.vfs not accessible" + fi + else + if test ! -f $DIRVID/$vid.vfs + then + error="$error +view factor file $DIRVID/$vid.vfs not accessible" + fi + fi + fi + if $mpioption + then + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" + fi + fi + ;; + *) + program=$prog.marc + case $prog in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + error="$error +program option may not be used with user subroutine" + fi + if test "$objs" + then + error="$error +program option may not be used with user objects or libraries" + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$nauto" + then + if test $nauto -gt 2 + then + error="$error +incorrect option for auto restart " + fi + fi + if test "$ndcoup" + then + if test $ndcoup -gt 3 + then + error="$error +incorrect option for contact decoupling " + fi + fi + if test "$ndytran" + then + if test $ndytran -gt 1 + then + error="$error +incorrect option for Marc-Dytran Switch " + fi + fi + if $mpioption + then + if test ! -x $MARC_BIN/$exefile + then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE " + fi + fi + ;; +esac + +############################################################################## +# check argument integrity # +############################################################################## + +if test "$jid" +then + : +else + error="$error +job id required" +fi + +if test $nprocd -gt 1 +then + if test $nauto -gt 0 + then + error="$error +cannot run DDM job with auto restart (-au) option " + fi +fi +case $qid in + S* | s*) + qid=short + ;; + L* | l*) + qid=long + ;; + V* | v*) + qid=verylong + ;; + B* | b*) + qid=background + ;; + F* | f*) + qid=foreground + ;; + A* | a*) + qid=at + ;; + *) + error="$error +bad value for queue_id option" + ;; +esac + +case $prgsav in + N* | n*) + prgsav=no + ;; + Y* | y*) + prgsav=yes + ;; + *) + error="$error +bad value for save option" + ;; +esac + +case $verify in + N* | n*) + verify=no + ;; + Y* | y*) + verify=yes + ;; + *) + error="$error +bad value for verify option" + ;; +esac + +case $nprocdddm in + -* ) + error="$error +bad value for nprocd option" + ;; +esac + +case $nt in + -* ) + error="$error +bad value for nt option" + ;; +esac + +case $itree in + -* ) + error="$error +bad value for itree option" + ;; +esac +case $iam in + -* ) + error="$error +bad value for iam option" + ;; +esac +case $compatible in + N* | n*) + compatible=no + ;; + Y* | y*) + compatible=yes + ;; + unknown) + ;; + *) + error="$error +bad value for comp option" + ;; +esac +case $cpinput in + N* | n*) + cpinput=no + ;; + Y* | y*) + cpinput=yes + ;; + *) + error="$error +bad value for copy input option" + ;; +esac +case $cpresults in + N* | n*) + cpresults=no + ;; + Y* | y*) + cpresults=yes + ;; + *) + error="$error +bad value for copy results option" + ;; +esac + +# +# check for external file to run +# +if test -f $MARC_TOOLS/run_marc_check +then + . $MARC_TOOLS/run_marc_check +fi + +# +# pick up version data from bin/VERSION if it exists +# +if test -f $MARC_BIN/VERSION; then + ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` + if test -n "$ppp" ;then + PRODUCT=$ppp + fi + ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` + if test -n "$ppp" ;then + REVISION=", Build $ppp" + fi +fi +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +deletelog=yes +if test $qid = background -a $verify = no +then +echo \ +" +$PRODUCT $REVISION $MACHINE version +----------------------------- +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto " > $jid.log +deletelog=no +fi +echo \ +" +$PRODUCT $REVISION $MACHINE version +----------------------------- +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto" + + +case $qid in + s* | S* | l* | L* | v* | V* ) + echo \ +"Queue priority : $priority +Queue CPU limit : $cpu +Queue start time : $att" + ;; +# * ) +# echo \ +#" " +# ;; +esac + +if test "$error" +then + if test $verify = yes + then + $ECHO "$error + +Please correct or quit(correct,quit,): $ECHOTXT" + error= + read answer + case $answer in + q* | Q*) + answer=quit + ;; + *) + answer=correct + ;; + esac + else + $ECHO "$error + $ECHOTXT" + echo " " + if test "$deletelog" = no + then + $ECHO "$error + $ECHOTXT" >> $jid.log + echo " " >> $jid.log + fi + answer=quit + fi +else + if test $verify = yes + then + $ECHO " +Are these parameters correct (yes,no,quit,)? $ECHOTXT" + read answer + case $answer in + q* | Q*) + answer=quit + ;; + y* | Y*) + answer=yes + ;; + *) + answer=no + ;; + esac + else + answer=yes + fi +fi + +case $answer in + no | correct) + +############################################################################## +# prompt for each value # +############################################################################## + + $ECHO " +Program name ($prog)? $ECHOTXT" + read value + if test "$value" + then + prog=$value + fi + $ECHO "Job ID ($jid)? $ECHOTXT" + read value + if test "$value" + then + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + fi + $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi + $ECHO "User objects or libraries ($objs)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + objs= + ;; + *) + objs="$value" + ;; + esac + fi + $ECHO "Restart File Job ID ($rid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + rid= + ;; + *) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + esac + fi + $ECHO "Substructure File ID ($sid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + sid= + ;; + *) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + esac + fi + $ECHO "Post File Job ID ($pid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + pid= + ;; + *) + pid=$value + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + esac + fi + $ECHO "Defaults File ID ($did)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + did= + ;; + *) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + esac + fi + $ECHO "View Factor File ID ($vid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + vid= + ;; + *) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + esac + fi + $ECHO "Save generated module ($prgsav)? $ECHOTXT" + read value + if test "$value" + then + prgsav=$value + fi + $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" + read value + if test "$value" + then + nprocdddm=$value + nprocdddmprint=$value + fi + $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" + read value + if test "$value" + then + nte=$value + fi + $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" + read value + if test "$value" + then + nsolver=$value + fi + $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" + read value + if test "$value" + then + nts=$value + fi +# + if test $nprocdddm -gt 0 + then + nprocd=$nprocdddm + fi + if test $nsolver -gt 0 + then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi + fi +# Element loop threads. + if test $nte -eq -1 + then + nte=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nte -lt 0 + then + nte=0 + fi + nteprint=$nte +# Copy from ddm + if test $nprocdddm -gt 1 + then + nteprint=$nprocdddm + fi +# override with -nthread_elem option + if test $nte -ne 0 + then + nteprint=$nte + fi +# check for minimum 1 threads per processes for DDM + if test $nprocdddm -ne 0 + then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi + fi + nte=$nteprint +# Solver threads. + if test $nts -eq -1 + then + nts=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nts -lt 0 + then + nts=0 + fi + ntsprint=$nts +# Copy from ddm + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +# override with -nthread_solver option + if test $nts -ne 0 + then + ntsprint=$nts + fi +# check for minimum 1 threads per solver process. + if test $nsolver -lt $nprocdddm + then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi + else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi + fi + if test $ntsprint -eq 1 + then + set ntsprint=0 + fi + nts=$ntsprint + $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" + read value + if test "$value" + then + gpuids=$value + fi + if test "$gpuids" = "" ; then + gpuoption= + else + gpuoption="-gp $gpuids" + fi + if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH + fi + if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + fi +# + if test $nprocd -gt 1 + then + $ECHO "Message passing type ($itree)? $ECHOTXT" + read value + if test "$value" + then + itree=$value + fi + $ECHO "Host file name ($host)? $ECHOTXT" + read value + if test "$value" + then + host=$value + fi + if test $nprocdddm -gt 1 + then + $ECHO "Single input file? $ECHOTXT" + read value + case $value in + y* | Y*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" + read value + if test "$value" + then + compatible=$value + fi + $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" + read value + if test "$value" + then + cpinput=$value + fi + $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" + read value + if test "$value" + then + cpresults=$value + fi + fi + fi + $ECHO "Run the job in the queue ($qid)? $ECHOTXT" + read value + if test "$value" + then + qid=$value + fi + case $qid in + s* | S* | l* | L* | v* | V* ) + $ECHO "Queue priority ($priority)? $ECHOTXT" + read value + if test "$value" + then + priority=$value + fi + $ECHO "Job starts at ($att)? $ECHOTXT" + read value + if test "$value" + then + att=$value + fi + $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" + read value + if test "$value" + then + cpu=$value + fi + ;; + * ) + ;; + esac + $ECHO "Auto Restart option ($nauto)? $ECHOTXT" + read value + if test "$value" + then + nauto=$value + fi + $ECHO "Run directory ($DIRJOB)? $ECHOTXT" + read value + if test "$value" + then + DIRJOB=$value + DIRSCR=$DIRJOB + fi + $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" + read value + if test "$value" + then + DIRSCR=$value + fi + ;; + quit) + exit 1 + ;; + *) + break + ;; + +esac + + if test $nt -eq -1 + then + nt=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nt -lt 0 + then + nt=0 + fi + +done +# +if test $nt -eq 0 +then + ntarg= +fi +if test $nt -eq 0 +then + ntprint= +fi +if test $nt -eq 0 +then + nt= +fi + +if test $nte -eq 0 +then + ntearg= +fi +if test $nte -eq 0 +then + nteprint= +fi +if test $nte -eq 0 +then + nte= +fi + +if test $nts -eq 0 +then + ntsarg= +fi +if test $nts -eq 0 +then + ntsprint= +fi +if test $nts -eq 0 +then + nts= +fi +# +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + pathdll=yes + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + fi + + if test "$pathdll"; then +# +# reset share lib path +# + if test $MACHINENAME = "HP" + then + SHLIB_PATH=$DIRJOB:$SHLIB_PATH + export SHLIB_PATH + fi + if test $MACHINENAME = "IBM" + then + LIBPATH=$DIRJOB:$LIBPATH + export LIBPATH + fi +# + LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH + LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH + LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH + export LD_LIBRARY_PATH + export LD_LIBRARY64_PATH + export LD_LIBRARYN32_PATH + fi +fi +# end of dllrun>0 + + +if test $program = $exefile -o $program = $prog.marc +then + +# delete the old .log file unless we run in the background +if test "$deletelog" = yes +then + /bin/rm $jid.log 2>/dev/null +else + echo + echo running the job in the background, see $jid.log + echo +fi + +# +# check if this is an autoforge or rezoning or radiation job +# +if test $nprocd -eq 1 +then + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` + if test "$line" + then + autoforge=1 + fi +fi +# +# check that jobname for restarted run is not the same +# as restart file basename +# +if test "$rid" +then + if test "$jid" = "$rid" + then + echo " " + echo "ERROR: job name of current run is the same as job name" + echo " of the restarted job" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "ERROR: job name of current run is the same as job name" >> $jid.log + echo " of the restarted job" >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi +fi + +# +# user objects/libraries used +# + + if test "$objs" + then + program="$DIRJOB/$jid.marc" + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# user subroutine used +# +# add BLAS options for linking + BLAS="%BLAS%" + + if test "$user" + then + program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# Special case for IBM using POE but not an SP machine +# in this case we always need a host file, also for serial jobs. +# +if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP +then + MP_HOSTFILE=${jid}.host + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $nprocd -gt 1 + then + numdom=$nprocd + while test $numdom -gt 0 + do + hostname -s >> $MP_HOSTFILE + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + else + hostname -s > $MP_HOSTFILE + fi +fi +# +# check ssh for all hosts in host file +# +if test $nprocd -gt 1 +then +if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" + then +# get host list + if test "$host" + then + line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` +# count failing hosts + counter=0 + for i in $line + do + $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n + status=$? + if [[ $status != 0 ]] ; then + counter=$((counter+1)) + if [ "$counter" = "1" ]; then + echo " " + echo " error - connection test failed... " + echo " " + fi + echo " " + echo " connection test with ssh failed on host $i" + echo " check the following command: ssh $i uname -n " + echo " " + fi + done +# echo error message and quit + if test $counter -ne 0 + then + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. Note that this is the case " + echo " also for running on a single machine. " + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. ">> $jid.log + echo " The ssh command must be working correctly between ">> $jid.log + echo " the computers used in the analysis. Furthermore, ">> $jid.log + echo " it must be set up such that it does not prompt the ">> $jid.log + echo " user for a password. Note that this is the case ">> $jid.log + echo " also for running on a single machine. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + else + counter=1 +# test ssh `hostname` + if test $counter -ne 0 + then + line=`hostname` + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi +# test ssh `hostname` + if test $counter -ne 0 + then + line=`hostname -s` + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi +# test ssh localhost + if test $counter -ne 0 + then + line=localhost + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi + if test $counter -ne 0 + then + echo " error - connection test failed... " + echo " " + echo " ssh needs to work on the machine without asking for a password." + echo " check the following command: ssh localhost uname -n" + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. Note that this is the case " + echo " also for running on a single machine. " + echo " " + if test "$deletelog" = no + then + echo " error - connection test failed... " >> $jid.log + echo " " >> $jid.log + echo " ssh needs to work on the machine without asking for a password." >> $jid.log + echo " check the following command: ssh localhost uname -n" >> $jid.log + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. " >> $jid.log + echo " The ssh command must be working correctly between " >> $jid.log + echo " the computers used in the analysis. Furthermore, " >> $jid.log + echo " it must be set up such that it does not prompt the " >> $jid.log + echo " user for a password. Note that this is the case " >> $jid.log + echo " also for running on a single machine. " >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + echo $line $nprocd > $jid.hosts + host=$jid.hosts + fi + fi +fi +fi +# +# check correctness of host file; fix for user sub +# + if test $nprocd -gt 1 + then + +# construct the path name to the executable (execpath) + execpath=$MARC_BIN/$exefile + usersub=0 + if test $program = $prog.marc + then + execpath=$prog.marc + usersub=1 + fi + if test "$objs" + then + execpath="$DIRJOB/$jid.marc" + usersub=1 + fi + if test "$user" + then + execpath=$usernoext.marc + usersub=1 + fi + export execpath + execname=`$BASENAME $execpath` + + if test "$host" + then + userhost=$host + case $userhost in + \/* | \.\/*) + ;; + *) + userhost=`pwd`/$userhost + ;; + esac + +# check that the number of processes specified in the hostfile is +# equal to nprocd specified by -nprocd. + numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` + if test $nprocd -ne $numproc + then + echo " " + echo "error, the number of processes specified in the host file" + echo "must be equal to the number of processes given by -nprocd/-nsolver" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, the number of processes specified in the host file" >> $jid.log + echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + +# check for Myrinet that the number of processes per host is +# less than number of available user ports, 5 +# .gmpi directory must exist in user's home directory +# and must have write permission from remote hosts + if test $MPITYPE = "myrinet" + then + numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` + if test $numproc -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes specified " + echo "in the hostfile must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes specified " >> $jid.log + echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + if test ! -d ~/.gmpi + then + echo " " + echo "error, for Myrinet a .gmpi directory must exist " + echo "under the user's home directory" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log + echo "under the user's home directory" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + homedir=`echo ~` + for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + echo " " + echo "error, for Myrinet a shared .gmpi directory must exist " + echo "under the user's home directory " + echo "with remote write permission" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log + echo "under the user's home directory " >> $jid.log + echo "with remote write permission" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + /bin/rm tmp.$$ + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + fi + fi + done + fi + fi + +# construct the host file $jid.host which is used by mpirun +# skip lines starting with # and only consider lines with more than +# one word in them. Note that the hostfile given to this script +# has two columns: the host name and the number of shared processes +# to run on this host. mpirun wants the number of _other_ +# processes to run in addition to the one being run on the machine +# on which the job is started. hence the $2-1 for fnr == 1. + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then +# HPMPI or HP hardware MPI + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ + -v mpihpspecial="$MPIHPSPECIAL" \ +'{if ( NF > 0) {\ + fnr++ ; \ + printf("-h %s -np %s",$1,$2); \ + printf(" %s",mpihpspecial); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ + if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ + }\ + }' > $jid.host +# end HPMPI or HP hardware MPI + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then +# IBM using hardware MPI (POE) + MP_HOSTFILE=$jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host +# end IBM using hardware MPI (POE) +# for Intel MPI, need to create a machinefile for DMP + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then +# Intel MPI + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + /bin/cp $host $jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Intel MPI for DMP +# for Solaris HPC 7.1, need to create a machinefile for DMP + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then +# Solaris HPC 7.1 + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Solaris HPC 7.1 for DMP +# for Myrinet, construct a configuration file in ~/.gmpi +# this must be readable by each process +# format is (hostname) (port number) for each process + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + grep -v '^#' $host | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ +{if ( NF > 0 ) \ + for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ +}' >> ~/.gmpi/$jid.host + else +# this is for mpich-1.2.5 and later, using the -pg option +# format: host nproc executable user arguments +# the arguments are added later + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s %s\n",path,user);\ + if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ + }\ + }' > $jid.host + fi +# end Myrinet + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then +# Compaq MPI via Memory Channel + grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host +# end Compaq MPI + else +# MPICH + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ + }\ + }' > $jid.host + fi +# define the variable host and host_filt +# host_filt is used for loops over hosts +# for Myrinet we need to use a filtered variant of userhost +# for others we can use $host + if test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + host=~/.gmpi/$jid.host + host_filt=$jid.host_tMp + grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt + else + host=$jid.host + host_filt=$host + fi + else + host=$jid.host + host_filt=$host + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + host_filt=$jid.mfile + fi + fi +# figure out if the machines in the hostfile are nfs mounted +# or distributed and set the variable "dirstatus" accordingly. +# only perform the check if user subroutine is used +# or a user subroutine executable is used + + numfield=1 + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + numfield=2 + fi + DIR1=$DIRJOB + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + counter=0 + echo " " + echo "checking if local or shared directories for host" + if test "$deletelog" = no + then + echo "checking if local or shared directories for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + dirstatus[$counter]="shared" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + dirstatus[$counter]="local" + /bin/rm tmp.$$ + else + if test ! -f $jid.$$ + then + dirstatus[$counter]="local" + $RSH $i /bin/rm $DIR1/$jid.$$ + else + /bin/rm $jid.$$ + fi + fi + if test -f tmp.$$ + then + /bin/rm tmp.$$ + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + echo " ${dirstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${dirstatus[$counter]}" >> $jid.log + fi + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + fi + +# figure out if this is a compatible set of machines +# unless explicitly specified with flag -comp +# only perform the check if user subroutine is used +# or a user subroutine executable is used +# Myrinet does not support heterogeneous + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + if test $compatible = "unknown" + then + thisname=$ARCH + compatible=yes + counter=0 + echo "checking if machines are compatible for host" + if test "$deletelog" = no + then + echo "checking if machines are compatible for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]="yes" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + othername=`$RSH $i uname -a | cut -f 1 -d " "` + if test $thisname != $othername + then + compatible=no + compstatus[$counter]="no" + fi + fi + echo " ${compstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${compstatus[$counter]}" >> $jid.log + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + else + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]=$compatible + fi + done + if test $compatible = "no" + then + echo "all machines assumed incompatible" + if test "$deletelog" = no + then + echo "all machines assumed incompatible" >> $jid.log + fi + else + echo "all machines compatible" + if test "$deletelog" = no + then + echo "all machines compatible" >> $jid.log + fi + fi + fi +# error out if user objects or libraries are used on incompatible machines + if test "$compatible" = "no" -a -n "$objs" + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" + if test "$deletelog" = no + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log + fi + exit 1 + fi +# modify new host file if NFS mounted heterogeneous machine + doit= + if test $program = $prog.marc + then + doit=yes + fi + if test "$user" + then + doit=yes + fi + if test "$doit" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + $AWK -v hst=$i '{fnr++ ; \ +if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ +printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} + /bin/mv $jid.host{$$} $jid.host + host=$jid.host + fi + fi + done + fi + fi # if test $program = $prog.marc -o $user -o $obj + + else # if test $host + # assume shared memory machine if no hostfile given and + # MPITYPE is set to mpich or Myrinet + # check for Myrinet that the total number of processes is + # less than number of available user ports, 5 + if test $MPITYPE = "mpich" -o $MPITYPE = "scali" + then + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + host=$jid.host + elif test $MPITYPE = "myrinet" + then + if test $nprocd -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes " + echo "must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes " >> $jid.log + echo "must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + echo `hostname` $nprocd | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ + {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ +' >> ~/.gmpi/$jid.host + host=~/.gmpi/$jid.host + else + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + + fi + fi # if test myrinet + + fi # if test $host + + fi # if test $nprocd -gt 1 + +fi # if test $program = $exefile -o $program = $prog.marc + +############################################################################## +# construct run stream (Marc only) # +############################################################################## + +# set maximum message length for ddm to a large number +# for vendor provided mpi +if test $itree -eq 0 -a $MPITYPE = hardware +then + itree=100000000 + if test $MACHINENAME = SGI + then + itree=100000001 + fi +fi +if test $itree -eq 0 -a $MPITYPE = hpmpi +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = myrinet +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = nec +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = scali +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = intelmpi +then + itree=100000000 +fi +if test $nprocdddm -lt 2 +then + nprocdarg= +else + nprocdarg="$nprocdarg $nprocdddm" +fi +if test $nsolver -eq 0 +then + nsolverarg= +else + nsolverarg="$nsolverarg $nsolver" +fi +if test $nprocdddm -lt 2 -a $nsolver -eq 0 +then +nprocd=0 +fi +if test $nprocd -gt 0 +then + if test "$host" + then + if test -z "$RUN_JOB2" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then + RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" + RUN_JOB=" -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + numhost=`uniq $jid.mfile | wc -l` + if test "$INTELMPI_VERSION" = "HYDRA" + then + RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n $numhost -r $RSH -f $jid.mfile + RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" + fi + +# intelmpi uses configfile. format: +# -host host1 -n n1 executable marcargs +# one such line per host +# collect the marcargs in RUN_JOB and construct the config file later +# collect the run stream in RUN_JOB_TMP + RUN_JOB="-jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + + + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then + RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test "$userhost" + then + RUN_JOB="$RUN_JOB -mhost $userhost" + fi + if test $MPITYPE = "scali" + then +# set default working directory to /tmp to allow +# different directory names + SCAMPI_WORKING_DIRECTORY=/tmp + export SCAMPI_WORKING_DIRECTORY + fi + else + if test -z "$RUN_JOB1" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + RUNNPROCD=$nprocd + if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" + then + RUNNPROCD= + MP_PROCS=$nprocd + export MP_PROCS + fi + if test $MPITYPE = "myrinet" + then + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + echo " " > /dev/null + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n 1 -f $jid.hosts + fi + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + fi +else + if test $nauto -gt 0 -o $ndcoup -gt 0 + then + RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else +# this is for a serial job without auto restart: + RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi +fi +if test "$rid" +then + RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" +fi +if test "$pid" +then + RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" +fi +if test "$sid" +then + RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" +fi +if test "$did" +then + RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" +fi +if test "$vid" +then + RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" +fi +if test $nauto -gt 0 +then + RUN_JOB="$RUN_JOB -autorst $nauto " +fi +if test $ndcoup -gt 0 +then + RUN_JOB="$RUN_JOB -dcoup $ndcoup " +fi +if test $ndytran -gt 0 +then + RUN_JOB="$RUN_JOB -dytran $ndytran " +fi +if test $mesh -gt 0 +then + RUN_JOB="$RUN_JOB -me $mesh " +fi +if test $noutcore -gt 0 +then + RUN_JOB="$RUN_JOB -outcore $noutcore " +fi +if test "$dllrun" -gt 0 +then + RUN_JOB="$RUN_JOB -dll $dllrun " +fi +if test "$trkrun" -gt 0 +then + RUN_JOB="$RUN_JOB -trk $trkrun " +fi +if test "$iam" +then + RUN_JOB="$RUN_JOB -iam $iam " +fi +if test "$justlist" +then + RUN_JOB="$RUN_JOB -list 1 " +fi +if test "$feature" +then + RUN_JOB="$RUN_JOB -feature $feature " +fi +if test "$memlimit" -ne 0 +then + RUN_JOB="$RUN_JOB -ml $memlimit " +fi +if test "$cpinput" +then + RUN_JOB="$RUN_JOB -ci $cpinput " +fi +if test "$cpresults" +then + RUN_JOB="$RUN_JOB -cr $cpresults " +fi +if test "$DIRSCR" != "$DIRJOB" +then + RUN_JOB="$RUN_JOB -dirscr $DIRSCR" +else + DIRSCR=$DIRJOB +fi +if test "$makebdf" +then + RUN_JOB="$RUN_JOB -bdf $makebdf " +fi +if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" +then + # append $RUN_JOB to all lines of the host file + # and set RUN_JOB + $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ + /bin/mv $host.$$ $host + RUN_JOB=$RUN_JOB_TMP +fi +if test $MPITYPE = "intelmpi" -a "$host" +then + # construct config file, append $RUN_JOB to all lines of the config file + # and set RUN_JOB + if test "$INTELMPI_VERSION" = "HYDRA" + then + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + else + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-host %s -n %s",$1,$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + fi + RUN_JOB=$RUN_JOB_TMP +fi +echo " " +echo "Final run stream value" +echo " RUNJOB="$RUN_JOB +if test "$deletelog" = no +then +echo " " >> $jid.log +echo "Final run stream value" >> $jid.log +echo " RUNJOB="$RUN_JOB >> $jid.log +fi + + +############################################################################## +# run marc using valgrind # +############################################################################## +#RUN_JOB="valgrind $RUN_JOB" +#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" +############################################################################## + + +############################################################################## +# run the requested program in a queue # +############################################################################## + +if test "$deletelog" = yes +then + echo + date +else + echo >> $jid.log + date >> $jid.log +fi +if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] +then + +/bin/rm -f $jid.runmarcscript + + +# +# compile user subroutine if present +# +if test "$link" +then + if test "$user" + then + userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then + if test $MACHINENAME = "CRAY" + then + $DFORTRAN $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTRAN $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } +END4 +else + prgsav=yes +fi +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# + +cat >> $jid.runmarcscript << END5 + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# first remove all .out files and incremental restart files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null + /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null +fi + +if test $nprocdddm -gt 1 +then + $RUN_JOB 2>>$jid.log +else + $RUN_JOB 2>>$jid.log +fi + +if test $dllrun -eq 0; then + if test $prgsav = no + then + /bin/rm -f $bd$program 2>/dev/null + fi +else + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes + then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +END5 + + +# Submit to marc batch queue +# +if [ $qid = at ] +then +QUENAME=at +SUBMCMD= +else +# +# Submit to qsub queue +# +QUENAME=qsub +SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" +if test "$priority" +then + SUBMCMD=$SUBMCMD" -p $priority" +fi +if test "$att" +then + SUBMCMD=$SUBMCMD" -a $att" +fi +if test "$cpu" +then + SUBMCMD=$SUBMCMD" -lt $cpu" +fi + +fi +echo $QUENAME $SUBMCMD +#cat $jid.runmarcscript +$QUENAME $SUBMCMD < $jid.runmarcscript + +/bin/rm -f $jid.runmarcscript + +############################################################################## +# run the requested program in the background # +############################################################################## + +else +if test $qid = background +then + +# +# first remove all old .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi +# +# compile user subroutine if present +# +( +if test "$link" +then + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTRAN $user || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTRAN $user -o $userobj || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc + +# + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +$RUN_JOB & + +marcpid=$! +echo $marcpid > $DIRJOB/$jid.pid +wait $marcpid + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + fi + fi + fi +fi + + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +) 1>>$jid.log 2>&1 & + + +############################################################################## +# run the requested program in the foreground # +############################################################################## + +else + +# +# compile user subroutine if present +# +if test "$link" +then + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTRAN $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTRAN $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi +# first remove all .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi + +$RUN_JOB + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + else + echo " " > /dev/null + fi + else + if test "$host" + then + mpdcleanup -a -f $jid.mfile + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.mfile 2> /dev/null + else + mpdcleanup -a -f $jid.hosts + /bin/rm $jid.hosts 2> /dev/null + fi + fi + fi +fi + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi + + +fi +fi diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_h b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_h new file mode 100644 index 000000000..d405146b3 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_h @@ -0,0 +1,4053 @@ +#!/bin/ksh +############################################################################## +# # +# run_marc - run a marc job # +# ------------------------- # +# # +# usage: run_marc -j jid { options } # +# # +# where standard options are: required: defaults: # +# -------------------------- # +# # +# -j* jid job id number. ** YES ** . # +# -pr* prog program name. . marc # +# -v* y|n do or do not verify inputs. . yes # +# -q* s|l|v|b|f batch queue name or background, . short # +# foreground. # +# -b* as alternative to option -q* # +# # +# ( batch queues only : # +# -pq* intra queue priority. . . # +# -at DATE/TIME delay start of job. . . # +# format : January,1,1990,12:31 # +# or : today,5pm # +# -cpu* secs job CPU limit . . ) # +# # +# -r* rid restart file job id. . . # +# -si* sid substructure file id. . . # +# -pi* post post file job id. . . # +# -de* did defaults file . no # +# -vf vid viewfactor . no # +# # +# -u* user user subroutine. . . # +# -obj obj user objects or libraries. . . # +# -sa* y|n do or do not save load module. . no # +# -autorst auto restart flag for auto forge . no # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo selects i4 or i8 version # +# default: i4 or via defaults file run_marc_defaults # +# the -mo option will override # +# -mpi selects MPI version # +# each platform has a default MPI version and some # +# have an alternative version. see the include file # +# for the respective platform # +# MPI_DEFAULT defines the default MPI version # +# MPI_OTHER defines versions one can switch to # +# -dcoup for contact decoupling # +# currently not supported # +# -dir directory where the job i/o should take place. # +# defaults to current directory. # +# -sdir directory where scratch files are created # +# defaults to current directory. # +# # +# -alloc only perform memory allocation test, no analysis # +# -list y only list options in the input file, no analysis # +# -fe num set feature number "num" for the run. only one allowed # +# -dytran flag to switch from Dytran to Marc # +# dytran = 0, program will run w/o Marc-Dytran Switch # +# = 1, program will restart Marc after Dytran run # +# >= 2, Not supported yet. # +# currently not supported # +# -ou force analysis to use out-of-core control # +# =0, not used # +# =1, element storage out-of-core # +# -dll run marc using shared library libmarc.so and exe_marc # +# =1, used # +# =2, do not free streaming input memory # +# =3, run with marc input deck # +# -trk run marc for post-tracking # +# -gpuid run marc using GPGPU capability # +# specify gpuid on to be used in the analysis. Multiple # +# IDs may be assigned for DDM runs. # +# Separate a list of IDs with a colon. Each DMP # +# process will be assigned a GPU ID in round robin fastion# +# = 0 # +# = 0:1 etc... # +# # +# where parallel options are: # +# -------------------------- # +# # +# itree, host, and comp options are available for the domain # +# decomposition only. # +# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # +# # +# # +# -nprocd number of domains. # +# defaults to single domain solution. # +# -nprocds number of domains if single input file. # +# defaults to single domain solution. # +# -nps same as -nprocds. # +# -nsolver number of solver tasks for solver types 12 and 13 # +# these are distributed tasks operating via MPI # +# -nthread_elem number of threads for element assembly and recovery # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by element assembly # +# recovery. # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_elem option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_elem specified. # +# -nthread_solver number of threads for solver types 6, 8, and 11 # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by 6, 8, and 11 # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_solver option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_solver specified. # +# -nthread Same as -nthread_solver. # +# -itree message passing tree type for domain decomposition. # +# for debugging purposes; should not normally be used. # +# -host hostfile name for distributed execution on network. # +# defaults to no hostfile, unless jobid.defhost exists. # +# if jobid.defhost exists, only -np(s) necessary # +# -comp* y|n to be used with user routines on a network of # +# incompatible machines. # +# if set to no, a separate executable will be created # +# for each machine on the network. # +# if set to yes, the executable located on the machine # +# from which marc is started will be used on all machines.# +# defaults to no if O/S versions different on machines. # +# # +# -ci y|n copy input files to remote hosts (default: yes) # +# if "yes", input files are automatically copied to # +# remote hosts for a network run if necessary. # +# -cr y|n copy post files from remote hosts (default: yes) # +# if "yes", post files are automatically copied back from # +# remote hosts for a network run if necessary. # +############################################################################## +# set DIR to the directory in which this script is +REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" +DIR=`dirname $REALCOM` +# make sure DIR has an absolute path +case $DIR in + \/*) + ;; + *) + DIR=`pwd`/$DIR + ;; +esac +DIRSCRIPT=$DIR +AWK=awk +ARCH=`uname -a | cut -f 1 -d " "` +# Sun has a bad awk, use nawk instead +if test $ARCH = "SunOS" +then + AWK=nawk +fi +BASENAME=basename +# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists +if test $ARCH = "SunOS" +then + if test -x /usr/ucb/basename + then + BASENAME=/usr/ucb/basename + fi +fi + +# echo command line in the case of ECHO_COMMAND is true +if test "$ECHO_COMMAND" = true ; then + echo command "$0" "$@" +fi + +# +# "mode" selects version, i4 or i8 +# default is i4 +# this can be changed by a file run_marc_defaults +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MODE i8 +# it can also be set by the environmental variable MARC_INTEGER_SIZE +# and by the command line option "-mo" +# +mode= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + mode=i4 + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -f $HOME/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + mode=i4 + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -n "$MARC_INTEGER_SIZE" ; then + mode=$MARC_INTEGER_SIZE +fi +if test -z "$mode" ; then + mode=i8 +fi +case $mode in + i4) + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "error, version mode must be i4 or i8" + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i4 or i8" + echo " " + echo " use -mo i4 or -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + setmode=true + fi + if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + fi + if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +done + +# set to i4 version for 32 bit Linux +if test "`uname -s`" = "Linux"; then + if test "`uname -m`" = "i686"; then + mode=i4 + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +fi + + +. "$DIR/getarch" + +. $MARC_INCLUDE +# + +# +# Dynamically determine the echo syntax +# + +case "`echo '\c'`" in + '\c') + ECHO='echo -n' + ECHOTXT=' ' + ;; + *) + ECHO='echo' + ECHOTXT=' \c' + ;; +esac + +# +# Variables for the MARC environment +# + +PRODUCT="Marc" +EXITMSG=$MARC_TOOLS/MESSAGES +export EXITMSG +FLEXDIR=$DIR/../flexlm/licenses +export FLEXDIR +TIMCHK=3600 +export TIMCHK +BINDIR=$MARC_BIN +export BINDIR +AFMATDAT=$MARC_RUNTIME/AF_flowmat/ +export AFMATDAT +# +# define directory path to global unified material database +# +MATFILE= +export MATFILE + +# +# define memory limit +# first set to MEMLIMIT from include +# -ml option overrules if specified +memlimit=$MEMLIMIT +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +# +if test $MACHINENAME = "HP" +then + SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH + export SHLIB_PATH +fi +# the one for IBM is defined futher down + +LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH +LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH +export LD_LIBRARY_PATH +export LD_LIBRARY64_PATH +export LD_LIBRARYN32_PATH + +atexit() { +kill -15 $$ +# +if test $MPITYPE = "myrinet" +then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi +fi +} + +trap "atexit" 2 + +# +# defaults +# + +prog=marc +exefile=marc +jid= +rid= +pid= +sid= +did= +vid= +user= +usernoext= +objs= +qid=background +cpu= +priority= +att= +trk= +verify=yes +prgsav=no +rmdll=no +cpdll=no +progdll= +pathdll= +error= +nprocd=0 +nprocdddm=1 +nprocdddmprint= +icreated=0 +nprocdarg= +nsolver=0 +nsolverarg=-ns +if test $nprocds +then + if test $nprocds -gt 1 + then + nprocdddm=$nprocds + nprocdddmprint=$nprocds + icreated=1 + nprocdarg=-nprocds + fi +fi +ntprint=0 +nt=-1 +nte=-1 +nts=-1 +ntarg=-nt +ntearg=-nte +ntsarg=-nts +nteprint= +ntsprint= +gpuids= +nauto=0 +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +link= +trkrun=0 +DIRJOB=`pwd` +DIRSCR=$DIRJOB +DIRSCRSET= +autoforge=0 +dotdat=.dat +dotdefhost=.defhost +host= +numhost= +mfile= +userhost= +makebdf= +cpinput=yes +cpresults=yes +marcdll=libmarc.$EXT_DLL +# define hostname and strip off extensions (alpha.aaa.com) +thishost=`hostname` +thishost=${thishost%%.*} +compatible=unknown +numfield=1 +justlist= +feature= +mpioption=false +MDSRCLIB=$MARC_LIB/mdsrc.a +# +# check run_marc_defaults file for default MPI setting +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MPI +# +value= +file= +if test -f $DIRSCRIPT/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$DIRSCRIPT/run_marc_defaults + fi +fi +if test -f $HOME/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$HOME/run_marc_defaults + fi +fi +if test -n "$value"; then + MARC_MPITYPE=$value + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + echo " " + echo " error, incorrect option for MARC_MPI" + echo " defined in $file: $MARC_MPITYPE" + echo " valid options: $MPI_DEFAULT $MPI_OTHER" + echo " " + exit + fi + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + fi +fi +# +# +# allow scratch directory to be specified with environmental variable +# MARCSCRATCH +if test $MARCSCRATCH +then + if test -d $MARCSCRATCH + then + DIRSCR=$MARCSCRATCH + else + echo "error, scratch directory '$MARCSCRATCH'" + echo " specified via environmental variable MARCSCRATCH does not exist" + exit + fi +fi +# +############################################################################## +# parse input - arguments always come in pairs # +############################################################################## + +arg=$1 +if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + shift + arg=$1 +fi +while [ -n "$arg" ] +do + shift + value=$1 + case $arg in + -al* | -AL*) + LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + $MARC_BIN/marc -alloc 1 + exit + ;; + -li* | -LI*) + justlist=yes + ;; + -fe* | -FE*) + feature=$value + ;; + -pr* | -PR*) + if test `dirname $value` = '.' + then + prog=`$BASENAME $value .marc` + progdll=`$BASENAME $value` + else + prog=`dirname $value`/`$BASENAME $value .marc` + progdll=`dirname $value`/`$BASENAME $value` + fi + prdir=`dirname $value` + case $prdir in + \/*) + ;; + *) + prog=`pwd`/$prdir/$prog + ;; + esac + ;; + -j* | -J*) + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + ;; + -r* | -R*) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + -si* | -SI*) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + -pi* | -PI*) + if test -f $value.t19 + then + pid=`$BASENAME $value .t19` + else + pid=`$BASENAME $value .t16` + fi + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + -bdf | -BDF) + makebdf=1 + ;; + -de* | -DE*) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + -vf | -VF) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + -u* | -U*) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -at | -AT) + att=$value + ;; + -cpu* | -CPU*) + cpu=$value + ;; + -pq | -PQ*) + priority=$value + ;; + -v* | -V*) + verify=$value + ;; + -sa* | -SA*) + prgsav=$value + ;; + -np* | -NP*) + nprocdddm=$value + nprocdddmprint=$value + case $arg in + -nps* | -NPS* | -nprocds* | -NPROCDS*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + case $arg in + -np | -NP | -nprocd | -NPROCD) + icreated=0 + nprocdarg=-nprocd + ;; + esac + ;; + -ns* | -NS*) + nsolver=$value + ;; + -nt* | -NT*) + case $arg in + -nte | -NTE | -nthread_e* | -NTHREAD_E*) + nte=$value + ;; + esac + case $arg in + -nts | -NTS | -nthread_s* | -NTHREAD_S*) + nts=$value + ;; + esac + case $arg in + -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) + nt=$value + ;; + esac + ;; + -gp* | -GP*) + gpuids=$value + ;; + -it* | -IT*) + itree=$value + ;; + -iam | -IAM) + iam=$value + ;; + -au* | -AU*) + nauto=$value + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -me | -ME ) + mesh=$value + ;; + -ml | -ML ) + memlimit=$value + ;; + -mo | -MO ) + ;; + -mpi | -MPI ) + mpioption=true + MARC_MPITYPE=$value + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + fi + fi + ;; + -dir* | -DIR*) + DIRJOB=$value + case $DIRJOB in + \/*) + ;; + *) + DIRJOB=`pwd`/$DIRJOB + ;; + esac + if test -z "$DIRSCRSET" + then + DIRSCR=$DIRJOB + fi + ;; + -sd* | -SD*) + DIRSCR=$value + DIRSCRSET=yes + case $DIRSCR in + \/*) + ;; + *) + DIRSCR=`pwd`/$DIRSCR + ;; + esac + ;; + -ho* | -HO*) + host=$value + ;; + -co* | -CO*) + compatible=$value + ;; + -ci* | -CI*) + cpinput=$value + ;; + -cr* | -CR*) + cpresults=$value + ;; + *) + error="$error +$arg: invalid option" + break + ;; + esac + case $value in + -*) + error="$error +$arg: invalid name $value" + break + ;; + esac + shift + arg=$1 + if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + shift + arg=$1 + fi +done +argc=`expr $# % 2` +if test $argc -eq 1 +then +# +# odd number of arguments +# + error="$error +argument list incomplete" +fi + +if test $nprocdddm -gt 0 +then +nprocd=$nprocdddm +fi + +if test $nsolver -gt 0 +then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi +fi +# Set defaults +if test $nt -eq -1 +then +nt=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nt -lt 0 +then +nt=0 +fi +if test $nte -eq -1 +then +nte=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nte -lt 0 +then +nte=0 +fi +if test $nts -eq -1 +then +nts=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nts -lt 0 +then +nts=0 +fi +# +# set number of element loop threads +# +ntprint=$nt +nteprint=$nte +# copy from -nprocd[s] +if test $nprocdddm -gt 1 +then + nteprint=$nprocdddm +fi +# override with -nthread_elem option +if test $nte -ne 0 +then +nteprint=$nte +fi +# check for minimum 1 threads per processes for DDM +if test $nprocdddm -gt 1 +then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi +fi +nte=$nteprint +# +# set number of Solver threads +# +ntsprint=$nts +# copy from -nthread or -nprocd[s] +if test $ntprint -ne 0 +then + ntsprint=$ntprint +else + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +fi +# override with -nthread_solver option +if test $nts -ne 0 +then + ntsprint=$nts +fi +# check for minimum 1 threads per solver process. +if test $nsolver -lt $nprocdddm +then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi +else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi +fi +if test $ntsprint -eq 1 +then + set ntsprint=0 +fi +nts=$ntsprint + +# set stack size for multi-threading. +export KMP_MONITOR_STACKSIZE=7M +export OMP_STACKSIZE=7M + +# +# deprecate -nthread option at arugment of marc +nt=0 +# Reset nprocdddmm, nsolver and threads if not given. +if test $nprocdddm -eq 0 +then + nprocdarg= +fi +if test $nprocdddm -eq 0 +then + nprocdddmprint= +fi +if test $nprocdddm -eq 0 +then + nprocdddm= +fi + +if test $nsolver -eq 0 +then + nsolverprint= +fi +# end of threads setting. +gpuoption= +if test "$gpuids" = "" ; then + gpuoption= +else + gpuoption="-gp $gpuids" +fi + +if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH +else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH +fi +# Linux 64 + HPMPI, Below code is taken from include_linux64 +if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" +then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +fi + +if test $nprocd -gt 1; then + if test -f $jid$dotdefhost; then + if test "$host" = ""; then + host=$jid$dotdefhost + fi + fi + if test -f hostfile_qa_$nprocd; then + if test "$host" = ""; then + host=hostfile_qa_$nprocd + fi + fi +fi + +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then + dotdat=.inp + fi + + if test "$progdll"; then + /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll + rmdll=yes + pathdll=yes + progdll=${progdll}_$marcdll + else + progdll=$marcdll + fi + + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + pathdll=yes + fi +fi + +############################################################################## +# check parameter validity # +############################################################################## + +while test forever; do + +# +# check for input file existence +# +if test $nprocdddm -gt 1 -a $icreated -eq 0; then + if test ! -f $DIRJID/1$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/1$jid$dotdat not accessible" + fi + fi +else + if test ! -f $DIRJID/$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/$jid$dotdat not accessible" + fi + fi +fi + if test $nprocd -gt 1; then + if test "$host" ; then + if test ! -f $host; then + error="$error +host name file $host not accessible" + fi + fi + fi + +# +# check if the job is already running in the background +# +if test -f $DIRJOB/$jid.pid; then + error="$error +job is already running (the file $jid.pid exists)" +fi + +# +# if the program name is other than marc, then +# assume that this is a program in the users local directory +# + +bd=$MARC_BIN/ + +case $prog in + marc | MARC | $exefile) + program=$exefile + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + if test ! -f $user + then + error="$error +user subroutine file $user not accessible" + fi + fi + if test "$objs" + then + missingobjs= + for o in $objs + do + if test ! -f "$o" + then + if test -z "$missingobjs" + then + missingobjs="$o" + else + missingobjs="$missingobjs $o" + fi + fi + done + if test -n "$missingobjs" + then + error="$error +user object/library file(s) $missingobjs not accessible" + fi + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$vid" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRVID/1$vid.vfs + then + error="$error +view factor file $DIRVID/1$vid.vfs not accessible" + fi + else + if test ! -f $DIRVID/$vid.vfs + then + error="$error +view factor file $DIRVID/$vid.vfs not accessible" + fi + fi + fi + if $mpioption + then + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" + fi + fi + ;; + *) + program=$prog.marc + case $prog in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + error="$error +program option may not be used with user subroutine" + fi + if test "$objs" + then + error="$error +program option may not be used with user objects or libraries" + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$nauto" + then + if test $nauto -gt 2 + then + error="$error +incorrect option for auto restart " + fi + fi + if test "$ndcoup" + then + if test $ndcoup -gt 3 + then + error="$error +incorrect option for contact decoupling " + fi + fi + if test "$ndytran" + then + if test $ndytran -gt 1 + then + error="$error +incorrect option for Marc-Dytran Switch " + fi + fi + if $mpioption + then + if test ! -x $MARC_BIN/$exefile + then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE " + fi + fi + ;; +esac + +############################################################################## +# check argument integrity # +############################################################################## + +if test "$jid" +then + : +else + error="$error +job id required" +fi + +if test $nprocd -gt 1 +then + if test $nauto -gt 0 + then + error="$error +cannot run DDM job with auto restart (-au) option " + fi +fi +case $qid in + S* | s*) + qid=short + ;; + L* | l*) + qid=long + ;; + V* | v*) + qid=verylong + ;; + B* | b*) + qid=background + ;; + F* | f*) + qid=foreground + ;; + A* | a*) + qid=at + ;; + *) + error="$error +bad value for queue_id option" + ;; +esac + +case $prgsav in + N* | n*) + prgsav=no + ;; + Y* | y*) + prgsav=yes + ;; + *) + error="$error +bad value for save option" + ;; +esac + +case $verify in + N* | n*) + verify=no + ;; + Y* | y*) + verify=yes + ;; + *) + error="$error +bad value for verify option" + ;; +esac + +case $nprocdddm in + -* ) + error="$error +bad value for nprocd option" + ;; +esac + +case $nt in + -* ) + error="$error +bad value for nt option" + ;; +esac + +case $itree in + -* ) + error="$error +bad value for itree option" + ;; +esac +case $iam in + -* ) + error="$error +bad value for iam option" + ;; +esac +case $compatible in + N* | n*) + compatible=no + ;; + Y* | y*) + compatible=yes + ;; + unknown) + ;; + *) + error="$error +bad value for comp option" + ;; +esac +case $cpinput in + N* | n*) + cpinput=no + ;; + Y* | y*) + cpinput=yes + ;; + *) + error="$error +bad value for copy input option" + ;; +esac +case $cpresults in + N* | n*) + cpresults=no + ;; + Y* | y*) + cpresults=yes + ;; + *) + error="$error +bad value for copy results option" + ;; +esac + +# +# check for external file to run +# +if test -f $MARC_TOOLS/run_marc_check +then + . $MARC_TOOLS/run_marc_check +fi + +# +# pick up version data from bin/VERSION if it exists +# +if test -f $MARC_BIN/VERSION; then + ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` + if test -n "$ppp" ;then + PRODUCT=$ppp + fi + ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` + if test -n "$ppp" ;then + REVISION=", Build $ppp" + fi +fi +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +deletelog=yes +if test $qid = background -a $verify = no +then +echo \ +" +$PRODUCT $REVISION $MACHINE version +----------------------------- +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto " > $jid.log +deletelog=no +fi +echo \ +" +$PRODUCT $REVISION $MACHINE version +----------------------------- +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto" + + +case $qid in + s* | S* | l* | L* | v* | V* ) + echo \ +"Queue priority : $priority +Queue CPU limit : $cpu +Queue start time : $att" + ;; +# * ) +# echo \ +#" " +# ;; +esac + +if test "$error" +then + if test $verify = yes + then + $ECHO "$error + +Please correct or quit(correct,quit,): $ECHOTXT" + error= + read answer + case $answer in + q* | Q*) + answer=quit + ;; + *) + answer=correct + ;; + esac + else + $ECHO "$error + $ECHOTXT" + echo " " + if test "$deletelog" = no + then + $ECHO "$error + $ECHOTXT" >> $jid.log + echo " " >> $jid.log + fi + answer=quit + fi +else + if test $verify = yes + then + $ECHO " +Are these parameters correct (yes,no,quit,)? $ECHOTXT" + read answer + case $answer in + q* | Q*) + answer=quit + ;; + y* | Y*) + answer=yes + ;; + *) + answer=no + ;; + esac + else + answer=yes + fi +fi + +case $answer in + no | correct) + +############################################################################## +# prompt for each value # +############################################################################## + + $ECHO " +Program name ($prog)? $ECHOTXT" + read value + if test "$value" + then + prog=$value + fi + $ECHO "Job ID ($jid)? $ECHOTXT" + read value + if test "$value" + then + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + fi + $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi + $ECHO "User objects or libraries ($objs)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + objs= + ;; + *) + objs="$value" + ;; + esac + fi + $ECHO "Restart File Job ID ($rid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + rid= + ;; + *) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + esac + fi + $ECHO "Substructure File ID ($sid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + sid= + ;; + *) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + esac + fi + $ECHO "Post File Job ID ($pid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + pid= + ;; + *) + pid=$value + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + esac + fi + $ECHO "Defaults File ID ($did)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + did= + ;; + *) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + esac + fi + $ECHO "View Factor File ID ($vid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + vid= + ;; + *) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + esac + fi + $ECHO "Save generated module ($prgsav)? $ECHOTXT" + read value + if test "$value" + then + prgsav=$value + fi + $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" + read value + if test "$value" + then + nprocdddm=$value + nprocdddmprint=$value + fi + $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" + read value + if test "$value" + then + nte=$value + fi + $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" + read value + if test "$value" + then + nsolver=$value + fi + $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" + read value + if test "$value" + then + nts=$value + fi +# + if test $nprocdddm -gt 0 + then + nprocd=$nprocdddm + fi + if test $nsolver -gt 0 + then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi + fi +# Element loop threads. + if test $nte -eq -1 + then + nte=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nte -lt 0 + then + nte=0 + fi + nteprint=$nte +# Copy from ddm + if test $nprocdddm -gt 1 + then + nteprint=$nprocdddm + fi +# override with -nthread_elem option + if test $nte -ne 0 + then + nteprint=$nte + fi +# check for minimum 1 threads per processes for DDM + if test $nprocdddm -ne 0 + then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi + fi + nte=$nteprint +# Solver threads. + if test $nts -eq -1 + then + nts=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nts -lt 0 + then + nts=0 + fi + ntsprint=$nts +# Copy from ddm + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +# override with -nthread_solver option + if test $nts -ne 0 + then + ntsprint=$nts + fi +# check for minimum 1 threads per solver process. + if test $nsolver -lt $nprocdddm + then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi + else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi + fi + if test $ntsprint -eq 1 + then + set ntsprint=0 + fi + nts=$ntsprint + $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" + read value + if test "$value" + then + gpuids=$value + fi + if test "$gpuids" = "" ; then + gpuoption= + else + gpuoption="-gp $gpuids" + fi + if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH + fi + if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + fi +# + if test $nprocd -gt 1 + then + $ECHO "Message passing type ($itree)? $ECHOTXT" + read value + if test "$value" + then + itree=$value + fi + $ECHO "Host file name ($host)? $ECHOTXT" + read value + if test "$value" + then + host=$value + fi + if test $nprocdddm -gt 1 + then + $ECHO "Single input file? $ECHOTXT" + read value + case $value in + y* | Y*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" + read value + if test "$value" + then + compatible=$value + fi + $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" + read value + if test "$value" + then + cpinput=$value + fi + $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" + read value + if test "$value" + then + cpresults=$value + fi + fi + fi + $ECHO "Run the job in the queue ($qid)? $ECHOTXT" + read value + if test "$value" + then + qid=$value + fi + case $qid in + s* | S* | l* | L* | v* | V* ) + $ECHO "Queue priority ($priority)? $ECHOTXT" + read value + if test "$value" + then + priority=$value + fi + $ECHO "Job starts at ($att)? $ECHOTXT" + read value + if test "$value" + then + att=$value + fi + $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" + read value + if test "$value" + then + cpu=$value + fi + ;; + * ) + ;; + esac + $ECHO "Auto Restart option ($nauto)? $ECHOTXT" + read value + if test "$value" + then + nauto=$value + fi + $ECHO "Run directory ($DIRJOB)? $ECHOTXT" + read value + if test "$value" + then + DIRJOB=$value + DIRSCR=$DIRJOB + fi + $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" + read value + if test "$value" + then + DIRSCR=$value + fi + ;; + quit) + exit 1 + ;; + *) + break + ;; + +esac + + if test $nt -eq -1 + then + nt=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nt -lt 0 + then + nt=0 + fi + +done +# +if test $nt -eq 0 +then + ntarg= +fi +if test $nt -eq 0 +then + ntprint= +fi +if test $nt -eq 0 +then + nt= +fi + +if test $nte -eq 0 +then + ntearg= +fi +if test $nte -eq 0 +then + nteprint= +fi +if test $nte -eq 0 +then + nte= +fi + +if test $nts -eq 0 +then + ntsarg= +fi +if test $nts -eq 0 +then + ntsprint= +fi +if test $nts -eq 0 +then + nts= +fi +# +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + pathdll=yes + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + fi + + if test "$pathdll"; then +# +# reset share lib path +# + if test $MACHINENAME = "HP" + then + SHLIB_PATH=$DIRJOB:$SHLIB_PATH + export SHLIB_PATH + fi + if test $MACHINENAME = "IBM" + then + LIBPATH=$DIRJOB:$LIBPATH + export LIBPATH + fi +# + LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH + LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH + LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH + export LD_LIBRARY_PATH + export LD_LIBRARY64_PATH + export LD_LIBRARYN32_PATH + fi +fi +# end of dllrun>0 + + +if test $program = $exefile -o $program = $prog.marc +then + +# delete the old .log file unless we run in the background +if test "$deletelog" = yes +then + /bin/rm $jid.log 2>/dev/null +else + echo + echo running the job in the background, see $jid.log + echo +fi + +# +# check if this is an autoforge or rezoning or radiation job +# +if test $nprocd -eq 1 +then + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` + if test "$line" + then + autoforge=1 + fi +fi +# +# check that jobname for restarted run is not the same +# as restart file basename +# +if test "$rid" +then + if test "$jid" = "$rid" + then + echo " " + echo "ERROR: job name of current run is the same as job name" + echo " of the restarted job" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "ERROR: job name of current run is the same as job name" >> $jid.log + echo " of the restarted job" >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi +fi + +# +# user objects/libraries used +# + + if test "$objs" + then + program="$DIRJOB/$jid.marc" + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# user subroutine used +# +# add BLAS options for linking + BLAS="%BLAS%" + + if test "$user" + then + program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# Special case for IBM using POE but not an SP machine +# in this case we always need a host file, also for serial jobs. +# +if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP +then + MP_HOSTFILE=${jid}.host + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $nprocd -gt 1 + then + numdom=$nprocd + while test $numdom -gt 0 + do + hostname -s >> $MP_HOSTFILE + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + else + hostname -s > $MP_HOSTFILE + fi +fi +# +# check ssh for all hosts in host file +# +if test $nprocd -gt 1 +then +if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" + then +# get host list + if test "$host" + then + line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` +# count failing hosts + counter=0 + for i in $line + do + $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n + status=$? + if [[ $status != 0 ]] ; then + counter=$((counter+1)) + if [ "$counter" = "1" ]; then + echo " " + echo " error - connection test failed... " + echo " " + fi + echo " " + echo " connection test with ssh failed on host $i" + echo " check the following command: ssh $i uname -n " + echo " " + fi + done +# echo error message and quit + if test $counter -ne 0 + then + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. Note that this is the case " + echo " also for running on a single machine. " + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. ">> $jid.log + echo " The ssh command must be working correctly between ">> $jid.log + echo " the computers used in the analysis. Furthermore, ">> $jid.log + echo " it must be set up such that it does not prompt the ">> $jid.log + echo " user for a password. Note that this is the case ">> $jid.log + echo " also for running on a single machine. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + else + counter=1 +# test ssh `hostname` + if test $counter -ne 0 + then + line=`hostname` + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi +# test ssh `hostname` + if test $counter -ne 0 + then + line=`hostname -s` + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi +# test ssh localhost + if test $counter -ne 0 + then + line=localhost + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi + if test $counter -ne 0 + then + echo " error - connection test failed... " + echo " " + echo " ssh needs to work on the machine without asking for a password." + echo " check the following command: ssh localhost uname -n" + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. Note that this is the case " + echo " also for running on a single machine. " + echo " " + if test "$deletelog" = no + then + echo " error - connection test failed... " >> $jid.log + echo " " >> $jid.log + echo " ssh needs to work on the machine without asking for a password." >> $jid.log + echo " check the following command: ssh localhost uname -n" >> $jid.log + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. " >> $jid.log + echo " The ssh command must be working correctly between " >> $jid.log + echo " the computers used in the analysis. Furthermore, " >> $jid.log + echo " it must be set up such that it does not prompt the " >> $jid.log + echo " user for a password. Note that this is the case " >> $jid.log + echo " also for running on a single machine. " >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + echo $line $nprocd > $jid.hosts + host=$jid.hosts + fi + fi +fi +fi +# +# check correctness of host file; fix for user sub +# + if test $nprocd -gt 1 + then + +# construct the path name to the executable (execpath) + execpath=$MARC_BIN/$exefile + usersub=0 + if test $program = $prog.marc + then + execpath=$prog.marc + usersub=1 + fi + if test "$objs" + then + execpath="$DIRJOB/$jid.marc" + usersub=1 + fi + if test "$user" + then + execpath=$usernoext.marc + usersub=1 + fi + export execpath + execname=`$BASENAME $execpath` + + if test "$host" + then + userhost=$host + case $userhost in + \/* | \.\/*) + ;; + *) + userhost=`pwd`/$userhost + ;; + esac + +# check that the number of processes specified in the hostfile is +# equal to nprocd specified by -nprocd. + numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` + if test $nprocd -ne $numproc + then + echo " " + echo "error, the number of processes specified in the host file" + echo "must be equal to the number of processes given by -nprocd/-nsolver" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, the number of processes specified in the host file" >> $jid.log + echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + +# check for Myrinet that the number of processes per host is +# less than number of available user ports, 5 +# .gmpi directory must exist in user's home directory +# and must have write permission from remote hosts + if test $MPITYPE = "myrinet" + then + numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` + if test $numproc -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes specified " + echo "in the hostfile must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes specified " >> $jid.log + echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + if test ! -d ~/.gmpi + then + echo " " + echo "error, for Myrinet a .gmpi directory must exist " + echo "under the user's home directory" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log + echo "under the user's home directory" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + homedir=`echo ~` + for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + echo " " + echo "error, for Myrinet a shared .gmpi directory must exist " + echo "under the user's home directory " + echo "with remote write permission" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log + echo "under the user's home directory " >> $jid.log + echo "with remote write permission" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + /bin/rm tmp.$$ + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + fi + fi + done + fi + fi + +# construct the host file $jid.host which is used by mpirun +# skip lines starting with # and only consider lines with more than +# one word in them. Note that the hostfile given to this script +# has two columns: the host name and the number of shared processes +# to run on this host. mpirun wants the number of _other_ +# processes to run in addition to the one being run on the machine +# on which the job is started. hence the $2-1 for fnr == 1. + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then +# HPMPI or HP hardware MPI + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ + -v mpihpspecial="$MPIHPSPECIAL" \ +'{if ( NF > 0) {\ + fnr++ ; \ + printf("-h %s -np %s",$1,$2); \ + printf(" %s",mpihpspecial); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ + if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ + }\ + }' > $jid.host +# end HPMPI or HP hardware MPI + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then +# IBM using hardware MPI (POE) + MP_HOSTFILE=$jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host +# end IBM using hardware MPI (POE) +# for Intel MPI, need to create a machinefile for DMP + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then +# Intel MPI + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + /bin/cp $host $jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Intel MPI for DMP +# for Solaris HPC 7.1, need to create a machinefile for DMP + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then +# Solaris HPC 7.1 + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Solaris HPC 7.1 for DMP +# for Myrinet, construct a configuration file in ~/.gmpi +# this must be readable by each process +# format is (hostname) (port number) for each process + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + grep -v '^#' $host | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ +{if ( NF > 0 ) \ + for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ +}' >> ~/.gmpi/$jid.host + else +# this is for mpich-1.2.5 and later, using the -pg option +# format: host nproc executable user arguments +# the arguments are added later + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s %s\n",path,user);\ + if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ + }\ + }' > $jid.host + fi +# end Myrinet + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then +# Compaq MPI via Memory Channel + grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host +# end Compaq MPI + else +# MPICH + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ + }\ + }' > $jid.host + fi +# define the variable host and host_filt +# host_filt is used for loops over hosts +# for Myrinet we need to use a filtered variant of userhost +# for others we can use $host + if test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + host=~/.gmpi/$jid.host + host_filt=$jid.host_tMp + grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt + else + host=$jid.host + host_filt=$host + fi + else + host=$jid.host + host_filt=$host + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + host_filt=$jid.mfile + fi + fi +# figure out if the machines in the hostfile are nfs mounted +# or distributed and set the variable "dirstatus" accordingly. +# only perform the check if user subroutine is used +# or a user subroutine executable is used + + numfield=1 + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + numfield=2 + fi + DIR1=$DIRJOB + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + counter=0 + echo " " + echo "checking if local or shared directories for host" + if test "$deletelog" = no + then + echo "checking if local or shared directories for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + dirstatus[$counter]="shared" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + dirstatus[$counter]="local" + /bin/rm tmp.$$ + else + if test ! -f $jid.$$ + then + dirstatus[$counter]="local" + $RSH $i /bin/rm $DIR1/$jid.$$ + else + /bin/rm $jid.$$ + fi + fi + if test -f tmp.$$ + then + /bin/rm tmp.$$ + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + echo " ${dirstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${dirstatus[$counter]}" >> $jid.log + fi + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + fi + +# figure out if this is a compatible set of machines +# unless explicitly specified with flag -comp +# only perform the check if user subroutine is used +# or a user subroutine executable is used +# Myrinet does not support heterogeneous + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + if test $compatible = "unknown" + then + thisname=$ARCH + compatible=yes + counter=0 + echo "checking if machines are compatible for host" + if test "$deletelog" = no + then + echo "checking if machines are compatible for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]="yes" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + othername=`$RSH $i uname -a | cut -f 1 -d " "` + if test $thisname != $othername + then + compatible=no + compstatus[$counter]="no" + fi + fi + echo " ${compstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${compstatus[$counter]}" >> $jid.log + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + else + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]=$compatible + fi + done + if test $compatible = "no" + then + echo "all machines assumed incompatible" + if test "$deletelog" = no + then + echo "all machines assumed incompatible" >> $jid.log + fi + else + echo "all machines compatible" + if test "$deletelog" = no + then + echo "all machines compatible" >> $jid.log + fi + fi + fi +# error out if user objects or libraries are used on incompatible machines + if test "$compatible" = "no" -a -n "$objs" + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" + if test "$deletelog" = no + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log + fi + exit 1 + fi +# modify new host file if NFS mounted heterogeneous machine + doit= + if test $program = $prog.marc + then + doit=yes + fi + if test "$user" + then + doit=yes + fi + if test "$doit" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + $AWK -v hst=$i '{fnr++ ; \ +if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ +printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} + /bin/mv $jid.host{$$} $jid.host + host=$jid.host + fi + fi + done + fi + fi # if test $program = $prog.marc -o $user -o $obj + + else # if test $host + # assume shared memory machine if no hostfile given and + # MPITYPE is set to mpich or Myrinet + # check for Myrinet that the total number of processes is + # less than number of available user ports, 5 + if test $MPITYPE = "mpich" -o $MPITYPE = "scali" + then + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + host=$jid.host + elif test $MPITYPE = "myrinet" + then + if test $nprocd -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes " + echo "must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes " >> $jid.log + echo "must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + echo `hostname` $nprocd | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ + {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ +' >> ~/.gmpi/$jid.host + host=~/.gmpi/$jid.host + else + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + + fi + fi # if test myrinet + + fi # if test $host + + fi # if test $nprocd -gt 1 + +fi # if test $program = $exefile -o $program = $prog.marc + +############################################################################## +# construct run stream (Marc only) # +############################################################################## + +# set maximum message length for ddm to a large number +# for vendor provided mpi +if test $itree -eq 0 -a $MPITYPE = hardware +then + itree=100000000 + if test $MACHINENAME = SGI + then + itree=100000001 + fi +fi +if test $itree -eq 0 -a $MPITYPE = hpmpi +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = myrinet +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = nec +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = scali +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = intelmpi +then + itree=100000000 +fi +if test $nprocdddm -lt 2 +then + nprocdarg= +else + nprocdarg="$nprocdarg $nprocdddm" +fi +if test $nsolver -eq 0 +then + nsolverarg= +else + nsolverarg="$nsolverarg $nsolver" +fi +if test $nprocdddm -lt 2 -a $nsolver -eq 0 +then +nprocd=0 +fi +if test $nprocd -gt 0 +then + if test "$host" + then + if test -z "$RUN_JOB2" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then + RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" + RUN_JOB=" -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + numhost=`uniq $jid.mfile | wc -l` + if test "$INTELMPI_VERSION" = "HYDRA" + then + RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n $numhost -r $RSH -f $jid.mfile + RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" + fi + +# intelmpi uses configfile. format: +# -host host1 -n n1 executable marcargs +# one such line per host +# collect the marcargs in RUN_JOB and construct the config file later +# collect the run stream in RUN_JOB_TMP + RUN_JOB="-jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + + + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then + RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test "$userhost" + then + RUN_JOB="$RUN_JOB -mhost $userhost" + fi + if test $MPITYPE = "scali" + then +# set default working directory to /tmp to allow +# different directory names + SCAMPI_WORKING_DIRECTORY=/tmp + export SCAMPI_WORKING_DIRECTORY + fi + else + if test -z "$RUN_JOB1" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + RUNNPROCD=$nprocd + if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" + then + RUNNPROCD= + MP_PROCS=$nprocd + export MP_PROCS + fi + if test $MPITYPE = "myrinet" + then + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + echo " " > /dev/null + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n 1 -f $jid.hosts + fi + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + fi +else + if test $nauto -gt 0 -o $ndcoup -gt 0 + then + RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else +# this is for a serial job without auto restart: + RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi +fi +if test "$rid" +then + RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" +fi +if test "$pid" +then + RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" +fi +if test "$sid" +then + RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" +fi +if test "$did" +then + RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" +fi +if test "$vid" +then + RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" +fi +if test $nauto -gt 0 +then + RUN_JOB="$RUN_JOB -autorst $nauto " +fi +if test $ndcoup -gt 0 +then + RUN_JOB="$RUN_JOB -dcoup $ndcoup " +fi +if test $ndytran -gt 0 +then + RUN_JOB="$RUN_JOB -dytran $ndytran " +fi +if test $mesh -gt 0 +then + RUN_JOB="$RUN_JOB -me $mesh " +fi +if test $noutcore -gt 0 +then + RUN_JOB="$RUN_JOB -outcore $noutcore " +fi +if test "$dllrun" -gt 0 +then + RUN_JOB="$RUN_JOB -dll $dllrun " +fi +if test "$trkrun" -gt 0 +then + RUN_JOB="$RUN_JOB -trk $trkrun " +fi +if test "$iam" +then + RUN_JOB="$RUN_JOB -iam $iam " +fi +if test "$justlist" +then + RUN_JOB="$RUN_JOB -list 1 " +fi +if test "$feature" +then + RUN_JOB="$RUN_JOB -feature $feature " +fi +if test "$memlimit" -ne 0 +then + RUN_JOB="$RUN_JOB -ml $memlimit " +fi +if test "$cpinput" +then + RUN_JOB="$RUN_JOB -ci $cpinput " +fi +if test "$cpresults" +then + RUN_JOB="$RUN_JOB -cr $cpresults " +fi +if test "$DIRSCR" != "$DIRJOB" +then + RUN_JOB="$RUN_JOB -dirscr $DIRSCR" +else + DIRSCR=$DIRJOB +fi +if test "$makebdf" +then + RUN_JOB="$RUN_JOB -bdf $makebdf " +fi +if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" +then + # append $RUN_JOB to all lines of the host file + # and set RUN_JOB + $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ + /bin/mv $host.$$ $host + RUN_JOB=$RUN_JOB_TMP +fi +if test $MPITYPE = "intelmpi" -a "$host" +then + # construct config file, append $RUN_JOB to all lines of the config file + # and set RUN_JOB + if test "$INTELMPI_VERSION" = "HYDRA" + then + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + else + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-host %s -n %s",$1,$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + fi + RUN_JOB=$RUN_JOB_TMP +fi +echo " " +echo "Final run stream value" +echo " RUNJOB="$RUN_JOB +if test "$deletelog" = no +then +echo " " >> $jid.log +echo "Final run stream value" >> $jid.log +echo " RUNJOB="$RUN_JOB >> $jid.log +fi + + +############################################################################## +# run marc using valgrind # +############################################################################## +#RUN_JOB="valgrind $RUN_JOB" +#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" +############################################################################## + + +############################################################################## +# run the requested program in a queue # +############################################################################## + +if test "$deletelog" = yes +then + echo + date +else + echo >> $jid.log + date >> $jid.log +fi +if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] +then + +/bin/rm -f $jid.runmarcscript + + +# +# compile user subroutine if present +# +if test "$link" +then + if test "$user" + then + userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then + if test $MACHINENAME = "CRAY" + then + $DFORTHIGH $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTHIGH $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } +END4 +else + prgsav=yes +fi +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# + +cat >> $jid.runmarcscript << END5 + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# first remove all .out files and incremental restart files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null + /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null +fi + +if test $nprocdddm -gt 1 +then + $RUN_JOB 2>>$jid.log +else + $RUN_JOB 2>>$jid.log +fi + +if test $dllrun -eq 0; then + if test $prgsav = no + then + /bin/rm -f $bd$program 2>/dev/null + fi +else + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes + then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +END5 + + +# Submit to marc batch queue +# +if [ $qid = at ] +then +QUENAME=at +SUBMCMD= +else +# +# Submit to qsub queue +# +QUENAME=qsub +SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" +if test "$priority" +then + SUBMCMD=$SUBMCMD" -p $priority" +fi +if test "$att" +then + SUBMCMD=$SUBMCMD" -a $att" +fi +if test "$cpu" +then + SUBMCMD=$SUBMCMD" -lt $cpu" +fi + +fi +echo $QUENAME $SUBMCMD +#cat $jid.runmarcscript +$QUENAME $SUBMCMD < $jid.runmarcscript + +/bin/rm -f $jid.runmarcscript + +############################################################################## +# run the requested program in the background # +############################################################################## + +else +if test $qid = background +then + +# +# first remove all old .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi +# +# compile user subroutine if present +# +( +if test "$link" +then + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_h $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTHIGH $user || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTHIGH $user -o $userobj || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc + +# + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +$RUN_JOB & + +marcpid=$! +echo $marcpid > $DIRJOB/$jid.pid +wait $marcpid + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + fi + fi + fi +fi + + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +) 1>>$jid.log 2>&1 & + + +############################################################################## +# run the requested program in the foreground # +############################################################################## + +else + +# +# compile user subroutine if present +# +if test "$link" +then + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_h $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTHIGH $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTHIGH $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi +# first remove all .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi + +$RUN_JOB + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + else + echo " " > /dev/null + fi + else + if test "$host" + then + mpdcleanup -a -f $jid.mfile + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.mfile 2> /dev/null + else + mpdcleanup -a -f $jid.hosts + /bin/rm $jid.hosts 2> /dev/null + fi + fi + fi +fi + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi + + +fi +fi diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_hmp b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_hmp new file mode 100644 index 000000000..a78a2833e --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_hmp @@ -0,0 +1,4053 @@ +#!/bin/ksh +############################################################################## +# # +# run_marc - run a marc job # +# ------------------------- # +# # +# usage: run_marc -j jid { options } # +# # +# where standard options are: required: defaults: # +# -------------------------- # +# # +# -j* jid job id number. ** YES ** . # +# -pr* prog program name. . marc # +# -v* y|n do or do not verify inputs. . yes # +# -q* s|l|v|b|f batch queue name or background, . short # +# foreground. # +# -b* as alternative to option -q* # +# # +# ( batch queues only : # +# -pq* intra queue priority. . . # +# -at DATE/TIME delay start of job. . . # +# format : January,1,1990,12:31 # +# or : today,5pm # +# -cpu* secs job CPU limit . . ) # +# # +# -r* rid restart file job id. . . # +# -si* sid substructure file id. . . # +# -pi* post post file job id. . . # +# -de* did defaults file . no # +# -vf vid viewfactor . no # +# # +# -u* user user subroutine. . . # +# -obj obj user objects or libraries. . . # +# -sa* y|n do or do not save load module. . no # +# -autorst auto restart flag for auto forge . no # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo selects i4 or i8 version # +# default: i4 or via defaults file run_marc_defaults # +# the -mo option will override # +# -mpi selects MPI version # +# each platform has a default MPI version and some # +# have an alternative version. see the include file # +# for the respective platform # +# MPI_DEFAULT defines the default MPI version # +# MPI_OTHER defines versions one can switch to # +# -dcoup for contact decoupling # +# currently not supported # +# -dir directory where the job i/o should take place. # +# defaults to current directory. # +# -sdir directory where scratch files are created # +# defaults to current directory. # +# # +# -alloc only perform memory allocation test, no analysis # +# -list y only list options in the input file, no analysis # +# -fe num set feature number "num" for the run. only one allowed # +# -dytran flag to switch from Dytran to Marc # +# dytran = 0, program will run w/o Marc-Dytran Switch # +# = 1, program will restart Marc after Dytran run # +# >= 2, Not supported yet. # +# currently not supported # +# -ou force analysis to use out-of-core control # +# =0, not used # +# =1, element storage out-of-core # +# -dll run marc using shared library libmarc.so and exe_marc # +# =1, used # +# =2, do not free streaming input memory # +# =3, run with marc input deck # +# -trk run marc for post-tracking # +# -gpuid run marc using GPGPU capability # +# specify gpuid on to be used in the analysis. Multiple # +# IDs may be assigned for DDM runs. # +# Separate a list of IDs with a colon. Each DMP # +# process will be assigned a GPU ID in round robin fastion# +# = 0 # +# = 0:1 etc... # +# # +# where parallel options are: # +# -------------------------- # +# # +# itree, host, and comp options are available for the domain # +# decomposition only. # +# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # +# # +# # +# -nprocd number of domains. # +# defaults to single domain solution. # +# -nprocds number of domains if single input file. # +# defaults to single domain solution. # +# -nps same as -nprocds. # +# -nsolver number of solver tasks for solver types 12 and 13 # +# these are distributed tasks operating via MPI # +# -nthread_elem number of threads for element assembly and recovery # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by element assembly # +# recovery. # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_elem option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_elem specified. # +# -nthread_solver number of threads for solver types 6, 8, and 11 # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by 6, 8, and 11 # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_solver option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_solver specified. # +# -nthread Same as -nthread_solver. # +# -itree message passing tree type for domain decomposition. # +# for debugging purposes; should not normally be used. # +# -host hostfile name for distributed execution on network. # +# defaults to no hostfile, unless jobid.defhost exists. # +# if jobid.defhost exists, only -np(s) necessary # +# -comp* y|n to be used with user routines on a network of # +# incompatible machines. # +# if set to no, a separate executable will be created # +# for each machine on the network. # +# if set to yes, the executable located on the machine # +# from which marc is started will be used on all machines.# +# defaults to no if O/S versions different on machines. # +# # +# -ci y|n copy input files to remote hosts (default: yes) # +# if "yes", input files are automatically copied to # +# remote hosts for a network run if necessary. # +# -cr y|n copy post files from remote hosts (default: yes) # +# if "yes", post files are automatically copied back from # +# remote hosts for a network run if necessary. # +############################################################################## +# set DIR to the directory in which this script is +REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" +DIR=`dirname $REALCOM` +# make sure DIR has an absolute path +case $DIR in + \/*) + ;; + *) + DIR=`pwd`/$DIR + ;; +esac +DIRSCRIPT=$DIR +AWK=awk +ARCH=`uname -a | cut -f 1 -d " "` +# Sun has a bad awk, use nawk instead +if test $ARCH = "SunOS" +then + AWK=nawk +fi +BASENAME=basename +# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists +if test $ARCH = "SunOS" +then + if test -x /usr/ucb/basename + then + BASENAME=/usr/ucb/basename + fi +fi + +# echo command line in the case of ECHO_COMMAND is true +if test "$ECHO_COMMAND" = true ; then + echo command "$0" "$@" +fi + +# +# "mode" selects version, i4 or i8 +# default is i4 +# this can be changed by a file run_marc_defaults +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MODE i8 +# it can also be set by the environmental variable MARC_INTEGER_SIZE +# and by the command line option "-mo" +# +mode= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + mode=i4 + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -f $HOME/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + mode=i4 + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -n "$MARC_INTEGER_SIZE" ; then + mode=$MARC_INTEGER_SIZE +fi +if test -z "$mode" ; then + mode=i8 +fi +case $mode in + i4) + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "error, version mode must be i4 or i8" + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i4 or i8" + echo " " + echo " use -mo i4 or -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + setmode=true + fi + if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + fi + if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +done + +# set to i4 version for 32 bit Linux +if test "`uname -s`" = "Linux"; then + if test "`uname -m`" = "i686"; then + mode=i4 + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +fi + + +. "$DIR/getarch" + +. $MARC_INCLUDE +# + +# +# Dynamically determine the echo syntax +# + +case "`echo '\c'`" in + '\c') + ECHO='echo -n' + ECHOTXT=' ' + ;; + *) + ECHO='echo' + ECHOTXT=' \c' + ;; +esac + +# +# Variables for the MARC environment +# + +PRODUCT="Marc" +EXITMSG=$MARC_TOOLS/MESSAGES +export EXITMSG +FLEXDIR=$DIR/../flexlm/licenses +export FLEXDIR +TIMCHK=3600 +export TIMCHK +BINDIR=$MARC_BIN +export BINDIR +AFMATDAT=$MARC_RUNTIME/AF_flowmat/ +export AFMATDAT +# +# define directory path to global unified material database +# +MATFILE= +export MATFILE + +# +# define memory limit +# first set to MEMLIMIT from include +# -ml option overrules if specified +memlimit=$MEMLIMIT +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +# +if test $MACHINENAME = "HP" +then + SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH + export SHLIB_PATH +fi +# the one for IBM is defined futher down + +LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH +LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH +export LD_LIBRARY_PATH +export LD_LIBRARY64_PATH +export LD_LIBRARYN32_PATH + +atexit() { +kill -15 $$ +# +if test $MPITYPE = "myrinet" +then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi +fi +} + +trap "atexit" 2 + +# +# defaults +# + +prog=marc +exefile=marc +jid= +rid= +pid= +sid= +did= +vid= +user= +usernoext= +objs= +qid=background +cpu= +priority= +att= +trk= +verify=yes +prgsav=no +rmdll=no +cpdll=no +progdll= +pathdll= +error= +nprocd=0 +nprocdddm=1 +nprocdddmprint= +icreated=0 +nprocdarg= +nsolver=0 +nsolverarg=-ns +if test $nprocds +then + if test $nprocds -gt 1 + then + nprocdddm=$nprocds + nprocdddmprint=$nprocds + icreated=1 + nprocdarg=-nprocds + fi +fi +ntprint=0 +nt=-1 +nte=-1 +nts=-1 +ntarg=-nt +ntearg=-nte +ntsarg=-nts +nteprint= +ntsprint= +gpuids= +nauto=0 +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +link= +trkrun=0 +DIRJOB=`pwd` +DIRSCR=$DIRJOB +DIRSCRSET= +autoforge=0 +dotdat=.dat +dotdefhost=.defhost +host= +numhost= +mfile= +userhost= +makebdf= +cpinput=yes +cpresults=yes +marcdll=libmarc.$EXT_DLL +# define hostname and strip off extensions (alpha.aaa.com) +thishost=`hostname` +thishost=${thishost%%.*} +compatible=unknown +numfield=1 +justlist= +feature= +mpioption=false +MDSRCLIB=$MARC_LIB/mdsrc.a +# +# check run_marc_defaults file for default MPI setting +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MPI +# +value= +file= +if test -f $DIRSCRIPT/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$DIRSCRIPT/run_marc_defaults + fi +fi +if test -f $HOME/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$HOME/run_marc_defaults + fi +fi +if test -n "$value"; then + MARC_MPITYPE=$value + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + echo " " + echo " error, incorrect option for MARC_MPI" + echo " defined in $file: $MARC_MPITYPE" + echo " valid options: $MPI_DEFAULT $MPI_OTHER" + echo " " + exit + fi + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + fi +fi +# +# +# allow scratch directory to be specified with environmental variable +# MARCSCRATCH +if test $MARCSCRATCH +then + if test -d $MARCSCRATCH + then + DIRSCR=$MARCSCRATCH + else + echo "error, scratch directory '$MARCSCRATCH'" + echo " specified via environmental variable MARCSCRATCH does not exist" + exit + fi +fi +# +############################################################################## +# parse input - arguments always come in pairs # +############################################################################## + +arg=$1 +if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + shift + arg=$1 +fi +while [ -n "$arg" ] +do + shift + value=$1 + case $arg in + -al* | -AL*) + LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + $MARC_BIN/marc -alloc 1 + exit + ;; + -li* | -LI*) + justlist=yes + ;; + -fe* | -FE*) + feature=$value + ;; + -pr* | -PR*) + if test `dirname $value` = '.' + then + prog=`$BASENAME $value .marc` + progdll=`$BASENAME $value` + else + prog=`dirname $value`/`$BASENAME $value .marc` + progdll=`dirname $value`/`$BASENAME $value` + fi + prdir=`dirname $value` + case $prdir in + \/*) + ;; + *) + prog=`pwd`/$prdir/$prog + ;; + esac + ;; + -j* | -J*) + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + ;; + -r* | -R*) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + -si* | -SI*) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + -pi* | -PI*) + if test -f $value.t19 + then + pid=`$BASENAME $value .t19` + else + pid=`$BASENAME $value .t16` + fi + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + -bdf | -BDF) + makebdf=1 + ;; + -de* | -DE*) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + -vf | -VF) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + -u* | -U*) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -at | -AT) + att=$value + ;; + -cpu* | -CPU*) + cpu=$value + ;; + -pq | -PQ*) + priority=$value + ;; + -v* | -V*) + verify=$value + ;; + -sa* | -SA*) + prgsav=$value + ;; + -np* | -NP*) + nprocdddm=$value + nprocdddmprint=$value + case $arg in + -nps* | -NPS* | -nprocds* | -NPROCDS*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + case $arg in + -np | -NP | -nprocd | -NPROCD) + icreated=0 + nprocdarg=-nprocd + ;; + esac + ;; + -ns* | -NS*) + nsolver=$value + ;; + -nt* | -NT*) + case $arg in + -nte | -NTE | -nthread_e* | -NTHREAD_E*) + nte=$value + ;; + esac + case $arg in + -nts | -NTS | -nthread_s* | -NTHREAD_S*) + nts=$value + ;; + esac + case $arg in + -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) + nt=$value + ;; + esac + ;; + -gp* | -GP*) + gpuids=$value + ;; + -it* | -IT*) + itree=$value + ;; + -iam | -IAM) + iam=$value + ;; + -au* | -AU*) + nauto=$value + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -me | -ME ) + mesh=$value + ;; + -ml | -ML ) + memlimit=$value + ;; + -mo | -MO ) + ;; + -mpi | -MPI ) + mpioption=true + MARC_MPITYPE=$value + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + fi + fi + ;; + -dir* | -DIR*) + DIRJOB=$value + case $DIRJOB in + \/*) + ;; + *) + DIRJOB=`pwd`/$DIRJOB + ;; + esac + if test -z "$DIRSCRSET" + then + DIRSCR=$DIRJOB + fi + ;; + -sd* | -SD*) + DIRSCR=$value + DIRSCRSET=yes + case $DIRSCR in + \/*) + ;; + *) + DIRSCR=`pwd`/$DIRSCR + ;; + esac + ;; + -ho* | -HO*) + host=$value + ;; + -co* | -CO*) + compatible=$value + ;; + -ci* | -CI*) + cpinput=$value + ;; + -cr* | -CR*) + cpresults=$value + ;; + *) + error="$error +$arg: invalid option" + break + ;; + esac + case $value in + -*) + error="$error +$arg: invalid name $value" + break + ;; + esac + shift + arg=$1 + if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + shift + arg=$1 + fi +done +argc=`expr $# % 2` +if test $argc -eq 1 +then +# +# odd number of arguments +# + error="$error +argument list incomplete" +fi + +if test $nprocdddm -gt 0 +then +nprocd=$nprocdddm +fi + +if test $nsolver -gt 0 +then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi +fi +# Set defaults +if test $nt -eq -1 +then +nt=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nt -lt 0 +then +nt=0 +fi +if test $nte -eq -1 +then +nte=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nte -lt 0 +then +nte=0 +fi +if test $nts -eq -1 +then +nts=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nts -lt 0 +then +nts=0 +fi +# +# set number of element loop threads +# +ntprint=$nt +nteprint=$nte +# copy from -nprocd[s] +if test $nprocdddm -gt 1 +then + nteprint=$nprocdddm +fi +# override with -nthread_elem option +if test $nte -ne 0 +then +nteprint=$nte +fi +# check for minimum 1 threads per processes for DDM +if test $nprocdddm -gt 1 +then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi +fi +nte=$nteprint +# +# set number of Solver threads +# +ntsprint=$nts +# copy from -nthread or -nprocd[s] +if test $ntprint -ne 0 +then + ntsprint=$ntprint +else + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +fi +# override with -nthread_solver option +if test $nts -ne 0 +then + ntsprint=$nts +fi +# check for minimum 1 threads per solver process. +if test $nsolver -lt $nprocdddm +then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi +else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi +fi +if test $ntsprint -eq 1 +then + set ntsprint=0 +fi +nts=$ntsprint + +# set stack size for multi-threading. +export KMP_MONITOR_STACKSIZE=7M +export OMP_STACKSIZE=7M + +# +# deprecate -nthread option at arugment of marc +nt=0 +# Reset nprocdddmm, nsolver and threads if not given. +if test $nprocdddm -eq 0 +then + nprocdarg= +fi +if test $nprocdddm -eq 0 +then + nprocdddmprint= +fi +if test $nprocdddm -eq 0 +then + nprocdddm= +fi + +if test $nsolver -eq 0 +then + nsolverprint= +fi +# end of threads setting. +gpuoption= +if test "$gpuids" = "" ; then + gpuoption= +else + gpuoption="-gp $gpuids" +fi + +if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH +else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH +fi +# Linux 64 + HPMPI, Below code is taken from include_linux64 +if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" +then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +fi + +if test $nprocd -gt 1; then + if test -f $jid$dotdefhost; then + if test "$host" = ""; then + host=$jid$dotdefhost + fi + fi + if test -f hostfile_qa_$nprocd; then + if test "$host" = ""; then + host=hostfile_qa_$nprocd + fi + fi +fi + +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then + dotdat=.inp + fi + + if test "$progdll"; then + /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll + rmdll=yes + pathdll=yes + progdll=${progdll}_$marcdll + else + progdll=$marcdll + fi + + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + pathdll=yes + fi +fi + +############################################################################## +# check parameter validity # +############################################################################## + +while test forever; do + +# +# check for input file existence +# +if test $nprocdddm -gt 1 -a $icreated -eq 0; then + if test ! -f $DIRJID/1$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/1$jid$dotdat not accessible" + fi + fi +else + if test ! -f $DIRJID/$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/$jid$dotdat not accessible" + fi + fi +fi + if test $nprocd -gt 1; then + if test "$host" ; then + if test ! -f $host; then + error="$error +host name file $host not accessible" + fi + fi + fi + +# +# check if the job is already running in the background +# +if test -f $DIRJOB/$jid.pid; then + error="$error +job is already running (the file $jid.pid exists)" +fi + +# +# if the program name is other than marc, then +# assume that this is a program in the users local directory +# + +bd=$MARC_BIN/ + +case $prog in + marc | MARC | $exefile) + program=$exefile + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + if test ! -f $user + then + error="$error +user subroutine file $user not accessible" + fi + fi + if test "$objs" + then + missingobjs= + for o in $objs + do + if test ! -f "$o" + then + if test -z "$missingobjs" + then + missingobjs="$o" + else + missingobjs="$missingobjs $o" + fi + fi + done + if test -n "$missingobjs" + then + error="$error +user object/library file(s) $missingobjs not accessible" + fi + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$vid" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRVID/1$vid.vfs + then + error="$error +view factor file $DIRVID/1$vid.vfs not accessible" + fi + else + if test ! -f $DIRVID/$vid.vfs + then + error="$error +view factor file $DIRVID/$vid.vfs not accessible" + fi + fi + fi + if $mpioption + then + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" + fi + fi + ;; + *) + program=$prog.marc + case $prog in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + error="$error +program option may not be used with user subroutine" + fi + if test "$objs" + then + error="$error +program option may not be used with user objects or libraries" + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$nauto" + then + if test $nauto -gt 2 + then + error="$error +incorrect option for auto restart " + fi + fi + if test "$ndcoup" + then + if test $ndcoup -gt 3 + then + error="$error +incorrect option for contact decoupling " + fi + fi + if test "$ndytran" + then + if test $ndytran -gt 1 + then + error="$error +incorrect option for Marc-Dytran Switch " + fi + fi + if $mpioption + then + if test ! -x $MARC_BIN/$exefile + then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE " + fi + fi + ;; +esac + +############################################################################## +# check argument integrity # +############################################################################## + +if test "$jid" +then + : +else + error="$error +job id required" +fi + +if test $nprocd -gt 1 +then + if test $nauto -gt 0 + then + error="$error +cannot run DDM job with auto restart (-au) option " + fi +fi +case $qid in + S* | s*) + qid=short + ;; + L* | l*) + qid=long + ;; + V* | v*) + qid=verylong + ;; + B* | b*) + qid=background + ;; + F* | f*) + qid=foreground + ;; + A* | a*) + qid=at + ;; + *) + error="$error +bad value for queue_id option" + ;; +esac + +case $prgsav in + N* | n*) + prgsav=no + ;; + Y* | y*) + prgsav=yes + ;; + *) + error="$error +bad value for save option" + ;; +esac + +case $verify in + N* | n*) + verify=no + ;; + Y* | y*) + verify=yes + ;; + *) + error="$error +bad value for verify option" + ;; +esac + +case $nprocdddm in + -* ) + error="$error +bad value for nprocd option" + ;; +esac + +case $nt in + -* ) + error="$error +bad value for nt option" + ;; +esac + +case $itree in + -* ) + error="$error +bad value for itree option" + ;; +esac +case $iam in + -* ) + error="$error +bad value for iam option" + ;; +esac +case $compatible in + N* | n*) + compatible=no + ;; + Y* | y*) + compatible=yes + ;; + unknown) + ;; + *) + error="$error +bad value for comp option" + ;; +esac +case $cpinput in + N* | n*) + cpinput=no + ;; + Y* | y*) + cpinput=yes + ;; + *) + error="$error +bad value for copy input option" + ;; +esac +case $cpresults in + N* | n*) + cpresults=no + ;; + Y* | y*) + cpresults=yes + ;; + *) + error="$error +bad value for copy results option" + ;; +esac + +# +# check for external file to run +# +if test -f $MARC_TOOLS/run_marc_check +then + . $MARC_TOOLS/run_marc_check +fi + +# +# pick up version data from bin/VERSION if it exists +# +if test -f $MARC_BIN/VERSION; then + ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` + if test -n "$ppp" ;then + PRODUCT=$ppp + fi + ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` + if test -n "$ppp" ;then + REVISION=", Build $ppp" + fi +fi +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +deletelog=yes +if test $qid = background -a $verify = no +then +echo \ +" +$PRODUCT $REVISION $MACHINE version +----------------------------- +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto " > $jid.log +deletelog=no +fi +echo \ +" +$PRODUCT $REVISION $MACHINE version +----------------------------- +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto" + + +case $qid in + s* | S* | l* | L* | v* | V* ) + echo \ +"Queue priority : $priority +Queue CPU limit : $cpu +Queue start time : $att" + ;; +# * ) +# echo \ +#" " +# ;; +esac + +if test "$error" +then + if test $verify = yes + then + $ECHO "$error + +Please correct or quit(correct,quit,): $ECHOTXT" + error= + read answer + case $answer in + q* | Q*) + answer=quit + ;; + *) + answer=correct + ;; + esac + else + $ECHO "$error + $ECHOTXT" + echo " " + if test "$deletelog" = no + then + $ECHO "$error + $ECHOTXT" >> $jid.log + echo " " >> $jid.log + fi + answer=quit + fi +else + if test $verify = yes + then + $ECHO " +Are these parameters correct (yes,no,quit,)? $ECHOTXT" + read answer + case $answer in + q* | Q*) + answer=quit + ;; + y* | Y*) + answer=yes + ;; + *) + answer=no + ;; + esac + else + answer=yes + fi +fi + +case $answer in + no | correct) + +############################################################################## +# prompt for each value # +############################################################################## + + $ECHO " +Program name ($prog)? $ECHOTXT" + read value + if test "$value" + then + prog=$value + fi + $ECHO "Job ID ($jid)? $ECHOTXT" + read value + if test "$value" + then + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + fi + $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi + $ECHO "User objects or libraries ($objs)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + objs= + ;; + *) + objs="$value" + ;; + esac + fi + $ECHO "Restart File Job ID ($rid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + rid= + ;; + *) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + esac + fi + $ECHO "Substructure File ID ($sid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + sid= + ;; + *) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + esac + fi + $ECHO "Post File Job ID ($pid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + pid= + ;; + *) + pid=$value + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + esac + fi + $ECHO "Defaults File ID ($did)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + did= + ;; + *) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + esac + fi + $ECHO "View Factor File ID ($vid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + vid= + ;; + *) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + esac + fi + $ECHO "Save generated module ($prgsav)? $ECHOTXT" + read value + if test "$value" + then + prgsav=$value + fi + $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" + read value + if test "$value" + then + nprocdddm=$value + nprocdddmprint=$value + fi + $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" + read value + if test "$value" + then + nte=$value + fi + $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" + read value + if test "$value" + then + nsolver=$value + fi + $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" + read value + if test "$value" + then + nts=$value + fi +# + if test $nprocdddm -gt 0 + then + nprocd=$nprocdddm + fi + if test $nsolver -gt 0 + then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi + fi +# Element loop threads. + if test $nte -eq -1 + then + nte=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nte -lt 0 + then + nte=0 + fi + nteprint=$nte +# Copy from ddm + if test $nprocdddm -gt 1 + then + nteprint=$nprocdddm + fi +# override with -nthread_elem option + if test $nte -ne 0 + then + nteprint=$nte + fi +# check for minimum 1 threads per processes for DDM + if test $nprocdddm -ne 0 + then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi + fi + nte=$nteprint +# Solver threads. + if test $nts -eq -1 + then + nts=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nts -lt 0 + then + nts=0 + fi + ntsprint=$nts +# Copy from ddm + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +# override with -nthread_solver option + if test $nts -ne 0 + then + ntsprint=$nts + fi +# check for minimum 1 threads per solver process. + if test $nsolver -lt $nprocdddm + then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi + else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi + fi + if test $ntsprint -eq 1 + then + set ntsprint=0 + fi + nts=$ntsprint + $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" + read value + if test "$value" + then + gpuids=$value + fi + if test "$gpuids" = "" ; then + gpuoption= + else + gpuoption="-gp $gpuids" + fi + if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH + fi + if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + fi +# + if test $nprocd -gt 1 + then + $ECHO "Message passing type ($itree)? $ECHOTXT" + read value + if test "$value" + then + itree=$value + fi + $ECHO "Host file name ($host)? $ECHOTXT" + read value + if test "$value" + then + host=$value + fi + if test $nprocdddm -gt 1 + then + $ECHO "Single input file? $ECHOTXT" + read value + case $value in + y* | Y*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" + read value + if test "$value" + then + compatible=$value + fi + $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" + read value + if test "$value" + then + cpinput=$value + fi + $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" + read value + if test "$value" + then + cpresults=$value + fi + fi + fi + $ECHO "Run the job in the queue ($qid)? $ECHOTXT" + read value + if test "$value" + then + qid=$value + fi + case $qid in + s* | S* | l* | L* | v* | V* ) + $ECHO "Queue priority ($priority)? $ECHOTXT" + read value + if test "$value" + then + priority=$value + fi + $ECHO "Job starts at ($att)? $ECHOTXT" + read value + if test "$value" + then + att=$value + fi + $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" + read value + if test "$value" + then + cpu=$value + fi + ;; + * ) + ;; + esac + $ECHO "Auto Restart option ($nauto)? $ECHOTXT" + read value + if test "$value" + then + nauto=$value + fi + $ECHO "Run directory ($DIRJOB)? $ECHOTXT" + read value + if test "$value" + then + DIRJOB=$value + DIRSCR=$DIRJOB + fi + $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" + read value + if test "$value" + then + DIRSCR=$value + fi + ;; + quit) + exit 1 + ;; + *) + break + ;; + +esac + + if test $nt -eq -1 + then + nt=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nt -lt 0 + then + nt=0 + fi + +done +# +if test $nt -eq 0 +then + ntarg= +fi +if test $nt -eq 0 +then + ntprint= +fi +if test $nt -eq 0 +then + nt= +fi + +if test $nte -eq 0 +then + ntearg= +fi +if test $nte -eq 0 +then + nteprint= +fi +if test $nte -eq 0 +then + nte= +fi + +if test $nts -eq 0 +then + ntsarg= +fi +if test $nts -eq 0 +then + ntsprint= +fi +if test $nts -eq 0 +then + nts= +fi +# +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + pathdll=yes + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + fi + + if test "$pathdll"; then +# +# reset share lib path +# + if test $MACHINENAME = "HP" + then + SHLIB_PATH=$DIRJOB:$SHLIB_PATH + export SHLIB_PATH + fi + if test $MACHINENAME = "IBM" + then + LIBPATH=$DIRJOB:$LIBPATH + export LIBPATH + fi +# + LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH + LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH + LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH + export LD_LIBRARY_PATH + export LD_LIBRARY64_PATH + export LD_LIBRARYN32_PATH + fi +fi +# end of dllrun>0 + + +if test $program = $exefile -o $program = $prog.marc +then + +# delete the old .log file unless we run in the background +if test "$deletelog" = yes +then + /bin/rm $jid.log 2>/dev/null +else + echo + echo running the job in the background, see $jid.log + echo +fi + +# +# check if this is an autoforge or rezoning or radiation job +# +if test $nprocd -eq 1 +then + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` + if test "$line" + then + autoforge=1 + fi +fi +# +# check that jobname for restarted run is not the same +# as restart file basename +# +if test "$rid" +then + if test "$jid" = "$rid" + then + echo " " + echo "ERROR: job name of current run is the same as job name" + echo " of the restarted job" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "ERROR: job name of current run is the same as job name" >> $jid.log + echo " of the restarted job" >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi +fi + +# +# user objects/libraries used +# + + if test "$objs" + then + program="$DIRJOB/$jid.marc" + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# user subroutine used +# +# add BLAS options for linking + BLAS="%BLAS%" + + if test "$user" + then + program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# Special case for IBM using POE but not an SP machine +# in this case we always need a host file, also for serial jobs. +# +if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP +then + MP_HOSTFILE=${jid}.host + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $nprocd -gt 1 + then + numdom=$nprocd + while test $numdom -gt 0 + do + hostname -s >> $MP_HOSTFILE + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + else + hostname -s > $MP_HOSTFILE + fi +fi +# +# check ssh for all hosts in host file +# +if test $nprocd -gt 1 +then +if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" + then +# get host list + if test "$host" + then + line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` +# count failing hosts + counter=0 + for i in $line + do + $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n + status=$? + if [[ $status != 0 ]] ; then + counter=$((counter+1)) + if [ "$counter" = "1" ]; then + echo " " + echo " error - connection test failed... " + echo " " + fi + echo " " + echo " connection test with ssh failed on host $i" + echo " check the following command: ssh $i uname -n " + echo " " + fi + done +# echo error message and quit + if test $counter -ne 0 + then + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. Note that this is the case " + echo " also for running on a single machine. " + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. ">> $jid.log + echo " The ssh command must be working correctly between ">> $jid.log + echo " the computers used in the analysis. Furthermore, ">> $jid.log + echo " it must be set up such that it does not prompt the ">> $jid.log + echo " user for a password. Note that this is the case ">> $jid.log + echo " also for running on a single machine. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + else + counter=1 +# test ssh `hostname` + if test $counter -ne 0 + then + line=`hostname` + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi +# test ssh `hostname` + if test $counter -ne 0 + then + line=`hostname -s` + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi +# test ssh localhost + if test $counter -ne 0 + then + line=localhost + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi + if test $counter -ne 0 + then + echo " error - connection test failed... " + echo " " + echo " ssh needs to work on the machine without asking for a password." + echo " check the following command: ssh localhost uname -n" + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. Note that this is the case " + echo " also for running on a single machine. " + echo " " + if test "$deletelog" = no + then + echo " error - connection test failed... " >> $jid.log + echo " " >> $jid.log + echo " ssh needs to work on the machine without asking for a password." >> $jid.log + echo " check the following command: ssh localhost uname -n" >> $jid.log + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. " >> $jid.log + echo " The ssh command must be working correctly between " >> $jid.log + echo " the computers used in the analysis. Furthermore, " >> $jid.log + echo " it must be set up such that it does not prompt the " >> $jid.log + echo " user for a password. Note that this is the case " >> $jid.log + echo " also for running on a single machine. " >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + echo $line $nprocd > $jid.hosts + host=$jid.hosts + fi + fi +fi +fi +# +# check correctness of host file; fix for user sub +# + if test $nprocd -gt 1 + then + +# construct the path name to the executable (execpath) + execpath=$MARC_BIN/$exefile + usersub=0 + if test $program = $prog.marc + then + execpath=$prog.marc + usersub=1 + fi + if test "$objs" + then + execpath="$DIRJOB/$jid.marc" + usersub=1 + fi + if test "$user" + then + execpath=$usernoext.marc + usersub=1 + fi + export execpath + execname=`$BASENAME $execpath` + + if test "$host" + then + userhost=$host + case $userhost in + \/* | \.\/*) + ;; + *) + userhost=`pwd`/$userhost + ;; + esac + +# check that the number of processes specified in the hostfile is +# equal to nprocd specified by -nprocd. + numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` + if test $nprocd -ne $numproc + then + echo " " + echo "error, the number of processes specified in the host file" + echo "must be equal to the number of processes given by -nprocd/-nsolver" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, the number of processes specified in the host file" >> $jid.log + echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + +# check for Myrinet that the number of processes per host is +# less than number of available user ports, 5 +# .gmpi directory must exist in user's home directory +# and must have write permission from remote hosts + if test $MPITYPE = "myrinet" + then + numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` + if test $numproc -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes specified " + echo "in the hostfile must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes specified " >> $jid.log + echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + if test ! -d ~/.gmpi + then + echo " " + echo "error, for Myrinet a .gmpi directory must exist " + echo "under the user's home directory" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log + echo "under the user's home directory" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + homedir=`echo ~` + for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + echo " " + echo "error, for Myrinet a shared .gmpi directory must exist " + echo "under the user's home directory " + echo "with remote write permission" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log + echo "under the user's home directory " >> $jid.log + echo "with remote write permission" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + /bin/rm tmp.$$ + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + fi + fi + done + fi + fi + +# construct the host file $jid.host which is used by mpirun +# skip lines starting with # and only consider lines with more than +# one word in them. Note that the hostfile given to this script +# has two columns: the host name and the number of shared processes +# to run on this host. mpirun wants the number of _other_ +# processes to run in addition to the one being run on the machine +# on which the job is started. hence the $2-1 for fnr == 1. + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then +# HPMPI or HP hardware MPI + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ + -v mpihpspecial="$MPIHPSPECIAL" \ +'{if ( NF > 0) {\ + fnr++ ; \ + printf("-h %s -np %s",$1,$2); \ + printf(" %s",mpihpspecial); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ + if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ + }\ + }' > $jid.host +# end HPMPI or HP hardware MPI + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then +# IBM using hardware MPI (POE) + MP_HOSTFILE=$jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host +# end IBM using hardware MPI (POE) +# for Intel MPI, need to create a machinefile for DMP + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then +# Intel MPI + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + /bin/cp $host $jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Intel MPI for DMP +# for Solaris HPC 7.1, need to create a machinefile for DMP + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then +# Solaris HPC 7.1 + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Solaris HPC 7.1 for DMP +# for Myrinet, construct a configuration file in ~/.gmpi +# this must be readable by each process +# format is (hostname) (port number) for each process + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + grep -v '^#' $host | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ +{if ( NF > 0 ) \ + for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ +}' >> ~/.gmpi/$jid.host + else +# this is for mpich-1.2.5 and later, using the -pg option +# format: host nproc executable user arguments +# the arguments are added later + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s %s\n",path,user);\ + if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ + }\ + }' > $jid.host + fi +# end Myrinet + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then +# Compaq MPI via Memory Channel + grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host +# end Compaq MPI + else +# MPICH + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ + }\ + }' > $jid.host + fi +# define the variable host and host_filt +# host_filt is used for loops over hosts +# for Myrinet we need to use a filtered variant of userhost +# for others we can use $host + if test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + host=~/.gmpi/$jid.host + host_filt=$jid.host_tMp + grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt + else + host=$jid.host + host_filt=$host + fi + else + host=$jid.host + host_filt=$host + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + host_filt=$jid.mfile + fi + fi +# figure out if the machines in the hostfile are nfs mounted +# or distributed and set the variable "dirstatus" accordingly. +# only perform the check if user subroutine is used +# or a user subroutine executable is used + + numfield=1 + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + numfield=2 + fi + DIR1=$DIRJOB + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + counter=0 + echo " " + echo "checking if local or shared directories for host" + if test "$deletelog" = no + then + echo "checking if local or shared directories for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + dirstatus[$counter]="shared" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + dirstatus[$counter]="local" + /bin/rm tmp.$$ + else + if test ! -f $jid.$$ + then + dirstatus[$counter]="local" + $RSH $i /bin/rm $DIR1/$jid.$$ + else + /bin/rm $jid.$$ + fi + fi + if test -f tmp.$$ + then + /bin/rm tmp.$$ + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + echo " ${dirstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${dirstatus[$counter]}" >> $jid.log + fi + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + fi + +# figure out if this is a compatible set of machines +# unless explicitly specified with flag -comp +# only perform the check if user subroutine is used +# or a user subroutine executable is used +# Myrinet does not support heterogeneous + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + if test $compatible = "unknown" + then + thisname=$ARCH + compatible=yes + counter=0 + echo "checking if machines are compatible for host" + if test "$deletelog" = no + then + echo "checking if machines are compatible for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]="yes" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + othername=`$RSH $i uname -a | cut -f 1 -d " "` + if test $thisname != $othername + then + compatible=no + compstatus[$counter]="no" + fi + fi + echo " ${compstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${compstatus[$counter]}" >> $jid.log + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + else + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]=$compatible + fi + done + if test $compatible = "no" + then + echo "all machines assumed incompatible" + if test "$deletelog" = no + then + echo "all machines assumed incompatible" >> $jid.log + fi + else + echo "all machines compatible" + if test "$deletelog" = no + then + echo "all machines compatible" >> $jid.log + fi + fi + fi +# error out if user objects or libraries are used on incompatible machines + if test "$compatible" = "no" -a -n "$objs" + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" + if test "$deletelog" = no + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log + fi + exit 1 + fi +# modify new host file if NFS mounted heterogeneous machine + doit= + if test $program = $prog.marc + then + doit=yes + fi + if test "$user" + then + doit=yes + fi + if test "$doit" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + $AWK -v hst=$i '{fnr++ ; \ +if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ +printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} + /bin/mv $jid.host{$$} $jid.host + host=$jid.host + fi + fi + done + fi + fi # if test $program = $prog.marc -o $user -o $obj + + else # if test $host + # assume shared memory machine if no hostfile given and + # MPITYPE is set to mpich or Myrinet + # check for Myrinet that the total number of processes is + # less than number of available user ports, 5 + if test $MPITYPE = "mpich" -o $MPITYPE = "scali" + then + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + host=$jid.host + elif test $MPITYPE = "myrinet" + then + if test $nprocd -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes " + echo "must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes " >> $jid.log + echo "must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + echo `hostname` $nprocd | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ + {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ +' >> ~/.gmpi/$jid.host + host=~/.gmpi/$jid.host + else + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + + fi + fi # if test myrinet + + fi # if test $host + + fi # if test $nprocd -gt 1 + +fi # if test $program = $exefile -o $program = $prog.marc + +############################################################################## +# construct run stream (Marc only) # +############################################################################## + +# set maximum message length for ddm to a large number +# for vendor provided mpi +if test $itree -eq 0 -a $MPITYPE = hardware +then + itree=100000000 + if test $MACHINENAME = SGI + then + itree=100000001 + fi +fi +if test $itree -eq 0 -a $MPITYPE = hpmpi +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = myrinet +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = nec +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = scali +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = intelmpi +then + itree=100000000 +fi +if test $nprocdddm -lt 2 +then + nprocdarg= +else + nprocdarg="$nprocdarg $nprocdddm" +fi +if test $nsolver -eq 0 +then + nsolverarg= +else + nsolverarg="$nsolverarg $nsolver" +fi +if test $nprocdddm -lt 2 -a $nsolver -eq 0 +then +nprocd=0 +fi +if test $nprocd -gt 0 +then + if test "$host" + then + if test -z "$RUN_JOB2" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then + RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" + RUN_JOB=" -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + numhost=`uniq $jid.mfile | wc -l` + if test "$INTELMPI_VERSION" = "HYDRA" + then + RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n $numhost -r $RSH -f $jid.mfile + RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" + fi + +# intelmpi uses configfile. format: +# -host host1 -n n1 executable marcargs +# one such line per host +# collect the marcargs in RUN_JOB and construct the config file later +# collect the run stream in RUN_JOB_TMP + RUN_JOB="-jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + + + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then + RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test "$userhost" + then + RUN_JOB="$RUN_JOB -mhost $userhost" + fi + if test $MPITYPE = "scali" + then +# set default working directory to /tmp to allow +# different directory names + SCAMPI_WORKING_DIRECTORY=/tmp + export SCAMPI_WORKING_DIRECTORY + fi + else + if test -z "$RUN_JOB1" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + RUNNPROCD=$nprocd + if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" + then + RUNNPROCD= + MP_PROCS=$nprocd + export MP_PROCS + fi + if test $MPITYPE = "myrinet" + then + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + echo " " > /dev/null + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n 1 -f $jid.hosts + fi + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + fi +else + if test $nauto -gt 0 -o $ndcoup -gt 0 + then + RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else +# this is for a serial job without auto restart: + RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi +fi +if test "$rid" +then + RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" +fi +if test "$pid" +then + RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" +fi +if test "$sid" +then + RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" +fi +if test "$did" +then + RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" +fi +if test "$vid" +then + RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" +fi +if test $nauto -gt 0 +then + RUN_JOB="$RUN_JOB -autorst $nauto " +fi +if test $ndcoup -gt 0 +then + RUN_JOB="$RUN_JOB -dcoup $ndcoup " +fi +if test $ndytran -gt 0 +then + RUN_JOB="$RUN_JOB -dytran $ndytran " +fi +if test $mesh -gt 0 +then + RUN_JOB="$RUN_JOB -me $mesh " +fi +if test $noutcore -gt 0 +then + RUN_JOB="$RUN_JOB -outcore $noutcore " +fi +if test "$dllrun" -gt 0 +then + RUN_JOB="$RUN_JOB -dll $dllrun " +fi +if test "$trkrun" -gt 0 +then + RUN_JOB="$RUN_JOB -trk $trkrun " +fi +if test "$iam" +then + RUN_JOB="$RUN_JOB -iam $iam " +fi +if test "$justlist" +then + RUN_JOB="$RUN_JOB -list 1 " +fi +if test "$feature" +then + RUN_JOB="$RUN_JOB -feature $feature " +fi +if test "$memlimit" -ne 0 +then + RUN_JOB="$RUN_JOB -ml $memlimit " +fi +if test "$cpinput" +then + RUN_JOB="$RUN_JOB -ci $cpinput " +fi +if test "$cpresults" +then + RUN_JOB="$RUN_JOB -cr $cpresults " +fi +if test "$DIRSCR" != "$DIRJOB" +then + RUN_JOB="$RUN_JOB -dirscr $DIRSCR" +else + DIRSCR=$DIRJOB +fi +if test "$makebdf" +then + RUN_JOB="$RUN_JOB -bdf $makebdf " +fi +if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" +then + # append $RUN_JOB to all lines of the host file + # and set RUN_JOB + $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ + /bin/mv $host.$$ $host + RUN_JOB=$RUN_JOB_TMP +fi +if test $MPITYPE = "intelmpi" -a "$host" +then + # construct config file, append $RUN_JOB to all lines of the config file + # and set RUN_JOB + if test "$INTELMPI_VERSION" = "HYDRA" + then + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + else + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-host %s -n %s",$1,$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + fi + RUN_JOB=$RUN_JOB_TMP +fi +echo " " +echo "Final run stream value" +echo " RUNJOB="$RUN_JOB +if test "$deletelog" = no +then +echo " " >> $jid.log +echo "Final run stream value" >> $jid.log +echo " RUNJOB="$RUN_JOB >> $jid.log +fi + + +############################################################################## +# run marc using valgrind # +############################################################################## +#RUN_JOB="valgrind $RUN_JOB" +#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" +############################################################################## + + +############################################################################## +# run the requested program in a queue # +############################################################################## + +if test "$deletelog" = yes +then + echo + date +else + echo >> $jid.log + date >> $jid.log +fi +if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] +then + +/bin/rm -f $jid.runmarcscript + + +# +# compile user subroutine if present +# +if test "$link" +then + if test "$user" + then + userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then + if test $MACHINENAME = "CRAY" + then + $DFORTHIGHMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTHIGHMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } +END4 +else + prgsav=yes +fi +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# + +cat >> $jid.runmarcscript << END5 + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# first remove all .out files and incremental restart files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null + /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null +fi + +if test $nprocdddm -gt 1 +then + $RUN_JOB 2>>$jid.log +else + $RUN_JOB 2>>$jid.log +fi + +if test $dllrun -eq 0; then + if test $prgsav = no + then + /bin/rm -f $bd$program 2>/dev/null + fi +else + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes + then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +END5 + + +# Submit to marc batch queue +# +if [ $qid = at ] +then +QUENAME=at +SUBMCMD= +else +# +# Submit to qsub queue +# +QUENAME=qsub +SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" +if test "$priority" +then + SUBMCMD=$SUBMCMD" -p $priority" +fi +if test "$att" +then + SUBMCMD=$SUBMCMD" -a $att" +fi +if test "$cpu" +then + SUBMCMD=$SUBMCMD" -lt $cpu" +fi + +fi +echo $QUENAME $SUBMCMD +#cat $jid.runmarcscript +$QUENAME $SUBMCMD < $jid.runmarcscript + +/bin/rm -f $jid.runmarcscript + +############################################################################## +# run the requested program in the background # +############################################################################## + +else +if test $qid = background +then + +# +# first remove all old .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi +# +# compile user subroutine if present +# +( +if test "$link" +then + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_hmp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTHIGHMP $user || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTHIGHMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc + +# + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +$RUN_JOB & + +marcpid=$! +echo $marcpid > $DIRJOB/$jid.pid +wait $marcpid + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + fi + fi + fi +fi + + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +) 1>>$jid.log 2>&1 & + + +############################################################################## +# run the requested program in the foreground # +############################################################################## + +else + +# +# compile user subroutine if present +# +if test "$link" +then + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_hmp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTHIGHMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTHIGHMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi +# first remove all .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi + +$RUN_JOB + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + else + echo " " > /dev/null + fi + else + if test "$host" + then + mpdcleanup -a -f $jid.mfile + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.mfile 2> /dev/null + else + mpdcleanup -a -f $jid.hosts + /bin/rm $jid.hosts 2> /dev/null + fi + fi + fi +fi + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi + + +fi +fi diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_l b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_l new file mode 100644 index 000000000..82aceb60c --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_l @@ -0,0 +1,4053 @@ +#!/bin/ksh +############################################################################## +# # +# run_marc - run a marc job # +# ------------------------- # +# # +# usage: run_marc -j jid { options } # +# # +# where standard options are: required: defaults: # +# -------------------------- # +# # +# -j* jid job id number. ** YES ** . # +# -pr* prog program name. . marc # +# -v* y|n do or do not verify inputs. . yes # +# -q* s|l|v|b|f batch queue name or background, . short # +# foreground. # +# -b* as alternative to option -q* # +# # +# ( batch queues only : # +# -pq* intra queue priority. . . # +# -at DATE/TIME delay start of job. . . # +# format : January,1,1990,12:31 # +# or : today,5pm # +# -cpu* secs job CPU limit . . ) # +# # +# -r* rid restart file job id. . . # +# -si* sid substructure file id. . . # +# -pi* post post file job id. . . # +# -de* did defaults file . no # +# -vf vid viewfactor . no # +# # +# -u* user user subroutine. . . # +# -obj obj user objects or libraries. . . # +# -sa* y|n do or do not save load module. . no # +# -autorst auto restart flag for auto forge . no # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo selects i4 or i8 version # +# default: i4 or via defaults file run_marc_defaults # +# the -mo option will override # +# -mpi selects MPI version # +# each platform has a default MPI version and some # +# have an alternative version. see the include file # +# for the respective platform # +# MPI_DEFAULT defines the default MPI version # +# MPI_OTHER defines versions one can switch to # +# -dcoup for contact decoupling # +# currently not supported # +# -dir directory where the job i/o should take place. # +# defaults to current directory. # +# -sdir directory where scratch files are created # +# defaults to current directory. # +# # +# -alloc only perform memory allocation test, no analysis # +# -list y only list options in the input file, no analysis # +# -fe num set feature number "num" for the run. only one allowed # +# -dytran flag to switch from Dytran to Marc # +# dytran = 0, program will run w/o Marc-Dytran Switch # +# = 1, program will restart Marc after Dytran run # +# >= 2, Not supported yet. # +# currently not supported # +# -ou force analysis to use out-of-core control # +# =0, not used # +# =1, element storage out-of-core # +# -dll run marc using shared library libmarc.so and exe_marc # +# =1, used # +# =2, do not free streaming input memory # +# =3, run with marc input deck # +# -trk run marc for post-tracking # +# -gpuid run marc using GPGPU capability # +# specify gpuid on to be used in the analysis. Multiple # +# IDs may be assigned for DDM runs. # +# Separate a list of IDs with a colon. Each DMP # +# process will be assigned a GPU ID in round robin fastion# +# = 0 # +# = 0:1 etc... # +# # +# where parallel options are: # +# -------------------------- # +# # +# itree, host, and comp options are available for the domain # +# decomposition only. # +# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # +# # +# # +# -nprocd number of domains. # +# defaults to single domain solution. # +# -nprocds number of domains if single input file. # +# defaults to single domain solution. # +# -nps same as -nprocds. # +# -nsolver number of solver tasks for solver types 12 and 13 # +# these are distributed tasks operating via MPI # +# -nthread_elem number of threads for element assembly and recovery # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by element assembly # +# recovery. # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_elem option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_elem specified. # +# -nthread_solver number of threads for solver types 6, 8, and 11 # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by 6, 8, and 11 # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_solver option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_solver specified. # +# -nthread Same as -nthread_solver. # +# -itree message passing tree type for domain decomposition. # +# for debugging purposes; should not normally be used. # +# -host hostfile name for distributed execution on network. # +# defaults to no hostfile, unless jobid.defhost exists. # +# if jobid.defhost exists, only -np(s) necessary # +# -comp* y|n to be used with user routines on a network of # +# incompatible machines. # +# if set to no, a separate executable will be created # +# for each machine on the network. # +# if set to yes, the executable located on the machine # +# from which marc is started will be used on all machines.# +# defaults to no if O/S versions different on machines. # +# # +# -ci y|n copy input files to remote hosts (default: yes) # +# if "yes", input files are automatically copied to # +# remote hosts for a network run if necessary. # +# -cr y|n copy post files from remote hosts (default: yes) # +# if "yes", post files are automatically copied back from # +# remote hosts for a network run if necessary. # +############################################################################## +# set DIR to the directory in which this script is +REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" +DIR=`dirname $REALCOM` +# make sure DIR has an absolute path +case $DIR in + \/*) + ;; + *) + DIR=`pwd`/$DIR + ;; +esac +DIRSCRIPT=$DIR +AWK=awk +ARCH=`uname -a | cut -f 1 -d " "` +# Sun has a bad awk, use nawk instead +if test $ARCH = "SunOS" +then + AWK=nawk +fi +BASENAME=basename +# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists +if test $ARCH = "SunOS" +then + if test -x /usr/ucb/basename + then + BASENAME=/usr/ucb/basename + fi +fi + +# echo command line in the case of ECHO_COMMAND is true +if test "$ECHO_COMMAND" = true ; then + echo command "$0" "$@" +fi + +# +# "mode" selects version, i4 or i8 +# default is i4 +# this can be changed by a file run_marc_defaults +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MODE i8 +# it can also be set by the environmental variable MARC_INTEGER_SIZE +# and by the command line option "-mo" +# +mode= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + mode=i4 + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -f $HOME/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + mode=i4 + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -n "$MARC_INTEGER_SIZE" ; then + mode=$MARC_INTEGER_SIZE +fi +if test -z "$mode" ; then + mode=i8 +fi +case $mode in + i4) + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "error, version mode must be i4 or i8" + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i4 or i8" + echo " " + echo " use -mo i4 or -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + setmode=true + fi + if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + fi + if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +done + +# set to i4 version for 32 bit Linux +if test "`uname -s`" = "Linux"; then + if test "`uname -m`" = "i686"; then + mode=i4 + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +fi + + +. "$DIR/getarch" + +. $MARC_INCLUDE +# + +# +# Dynamically determine the echo syntax +# + +case "`echo '\c'`" in + '\c') + ECHO='echo -n' + ECHOTXT=' ' + ;; + *) + ECHO='echo' + ECHOTXT=' \c' + ;; +esac + +# +# Variables for the MARC environment +# + +PRODUCT="Marc" +EXITMSG=$MARC_TOOLS/MESSAGES +export EXITMSG +FLEXDIR=$DIR/../flexlm/licenses +export FLEXDIR +TIMCHK=3600 +export TIMCHK +BINDIR=$MARC_BIN +export BINDIR +AFMATDAT=$MARC_RUNTIME/AF_flowmat/ +export AFMATDAT +# +# define directory path to global unified material database +# +MATFILE= +export MATFILE + +# +# define memory limit +# first set to MEMLIMIT from include +# -ml option overrules if specified +memlimit=$MEMLIMIT +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +# +if test $MACHINENAME = "HP" +then + SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH + export SHLIB_PATH +fi +# the one for IBM is defined futher down + +LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH +LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH +export LD_LIBRARY_PATH +export LD_LIBRARY64_PATH +export LD_LIBRARYN32_PATH + +atexit() { +kill -15 $$ +# +if test $MPITYPE = "myrinet" +then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi +fi +} + +trap "atexit" 2 + +# +# defaults +# + +prog=marc +exefile=marc +jid= +rid= +pid= +sid= +did= +vid= +user= +usernoext= +objs= +qid=background +cpu= +priority= +att= +trk= +verify=yes +prgsav=no +rmdll=no +cpdll=no +progdll= +pathdll= +error= +nprocd=0 +nprocdddm=1 +nprocdddmprint= +icreated=0 +nprocdarg= +nsolver=0 +nsolverarg=-ns +if test $nprocds +then + if test $nprocds -gt 1 + then + nprocdddm=$nprocds + nprocdddmprint=$nprocds + icreated=1 + nprocdarg=-nprocds + fi +fi +ntprint=0 +nt=-1 +nte=-1 +nts=-1 +ntarg=-nt +ntearg=-nte +ntsarg=-nts +nteprint= +ntsprint= +gpuids= +nauto=0 +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +link= +trkrun=0 +DIRJOB=`pwd` +DIRSCR=$DIRJOB +DIRSCRSET= +autoforge=0 +dotdat=.dat +dotdefhost=.defhost +host= +numhost= +mfile= +userhost= +makebdf= +cpinput=yes +cpresults=yes +marcdll=libmarc.$EXT_DLL +# define hostname and strip off extensions (alpha.aaa.com) +thishost=`hostname` +thishost=${thishost%%.*} +compatible=unknown +numfield=1 +justlist= +feature= +mpioption=false +MDSRCLIB=$MARC_LIB/mdsrc.a +# +# check run_marc_defaults file for default MPI setting +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MPI +# +value= +file= +if test -f $DIRSCRIPT/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$DIRSCRIPT/run_marc_defaults + fi +fi +if test -f $HOME/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$HOME/run_marc_defaults + fi +fi +if test -n "$value"; then + MARC_MPITYPE=$value + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + echo " " + echo " error, incorrect option for MARC_MPI" + echo " defined in $file: $MARC_MPITYPE" + echo " valid options: $MPI_DEFAULT $MPI_OTHER" + echo " " + exit + fi + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + fi +fi +# +# +# allow scratch directory to be specified with environmental variable +# MARCSCRATCH +if test $MARCSCRATCH +then + if test -d $MARCSCRATCH + then + DIRSCR=$MARCSCRATCH + else + echo "error, scratch directory '$MARCSCRATCH'" + echo " specified via environmental variable MARCSCRATCH does not exist" + exit + fi +fi +# +############################################################################## +# parse input - arguments always come in pairs # +############################################################################## + +arg=$1 +if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + shift + arg=$1 +fi +while [ -n "$arg" ] +do + shift + value=$1 + case $arg in + -al* | -AL*) + LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + $MARC_BIN/marc -alloc 1 + exit + ;; + -li* | -LI*) + justlist=yes + ;; + -fe* | -FE*) + feature=$value + ;; + -pr* | -PR*) + if test `dirname $value` = '.' + then + prog=`$BASENAME $value .marc` + progdll=`$BASENAME $value` + else + prog=`dirname $value`/`$BASENAME $value .marc` + progdll=`dirname $value`/`$BASENAME $value` + fi + prdir=`dirname $value` + case $prdir in + \/*) + ;; + *) + prog=`pwd`/$prdir/$prog + ;; + esac + ;; + -j* | -J*) + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + ;; + -r* | -R*) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + -si* | -SI*) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + -pi* | -PI*) + if test -f $value.t19 + then + pid=`$BASENAME $value .t19` + else + pid=`$BASENAME $value .t16` + fi + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + -bdf | -BDF) + makebdf=1 + ;; + -de* | -DE*) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + -vf | -VF) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + -u* | -U*) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -at | -AT) + att=$value + ;; + -cpu* | -CPU*) + cpu=$value + ;; + -pq | -PQ*) + priority=$value + ;; + -v* | -V*) + verify=$value + ;; + -sa* | -SA*) + prgsav=$value + ;; + -np* | -NP*) + nprocdddm=$value + nprocdddmprint=$value + case $arg in + -nps* | -NPS* | -nprocds* | -NPROCDS*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + case $arg in + -np | -NP | -nprocd | -NPROCD) + icreated=0 + nprocdarg=-nprocd + ;; + esac + ;; + -ns* | -NS*) + nsolver=$value + ;; + -nt* | -NT*) + case $arg in + -nte | -NTE | -nthread_e* | -NTHREAD_E*) + nte=$value + ;; + esac + case $arg in + -nts | -NTS | -nthread_s* | -NTHREAD_S*) + nts=$value + ;; + esac + case $arg in + -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) + nt=$value + ;; + esac + ;; + -gp* | -GP*) + gpuids=$value + ;; + -it* | -IT*) + itree=$value + ;; + -iam | -IAM) + iam=$value + ;; + -au* | -AU*) + nauto=$value + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -me | -ME ) + mesh=$value + ;; + -ml | -ML ) + memlimit=$value + ;; + -mo | -MO ) + ;; + -mpi | -MPI ) + mpioption=true + MARC_MPITYPE=$value + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + fi + fi + ;; + -dir* | -DIR*) + DIRJOB=$value + case $DIRJOB in + \/*) + ;; + *) + DIRJOB=`pwd`/$DIRJOB + ;; + esac + if test -z "$DIRSCRSET" + then + DIRSCR=$DIRJOB + fi + ;; + -sd* | -SD*) + DIRSCR=$value + DIRSCRSET=yes + case $DIRSCR in + \/*) + ;; + *) + DIRSCR=`pwd`/$DIRSCR + ;; + esac + ;; + -ho* | -HO*) + host=$value + ;; + -co* | -CO*) + compatible=$value + ;; + -ci* | -CI*) + cpinput=$value + ;; + -cr* | -CR*) + cpresults=$value + ;; + *) + error="$error +$arg: invalid option" + break + ;; + esac + case $value in + -*) + error="$error +$arg: invalid name $value" + break + ;; + esac + shift + arg=$1 + if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + shift + arg=$1 + fi +done +argc=`expr $# % 2` +if test $argc -eq 1 +then +# +# odd number of arguments +# + error="$error +argument list incomplete" +fi + +if test $nprocdddm -gt 0 +then +nprocd=$nprocdddm +fi + +if test $nsolver -gt 0 +then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi +fi +# Set defaults +if test $nt -eq -1 +then +nt=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nt -lt 0 +then +nt=0 +fi +if test $nte -eq -1 +then +nte=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nte -lt 0 +then +nte=0 +fi +if test $nts -eq -1 +then +nts=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nts -lt 0 +then +nts=0 +fi +# +# set number of element loop threads +# +ntprint=$nt +nteprint=$nte +# copy from -nprocd[s] +if test $nprocdddm -gt 1 +then + nteprint=$nprocdddm +fi +# override with -nthread_elem option +if test $nte -ne 0 +then +nteprint=$nte +fi +# check for minimum 1 threads per processes for DDM +if test $nprocdddm -gt 1 +then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi +fi +nte=$nteprint +# +# set number of Solver threads +# +ntsprint=$nts +# copy from -nthread or -nprocd[s] +if test $ntprint -ne 0 +then + ntsprint=$ntprint +else + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +fi +# override with -nthread_solver option +if test $nts -ne 0 +then + ntsprint=$nts +fi +# check for minimum 1 threads per solver process. +if test $nsolver -lt $nprocdddm +then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi +else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi +fi +if test $ntsprint -eq 1 +then + set ntsprint=0 +fi +nts=$ntsprint + +# set stack size for multi-threading. +export KMP_MONITOR_STACKSIZE=7M +export OMP_STACKSIZE=7M + +# +# deprecate -nthread option at arugment of marc +nt=0 +# Reset nprocdddmm, nsolver and threads if not given. +if test $nprocdddm -eq 0 +then + nprocdarg= +fi +if test $nprocdddm -eq 0 +then + nprocdddmprint= +fi +if test $nprocdddm -eq 0 +then + nprocdddm= +fi + +if test $nsolver -eq 0 +then + nsolverprint= +fi +# end of threads setting. +gpuoption= +if test "$gpuids" = "" ; then + gpuoption= +else + gpuoption="-gp $gpuids" +fi + +if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH +else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH +fi +# Linux 64 + HPMPI, Below code is taken from include_linux64 +if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" +then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +fi + +if test $nprocd -gt 1; then + if test -f $jid$dotdefhost; then + if test "$host" = ""; then + host=$jid$dotdefhost + fi + fi + if test -f hostfile_qa_$nprocd; then + if test "$host" = ""; then + host=hostfile_qa_$nprocd + fi + fi +fi + +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then + dotdat=.inp + fi + + if test "$progdll"; then + /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll + rmdll=yes + pathdll=yes + progdll=${progdll}_$marcdll + else + progdll=$marcdll + fi + + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + pathdll=yes + fi +fi + +############################################################################## +# check parameter validity # +############################################################################## + +while test forever; do + +# +# check for input file existence +# +if test $nprocdddm -gt 1 -a $icreated -eq 0; then + if test ! -f $DIRJID/1$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/1$jid$dotdat not accessible" + fi + fi +else + if test ! -f $DIRJID/$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/$jid$dotdat not accessible" + fi + fi +fi + if test $nprocd -gt 1; then + if test "$host" ; then + if test ! -f $host; then + error="$error +host name file $host not accessible" + fi + fi + fi + +# +# check if the job is already running in the background +# +if test -f $DIRJOB/$jid.pid; then + error="$error +job is already running (the file $jid.pid exists)" +fi + +# +# if the program name is other than marc, then +# assume that this is a program in the users local directory +# + +bd=$MARC_BIN/ + +case $prog in + marc | MARC | $exefile) + program=$exefile + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + if test ! -f $user + then + error="$error +user subroutine file $user not accessible" + fi + fi + if test "$objs" + then + missingobjs= + for o in $objs + do + if test ! -f "$o" + then + if test -z "$missingobjs" + then + missingobjs="$o" + else + missingobjs="$missingobjs $o" + fi + fi + done + if test -n "$missingobjs" + then + error="$error +user object/library file(s) $missingobjs not accessible" + fi + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$vid" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRVID/1$vid.vfs + then + error="$error +view factor file $DIRVID/1$vid.vfs not accessible" + fi + else + if test ! -f $DIRVID/$vid.vfs + then + error="$error +view factor file $DIRVID/$vid.vfs not accessible" + fi + fi + fi + if $mpioption + then + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" + fi + fi + ;; + *) + program=$prog.marc + case $prog in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + error="$error +program option may not be used with user subroutine" + fi + if test "$objs" + then + error="$error +program option may not be used with user objects or libraries" + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$nauto" + then + if test $nauto -gt 2 + then + error="$error +incorrect option for auto restart " + fi + fi + if test "$ndcoup" + then + if test $ndcoup -gt 3 + then + error="$error +incorrect option for contact decoupling " + fi + fi + if test "$ndytran" + then + if test $ndytran -gt 1 + then + error="$error +incorrect option for Marc-Dytran Switch " + fi + fi + if $mpioption + then + if test ! -x $MARC_BIN/$exefile + then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE " + fi + fi + ;; +esac + +############################################################################## +# check argument integrity # +############################################################################## + +if test "$jid" +then + : +else + error="$error +job id required" +fi + +if test $nprocd -gt 1 +then + if test $nauto -gt 0 + then + error="$error +cannot run DDM job with auto restart (-au) option " + fi +fi +case $qid in + S* | s*) + qid=short + ;; + L* | l*) + qid=long + ;; + V* | v*) + qid=verylong + ;; + B* | b*) + qid=background + ;; + F* | f*) + qid=foreground + ;; + A* | a*) + qid=at + ;; + *) + error="$error +bad value for queue_id option" + ;; +esac + +case $prgsav in + N* | n*) + prgsav=no + ;; + Y* | y*) + prgsav=yes + ;; + *) + error="$error +bad value for save option" + ;; +esac + +case $verify in + N* | n*) + verify=no + ;; + Y* | y*) + verify=yes + ;; + *) + error="$error +bad value for verify option" + ;; +esac + +case $nprocdddm in + -* ) + error="$error +bad value for nprocd option" + ;; +esac + +case $nt in + -* ) + error="$error +bad value for nt option" + ;; +esac + +case $itree in + -* ) + error="$error +bad value for itree option" + ;; +esac +case $iam in + -* ) + error="$error +bad value for iam option" + ;; +esac +case $compatible in + N* | n*) + compatible=no + ;; + Y* | y*) + compatible=yes + ;; + unknown) + ;; + *) + error="$error +bad value for comp option" + ;; +esac +case $cpinput in + N* | n*) + cpinput=no + ;; + Y* | y*) + cpinput=yes + ;; + *) + error="$error +bad value for copy input option" + ;; +esac +case $cpresults in + N* | n*) + cpresults=no + ;; + Y* | y*) + cpresults=yes + ;; + *) + error="$error +bad value for copy results option" + ;; +esac + +# +# check for external file to run +# +if test -f $MARC_TOOLS/run_marc_check +then + . $MARC_TOOLS/run_marc_check +fi + +# +# pick up version data from bin/VERSION if it exists +# +if test -f $MARC_BIN/VERSION; then + ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` + if test -n "$ppp" ;then + PRODUCT=$ppp + fi + ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` + if test -n "$ppp" ;then + REVISION=", Build $ppp" + fi +fi +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +deletelog=yes +if test $qid = background -a $verify = no +then +echo \ +" +$PRODUCT $REVISION $MACHINE version +----------------------------- +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto " > $jid.log +deletelog=no +fi +echo \ +" +$PRODUCT $REVISION $MACHINE version +----------------------------- +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto" + + +case $qid in + s* | S* | l* | L* | v* | V* ) + echo \ +"Queue priority : $priority +Queue CPU limit : $cpu +Queue start time : $att" + ;; +# * ) +# echo \ +#" " +# ;; +esac + +if test "$error" +then + if test $verify = yes + then + $ECHO "$error + +Please correct or quit(correct,quit,): $ECHOTXT" + error= + read answer + case $answer in + q* | Q*) + answer=quit + ;; + *) + answer=correct + ;; + esac + else + $ECHO "$error + $ECHOTXT" + echo " " + if test "$deletelog" = no + then + $ECHO "$error + $ECHOTXT" >> $jid.log + echo " " >> $jid.log + fi + answer=quit + fi +else + if test $verify = yes + then + $ECHO " +Are these parameters correct (yes,no,quit,)? $ECHOTXT" + read answer + case $answer in + q* | Q*) + answer=quit + ;; + y* | Y*) + answer=yes + ;; + *) + answer=no + ;; + esac + else + answer=yes + fi +fi + +case $answer in + no | correct) + +############################################################################## +# prompt for each value # +############################################################################## + + $ECHO " +Program name ($prog)? $ECHOTXT" + read value + if test "$value" + then + prog=$value + fi + $ECHO "Job ID ($jid)? $ECHOTXT" + read value + if test "$value" + then + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + fi + $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi + $ECHO "User objects or libraries ($objs)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + objs= + ;; + *) + objs="$value" + ;; + esac + fi + $ECHO "Restart File Job ID ($rid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + rid= + ;; + *) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + esac + fi + $ECHO "Substructure File ID ($sid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + sid= + ;; + *) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + esac + fi + $ECHO "Post File Job ID ($pid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + pid= + ;; + *) + pid=$value + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + esac + fi + $ECHO "Defaults File ID ($did)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + did= + ;; + *) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + esac + fi + $ECHO "View Factor File ID ($vid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + vid= + ;; + *) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + esac + fi + $ECHO "Save generated module ($prgsav)? $ECHOTXT" + read value + if test "$value" + then + prgsav=$value + fi + $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" + read value + if test "$value" + then + nprocdddm=$value + nprocdddmprint=$value + fi + $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" + read value + if test "$value" + then + nte=$value + fi + $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" + read value + if test "$value" + then + nsolver=$value + fi + $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" + read value + if test "$value" + then + nts=$value + fi +# + if test $nprocdddm -gt 0 + then + nprocd=$nprocdddm + fi + if test $nsolver -gt 0 + then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi + fi +# Element loop threads. + if test $nte -eq -1 + then + nte=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nte -lt 0 + then + nte=0 + fi + nteprint=$nte +# Copy from ddm + if test $nprocdddm -gt 1 + then + nteprint=$nprocdddm + fi +# override with -nthread_elem option + if test $nte -ne 0 + then + nteprint=$nte + fi +# check for minimum 1 threads per processes for DDM + if test $nprocdddm -ne 0 + then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi + fi + nte=$nteprint +# Solver threads. + if test $nts -eq -1 + then + nts=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nts -lt 0 + then + nts=0 + fi + ntsprint=$nts +# Copy from ddm + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +# override with -nthread_solver option + if test $nts -ne 0 + then + ntsprint=$nts + fi +# check for minimum 1 threads per solver process. + if test $nsolver -lt $nprocdddm + then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi + else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi + fi + if test $ntsprint -eq 1 + then + set ntsprint=0 + fi + nts=$ntsprint + $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" + read value + if test "$value" + then + gpuids=$value + fi + if test "$gpuids" = "" ; then + gpuoption= + else + gpuoption="-gp $gpuids" + fi + if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH + fi + if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + fi +# + if test $nprocd -gt 1 + then + $ECHO "Message passing type ($itree)? $ECHOTXT" + read value + if test "$value" + then + itree=$value + fi + $ECHO "Host file name ($host)? $ECHOTXT" + read value + if test "$value" + then + host=$value + fi + if test $nprocdddm -gt 1 + then + $ECHO "Single input file? $ECHOTXT" + read value + case $value in + y* | Y*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" + read value + if test "$value" + then + compatible=$value + fi + $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" + read value + if test "$value" + then + cpinput=$value + fi + $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" + read value + if test "$value" + then + cpresults=$value + fi + fi + fi + $ECHO "Run the job in the queue ($qid)? $ECHOTXT" + read value + if test "$value" + then + qid=$value + fi + case $qid in + s* | S* | l* | L* | v* | V* ) + $ECHO "Queue priority ($priority)? $ECHOTXT" + read value + if test "$value" + then + priority=$value + fi + $ECHO "Job starts at ($att)? $ECHOTXT" + read value + if test "$value" + then + att=$value + fi + $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" + read value + if test "$value" + then + cpu=$value + fi + ;; + * ) + ;; + esac + $ECHO "Auto Restart option ($nauto)? $ECHOTXT" + read value + if test "$value" + then + nauto=$value + fi + $ECHO "Run directory ($DIRJOB)? $ECHOTXT" + read value + if test "$value" + then + DIRJOB=$value + DIRSCR=$DIRJOB + fi + $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" + read value + if test "$value" + then + DIRSCR=$value + fi + ;; + quit) + exit 1 + ;; + *) + break + ;; + +esac + + if test $nt -eq -1 + then + nt=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nt -lt 0 + then + nt=0 + fi + +done +# +if test $nt -eq 0 +then + ntarg= +fi +if test $nt -eq 0 +then + ntprint= +fi +if test $nt -eq 0 +then + nt= +fi + +if test $nte -eq 0 +then + ntearg= +fi +if test $nte -eq 0 +then + nteprint= +fi +if test $nte -eq 0 +then + nte= +fi + +if test $nts -eq 0 +then + ntsarg= +fi +if test $nts -eq 0 +then + ntsprint= +fi +if test $nts -eq 0 +then + nts= +fi +# +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + pathdll=yes + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + fi + + if test "$pathdll"; then +# +# reset share lib path +# + if test $MACHINENAME = "HP" + then + SHLIB_PATH=$DIRJOB:$SHLIB_PATH + export SHLIB_PATH + fi + if test $MACHINENAME = "IBM" + then + LIBPATH=$DIRJOB:$LIBPATH + export LIBPATH + fi +# + LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH + LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH + LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH + export LD_LIBRARY_PATH + export LD_LIBRARY64_PATH + export LD_LIBRARYN32_PATH + fi +fi +# end of dllrun>0 + + +if test $program = $exefile -o $program = $prog.marc +then + +# delete the old .log file unless we run in the background +if test "$deletelog" = yes +then + /bin/rm $jid.log 2>/dev/null +else + echo + echo running the job in the background, see $jid.log + echo +fi + +# +# check if this is an autoforge or rezoning or radiation job +# +if test $nprocd -eq 1 +then + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` + if test "$line" + then + autoforge=1 + fi +fi +# +# check that jobname for restarted run is not the same +# as restart file basename +# +if test "$rid" +then + if test "$jid" = "$rid" + then + echo " " + echo "ERROR: job name of current run is the same as job name" + echo " of the restarted job" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "ERROR: job name of current run is the same as job name" >> $jid.log + echo " of the restarted job" >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi +fi + +# +# user objects/libraries used +# + + if test "$objs" + then + program="$DIRJOB/$jid.marc" + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# user subroutine used +# +# add BLAS options for linking + BLAS="%BLAS%" + + if test "$user" + then + program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# Special case for IBM using POE but not an SP machine +# in this case we always need a host file, also for serial jobs. +# +if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP +then + MP_HOSTFILE=${jid}.host + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $nprocd -gt 1 + then + numdom=$nprocd + while test $numdom -gt 0 + do + hostname -s >> $MP_HOSTFILE + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + else + hostname -s > $MP_HOSTFILE + fi +fi +# +# check ssh for all hosts in host file +# +if test $nprocd -gt 1 +then +if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" + then +# get host list + if test "$host" + then + line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` +# count failing hosts + counter=0 + for i in $line + do + $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n + status=$? + if [[ $status != 0 ]] ; then + counter=$((counter+1)) + if [ "$counter" = "1" ]; then + echo " " + echo " error - connection test failed... " + echo " " + fi + echo " " + echo " connection test with ssh failed on host $i" + echo " check the following command: ssh $i uname -n " + echo " " + fi + done +# echo error message and quit + if test $counter -ne 0 + then + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. Note that this is the case " + echo " also for running on a single machine. " + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. ">> $jid.log + echo " The ssh command must be working correctly between ">> $jid.log + echo " the computers used in the analysis. Furthermore, ">> $jid.log + echo " it must be set up such that it does not prompt the ">> $jid.log + echo " user for a password. Note that this is the case ">> $jid.log + echo " also for running on a single machine. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + else + counter=1 +# test ssh `hostname` + if test $counter -ne 0 + then + line=`hostname` + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi +# test ssh `hostname` + if test $counter -ne 0 + then + line=`hostname -s` + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi +# test ssh localhost + if test $counter -ne 0 + then + line=localhost + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi + if test $counter -ne 0 + then + echo " error - connection test failed... " + echo " " + echo " ssh needs to work on the machine without asking for a password." + echo " check the following command: ssh localhost uname -n" + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. Note that this is the case " + echo " also for running on a single machine. " + echo " " + if test "$deletelog" = no + then + echo " error - connection test failed... " >> $jid.log + echo " " >> $jid.log + echo " ssh needs to work on the machine without asking for a password." >> $jid.log + echo " check the following command: ssh localhost uname -n" >> $jid.log + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. " >> $jid.log + echo " The ssh command must be working correctly between " >> $jid.log + echo " the computers used in the analysis. Furthermore, " >> $jid.log + echo " it must be set up such that it does not prompt the " >> $jid.log + echo " user for a password. Note that this is the case " >> $jid.log + echo " also for running on a single machine. " >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + echo $line $nprocd > $jid.hosts + host=$jid.hosts + fi + fi +fi +fi +# +# check correctness of host file; fix for user sub +# + if test $nprocd -gt 1 + then + +# construct the path name to the executable (execpath) + execpath=$MARC_BIN/$exefile + usersub=0 + if test $program = $prog.marc + then + execpath=$prog.marc + usersub=1 + fi + if test "$objs" + then + execpath="$DIRJOB/$jid.marc" + usersub=1 + fi + if test "$user" + then + execpath=$usernoext.marc + usersub=1 + fi + export execpath + execname=`$BASENAME $execpath` + + if test "$host" + then + userhost=$host + case $userhost in + \/* | \.\/*) + ;; + *) + userhost=`pwd`/$userhost + ;; + esac + +# check that the number of processes specified in the hostfile is +# equal to nprocd specified by -nprocd. + numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` + if test $nprocd -ne $numproc + then + echo " " + echo "error, the number of processes specified in the host file" + echo "must be equal to the number of processes given by -nprocd/-nsolver" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, the number of processes specified in the host file" >> $jid.log + echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + +# check for Myrinet that the number of processes per host is +# less than number of available user ports, 5 +# .gmpi directory must exist in user's home directory +# and must have write permission from remote hosts + if test $MPITYPE = "myrinet" + then + numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` + if test $numproc -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes specified " + echo "in the hostfile must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes specified " >> $jid.log + echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + if test ! -d ~/.gmpi + then + echo " " + echo "error, for Myrinet a .gmpi directory must exist " + echo "under the user's home directory" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log + echo "under the user's home directory" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + homedir=`echo ~` + for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + echo " " + echo "error, for Myrinet a shared .gmpi directory must exist " + echo "under the user's home directory " + echo "with remote write permission" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log + echo "under the user's home directory " >> $jid.log + echo "with remote write permission" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + /bin/rm tmp.$$ + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + fi + fi + done + fi + fi + +# construct the host file $jid.host which is used by mpirun +# skip lines starting with # and only consider lines with more than +# one word in them. Note that the hostfile given to this script +# has two columns: the host name and the number of shared processes +# to run on this host. mpirun wants the number of _other_ +# processes to run in addition to the one being run on the machine +# on which the job is started. hence the $2-1 for fnr == 1. + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then +# HPMPI or HP hardware MPI + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ + -v mpihpspecial="$MPIHPSPECIAL" \ +'{if ( NF > 0) {\ + fnr++ ; \ + printf("-h %s -np %s",$1,$2); \ + printf(" %s",mpihpspecial); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ + if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ + }\ + }' > $jid.host +# end HPMPI or HP hardware MPI + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then +# IBM using hardware MPI (POE) + MP_HOSTFILE=$jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host +# end IBM using hardware MPI (POE) +# for Intel MPI, need to create a machinefile for DMP + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then +# Intel MPI + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + /bin/cp $host $jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Intel MPI for DMP +# for Solaris HPC 7.1, need to create a machinefile for DMP + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then +# Solaris HPC 7.1 + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Solaris HPC 7.1 for DMP +# for Myrinet, construct a configuration file in ~/.gmpi +# this must be readable by each process +# format is (hostname) (port number) for each process + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + grep -v '^#' $host | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ +{if ( NF > 0 ) \ + for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ +}' >> ~/.gmpi/$jid.host + else +# this is for mpich-1.2.5 and later, using the -pg option +# format: host nproc executable user arguments +# the arguments are added later + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s %s\n",path,user);\ + if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ + }\ + }' > $jid.host + fi +# end Myrinet + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then +# Compaq MPI via Memory Channel + grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host +# end Compaq MPI + else +# MPICH + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ + }\ + }' > $jid.host + fi +# define the variable host and host_filt +# host_filt is used for loops over hosts +# for Myrinet we need to use a filtered variant of userhost +# for others we can use $host + if test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + host=~/.gmpi/$jid.host + host_filt=$jid.host_tMp + grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt + else + host=$jid.host + host_filt=$host + fi + else + host=$jid.host + host_filt=$host + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + host_filt=$jid.mfile + fi + fi +# figure out if the machines in the hostfile are nfs mounted +# or distributed and set the variable "dirstatus" accordingly. +# only perform the check if user subroutine is used +# or a user subroutine executable is used + + numfield=1 + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + numfield=2 + fi + DIR1=$DIRJOB + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + counter=0 + echo " " + echo "checking if local or shared directories for host" + if test "$deletelog" = no + then + echo "checking if local or shared directories for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + dirstatus[$counter]="shared" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + dirstatus[$counter]="local" + /bin/rm tmp.$$ + else + if test ! -f $jid.$$ + then + dirstatus[$counter]="local" + $RSH $i /bin/rm $DIR1/$jid.$$ + else + /bin/rm $jid.$$ + fi + fi + if test -f tmp.$$ + then + /bin/rm tmp.$$ + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + echo " ${dirstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${dirstatus[$counter]}" >> $jid.log + fi + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + fi + +# figure out if this is a compatible set of machines +# unless explicitly specified with flag -comp +# only perform the check if user subroutine is used +# or a user subroutine executable is used +# Myrinet does not support heterogeneous + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + if test $compatible = "unknown" + then + thisname=$ARCH + compatible=yes + counter=0 + echo "checking if machines are compatible for host" + if test "$deletelog" = no + then + echo "checking if machines are compatible for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]="yes" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + othername=`$RSH $i uname -a | cut -f 1 -d " "` + if test $thisname != $othername + then + compatible=no + compstatus[$counter]="no" + fi + fi + echo " ${compstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${compstatus[$counter]}" >> $jid.log + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + else + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]=$compatible + fi + done + if test $compatible = "no" + then + echo "all machines assumed incompatible" + if test "$deletelog" = no + then + echo "all machines assumed incompatible" >> $jid.log + fi + else + echo "all machines compatible" + if test "$deletelog" = no + then + echo "all machines compatible" >> $jid.log + fi + fi + fi +# error out if user objects or libraries are used on incompatible machines + if test "$compatible" = "no" -a -n "$objs" + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" + if test "$deletelog" = no + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log + fi + exit 1 + fi +# modify new host file if NFS mounted heterogeneous machine + doit= + if test $program = $prog.marc + then + doit=yes + fi + if test "$user" + then + doit=yes + fi + if test "$doit" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + $AWK -v hst=$i '{fnr++ ; \ +if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ +printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} + /bin/mv $jid.host{$$} $jid.host + host=$jid.host + fi + fi + done + fi + fi # if test $program = $prog.marc -o $user -o $obj + + else # if test $host + # assume shared memory machine if no hostfile given and + # MPITYPE is set to mpich or Myrinet + # check for Myrinet that the total number of processes is + # less than number of available user ports, 5 + if test $MPITYPE = "mpich" -o $MPITYPE = "scali" + then + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + host=$jid.host + elif test $MPITYPE = "myrinet" + then + if test $nprocd -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes " + echo "must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes " >> $jid.log + echo "must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + echo `hostname` $nprocd | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ + {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ +' >> ~/.gmpi/$jid.host + host=~/.gmpi/$jid.host + else + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + + fi + fi # if test myrinet + + fi # if test $host + + fi # if test $nprocd -gt 1 + +fi # if test $program = $exefile -o $program = $prog.marc + +############################################################################## +# construct run stream (Marc only) # +############################################################################## + +# set maximum message length for ddm to a large number +# for vendor provided mpi +if test $itree -eq 0 -a $MPITYPE = hardware +then + itree=100000000 + if test $MACHINENAME = SGI + then + itree=100000001 + fi +fi +if test $itree -eq 0 -a $MPITYPE = hpmpi +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = myrinet +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = nec +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = scali +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = intelmpi +then + itree=100000000 +fi +if test $nprocdddm -lt 2 +then + nprocdarg= +else + nprocdarg="$nprocdarg $nprocdddm" +fi +if test $nsolver -eq 0 +then + nsolverarg= +else + nsolverarg="$nsolverarg $nsolver" +fi +if test $nprocdddm -lt 2 -a $nsolver -eq 0 +then +nprocd=0 +fi +if test $nprocd -gt 0 +then + if test "$host" + then + if test -z "$RUN_JOB2" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then + RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" + RUN_JOB=" -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + numhost=`uniq $jid.mfile | wc -l` + if test "$INTELMPI_VERSION" = "HYDRA" + then + RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n $numhost -r $RSH -f $jid.mfile + RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" + fi + +# intelmpi uses configfile. format: +# -host host1 -n n1 executable marcargs +# one such line per host +# collect the marcargs in RUN_JOB and construct the config file later +# collect the run stream in RUN_JOB_TMP + RUN_JOB="-jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + + + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then + RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test "$userhost" + then + RUN_JOB="$RUN_JOB -mhost $userhost" + fi + if test $MPITYPE = "scali" + then +# set default working directory to /tmp to allow +# different directory names + SCAMPI_WORKING_DIRECTORY=/tmp + export SCAMPI_WORKING_DIRECTORY + fi + else + if test -z "$RUN_JOB1" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + RUNNPROCD=$nprocd + if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" + then + RUNNPROCD= + MP_PROCS=$nprocd + export MP_PROCS + fi + if test $MPITYPE = "myrinet" + then + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + echo " " > /dev/null + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n 1 -f $jid.hosts + fi + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + fi +else + if test $nauto -gt 0 -o $ndcoup -gt 0 + then + RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else +# this is for a serial job without auto restart: + RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi +fi +if test "$rid" +then + RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" +fi +if test "$pid" +then + RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" +fi +if test "$sid" +then + RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" +fi +if test "$did" +then + RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" +fi +if test "$vid" +then + RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" +fi +if test $nauto -gt 0 +then + RUN_JOB="$RUN_JOB -autorst $nauto " +fi +if test $ndcoup -gt 0 +then + RUN_JOB="$RUN_JOB -dcoup $ndcoup " +fi +if test $ndytran -gt 0 +then + RUN_JOB="$RUN_JOB -dytran $ndytran " +fi +if test $mesh -gt 0 +then + RUN_JOB="$RUN_JOB -me $mesh " +fi +if test $noutcore -gt 0 +then + RUN_JOB="$RUN_JOB -outcore $noutcore " +fi +if test "$dllrun" -gt 0 +then + RUN_JOB="$RUN_JOB -dll $dllrun " +fi +if test "$trkrun" -gt 0 +then + RUN_JOB="$RUN_JOB -trk $trkrun " +fi +if test "$iam" +then + RUN_JOB="$RUN_JOB -iam $iam " +fi +if test "$justlist" +then + RUN_JOB="$RUN_JOB -list 1 " +fi +if test "$feature" +then + RUN_JOB="$RUN_JOB -feature $feature " +fi +if test "$memlimit" -ne 0 +then + RUN_JOB="$RUN_JOB -ml $memlimit " +fi +if test "$cpinput" +then + RUN_JOB="$RUN_JOB -ci $cpinput " +fi +if test "$cpresults" +then + RUN_JOB="$RUN_JOB -cr $cpresults " +fi +if test "$DIRSCR" != "$DIRJOB" +then + RUN_JOB="$RUN_JOB -dirscr $DIRSCR" +else + DIRSCR=$DIRJOB +fi +if test "$makebdf" +then + RUN_JOB="$RUN_JOB -bdf $makebdf " +fi +if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" +then + # append $RUN_JOB to all lines of the host file + # and set RUN_JOB + $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ + /bin/mv $host.$$ $host + RUN_JOB=$RUN_JOB_TMP +fi +if test $MPITYPE = "intelmpi" -a "$host" +then + # construct config file, append $RUN_JOB to all lines of the config file + # and set RUN_JOB + if test "$INTELMPI_VERSION" = "HYDRA" + then + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + else + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-host %s -n %s",$1,$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + fi + RUN_JOB=$RUN_JOB_TMP +fi +echo " " +echo "Final run stream value" +echo " RUNJOB="$RUN_JOB +if test "$deletelog" = no +then +echo " " >> $jid.log +echo "Final run stream value" >> $jid.log +echo " RUNJOB="$RUN_JOB >> $jid.log +fi + + +############################################################################## +# run marc using valgrind # +############################################################################## +#RUN_JOB="valgrind $RUN_JOB" +#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" +############################################################################## + + +############################################################################## +# run the requested program in a queue # +############################################################################## + +if test "$deletelog" = yes +then + echo + date +else + echo >> $jid.log + date >> $jid.log +fi +if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] +then + +/bin/rm -f $jid.runmarcscript + + +# +# compile user subroutine if present +# +if test "$link" +then + if test "$user" + then + userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then + if test $MACHINENAME = "CRAY" + then + $DFORTLOW $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTLOW $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } +END4 +else + prgsav=yes +fi +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# + +cat >> $jid.runmarcscript << END5 + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# first remove all .out files and incremental restart files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null + /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null +fi + +if test $nprocdddm -gt 1 +then + $RUN_JOB 2>>$jid.log +else + $RUN_JOB 2>>$jid.log +fi + +if test $dllrun -eq 0; then + if test $prgsav = no + then + /bin/rm -f $bd$program 2>/dev/null + fi +else + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes + then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +END5 + + +# Submit to marc batch queue +# +if [ $qid = at ] +then +QUENAME=at +SUBMCMD= +else +# +# Submit to qsub queue +# +QUENAME=qsub +SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" +if test "$priority" +then + SUBMCMD=$SUBMCMD" -p $priority" +fi +if test "$att" +then + SUBMCMD=$SUBMCMD" -a $att" +fi +if test "$cpu" +then + SUBMCMD=$SUBMCMD" -lt $cpu" +fi + +fi +echo $QUENAME $SUBMCMD +#cat $jid.runmarcscript +$QUENAME $SUBMCMD < $jid.runmarcscript + +/bin/rm -f $jid.runmarcscript + +############################################################################## +# run the requested program in the background # +############################################################################## + +else +if test $qid = background +then + +# +# first remove all old .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi +# +# compile user subroutine if present +# +( +if test "$link" +then + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_l $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTLOW $user || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTLOW $user -o $userobj || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc + +# + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +$RUN_JOB & + +marcpid=$! +echo $marcpid > $DIRJOB/$jid.pid +wait $marcpid + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + fi + fi + fi +fi + + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +) 1>>$jid.log 2>&1 & + + +############################################################################## +# run the requested program in the foreground # +############################################################################## + +else + +# +# compile user subroutine if present +# +if test "$link" +then + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_l $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTLOW $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTLOW $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi +# first remove all .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi + +$RUN_JOB + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + else + echo " " > /dev/null + fi + else + if test "$host" + then + mpdcleanup -a -f $jid.mfile + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.mfile 2> /dev/null + else + mpdcleanup -a -f $jid.hosts + /bin/rm $jid.hosts 2> /dev/null + fi + fi + fi +fi + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi + + +fi +fi diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_lmp b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_lmp new file mode 100644 index 000000000..5d5c52221 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_lmp @@ -0,0 +1,4053 @@ +#!/bin/ksh +############################################################################## +# # +# run_marc - run a marc job # +# ------------------------- # +# # +# usage: run_marc -j jid { options } # +# # +# where standard options are: required: defaults: # +# -------------------------- # +# # +# -j* jid job id number. ** YES ** . # +# -pr* prog program name. . marc # +# -v* y|n do or do not verify inputs. . yes # +# -q* s|l|v|b|f batch queue name or background, . short # +# foreground. # +# -b* as alternative to option -q* # +# # +# ( batch queues only : # +# -pq* intra queue priority. . . # +# -at DATE/TIME delay start of job. . . # +# format : January,1,1990,12:31 # +# or : today,5pm # +# -cpu* secs job CPU limit . . ) # +# # +# -r* rid restart file job id. . . # +# -si* sid substructure file id. . . # +# -pi* post post file job id. . . # +# -de* did defaults file . no # +# -vf vid viewfactor . no # +# # +# -u* user user subroutine. . . # +# -obj obj user objects or libraries. . . # +# -sa* y|n do or do not save load module. . no # +# -autorst auto restart flag for auto forge . no # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo selects i4 or i8 version # +# default: i4 or via defaults file run_marc_defaults # +# the -mo option will override # +# -mpi selects MPI version # +# each platform has a default MPI version and some # +# have an alternative version. see the include file # +# for the respective platform # +# MPI_DEFAULT defines the default MPI version # +# MPI_OTHER defines versions one can switch to # +# -dcoup for contact decoupling # +# currently not supported # +# -dir directory where the job i/o should take place. # +# defaults to current directory. # +# -sdir directory where scratch files are created # +# defaults to current directory. # +# # +# -alloc only perform memory allocation test, no analysis # +# -list y only list options in the input file, no analysis # +# -fe num set feature number "num" for the run. only one allowed # +# -dytran flag to switch from Dytran to Marc # +# dytran = 0, program will run w/o Marc-Dytran Switch # +# = 1, program will restart Marc after Dytran run # +# >= 2, Not supported yet. # +# currently not supported # +# -ou force analysis to use out-of-core control # +# =0, not used # +# =1, element storage out-of-core # +# -dll run marc using shared library libmarc.so and exe_marc # +# =1, used # +# =2, do not free streaming input memory # +# =3, run with marc input deck # +# -trk run marc for post-tracking # +# -gpuid run marc using GPGPU capability # +# specify gpuid on to be used in the analysis. Multiple # +# IDs may be assigned for DDM runs. # +# Separate a list of IDs with a colon. Each DMP # +# process will be assigned a GPU ID in round robin fastion# +# = 0 # +# = 0:1 etc... # +# # +# where parallel options are: # +# -------------------------- # +# # +# itree, host, and comp options are available for the domain # +# decomposition only. # +# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # +# # +# # +# -nprocd number of domains. # +# defaults to single domain solution. # +# -nprocds number of domains if single input file. # +# defaults to single domain solution. # +# -nps same as -nprocds. # +# -nsolver number of solver tasks for solver types 12 and 13 # +# these are distributed tasks operating via MPI # +# -nthread_elem number of threads for element assembly and recovery # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by element assembly # +# recovery. # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_elem option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_elem specified. # +# -nthread_solver number of threads for solver types 6, 8, and 11 # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by 6, 8, and 11 # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_solver option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_solver specified. # +# -nthread Same as -nthread_solver. # +# -itree message passing tree type for domain decomposition. # +# for debugging purposes; should not normally be used. # +# -host hostfile name for distributed execution on network. # +# defaults to no hostfile, unless jobid.defhost exists. # +# if jobid.defhost exists, only -np(s) necessary # +# -comp* y|n to be used with user routines on a network of # +# incompatible machines. # +# if set to no, a separate executable will be created # +# for each machine on the network. # +# if set to yes, the executable located on the machine # +# from which marc is started will be used on all machines.# +# defaults to no if O/S versions different on machines. # +# # +# -ci y|n copy input files to remote hosts (default: yes) # +# if "yes", input files are automatically copied to # +# remote hosts for a network run if necessary. # +# -cr y|n copy post files from remote hosts (default: yes) # +# if "yes", post files are automatically copied back from # +# remote hosts for a network run if necessary. # +############################################################################## +# set DIR to the directory in which this script is +REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" +DIR=`dirname $REALCOM` +# make sure DIR has an absolute path +case $DIR in + \/*) + ;; + *) + DIR=`pwd`/$DIR + ;; +esac +DIRSCRIPT=$DIR +AWK=awk +ARCH=`uname -a | cut -f 1 -d " "` +# Sun has a bad awk, use nawk instead +if test $ARCH = "SunOS" +then + AWK=nawk +fi +BASENAME=basename +# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists +if test $ARCH = "SunOS" +then + if test -x /usr/ucb/basename + then + BASENAME=/usr/ucb/basename + fi +fi + +# echo command line in the case of ECHO_COMMAND is true +if test "$ECHO_COMMAND" = true ; then + echo command "$0" "$@" +fi + +# +# "mode" selects version, i4 or i8 +# default is i4 +# this can be changed by a file run_marc_defaults +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MODE i8 +# it can also be set by the environmental variable MARC_INTEGER_SIZE +# and by the command line option "-mo" +# +mode= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + mode=i4 + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -f $HOME/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + mode=i4 + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -n "$MARC_INTEGER_SIZE" ; then + mode=$MARC_INTEGER_SIZE +fi +if test -z "$mode" ; then + mode=i8 +fi +case $mode in + i4) + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "error, version mode must be i4 or i8" + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i4 or i8" + echo " " + echo " use -mo i4 or -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + setmode=true + fi + if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + fi + if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +done + +# set to i4 version for 32 bit Linux +if test "`uname -s`" = "Linux"; then + if test "`uname -m`" = "i686"; then + mode=i4 + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +fi + + +. "$DIR/getarch" + +. $MARC_INCLUDE +# + +# +# Dynamically determine the echo syntax +# + +case "`echo '\c'`" in + '\c') + ECHO='echo -n' + ECHOTXT=' ' + ;; + *) + ECHO='echo' + ECHOTXT=' \c' + ;; +esac + +# +# Variables for the MARC environment +# + +PRODUCT="Marc" +EXITMSG=$MARC_TOOLS/MESSAGES +export EXITMSG +FLEXDIR=$DIR/../flexlm/licenses +export FLEXDIR +TIMCHK=3600 +export TIMCHK +BINDIR=$MARC_BIN +export BINDIR +AFMATDAT=$MARC_RUNTIME/AF_flowmat/ +export AFMATDAT +# +# define directory path to global unified material database +# +MATFILE= +export MATFILE + +# +# define memory limit +# first set to MEMLIMIT from include +# -ml option overrules if specified +memlimit=$MEMLIMIT +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +# +if test $MACHINENAME = "HP" +then + SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH + export SHLIB_PATH +fi +# the one for IBM is defined futher down + +LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH +LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH +export LD_LIBRARY_PATH +export LD_LIBRARY64_PATH +export LD_LIBRARYN32_PATH + +atexit() { +kill -15 $$ +# +if test $MPITYPE = "myrinet" +then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi +fi +} + +trap "atexit" 2 + +# +# defaults +# + +prog=marc +exefile=marc +jid= +rid= +pid= +sid= +did= +vid= +user= +usernoext= +objs= +qid=background +cpu= +priority= +att= +trk= +verify=yes +prgsav=no +rmdll=no +cpdll=no +progdll= +pathdll= +error= +nprocd=0 +nprocdddm=1 +nprocdddmprint= +icreated=0 +nprocdarg= +nsolver=0 +nsolverarg=-ns +if test $nprocds +then + if test $nprocds -gt 1 + then + nprocdddm=$nprocds + nprocdddmprint=$nprocds + icreated=1 + nprocdarg=-nprocds + fi +fi +ntprint=0 +nt=-1 +nte=-1 +nts=-1 +ntarg=-nt +ntearg=-nte +ntsarg=-nts +nteprint= +ntsprint= +gpuids= +nauto=0 +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +link= +trkrun=0 +DIRJOB=`pwd` +DIRSCR=$DIRJOB +DIRSCRSET= +autoforge=0 +dotdat=.dat +dotdefhost=.defhost +host= +numhost= +mfile= +userhost= +makebdf= +cpinput=yes +cpresults=yes +marcdll=libmarc.$EXT_DLL +# define hostname and strip off extensions (alpha.aaa.com) +thishost=`hostname` +thishost=${thishost%%.*} +compatible=unknown +numfield=1 +justlist= +feature= +mpioption=false +MDSRCLIB=$MARC_LIB/mdsrc.a +# +# check run_marc_defaults file for default MPI setting +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MPI +# +value= +file= +if test -f $DIRSCRIPT/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$DIRSCRIPT/run_marc_defaults + fi +fi +if test -f $HOME/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$HOME/run_marc_defaults + fi +fi +if test -n "$value"; then + MARC_MPITYPE=$value + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + echo " " + echo " error, incorrect option for MARC_MPI" + echo " defined in $file: $MARC_MPITYPE" + echo " valid options: $MPI_DEFAULT $MPI_OTHER" + echo " " + exit + fi + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + fi +fi +# +# +# allow scratch directory to be specified with environmental variable +# MARCSCRATCH +if test $MARCSCRATCH +then + if test -d $MARCSCRATCH + then + DIRSCR=$MARCSCRATCH + else + echo "error, scratch directory '$MARCSCRATCH'" + echo " specified via environmental variable MARCSCRATCH does not exist" + exit + fi +fi +# +############################################################################## +# parse input - arguments always come in pairs # +############################################################################## + +arg=$1 +if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + shift + arg=$1 +fi +while [ -n "$arg" ] +do + shift + value=$1 + case $arg in + -al* | -AL*) + LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + $MARC_BIN/marc -alloc 1 + exit + ;; + -li* | -LI*) + justlist=yes + ;; + -fe* | -FE*) + feature=$value + ;; + -pr* | -PR*) + if test `dirname $value` = '.' + then + prog=`$BASENAME $value .marc` + progdll=`$BASENAME $value` + else + prog=`dirname $value`/`$BASENAME $value .marc` + progdll=`dirname $value`/`$BASENAME $value` + fi + prdir=`dirname $value` + case $prdir in + \/*) + ;; + *) + prog=`pwd`/$prdir/$prog + ;; + esac + ;; + -j* | -J*) + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + ;; + -r* | -R*) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + -si* | -SI*) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + -pi* | -PI*) + if test -f $value.t19 + then + pid=`$BASENAME $value .t19` + else + pid=`$BASENAME $value .t16` + fi + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + -bdf | -BDF) + makebdf=1 + ;; + -de* | -DE*) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + -vf | -VF) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + -u* | -U*) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -at | -AT) + att=$value + ;; + -cpu* | -CPU*) + cpu=$value + ;; + -pq | -PQ*) + priority=$value + ;; + -v* | -V*) + verify=$value + ;; + -sa* | -SA*) + prgsav=$value + ;; + -np* | -NP*) + nprocdddm=$value + nprocdddmprint=$value + case $arg in + -nps* | -NPS* | -nprocds* | -NPROCDS*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + case $arg in + -np | -NP | -nprocd | -NPROCD) + icreated=0 + nprocdarg=-nprocd + ;; + esac + ;; + -ns* | -NS*) + nsolver=$value + ;; + -nt* | -NT*) + case $arg in + -nte | -NTE | -nthread_e* | -NTHREAD_E*) + nte=$value + ;; + esac + case $arg in + -nts | -NTS | -nthread_s* | -NTHREAD_S*) + nts=$value + ;; + esac + case $arg in + -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) + nt=$value + ;; + esac + ;; + -gp* | -GP*) + gpuids=$value + ;; + -it* | -IT*) + itree=$value + ;; + -iam | -IAM) + iam=$value + ;; + -au* | -AU*) + nauto=$value + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -me | -ME ) + mesh=$value + ;; + -ml | -ML ) + memlimit=$value + ;; + -mo | -MO ) + ;; + -mpi | -MPI ) + mpioption=true + MARC_MPITYPE=$value + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + fi + fi + ;; + -dir* | -DIR*) + DIRJOB=$value + case $DIRJOB in + \/*) + ;; + *) + DIRJOB=`pwd`/$DIRJOB + ;; + esac + if test -z "$DIRSCRSET" + then + DIRSCR=$DIRJOB + fi + ;; + -sd* | -SD*) + DIRSCR=$value + DIRSCRSET=yes + case $DIRSCR in + \/*) + ;; + *) + DIRSCR=`pwd`/$DIRSCR + ;; + esac + ;; + -ho* | -HO*) + host=$value + ;; + -co* | -CO*) + compatible=$value + ;; + -ci* | -CI*) + cpinput=$value + ;; + -cr* | -CR*) + cpresults=$value + ;; + *) + error="$error +$arg: invalid option" + break + ;; + esac + case $value in + -*) + error="$error +$arg: invalid name $value" + break + ;; + esac + shift + arg=$1 + if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + shift + arg=$1 + fi +done +argc=`expr $# % 2` +if test $argc -eq 1 +then +# +# odd number of arguments +# + error="$error +argument list incomplete" +fi + +if test $nprocdddm -gt 0 +then +nprocd=$nprocdddm +fi + +if test $nsolver -gt 0 +then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi +fi +# Set defaults +if test $nt -eq -1 +then +nt=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nt -lt 0 +then +nt=0 +fi +if test $nte -eq -1 +then +nte=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nte -lt 0 +then +nte=0 +fi +if test $nts -eq -1 +then +nts=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nts -lt 0 +then +nts=0 +fi +# +# set number of element loop threads +# +ntprint=$nt +nteprint=$nte +# copy from -nprocd[s] +if test $nprocdddm -gt 1 +then + nteprint=$nprocdddm +fi +# override with -nthread_elem option +if test $nte -ne 0 +then +nteprint=$nte +fi +# check for minimum 1 threads per processes for DDM +if test $nprocdddm -gt 1 +then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi +fi +nte=$nteprint +# +# set number of Solver threads +# +ntsprint=$nts +# copy from -nthread or -nprocd[s] +if test $ntprint -ne 0 +then + ntsprint=$ntprint +else + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +fi +# override with -nthread_solver option +if test $nts -ne 0 +then + ntsprint=$nts +fi +# check for minimum 1 threads per solver process. +if test $nsolver -lt $nprocdddm +then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi +else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi +fi +if test $ntsprint -eq 1 +then + set ntsprint=0 +fi +nts=$ntsprint + +# set stack size for multi-threading. +export KMP_MONITOR_STACKSIZE=7M +export OMP_STACKSIZE=7M + +# +# deprecate -nthread option at arugment of marc +nt=0 +# Reset nprocdddmm, nsolver and threads if not given. +if test $nprocdddm -eq 0 +then + nprocdarg= +fi +if test $nprocdddm -eq 0 +then + nprocdddmprint= +fi +if test $nprocdddm -eq 0 +then + nprocdddm= +fi + +if test $nsolver -eq 0 +then + nsolverprint= +fi +# end of threads setting. +gpuoption= +if test "$gpuids" = "" ; then + gpuoption= +else + gpuoption="-gp $gpuids" +fi + +if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH +else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH +fi +# Linux 64 + HPMPI, Below code is taken from include_linux64 +if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" +then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +fi + +if test $nprocd -gt 1; then + if test -f $jid$dotdefhost; then + if test "$host" = ""; then + host=$jid$dotdefhost + fi + fi + if test -f hostfile_qa_$nprocd; then + if test "$host" = ""; then + host=hostfile_qa_$nprocd + fi + fi +fi + +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then + dotdat=.inp + fi + + if test "$progdll"; then + /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll + rmdll=yes + pathdll=yes + progdll=${progdll}_$marcdll + else + progdll=$marcdll + fi + + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + pathdll=yes + fi +fi + +############################################################################## +# check parameter validity # +############################################################################## + +while test forever; do + +# +# check for input file existence +# +if test $nprocdddm -gt 1 -a $icreated -eq 0; then + if test ! -f $DIRJID/1$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/1$jid$dotdat not accessible" + fi + fi +else + if test ! -f $DIRJID/$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/$jid$dotdat not accessible" + fi + fi +fi + if test $nprocd -gt 1; then + if test "$host" ; then + if test ! -f $host; then + error="$error +host name file $host not accessible" + fi + fi + fi + +# +# check if the job is already running in the background +# +if test -f $DIRJOB/$jid.pid; then + error="$error +job is already running (the file $jid.pid exists)" +fi + +# +# if the program name is other than marc, then +# assume that this is a program in the users local directory +# + +bd=$MARC_BIN/ + +case $prog in + marc | MARC | $exefile) + program=$exefile + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + if test ! -f $user + then + error="$error +user subroutine file $user not accessible" + fi + fi + if test "$objs" + then + missingobjs= + for o in $objs + do + if test ! -f "$o" + then + if test -z "$missingobjs" + then + missingobjs="$o" + else + missingobjs="$missingobjs $o" + fi + fi + done + if test -n "$missingobjs" + then + error="$error +user object/library file(s) $missingobjs not accessible" + fi + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$vid" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRVID/1$vid.vfs + then + error="$error +view factor file $DIRVID/1$vid.vfs not accessible" + fi + else + if test ! -f $DIRVID/$vid.vfs + then + error="$error +view factor file $DIRVID/$vid.vfs not accessible" + fi + fi + fi + if $mpioption + then + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" + fi + fi + ;; + *) + program=$prog.marc + case $prog in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + error="$error +program option may not be used with user subroutine" + fi + if test "$objs" + then + error="$error +program option may not be used with user objects or libraries" + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$nauto" + then + if test $nauto -gt 2 + then + error="$error +incorrect option for auto restart " + fi + fi + if test "$ndcoup" + then + if test $ndcoup -gt 3 + then + error="$error +incorrect option for contact decoupling " + fi + fi + if test "$ndytran" + then + if test $ndytran -gt 1 + then + error="$error +incorrect option for Marc-Dytran Switch " + fi + fi + if $mpioption + then + if test ! -x $MARC_BIN/$exefile + then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE " + fi + fi + ;; +esac + +############################################################################## +# check argument integrity # +############################################################################## + +if test "$jid" +then + : +else + error="$error +job id required" +fi + +if test $nprocd -gt 1 +then + if test $nauto -gt 0 + then + error="$error +cannot run DDM job with auto restart (-au) option " + fi +fi +case $qid in + S* | s*) + qid=short + ;; + L* | l*) + qid=long + ;; + V* | v*) + qid=verylong + ;; + B* | b*) + qid=background + ;; + F* | f*) + qid=foreground + ;; + A* | a*) + qid=at + ;; + *) + error="$error +bad value for queue_id option" + ;; +esac + +case $prgsav in + N* | n*) + prgsav=no + ;; + Y* | y*) + prgsav=yes + ;; + *) + error="$error +bad value for save option" + ;; +esac + +case $verify in + N* | n*) + verify=no + ;; + Y* | y*) + verify=yes + ;; + *) + error="$error +bad value for verify option" + ;; +esac + +case $nprocdddm in + -* ) + error="$error +bad value for nprocd option" + ;; +esac + +case $nt in + -* ) + error="$error +bad value for nt option" + ;; +esac + +case $itree in + -* ) + error="$error +bad value for itree option" + ;; +esac +case $iam in + -* ) + error="$error +bad value for iam option" + ;; +esac +case $compatible in + N* | n*) + compatible=no + ;; + Y* | y*) + compatible=yes + ;; + unknown) + ;; + *) + error="$error +bad value for comp option" + ;; +esac +case $cpinput in + N* | n*) + cpinput=no + ;; + Y* | y*) + cpinput=yes + ;; + *) + error="$error +bad value for copy input option" + ;; +esac +case $cpresults in + N* | n*) + cpresults=no + ;; + Y* | y*) + cpresults=yes + ;; + *) + error="$error +bad value for copy results option" + ;; +esac + +# +# check for external file to run +# +if test -f $MARC_TOOLS/run_marc_check +then + . $MARC_TOOLS/run_marc_check +fi + +# +# pick up version data from bin/VERSION if it exists +# +if test -f $MARC_BIN/VERSION; then + ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` + if test -n "$ppp" ;then + PRODUCT=$ppp + fi + ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` + if test -n "$ppp" ;then + REVISION=", Build $ppp" + fi +fi +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +deletelog=yes +if test $qid = background -a $verify = no +then +echo \ +" +$PRODUCT $REVISION $MACHINE version +----------------------------- +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto " > $jid.log +deletelog=no +fi +echo \ +" +$PRODUCT $REVISION $MACHINE version +----------------------------- +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto" + + +case $qid in + s* | S* | l* | L* | v* | V* ) + echo \ +"Queue priority : $priority +Queue CPU limit : $cpu +Queue start time : $att" + ;; +# * ) +# echo \ +#" " +# ;; +esac + +if test "$error" +then + if test $verify = yes + then + $ECHO "$error + +Please correct or quit(correct,quit,): $ECHOTXT" + error= + read answer + case $answer in + q* | Q*) + answer=quit + ;; + *) + answer=correct + ;; + esac + else + $ECHO "$error + $ECHOTXT" + echo " " + if test "$deletelog" = no + then + $ECHO "$error + $ECHOTXT" >> $jid.log + echo " " >> $jid.log + fi + answer=quit + fi +else + if test $verify = yes + then + $ECHO " +Are these parameters correct (yes,no,quit,)? $ECHOTXT" + read answer + case $answer in + q* | Q*) + answer=quit + ;; + y* | Y*) + answer=yes + ;; + *) + answer=no + ;; + esac + else + answer=yes + fi +fi + +case $answer in + no | correct) + +############################################################################## +# prompt for each value # +############################################################################## + + $ECHO " +Program name ($prog)? $ECHOTXT" + read value + if test "$value" + then + prog=$value + fi + $ECHO "Job ID ($jid)? $ECHOTXT" + read value + if test "$value" + then + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + fi + $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi + $ECHO "User objects or libraries ($objs)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + objs= + ;; + *) + objs="$value" + ;; + esac + fi + $ECHO "Restart File Job ID ($rid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + rid= + ;; + *) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + esac + fi + $ECHO "Substructure File ID ($sid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + sid= + ;; + *) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + esac + fi + $ECHO "Post File Job ID ($pid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + pid= + ;; + *) + pid=$value + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + esac + fi + $ECHO "Defaults File ID ($did)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + did= + ;; + *) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + esac + fi + $ECHO "View Factor File ID ($vid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + vid= + ;; + *) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + esac + fi + $ECHO "Save generated module ($prgsav)? $ECHOTXT" + read value + if test "$value" + then + prgsav=$value + fi + $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" + read value + if test "$value" + then + nprocdddm=$value + nprocdddmprint=$value + fi + $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" + read value + if test "$value" + then + nte=$value + fi + $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" + read value + if test "$value" + then + nsolver=$value + fi + $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" + read value + if test "$value" + then + nts=$value + fi +# + if test $nprocdddm -gt 0 + then + nprocd=$nprocdddm + fi + if test $nsolver -gt 0 + then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi + fi +# Element loop threads. + if test $nte -eq -1 + then + nte=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nte -lt 0 + then + nte=0 + fi + nteprint=$nte +# Copy from ddm + if test $nprocdddm -gt 1 + then + nteprint=$nprocdddm + fi +# override with -nthread_elem option + if test $nte -ne 0 + then + nteprint=$nte + fi +# check for minimum 1 threads per processes for DDM + if test $nprocdddm -ne 0 + then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi + fi + nte=$nteprint +# Solver threads. + if test $nts -eq -1 + then + nts=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nts -lt 0 + then + nts=0 + fi + ntsprint=$nts +# Copy from ddm + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +# override with -nthread_solver option + if test $nts -ne 0 + then + ntsprint=$nts + fi +# check for minimum 1 threads per solver process. + if test $nsolver -lt $nprocdddm + then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi + else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi + fi + if test $ntsprint -eq 1 + then + set ntsprint=0 + fi + nts=$ntsprint + $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" + read value + if test "$value" + then + gpuids=$value + fi + if test "$gpuids" = "" ; then + gpuoption= + else + gpuoption="-gp $gpuids" + fi + if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH + fi + if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + fi +# + if test $nprocd -gt 1 + then + $ECHO "Message passing type ($itree)? $ECHOTXT" + read value + if test "$value" + then + itree=$value + fi + $ECHO "Host file name ($host)? $ECHOTXT" + read value + if test "$value" + then + host=$value + fi + if test $nprocdddm -gt 1 + then + $ECHO "Single input file? $ECHOTXT" + read value + case $value in + y* | Y*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" + read value + if test "$value" + then + compatible=$value + fi + $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" + read value + if test "$value" + then + cpinput=$value + fi + $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" + read value + if test "$value" + then + cpresults=$value + fi + fi + fi + $ECHO "Run the job in the queue ($qid)? $ECHOTXT" + read value + if test "$value" + then + qid=$value + fi + case $qid in + s* | S* | l* | L* | v* | V* ) + $ECHO "Queue priority ($priority)? $ECHOTXT" + read value + if test "$value" + then + priority=$value + fi + $ECHO "Job starts at ($att)? $ECHOTXT" + read value + if test "$value" + then + att=$value + fi + $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" + read value + if test "$value" + then + cpu=$value + fi + ;; + * ) + ;; + esac + $ECHO "Auto Restart option ($nauto)? $ECHOTXT" + read value + if test "$value" + then + nauto=$value + fi + $ECHO "Run directory ($DIRJOB)? $ECHOTXT" + read value + if test "$value" + then + DIRJOB=$value + DIRSCR=$DIRJOB + fi + $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" + read value + if test "$value" + then + DIRSCR=$value + fi + ;; + quit) + exit 1 + ;; + *) + break + ;; + +esac + + if test $nt -eq -1 + then + nt=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nt -lt 0 + then + nt=0 + fi + +done +# +if test $nt -eq 0 +then + ntarg= +fi +if test $nt -eq 0 +then + ntprint= +fi +if test $nt -eq 0 +then + nt= +fi + +if test $nte -eq 0 +then + ntearg= +fi +if test $nte -eq 0 +then + nteprint= +fi +if test $nte -eq 0 +then + nte= +fi + +if test $nts -eq 0 +then + ntsarg= +fi +if test $nts -eq 0 +then + ntsprint= +fi +if test $nts -eq 0 +then + nts= +fi +# +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + pathdll=yes + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + fi + + if test "$pathdll"; then +# +# reset share lib path +# + if test $MACHINENAME = "HP" + then + SHLIB_PATH=$DIRJOB:$SHLIB_PATH + export SHLIB_PATH + fi + if test $MACHINENAME = "IBM" + then + LIBPATH=$DIRJOB:$LIBPATH + export LIBPATH + fi +# + LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH + LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH + LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH + export LD_LIBRARY_PATH + export LD_LIBRARY64_PATH + export LD_LIBRARYN32_PATH + fi +fi +# end of dllrun>0 + + +if test $program = $exefile -o $program = $prog.marc +then + +# delete the old .log file unless we run in the background +if test "$deletelog" = yes +then + /bin/rm $jid.log 2>/dev/null +else + echo + echo running the job in the background, see $jid.log + echo +fi + +# +# check if this is an autoforge or rezoning or radiation job +# +if test $nprocd -eq 1 +then + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` + if test "$line" + then + autoforge=1 + fi +fi +# +# check that jobname for restarted run is not the same +# as restart file basename +# +if test "$rid" +then + if test "$jid" = "$rid" + then + echo " " + echo "ERROR: job name of current run is the same as job name" + echo " of the restarted job" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "ERROR: job name of current run is the same as job name" >> $jid.log + echo " of the restarted job" >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi +fi + +# +# user objects/libraries used +# + + if test "$objs" + then + program="$DIRJOB/$jid.marc" + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# user subroutine used +# +# add BLAS options for linking + BLAS="%BLAS%" + + if test "$user" + then + program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# Special case for IBM using POE but not an SP machine +# in this case we always need a host file, also for serial jobs. +# +if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP +then + MP_HOSTFILE=${jid}.host + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $nprocd -gt 1 + then + numdom=$nprocd + while test $numdom -gt 0 + do + hostname -s >> $MP_HOSTFILE + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + else + hostname -s > $MP_HOSTFILE + fi +fi +# +# check ssh for all hosts in host file +# +if test $nprocd -gt 1 +then +if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" + then +# get host list + if test "$host" + then + line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` +# count failing hosts + counter=0 + for i in $line + do + $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n + status=$? + if [[ $status != 0 ]] ; then + counter=$((counter+1)) + if [ "$counter" = "1" ]; then + echo " " + echo " error - connection test failed... " + echo " " + fi + echo " " + echo " connection test with ssh failed on host $i" + echo " check the following command: ssh $i uname -n " + echo " " + fi + done +# echo error message and quit + if test $counter -ne 0 + then + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. Note that this is the case " + echo " also for running on a single machine. " + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. ">> $jid.log + echo " The ssh command must be working correctly between ">> $jid.log + echo " the computers used in the analysis. Furthermore, ">> $jid.log + echo " it must be set up such that it does not prompt the ">> $jid.log + echo " user for a password. Note that this is the case ">> $jid.log + echo " also for running on a single machine. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + else + counter=1 +# test ssh `hostname` + if test $counter -ne 0 + then + line=`hostname` + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi +# test ssh `hostname` + if test $counter -ne 0 + then + line=`hostname -s` + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi +# test ssh localhost + if test $counter -ne 0 + then + line=localhost + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi + if test $counter -ne 0 + then + echo " error - connection test failed... " + echo " " + echo " ssh needs to work on the machine without asking for a password." + echo " check the following command: ssh localhost uname -n" + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. Note that this is the case " + echo " also for running on a single machine. " + echo " " + if test "$deletelog" = no + then + echo " error - connection test failed... " >> $jid.log + echo " " >> $jid.log + echo " ssh needs to work on the machine without asking for a password." >> $jid.log + echo " check the following command: ssh localhost uname -n" >> $jid.log + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. " >> $jid.log + echo " The ssh command must be working correctly between " >> $jid.log + echo " the computers used in the analysis. Furthermore, " >> $jid.log + echo " it must be set up such that it does not prompt the " >> $jid.log + echo " user for a password. Note that this is the case " >> $jid.log + echo " also for running on a single machine. " >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + echo $line $nprocd > $jid.hosts + host=$jid.hosts + fi + fi +fi +fi +# +# check correctness of host file; fix for user sub +# + if test $nprocd -gt 1 + then + +# construct the path name to the executable (execpath) + execpath=$MARC_BIN/$exefile + usersub=0 + if test $program = $prog.marc + then + execpath=$prog.marc + usersub=1 + fi + if test "$objs" + then + execpath="$DIRJOB/$jid.marc" + usersub=1 + fi + if test "$user" + then + execpath=$usernoext.marc + usersub=1 + fi + export execpath + execname=`$BASENAME $execpath` + + if test "$host" + then + userhost=$host + case $userhost in + \/* | \.\/*) + ;; + *) + userhost=`pwd`/$userhost + ;; + esac + +# check that the number of processes specified in the hostfile is +# equal to nprocd specified by -nprocd. + numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` + if test $nprocd -ne $numproc + then + echo " " + echo "error, the number of processes specified in the host file" + echo "must be equal to the number of processes given by -nprocd/-nsolver" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, the number of processes specified in the host file" >> $jid.log + echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + +# check for Myrinet that the number of processes per host is +# less than number of available user ports, 5 +# .gmpi directory must exist in user's home directory +# and must have write permission from remote hosts + if test $MPITYPE = "myrinet" + then + numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` + if test $numproc -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes specified " + echo "in the hostfile must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes specified " >> $jid.log + echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + if test ! -d ~/.gmpi + then + echo " " + echo "error, for Myrinet a .gmpi directory must exist " + echo "under the user's home directory" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log + echo "under the user's home directory" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + homedir=`echo ~` + for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + echo " " + echo "error, for Myrinet a shared .gmpi directory must exist " + echo "under the user's home directory " + echo "with remote write permission" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log + echo "under the user's home directory " >> $jid.log + echo "with remote write permission" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + /bin/rm tmp.$$ + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + fi + fi + done + fi + fi + +# construct the host file $jid.host which is used by mpirun +# skip lines starting with # and only consider lines with more than +# one word in them. Note that the hostfile given to this script +# has two columns: the host name and the number of shared processes +# to run on this host. mpirun wants the number of _other_ +# processes to run in addition to the one being run on the machine +# on which the job is started. hence the $2-1 for fnr == 1. + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then +# HPMPI or HP hardware MPI + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ + -v mpihpspecial="$MPIHPSPECIAL" \ +'{if ( NF > 0) {\ + fnr++ ; \ + printf("-h %s -np %s",$1,$2); \ + printf(" %s",mpihpspecial); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ + if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ + }\ + }' > $jid.host +# end HPMPI or HP hardware MPI + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then +# IBM using hardware MPI (POE) + MP_HOSTFILE=$jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host +# end IBM using hardware MPI (POE) +# for Intel MPI, need to create a machinefile for DMP + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then +# Intel MPI + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + /bin/cp $host $jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Intel MPI for DMP +# for Solaris HPC 7.1, need to create a machinefile for DMP + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then +# Solaris HPC 7.1 + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Solaris HPC 7.1 for DMP +# for Myrinet, construct a configuration file in ~/.gmpi +# this must be readable by each process +# format is (hostname) (port number) for each process + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + grep -v '^#' $host | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ +{if ( NF > 0 ) \ + for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ +}' >> ~/.gmpi/$jid.host + else +# this is for mpich-1.2.5 and later, using the -pg option +# format: host nproc executable user arguments +# the arguments are added later + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s %s\n",path,user);\ + if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ + }\ + }' > $jid.host + fi +# end Myrinet + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then +# Compaq MPI via Memory Channel + grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host +# end Compaq MPI + else +# MPICH + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ + }\ + }' > $jid.host + fi +# define the variable host and host_filt +# host_filt is used for loops over hosts +# for Myrinet we need to use a filtered variant of userhost +# for others we can use $host + if test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + host=~/.gmpi/$jid.host + host_filt=$jid.host_tMp + grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt + else + host=$jid.host + host_filt=$host + fi + else + host=$jid.host + host_filt=$host + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + host_filt=$jid.mfile + fi + fi +# figure out if the machines in the hostfile are nfs mounted +# or distributed and set the variable "dirstatus" accordingly. +# only perform the check if user subroutine is used +# or a user subroutine executable is used + + numfield=1 + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + numfield=2 + fi + DIR1=$DIRJOB + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + counter=0 + echo " " + echo "checking if local or shared directories for host" + if test "$deletelog" = no + then + echo "checking if local or shared directories for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + dirstatus[$counter]="shared" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + dirstatus[$counter]="local" + /bin/rm tmp.$$ + else + if test ! -f $jid.$$ + then + dirstatus[$counter]="local" + $RSH $i /bin/rm $DIR1/$jid.$$ + else + /bin/rm $jid.$$ + fi + fi + if test -f tmp.$$ + then + /bin/rm tmp.$$ + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + echo " ${dirstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${dirstatus[$counter]}" >> $jid.log + fi + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + fi + +# figure out if this is a compatible set of machines +# unless explicitly specified with flag -comp +# only perform the check if user subroutine is used +# or a user subroutine executable is used +# Myrinet does not support heterogeneous + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + if test $compatible = "unknown" + then + thisname=$ARCH + compatible=yes + counter=0 + echo "checking if machines are compatible for host" + if test "$deletelog" = no + then + echo "checking if machines are compatible for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]="yes" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + othername=`$RSH $i uname -a | cut -f 1 -d " "` + if test $thisname != $othername + then + compatible=no + compstatus[$counter]="no" + fi + fi + echo " ${compstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${compstatus[$counter]}" >> $jid.log + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + else + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]=$compatible + fi + done + if test $compatible = "no" + then + echo "all machines assumed incompatible" + if test "$deletelog" = no + then + echo "all machines assumed incompatible" >> $jid.log + fi + else + echo "all machines compatible" + if test "$deletelog" = no + then + echo "all machines compatible" >> $jid.log + fi + fi + fi +# error out if user objects or libraries are used on incompatible machines + if test "$compatible" = "no" -a -n "$objs" + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" + if test "$deletelog" = no + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log + fi + exit 1 + fi +# modify new host file if NFS mounted heterogeneous machine + doit= + if test $program = $prog.marc + then + doit=yes + fi + if test "$user" + then + doit=yes + fi + if test "$doit" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + $AWK -v hst=$i '{fnr++ ; \ +if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ +printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} + /bin/mv $jid.host{$$} $jid.host + host=$jid.host + fi + fi + done + fi + fi # if test $program = $prog.marc -o $user -o $obj + + else # if test $host + # assume shared memory machine if no hostfile given and + # MPITYPE is set to mpich or Myrinet + # check for Myrinet that the total number of processes is + # less than number of available user ports, 5 + if test $MPITYPE = "mpich" -o $MPITYPE = "scali" + then + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + host=$jid.host + elif test $MPITYPE = "myrinet" + then + if test $nprocd -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes " + echo "must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes " >> $jid.log + echo "must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + echo `hostname` $nprocd | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ + {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ +' >> ~/.gmpi/$jid.host + host=~/.gmpi/$jid.host + else + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + + fi + fi # if test myrinet + + fi # if test $host + + fi # if test $nprocd -gt 1 + +fi # if test $program = $exefile -o $program = $prog.marc + +############################################################################## +# construct run stream (Marc only) # +############################################################################## + +# set maximum message length for ddm to a large number +# for vendor provided mpi +if test $itree -eq 0 -a $MPITYPE = hardware +then + itree=100000000 + if test $MACHINENAME = SGI + then + itree=100000001 + fi +fi +if test $itree -eq 0 -a $MPITYPE = hpmpi +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = myrinet +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = nec +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = scali +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = intelmpi +then + itree=100000000 +fi +if test $nprocdddm -lt 2 +then + nprocdarg= +else + nprocdarg="$nprocdarg $nprocdddm" +fi +if test $nsolver -eq 0 +then + nsolverarg= +else + nsolverarg="$nsolverarg $nsolver" +fi +if test $nprocdddm -lt 2 -a $nsolver -eq 0 +then +nprocd=0 +fi +if test $nprocd -gt 0 +then + if test "$host" + then + if test -z "$RUN_JOB2" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then + RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" + RUN_JOB=" -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + numhost=`uniq $jid.mfile | wc -l` + if test "$INTELMPI_VERSION" = "HYDRA" + then + RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n $numhost -r $RSH -f $jid.mfile + RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" + fi + +# intelmpi uses configfile. format: +# -host host1 -n n1 executable marcargs +# one such line per host +# collect the marcargs in RUN_JOB and construct the config file later +# collect the run stream in RUN_JOB_TMP + RUN_JOB="-jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + + + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then + RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test "$userhost" + then + RUN_JOB="$RUN_JOB -mhost $userhost" + fi + if test $MPITYPE = "scali" + then +# set default working directory to /tmp to allow +# different directory names + SCAMPI_WORKING_DIRECTORY=/tmp + export SCAMPI_WORKING_DIRECTORY + fi + else + if test -z "$RUN_JOB1" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + RUNNPROCD=$nprocd + if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" + then + RUNNPROCD= + MP_PROCS=$nprocd + export MP_PROCS + fi + if test $MPITYPE = "myrinet" + then + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + echo " " > /dev/null + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n 1 -f $jid.hosts + fi + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + fi +else + if test $nauto -gt 0 -o $ndcoup -gt 0 + then + RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else +# this is for a serial job without auto restart: + RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi +fi +if test "$rid" +then + RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" +fi +if test "$pid" +then + RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" +fi +if test "$sid" +then + RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" +fi +if test "$did" +then + RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" +fi +if test "$vid" +then + RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" +fi +if test $nauto -gt 0 +then + RUN_JOB="$RUN_JOB -autorst $nauto " +fi +if test $ndcoup -gt 0 +then + RUN_JOB="$RUN_JOB -dcoup $ndcoup " +fi +if test $ndytran -gt 0 +then + RUN_JOB="$RUN_JOB -dytran $ndytran " +fi +if test $mesh -gt 0 +then + RUN_JOB="$RUN_JOB -me $mesh " +fi +if test $noutcore -gt 0 +then + RUN_JOB="$RUN_JOB -outcore $noutcore " +fi +if test "$dllrun" -gt 0 +then + RUN_JOB="$RUN_JOB -dll $dllrun " +fi +if test "$trkrun" -gt 0 +then + RUN_JOB="$RUN_JOB -trk $trkrun " +fi +if test "$iam" +then + RUN_JOB="$RUN_JOB -iam $iam " +fi +if test "$justlist" +then + RUN_JOB="$RUN_JOB -list 1 " +fi +if test "$feature" +then + RUN_JOB="$RUN_JOB -feature $feature " +fi +if test "$memlimit" -ne 0 +then + RUN_JOB="$RUN_JOB -ml $memlimit " +fi +if test "$cpinput" +then + RUN_JOB="$RUN_JOB -ci $cpinput " +fi +if test "$cpresults" +then + RUN_JOB="$RUN_JOB -cr $cpresults " +fi +if test "$DIRSCR" != "$DIRJOB" +then + RUN_JOB="$RUN_JOB -dirscr $DIRSCR" +else + DIRSCR=$DIRJOB +fi +if test "$makebdf" +then + RUN_JOB="$RUN_JOB -bdf $makebdf " +fi +if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" +then + # append $RUN_JOB to all lines of the host file + # and set RUN_JOB + $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ + /bin/mv $host.$$ $host + RUN_JOB=$RUN_JOB_TMP +fi +if test $MPITYPE = "intelmpi" -a "$host" +then + # construct config file, append $RUN_JOB to all lines of the config file + # and set RUN_JOB + if test "$INTELMPI_VERSION" = "HYDRA" + then + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + else + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-host %s -n %s",$1,$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + fi + RUN_JOB=$RUN_JOB_TMP +fi +echo " " +echo "Final run stream value" +echo " RUNJOB="$RUN_JOB +if test "$deletelog" = no +then +echo " " >> $jid.log +echo "Final run stream value" >> $jid.log +echo " RUNJOB="$RUN_JOB >> $jid.log +fi + + +############################################################################## +# run marc using valgrind # +############################################################################## +#RUN_JOB="valgrind $RUN_JOB" +#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" +############################################################################## + + +############################################################################## +# run the requested program in a queue # +############################################################################## + +if test "$deletelog" = yes +then + echo + date +else + echo >> $jid.log + date >> $jid.log +fi +if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] +then + +/bin/rm -f $jid.runmarcscript + + +# +# compile user subroutine if present +# +if test "$link" +then + if test "$user" + then + userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then + if test $MACHINENAME = "CRAY" + then + $DFORTLOWMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTLOWMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } +END4 +else + prgsav=yes +fi +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# + +cat >> $jid.runmarcscript << END5 + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# first remove all .out files and incremental restart files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null + /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null +fi + +if test $nprocdddm -gt 1 +then + $RUN_JOB 2>>$jid.log +else + $RUN_JOB 2>>$jid.log +fi + +if test $dllrun -eq 0; then + if test $prgsav = no + then + /bin/rm -f $bd$program 2>/dev/null + fi +else + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes + then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +END5 + + +# Submit to marc batch queue +# +if [ $qid = at ] +then +QUENAME=at +SUBMCMD= +else +# +# Submit to qsub queue +# +QUENAME=qsub +SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" +if test "$priority" +then + SUBMCMD=$SUBMCMD" -p $priority" +fi +if test "$att" +then + SUBMCMD=$SUBMCMD" -a $att" +fi +if test "$cpu" +then + SUBMCMD=$SUBMCMD" -lt $cpu" +fi + +fi +echo $QUENAME $SUBMCMD +#cat $jid.runmarcscript +$QUENAME $SUBMCMD < $jid.runmarcscript + +/bin/rm -f $jid.runmarcscript + +############################################################################## +# run the requested program in the background # +############################################################################## + +else +if test $qid = background +then + +# +# first remove all old .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi +# +# compile user subroutine if present +# +( +if test "$link" +then + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_lmp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTLOWMP $user || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTLOWMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc + +# + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +$RUN_JOB & + +marcpid=$! +echo $marcpid > $DIRJOB/$jid.pid +wait $marcpid + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + fi + fi + fi +fi + + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +) 1>>$jid.log 2>&1 & + + +############################################################################## +# run the requested program in the foreground # +############################################################################## + +else + +# +# compile user subroutine if present +# +if test "$link" +then + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_lmp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTLOWMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTLOWMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi +# first remove all .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi + +$RUN_JOB + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + else + echo " " > /dev/null + fi + else + if test "$host" + then + mpdcleanup -a -f $jid.mfile + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.mfile 2> /dev/null + else + mpdcleanup -a -f $jid.hosts + /bin/rm $jid.hosts 2> /dev/null + fi + fi + fi +fi + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi + + +fi +fi diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_mp b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_mp new file mode 100644 index 000000000..d2081273b --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_mp @@ -0,0 +1,4053 @@ +#!/bin/ksh +############################################################################## +# # +# run_marc - run a marc job # +# ------------------------- # +# # +# usage: run_marc -j jid { options } # +# # +# where standard options are: required: defaults: # +# -------------------------- # +# # +# -j* jid job id number. ** YES ** . # +# -pr* prog program name. . marc # +# -v* y|n do or do not verify inputs. . yes # +# -q* s|l|v|b|f batch queue name or background, . short # +# foreground. # +# -b* as alternative to option -q* # +# # +# ( batch queues only : # +# -pq* intra queue priority. . . # +# -at DATE/TIME delay start of job. . . # +# format : January,1,1990,12:31 # +# or : today,5pm # +# -cpu* secs job CPU limit . . ) # +# # +# -r* rid restart file job id. . . # +# -si* sid substructure file id. . . # +# -pi* post post file job id. . . # +# -de* did defaults file . no # +# -vf vid viewfactor . no # +# # +# -u* user user subroutine. . . # +# -obj obj user objects or libraries. . . # +# -sa* y|n do or do not save load module. . no # +# -autorst auto restart flag for auto forge . no # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo selects i4 or i8 version # +# default: i4 or via defaults file run_marc_defaults # +# the -mo option will override # +# -mpi selects MPI version # +# each platform has a default MPI version and some # +# have an alternative version. see the include file # +# for the respective platform # +# MPI_DEFAULT defines the default MPI version # +# MPI_OTHER defines versions one can switch to # +# -dcoup for contact decoupling # +# currently not supported # +# -dir directory where the job i/o should take place. # +# defaults to current directory. # +# -sdir directory where scratch files are created # +# defaults to current directory. # +# # +# -alloc only perform memory allocation test, no analysis # +# -list y only list options in the input file, no analysis # +# -fe num set feature number "num" for the run. only one allowed # +# -dytran flag to switch from Dytran to Marc # +# dytran = 0, program will run w/o Marc-Dytran Switch # +# = 1, program will restart Marc after Dytran run # +# >= 2, Not supported yet. # +# currently not supported # +# -ou force analysis to use out-of-core control # +# =0, not used # +# =1, element storage out-of-core # +# -dll run marc using shared library libmarc.so and exe_marc # +# =1, used # +# =2, do not free streaming input memory # +# =3, run with marc input deck # +# -trk run marc for post-tracking # +# -gpuid run marc using GPGPU capability # +# specify gpuid on to be used in the analysis. Multiple # +# IDs may be assigned for DDM runs. # +# Separate a list of IDs with a colon. Each DMP # +# process will be assigned a GPU ID in round robin fastion# +# = 0 # +# = 0:1 etc... # +# # +# where parallel options are: # +# -------------------------- # +# # +# itree, host, and comp options are available for the domain # +# decomposition only. # +# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # +# # +# # +# -nprocd number of domains. # +# defaults to single domain solution. # +# -nprocds number of domains if single input file. # +# defaults to single domain solution. # +# -nps same as -nprocds. # +# -nsolver number of solver tasks for solver types 12 and 13 # +# these are distributed tasks operating via MPI # +# -nthread_elem number of threads for element assembly and recovery # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by element assembly # +# recovery. # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_elem option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_elem specified. # +# -nthread_solver number of threads for solver types 6, 8, and 11 # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by 6, 8, and 11 # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_solver option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_solver specified. # +# -nthread Same as -nthread_solver. # +# -itree message passing tree type for domain decomposition. # +# for debugging purposes; should not normally be used. # +# -host hostfile name for distributed execution on network. # +# defaults to no hostfile, unless jobid.defhost exists. # +# if jobid.defhost exists, only -np(s) necessary # +# -comp* y|n to be used with user routines on a network of # +# incompatible machines. # +# if set to no, a separate executable will be created # +# for each machine on the network. # +# if set to yes, the executable located on the machine # +# from which marc is started will be used on all machines.# +# defaults to no if O/S versions different on machines. # +# # +# -ci y|n copy input files to remote hosts (default: yes) # +# if "yes", input files are automatically copied to # +# remote hosts for a network run if necessary. # +# -cr y|n copy post files from remote hosts (default: yes) # +# if "yes", post files are automatically copied back from # +# remote hosts for a network run if necessary. # +############################################################################## +# set DIR to the directory in which this script is +REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" +DIR=`dirname $REALCOM` +# make sure DIR has an absolute path +case $DIR in + \/*) + ;; + *) + DIR=`pwd`/$DIR + ;; +esac +DIRSCRIPT=$DIR +AWK=awk +ARCH=`uname -a | cut -f 1 -d " "` +# Sun has a bad awk, use nawk instead +if test $ARCH = "SunOS" +then + AWK=nawk +fi +BASENAME=basename +# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists +if test $ARCH = "SunOS" +then + if test -x /usr/ucb/basename + then + BASENAME=/usr/ucb/basename + fi +fi + +# echo command line in the case of ECHO_COMMAND is true +if test "$ECHO_COMMAND" = true ; then + echo command "$0" "$@" +fi + +# +# "mode" selects version, i4 or i8 +# default is i4 +# this can be changed by a file run_marc_defaults +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MODE i8 +# it can also be set by the environmental variable MARC_INTEGER_SIZE +# and by the command line option "-mo" +# +mode= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + mode=i4 + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -f $HOME/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + mode=i4 + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -n "$MARC_INTEGER_SIZE" ; then + mode=$MARC_INTEGER_SIZE +fi +if test -z "$mode" ; then + mode=i8 +fi +case $mode in + i4) + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "error, version mode must be i4 or i8" + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i4 or i8" + echo " " + echo " use -mo i4 or -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + setmode=true + fi + if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + fi + if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +done + +# set to i4 version for 32 bit Linux +if test "`uname -s`" = "Linux"; then + if test "`uname -m`" = "i686"; then + mode=i4 + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +fi + + +. "$DIR/getarch" + +. $MARC_INCLUDE +# + +# +# Dynamically determine the echo syntax +# + +case "`echo '\c'`" in + '\c') + ECHO='echo -n' + ECHOTXT=' ' + ;; + *) + ECHO='echo' + ECHOTXT=' \c' + ;; +esac + +# +# Variables for the MARC environment +# + +PRODUCT="Marc" +EXITMSG=$MARC_TOOLS/MESSAGES +export EXITMSG +FLEXDIR=$DIR/../flexlm/licenses +export FLEXDIR +TIMCHK=3600 +export TIMCHK +BINDIR=$MARC_BIN +export BINDIR +AFMATDAT=$MARC_RUNTIME/AF_flowmat/ +export AFMATDAT +# +# define directory path to global unified material database +# +MATFILE= +export MATFILE + +# +# define memory limit +# first set to MEMLIMIT from include +# -ml option overrules if specified +memlimit=$MEMLIMIT +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +# +if test $MACHINENAME = "HP" +then + SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH + export SHLIB_PATH +fi +# the one for IBM is defined futher down + +LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH +LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH +export LD_LIBRARY_PATH +export LD_LIBRARY64_PATH +export LD_LIBRARYN32_PATH + +atexit() { +kill -15 $$ +# +if test $MPITYPE = "myrinet" +then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi +fi +} + +trap "atexit" 2 + +# +# defaults +# + +prog=marc +exefile=marc +jid= +rid= +pid= +sid= +did= +vid= +user= +usernoext= +objs= +qid=background +cpu= +priority= +att= +trk= +verify=yes +prgsav=no +rmdll=no +cpdll=no +progdll= +pathdll= +error= +nprocd=0 +nprocdddm=1 +nprocdddmprint= +icreated=0 +nprocdarg= +nsolver=0 +nsolverarg=-ns +if test $nprocds +then + if test $nprocds -gt 1 + then + nprocdddm=$nprocds + nprocdddmprint=$nprocds + icreated=1 + nprocdarg=-nprocds + fi +fi +ntprint=0 +nt=-1 +nte=-1 +nts=-1 +ntarg=-nt +ntearg=-nte +ntsarg=-nts +nteprint= +ntsprint= +gpuids= +nauto=0 +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +link= +trkrun=0 +DIRJOB=`pwd` +DIRSCR=$DIRJOB +DIRSCRSET= +autoforge=0 +dotdat=.dat +dotdefhost=.defhost +host= +numhost= +mfile= +userhost= +makebdf= +cpinput=yes +cpresults=yes +marcdll=libmarc.$EXT_DLL +# define hostname and strip off extensions (alpha.aaa.com) +thishost=`hostname` +thishost=${thishost%%.*} +compatible=unknown +numfield=1 +justlist= +feature= +mpioption=false +MDSRCLIB=$MARC_LIB/mdsrc.a +# +# check run_marc_defaults file for default MPI setting +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MPI +# +value= +file= +if test -f $DIRSCRIPT/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$DIRSCRIPT/run_marc_defaults + fi +fi +if test -f $HOME/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$HOME/run_marc_defaults + fi +fi +if test -n "$value"; then + MARC_MPITYPE=$value + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + echo " " + echo " error, incorrect option for MARC_MPI" + echo " defined in $file: $MARC_MPITYPE" + echo " valid options: $MPI_DEFAULT $MPI_OTHER" + echo " " + exit + fi + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + fi +fi +# +# +# allow scratch directory to be specified with environmental variable +# MARCSCRATCH +if test $MARCSCRATCH +then + if test -d $MARCSCRATCH + then + DIRSCR=$MARCSCRATCH + else + echo "error, scratch directory '$MARCSCRATCH'" + echo " specified via environmental variable MARCSCRATCH does not exist" + exit + fi +fi +# +############################################################################## +# parse input - arguments always come in pairs # +############################################################################## + +arg=$1 +if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + shift + arg=$1 +fi +while [ -n "$arg" ] +do + shift + value=$1 + case $arg in + -al* | -AL*) + LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + $MARC_BIN/marc -alloc 1 + exit + ;; + -li* | -LI*) + justlist=yes + ;; + -fe* | -FE*) + feature=$value + ;; + -pr* | -PR*) + if test `dirname $value` = '.' + then + prog=`$BASENAME $value .marc` + progdll=`$BASENAME $value` + else + prog=`dirname $value`/`$BASENAME $value .marc` + progdll=`dirname $value`/`$BASENAME $value` + fi + prdir=`dirname $value` + case $prdir in + \/*) + ;; + *) + prog=`pwd`/$prdir/$prog + ;; + esac + ;; + -j* | -J*) + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + ;; + -r* | -R*) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + -si* | -SI*) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + -pi* | -PI*) + if test -f $value.t19 + then + pid=`$BASENAME $value .t19` + else + pid=`$BASENAME $value .t16` + fi + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + -bdf | -BDF) + makebdf=1 + ;; + -de* | -DE*) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + -vf | -VF) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + -u* | -U*) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -at | -AT) + att=$value + ;; + -cpu* | -CPU*) + cpu=$value + ;; + -pq | -PQ*) + priority=$value + ;; + -v* | -V*) + verify=$value + ;; + -sa* | -SA*) + prgsav=$value + ;; + -np* | -NP*) + nprocdddm=$value + nprocdddmprint=$value + case $arg in + -nps* | -NPS* | -nprocds* | -NPROCDS*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + case $arg in + -np | -NP | -nprocd | -NPROCD) + icreated=0 + nprocdarg=-nprocd + ;; + esac + ;; + -ns* | -NS*) + nsolver=$value + ;; + -nt* | -NT*) + case $arg in + -nte | -NTE | -nthread_e* | -NTHREAD_E*) + nte=$value + ;; + esac + case $arg in + -nts | -NTS | -nthread_s* | -NTHREAD_S*) + nts=$value + ;; + esac + case $arg in + -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) + nt=$value + ;; + esac + ;; + -gp* | -GP*) + gpuids=$value + ;; + -it* | -IT*) + itree=$value + ;; + -iam | -IAM) + iam=$value + ;; + -au* | -AU*) + nauto=$value + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -me | -ME ) + mesh=$value + ;; + -ml | -ML ) + memlimit=$value + ;; + -mo | -MO ) + ;; + -mpi | -MPI ) + mpioption=true + MARC_MPITYPE=$value + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + fi + fi + ;; + -dir* | -DIR*) + DIRJOB=$value + case $DIRJOB in + \/*) + ;; + *) + DIRJOB=`pwd`/$DIRJOB + ;; + esac + if test -z "$DIRSCRSET" + then + DIRSCR=$DIRJOB + fi + ;; + -sd* | -SD*) + DIRSCR=$value + DIRSCRSET=yes + case $DIRSCR in + \/*) + ;; + *) + DIRSCR=`pwd`/$DIRSCR + ;; + esac + ;; + -ho* | -HO*) + host=$value + ;; + -co* | -CO*) + compatible=$value + ;; + -ci* | -CI*) + cpinput=$value + ;; + -cr* | -CR*) + cpresults=$value + ;; + *) + error="$error +$arg: invalid option" + break + ;; + esac + case $value in + -*) + error="$error +$arg: invalid name $value" + break + ;; + esac + shift + arg=$1 + if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + shift + arg=$1 + fi +done +argc=`expr $# % 2` +if test $argc -eq 1 +then +# +# odd number of arguments +# + error="$error +argument list incomplete" +fi + +if test $nprocdddm -gt 0 +then +nprocd=$nprocdddm +fi + +if test $nsolver -gt 0 +then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi +fi +# Set defaults +if test $nt -eq -1 +then +nt=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nt -lt 0 +then +nt=0 +fi +if test $nte -eq -1 +then +nte=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nte -lt 0 +then +nte=0 +fi +if test $nts -eq -1 +then +nts=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nts -lt 0 +then +nts=0 +fi +# +# set number of element loop threads +# +ntprint=$nt +nteprint=$nte +# copy from -nprocd[s] +if test $nprocdddm -gt 1 +then + nteprint=$nprocdddm +fi +# override with -nthread_elem option +if test $nte -ne 0 +then +nteprint=$nte +fi +# check for minimum 1 threads per processes for DDM +if test $nprocdddm -gt 1 +then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi +fi +nte=$nteprint +# +# set number of Solver threads +# +ntsprint=$nts +# copy from -nthread or -nprocd[s] +if test $ntprint -ne 0 +then + ntsprint=$ntprint +else + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +fi +# override with -nthread_solver option +if test $nts -ne 0 +then + ntsprint=$nts +fi +# check for minimum 1 threads per solver process. +if test $nsolver -lt $nprocdddm +then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi +else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi +fi +if test $ntsprint -eq 1 +then + set ntsprint=0 +fi +nts=$ntsprint + +# set stack size for multi-threading. +export KMP_MONITOR_STACKSIZE=7M +export OMP_STACKSIZE=7M + +# +# deprecate -nthread option at arugment of marc +nt=0 +# Reset nprocdddmm, nsolver and threads if not given. +if test $nprocdddm -eq 0 +then + nprocdarg= +fi +if test $nprocdddm -eq 0 +then + nprocdddmprint= +fi +if test $nprocdddm -eq 0 +then + nprocdddm= +fi + +if test $nsolver -eq 0 +then + nsolverprint= +fi +# end of threads setting. +gpuoption= +if test "$gpuids" = "" ; then + gpuoption= +else + gpuoption="-gp $gpuids" +fi + +if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH +else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH +fi +# Linux 64 + HPMPI, Below code is taken from include_linux64 +if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" +then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +fi + +if test $nprocd -gt 1; then + if test -f $jid$dotdefhost; then + if test "$host" = ""; then + host=$jid$dotdefhost + fi + fi + if test -f hostfile_qa_$nprocd; then + if test "$host" = ""; then + host=hostfile_qa_$nprocd + fi + fi +fi + +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then + dotdat=.inp + fi + + if test "$progdll"; then + /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll + rmdll=yes + pathdll=yes + progdll=${progdll}_$marcdll + else + progdll=$marcdll + fi + + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + pathdll=yes + fi +fi + +############################################################################## +# check parameter validity # +############################################################################## + +while test forever; do + +# +# check for input file existence +# +if test $nprocdddm -gt 1 -a $icreated -eq 0; then + if test ! -f $DIRJID/1$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/1$jid$dotdat not accessible" + fi + fi +else + if test ! -f $DIRJID/$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/$jid$dotdat not accessible" + fi + fi +fi + if test $nprocd -gt 1; then + if test "$host" ; then + if test ! -f $host; then + error="$error +host name file $host not accessible" + fi + fi + fi + +# +# check if the job is already running in the background +# +if test -f $DIRJOB/$jid.pid; then + error="$error +job is already running (the file $jid.pid exists)" +fi + +# +# if the program name is other than marc, then +# assume that this is a program in the users local directory +# + +bd=$MARC_BIN/ + +case $prog in + marc | MARC | $exefile) + program=$exefile + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + if test ! -f $user + then + error="$error +user subroutine file $user not accessible" + fi + fi + if test "$objs" + then + missingobjs= + for o in $objs + do + if test ! -f "$o" + then + if test -z "$missingobjs" + then + missingobjs="$o" + else + missingobjs="$missingobjs $o" + fi + fi + done + if test -n "$missingobjs" + then + error="$error +user object/library file(s) $missingobjs not accessible" + fi + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$vid" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRVID/1$vid.vfs + then + error="$error +view factor file $DIRVID/1$vid.vfs not accessible" + fi + else + if test ! -f $DIRVID/$vid.vfs + then + error="$error +view factor file $DIRVID/$vid.vfs not accessible" + fi + fi + fi + if $mpioption + then + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" + fi + fi + ;; + *) + program=$prog.marc + case $prog in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + error="$error +program option may not be used with user subroutine" + fi + if test "$objs" + then + error="$error +program option may not be used with user objects or libraries" + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$nauto" + then + if test $nauto -gt 2 + then + error="$error +incorrect option for auto restart " + fi + fi + if test "$ndcoup" + then + if test $ndcoup -gt 3 + then + error="$error +incorrect option for contact decoupling " + fi + fi + if test "$ndytran" + then + if test $ndytran -gt 1 + then + error="$error +incorrect option for Marc-Dytran Switch " + fi + fi + if $mpioption + then + if test ! -x $MARC_BIN/$exefile + then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE " + fi + fi + ;; +esac + +############################################################################## +# check argument integrity # +############################################################################## + +if test "$jid" +then + : +else + error="$error +job id required" +fi + +if test $nprocd -gt 1 +then + if test $nauto -gt 0 + then + error="$error +cannot run DDM job with auto restart (-au) option " + fi +fi +case $qid in + S* | s*) + qid=short + ;; + L* | l*) + qid=long + ;; + V* | v*) + qid=verylong + ;; + B* | b*) + qid=background + ;; + F* | f*) + qid=foreground + ;; + A* | a*) + qid=at + ;; + *) + error="$error +bad value for queue_id option" + ;; +esac + +case $prgsav in + N* | n*) + prgsav=no + ;; + Y* | y*) + prgsav=yes + ;; + *) + error="$error +bad value for save option" + ;; +esac + +case $verify in + N* | n*) + verify=no + ;; + Y* | y*) + verify=yes + ;; + *) + error="$error +bad value for verify option" + ;; +esac + +case $nprocdddm in + -* ) + error="$error +bad value for nprocd option" + ;; +esac + +case $nt in + -* ) + error="$error +bad value for nt option" + ;; +esac + +case $itree in + -* ) + error="$error +bad value for itree option" + ;; +esac +case $iam in + -* ) + error="$error +bad value for iam option" + ;; +esac +case $compatible in + N* | n*) + compatible=no + ;; + Y* | y*) + compatible=yes + ;; + unknown) + ;; + *) + error="$error +bad value for comp option" + ;; +esac +case $cpinput in + N* | n*) + cpinput=no + ;; + Y* | y*) + cpinput=yes + ;; + *) + error="$error +bad value for copy input option" + ;; +esac +case $cpresults in + N* | n*) + cpresults=no + ;; + Y* | y*) + cpresults=yes + ;; + *) + error="$error +bad value for copy results option" + ;; +esac + +# +# check for external file to run +# +if test -f $MARC_TOOLS/run_marc_check +then + . $MARC_TOOLS/run_marc_check +fi + +# +# pick up version data from bin/VERSION if it exists +# +if test -f $MARC_BIN/VERSION; then + ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` + if test -n "$ppp" ;then + PRODUCT=$ppp + fi + ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` + if test -n "$ppp" ;then + REVISION=", Build $ppp" + fi +fi +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +deletelog=yes +if test $qid = background -a $verify = no +then +echo \ +" +$PRODUCT $REVISION $MACHINE version +----------------------------- +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto " > $jid.log +deletelog=no +fi +echo \ +" +$PRODUCT $REVISION $MACHINE version +----------------------------- +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto" + + +case $qid in + s* | S* | l* | L* | v* | V* ) + echo \ +"Queue priority : $priority +Queue CPU limit : $cpu +Queue start time : $att" + ;; +# * ) +# echo \ +#" " +# ;; +esac + +if test "$error" +then + if test $verify = yes + then + $ECHO "$error + +Please correct or quit(correct,quit,): $ECHOTXT" + error= + read answer + case $answer in + q* | Q*) + answer=quit + ;; + *) + answer=correct + ;; + esac + else + $ECHO "$error + $ECHOTXT" + echo " " + if test "$deletelog" = no + then + $ECHO "$error + $ECHOTXT" >> $jid.log + echo " " >> $jid.log + fi + answer=quit + fi +else + if test $verify = yes + then + $ECHO " +Are these parameters correct (yes,no,quit,)? $ECHOTXT" + read answer + case $answer in + q* | Q*) + answer=quit + ;; + y* | Y*) + answer=yes + ;; + *) + answer=no + ;; + esac + else + answer=yes + fi +fi + +case $answer in + no | correct) + +############################################################################## +# prompt for each value # +############################################################################## + + $ECHO " +Program name ($prog)? $ECHOTXT" + read value + if test "$value" + then + prog=$value + fi + $ECHO "Job ID ($jid)? $ECHOTXT" + read value + if test "$value" + then + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + fi + $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi + $ECHO "User objects or libraries ($objs)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + objs= + ;; + *) + objs="$value" + ;; + esac + fi + $ECHO "Restart File Job ID ($rid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + rid= + ;; + *) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + esac + fi + $ECHO "Substructure File ID ($sid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + sid= + ;; + *) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + esac + fi + $ECHO "Post File Job ID ($pid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + pid= + ;; + *) + pid=$value + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + esac + fi + $ECHO "Defaults File ID ($did)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + did= + ;; + *) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + esac + fi + $ECHO "View Factor File ID ($vid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + vid= + ;; + *) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + esac + fi + $ECHO "Save generated module ($prgsav)? $ECHOTXT" + read value + if test "$value" + then + prgsav=$value + fi + $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" + read value + if test "$value" + then + nprocdddm=$value + nprocdddmprint=$value + fi + $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" + read value + if test "$value" + then + nte=$value + fi + $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" + read value + if test "$value" + then + nsolver=$value + fi + $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" + read value + if test "$value" + then + nts=$value + fi +# + if test $nprocdddm -gt 0 + then + nprocd=$nprocdddm + fi + if test $nsolver -gt 0 + then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi + fi +# Element loop threads. + if test $nte -eq -1 + then + nte=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nte -lt 0 + then + nte=0 + fi + nteprint=$nte +# Copy from ddm + if test $nprocdddm -gt 1 + then + nteprint=$nprocdddm + fi +# override with -nthread_elem option + if test $nte -ne 0 + then + nteprint=$nte + fi +# check for minimum 1 threads per processes for DDM + if test $nprocdddm -ne 0 + then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi + fi + nte=$nteprint +# Solver threads. + if test $nts -eq -1 + then + nts=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nts -lt 0 + then + nts=0 + fi + ntsprint=$nts +# Copy from ddm + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +# override with -nthread_solver option + if test $nts -ne 0 + then + ntsprint=$nts + fi +# check for minimum 1 threads per solver process. + if test $nsolver -lt $nprocdddm + then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi + else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi + fi + if test $ntsprint -eq 1 + then + set ntsprint=0 + fi + nts=$ntsprint + $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" + read value + if test "$value" + then + gpuids=$value + fi + if test "$gpuids" = "" ; then + gpuoption= + else + gpuoption="-gp $gpuids" + fi + if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH + fi + if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + fi +# + if test $nprocd -gt 1 + then + $ECHO "Message passing type ($itree)? $ECHOTXT" + read value + if test "$value" + then + itree=$value + fi + $ECHO "Host file name ($host)? $ECHOTXT" + read value + if test "$value" + then + host=$value + fi + if test $nprocdddm -gt 1 + then + $ECHO "Single input file? $ECHOTXT" + read value + case $value in + y* | Y*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" + read value + if test "$value" + then + compatible=$value + fi + $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" + read value + if test "$value" + then + cpinput=$value + fi + $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" + read value + if test "$value" + then + cpresults=$value + fi + fi + fi + $ECHO "Run the job in the queue ($qid)? $ECHOTXT" + read value + if test "$value" + then + qid=$value + fi + case $qid in + s* | S* | l* | L* | v* | V* ) + $ECHO "Queue priority ($priority)? $ECHOTXT" + read value + if test "$value" + then + priority=$value + fi + $ECHO "Job starts at ($att)? $ECHOTXT" + read value + if test "$value" + then + att=$value + fi + $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" + read value + if test "$value" + then + cpu=$value + fi + ;; + * ) + ;; + esac + $ECHO "Auto Restart option ($nauto)? $ECHOTXT" + read value + if test "$value" + then + nauto=$value + fi + $ECHO "Run directory ($DIRJOB)? $ECHOTXT" + read value + if test "$value" + then + DIRJOB=$value + DIRSCR=$DIRJOB + fi + $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" + read value + if test "$value" + then + DIRSCR=$value + fi + ;; + quit) + exit 1 + ;; + *) + break + ;; + +esac + + if test $nt -eq -1 + then + nt=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nt -lt 0 + then + nt=0 + fi + +done +# +if test $nt -eq 0 +then + ntarg= +fi +if test $nt -eq 0 +then + ntprint= +fi +if test $nt -eq 0 +then + nt= +fi + +if test $nte -eq 0 +then + ntearg= +fi +if test $nte -eq 0 +then + nteprint= +fi +if test $nte -eq 0 +then + nte= +fi + +if test $nts -eq 0 +then + ntsarg= +fi +if test $nts -eq 0 +then + ntsprint= +fi +if test $nts -eq 0 +then + nts= +fi +# +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + pathdll=yes + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + fi + + if test "$pathdll"; then +# +# reset share lib path +# + if test $MACHINENAME = "HP" + then + SHLIB_PATH=$DIRJOB:$SHLIB_PATH + export SHLIB_PATH + fi + if test $MACHINENAME = "IBM" + then + LIBPATH=$DIRJOB:$LIBPATH + export LIBPATH + fi +# + LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH + LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH + LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH + export LD_LIBRARY_PATH + export LD_LIBRARY64_PATH + export LD_LIBRARYN32_PATH + fi +fi +# end of dllrun>0 + + +if test $program = $exefile -o $program = $prog.marc +then + +# delete the old .log file unless we run in the background +if test "$deletelog" = yes +then + /bin/rm $jid.log 2>/dev/null +else + echo + echo running the job in the background, see $jid.log + echo +fi + +# +# check if this is an autoforge or rezoning or radiation job +# +if test $nprocd -eq 1 +then + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` + if test "$line" + then + autoforge=1 + fi +fi +# +# check that jobname for restarted run is not the same +# as restart file basename +# +if test "$rid" +then + if test "$jid" = "$rid" + then + echo " " + echo "ERROR: job name of current run is the same as job name" + echo " of the restarted job" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "ERROR: job name of current run is the same as job name" >> $jid.log + echo " of the restarted job" >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi +fi + +# +# user objects/libraries used +# + + if test "$objs" + then + program="$DIRJOB/$jid.marc" + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# user subroutine used +# +# add BLAS options for linking + BLAS="%BLAS%" + + if test "$user" + then + program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# Special case for IBM using POE but not an SP machine +# in this case we always need a host file, also for serial jobs. +# +if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP +then + MP_HOSTFILE=${jid}.host + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $nprocd -gt 1 + then + numdom=$nprocd + while test $numdom -gt 0 + do + hostname -s >> $MP_HOSTFILE + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + else + hostname -s > $MP_HOSTFILE + fi +fi +# +# check ssh for all hosts in host file +# +if test $nprocd -gt 1 +then +if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" + then +# get host list + if test "$host" + then + line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` +# count failing hosts + counter=0 + for i in $line + do + $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n + status=$? + if [[ $status != 0 ]] ; then + counter=$((counter+1)) + if [ "$counter" = "1" ]; then + echo " " + echo " error - connection test failed... " + echo " " + fi + echo " " + echo " connection test with ssh failed on host $i" + echo " check the following command: ssh $i uname -n " + echo " " + fi + done +# echo error message and quit + if test $counter -ne 0 + then + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. Note that this is the case " + echo " also for running on a single machine. " + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. ">> $jid.log + echo " The ssh command must be working correctly between ">> $jid.log + echo " the computers used in the analysis. Furthermore, ">> $jid.log + echo " it must be set up such that it does not prompt the ">> $jid.log + echo " user for a password. Note that this is the case ">> $jid.log + echo " also for running on a single machine. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + else + counter=1 +# test ssh `hostname` + if test $counter -ne 0 + then + line=`hostname` + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi +# test ssh `hostname` + if test $counter -ne 0 + then + line=`hostname -s` + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi +# test ssh localhost + if test $counter -ne 0 + then + line=localhost + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi + if test $counter -ne 0 + then + echo " error - connection test failed... " + echo " " + echo " ssh needs to work on the machine without asking for a password." + echo " check the following command: ssh localhost uname -n" + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. Note that this is the case " + echo " also for running on a single machine. " + echo " " + if test "$deletelog" = no + then + echo " error - connection test failed... " >> $jid.log + echo " " >> $jid.log + echo " ssh needs to work on the machine without asking for a password." >> $jid.log + echo " check the following command: ssh localhost uname -n" >> $jid.log + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. " >> $jid.log + echo " The ssh command must be working correctly between " >> $jid.log + echo " the computers used in the analysis. Furthermore, " >> $jid.log + echo " it must be set up such that it does not prompt the " >> $jid.log + echo " user for a password. Note that this is the case " >> $jid.log + echo " also for running on a single machine. " >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + echo $line $nprocd > $jid.hosts + host=$jid.hosts + fi + fi +fi +fi +# +# check correctness of host file; fix for user sub +# + if test $nprocd -gt 1 + then + +# construct the path name to the executable (execpath) + execpath=$MARC_BIN/$exefile + usersub=0 + if test $program = $prog.marc + then + execpath=$prog.marc + usersub=1 + fi + if test "$objs" + then + execpath="$DIRJOB/$jid.marc" + usersub=1 + fi + if test "$user" + then + execpath=$usernoext.marc + usersub=1 + fi + export execpath + execname=`$BASENAME $execpath` + + if test "$host" + then + userhost=$host + case $userhost in + \/* | \.\/*) + ;; + *) + userhost=`pwd`/$userhost + ;; + esac + +# check that the number of processes specified in the hostfile is +# equal to nprocd specified by -nprocd. + numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` + if test $nprocd -ne $numproc + then + echo " " + echo "error, the number of processes specified in the host file" + echo "must be equal to the number of processes given by -nprocd/-nsolver" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, the number of processes specified in the host file" >> $jid.log + echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + +# check for Myrinet that the number of processes per host is +# less than number of available user ports, 5 +# .gmpi directory must exist in user's home directory +# and must have write permission from remote hosts + if test $MPITYPE = "myrinet" + then + numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` + if test $numproc -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes specified " + echo "in the hostfile must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes specified " >> $jid.log + echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + if test ! -d ~/.gmpi + then + echo " " + echo "error, for Myrinet a .gmpi directory must exist " + echo "under the user's home directory" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log + echo "under the user's home directory" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + homedir=`echo ~` + for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + echo " " + echo "error, for Myrinet a shared .gmpi directory must exist " + echo "under the user's home directory " + echo "with remote write permission" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log + echo "under the user's home directory " >> $jid.log + echo "with remote write permission" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + /bin/rm tmp.$$ + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + fi + fi + done + fi + fi + +# construct the host file $jid.host which is used by mpirun +# skip lines starting with # and only consider lines with more than +# one word in them. Note that the hostfile given to this script +# has two columns: the host name and the number of shared processes +# to run on this host. mpirun wants the number of _other_ +# processes to run in addition to the one being run on the machine +# on which the job is started. hence the $2-1 for fnr == 1. + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then +# HPMPI or HP hardware MPI + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ + -v mpihpspecial="$MPIHPSPECIAL" \ +'{if ( NF > 0) {\ + fnr++ ; \ + printf("-h %s -np %s",$1,$2); \ + printf(" %s",mpihpspecial); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ + if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ + }\ + }' > $jid.host +# end HPMPI or HP hardware MPI + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then +# IBM using hardware MPI (POE) + MP_HOSTFILE=$jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host +# end IBM using hardware MPI (POE) +# for Intel MPI, need to create a machinefile for DMP + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then +# Intel MPI + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + /bin/cp $host $jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Intel MPI for DMP +# for Solaris HPC 7.1, need to create a machinefile for DMP + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then +# Solaris HPC 7.1 + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Solaris HPC 7.1 for DMP +# for Myrinet, construct a configuration file in ~/.gmpi +# this must be readable by each process +# format is (hostname) (port number) for each process + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + grep -v '^#' $host | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ +{if ( NF > 0 ) \ + for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ +}' >> ~/.gmpi/$jid.host + else +# this is for mpich-1.2.5 and later, using the -pg option +# format: host nproc executable user arguments +# the arguments are added later + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s %s\n",path,user);\ + if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ + }\ + }' > $jid.host + fi +# end Myrinet + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then +# Compaq MPI via Memory Channel + grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host +# end Compaq MPI + else +# MPICH + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ + }\ + }' > $jid.host + fi +# define the variable host and host_filt +# host_filt is used for loops over hosts +# for Myrinet we need to use a filtered variant of userhost +# for others we can use $host + if test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + host=~/.gmpi/$jid.host + host_filt=$jid.host_tMp + grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt + else + host=$jid.host + host_filt=$host + fi + else + host=$jid.host + host_filt=$host + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + host_filt=$jid.mfile + fi + fi +# figure out if the machines in the hostfile are nfs mounted +# or distributed and set the variable "dirstatus" accordingly. +# only perform the check if user subroutine is used +# or a user subroutine executable is used + + numfield=1 + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + numfield=2 + fi + DIR1=$DIRJOB + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + counter=0 + echo " " + echo "checking if local or shared directories for host" + if test "$deletelog" = no + then + echo "checking if local or shared directories for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + dirstatus[$counter]="shared" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + dirstatus[$counter]="local" + /bin/rm tmp.$$ + else + if test ! -f $jid.$$ + then + dirstatus[$counter]="local" + $RSH $i /bin/rm $DIR1/$jid.$$ + else + /bin/rm $jid.$$ + fi + fi + if test -f tmp.$$ + then + /bin/rm tmp.$$ + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + echo " ${dirstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${dirstatus[$counter]}" >> $jid.log + fi + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + fi + +# figure out if this is a compatible set of machines +# unless explicitly specified with flag -comp +# only perform the check if user subroutine is used +# or a user subroutine executable is used +# Myrinet does not support heterogeneous + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + if test $compatible = "unknown" + then + thisname=$ARCH + compatible=yes + counter=0 + echo "checking if machines are compatible for host" + if test "$deletelog" = no + then + echo "checking if machines are compatible for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]="yes" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + othername=`$RSH $i uname -a | cut -f 1 -d " "` + if test $thisname != $othername + then + compatible=no + compstatus[$counter]="no" + fi + fi + echo " ${compstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${compstatus[$counter]}" >> $jid.log + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + else + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]=$compatible + fi + done + if test $compatible = "no" + then + echo "all machines assumed incompatible" + if test "$deletelog" = no + then + echo "all machines assumed incompatible" >> $jid.log + fi + else + echo "all machines compatible" + if test "$deletelog" = no + then + echo "all machines compatible" >> $jid.log + fi + fi + fi +# error out if user objects or libraries are used on incompatible machines + if test "$compatible" = "no" -a -n "$objs" + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" + if test "$deletelog" = no + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log + fi + exit 1 + fi +# modify new host file if NFS mounted heterogeneous machine + doit= + if test $program = $prog.marc + then + doit=yes + fi + if test "$user" + then + doit=yes + fi + if test "$doit" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + $AWK -v hst=$i '{fnr++ ; \ +if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ +printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} + /bin/mv $jid.host{$$} $jid.host + host=$jid.host + fi + fi + done + fi + fi # if test $program = $prog.marc -o $user -o $obj + + else # if test $host + # assume shared memory machine if no hostfile given and + # MPITYPE is set to mpich or Myrinet + # check for Myrinet that the total number of processes is + # less than number of available user ports, 5 + if test $MPITYPE = "mpich" -o $MPITYPE = "scali" + then + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + host=$jid.host + elif test $MPITYPE = "myrinet" + then + if test $nprocd -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes " + echo "must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes " >> $jid.log + echo "must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + echo `hostname` $nprocd | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ + {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ +' >> ~/.gmpi/$jid.host + host=~/.gmpi/$jid.host + else + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + + fi + fi # if test myrinet + + fi # if test $host + + fi # if test $nprocd -gt 1 + +fi # if test $program = $exefile -o $program = $prog.marc + +############################################################################## +# construct run stream (Marc only) # +############################################################################## + +# set maximum message length for ddm to a large number +# for vendor provided mpi +if test $itree -eq 0 -a $MPITYPE = hardware +then + itree=100000000 + if test $MACHINENAME = SGI + then + itree=100000001 + fi +fi +if test $itree -eq 0 -a $MPITYPE = hpmpi +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = myrinet +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = nec +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = scali +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = intelmpi +then + itree=100000000 +fi +if test $nprocdddm -lt 2 +then + nprocdarg= +else + nprocdarg="$nprocdarg $nprocdddm" +fi +if test $nsolver -eq 0 +then + nsolverarg= +else + nsolverarg="$nsolverarg $nsolver" +fi +if test $nprocdddm -lt 2 -a $nsolver -eq 0 +then +nprocd=0 +fi +if test $nprocd -gt 0 +then + if test "$host" + then + if test -z "$RUN_JOB2" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then + RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" + RUN_JOB=" -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + numhost=`uniq $jid.mfile | wc -l` + if test "$INTELMPI_VERSION" = "HYDRA" + then + RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n $numhost -r $RSH -f $jid.mfile + RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" + fi + +# intelmpi uses configfile. format: +# -host host1 -n n1 executable marcargs +# one such line per host +# collect the marcargs in RUN_JOB and construct the config file later +# collect the run stream in RUN_JOB_TMP + RUN_JOB="-jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + + + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then + RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test "$userhost" + then + RUN_JOB="$RUN_JOB -mhost $userhost" + fi + if test $MPITYPE = "scali" + then +# set default working directory to /tmp to allow +# different directory names + SCAMPI_WORKING_DIRECTORY=/tmp + export SCAMPI_WORKING_DIRECTORY + fi + else + if test -z "$RUN_JOB1" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + RUNNPROCD=$nprocd + if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" + then + RUNNPROCD= + MP_PROCS=$nprocd + export MP_PROCS + fi + if test $MPITYPE = "myrinet" + then + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + echo " " > /dev/null + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n 1 -f $jid.hosts + fi + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + fi +else + if test $nauto -gt 0 -o $ndcoup -gt 0 + then + RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else +# this is for a serial job without auto restart: + RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi +fi +if test "$rid" +then + RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" +fi +if test "$pid" +then + RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" +fi +if test "$sid" +then + RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" +fi +if test "$did" +then + RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" +fi +if test "$vid" +then + RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" +fi +if test $nauto -gt 0 +then + RUN_JOB="$RUN_JOB -autorst $nauto " +fi +if test $ndcoup -gt 0 +then + RUN_JOB="$RUN_JOB -dcoup $ndcoup " +fi +if test $ndytran -gt 0 +then + RUN_JOB="$RUN_JOB -dytran $ndytran " +fi +if test $mesh -gt 0 +then + RUN_JOB="$RUN_JOB -me $mesh " +fi +if test $noutcore -gt 0 +then + RUN_JOB="$RUN_JOB -outcore $noutcore " +fi +if test "$dllrun" -gt 0 +then + RUN_JOB="$RUN_JOB -dll $dllrun " +fi +if test "$trkrun" -gt 0 +then + RUN_JOB="$RUN_JOB -trk $trkrun " +fi +if test "$iam" +then + RUN_JOB="$RUN_JOB -iam $iam " +fi +if test "$justlist" +then + RUN_JOB="$RUN_JOB -list 1 " +fi +if test "$feature" +then + RUN_JOB="$RUN_JOB -feature $feature " +fi +if test "$memlimit" -ne 0 +then + RUN_JOB="$RUN_JOB -ml $memlimit " +fi +if test "$cpinput" +then + RUN_JOB="$RUN_JOB -ci $cpinput " +fi +if test "$cpresults" +then + RUN_JOB="$RUN_JOB -cr $cpresults " +fi +if test "$DIRSCR" != "$DIRJOB" +then + RUN_JOB="$RUN_JOB -dirscr $DIRSCR" +else + DIRSCR=$DIRJOB +fi +if test "$makebdf" +then + RUN_JOB="$RUN_JOB -bdf $makebdf " +fi +if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" +then + # append $RUN_JOB to all lines of the host file + # and set RUN_JOB + $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ + /bin/mv $host.$$ $host + RUN_JOB=$RUN_JOB_TMP +fi +if test $MPITYPE = "intelmpi" -a "$host" +then + # construct config file, append $RUN_JOB to all lines of the config file + # and set RUN_JOB + if test "$INTELMPI_VERSION" = "HYDRA" + then + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + else + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-host %s -n %s",$1,$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + fi + RUN_JOB=$RUN_JOB_TMP +fi +echo " " +echo "Final run stream value" +echo " RUNJOB="$RUN_JOB +if test "$deletelog" = no +then +echo " " >> $jid.log +echo "Final run stream value" >> $jid.log +echo " RUNJOB="$RUN_JOB >> $jid.log +fi + + +############################################################################## +# run marc using valgrind # +############################################################################## +#RUN_JOB="valgrind $RUN_JOB" +#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" +############################################################################## + + +############################################################################## +# run the requested program in a queue # +############################################################################## + +if test "$deletelog" = yes +then + echo + date +else + echo >> $jid.log + date >> $jid.log +fi +if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] +then + +/bin/rm -f $jid.runmarcscript + + +# +# compile user subroutine if present +# +if test "$link" +then + if test "$user" + then + userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then + if test $MACHINENAME = "CRAY" + then + $DFORTRANMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTRANMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } +END4 +else + prgsav=yes +fi +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# + +cat >> $jid.runmarcscript << END5 + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# first remove all .out files and incremental restart files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null + /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null +fi + +if test $nprocdddm -gt 1 +then + $RUN_JOB 2>>$jid.log +else + $RUN_JOB 2>>$jid.log +fi + +if test $dllrun -eq 0; then + if test $prgsav = no + then + /bin/rm -f $bd$program 2>/dev/null + fi +else + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes + then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +END5 + + +# Submit to marc batch queue +# +if [ $qid = at ] +then +QUENAME=at +SUBMCMD= +else +# +# Submit to qsub queue +# +QUENAME=qsub +SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" +if test "$priority" +then + SUBMCMD=$SUBMCMD" -p $priority" +fi +if test "$att" +then + SUBMCMD=$SUBMCMD" -a $att" +fi +if test "$cpu" +then + SUBMCMD=$SUBMCMD" -lt $cpu" +fi + +fi +echo $QUENAME $SUBMCMD +#cat $jid.runmarcscript +$QUENAME $SUBMCMD < $jid.runmarcscript + +/bin/rm -f $jid.runmarcscript + +############################################################################## +# run the requested program in the background # +############################################################################## + +else +if test $qid = background +then + +# +# first remove all old .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi +# +# compile user subroutine if present +# +( +if test "$link" +then + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_mp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTRANMP $user || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTRANMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc + +# + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +$RUN_JOB & + +marcpid=$! +echo $marcpid > $DIRJOB/$jid.pid +wait $marcpid + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + fi + fi + fi +fi + + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +) 1>>$jid.log 2>&1 & + + +############################################################################## +# run the requested program in the foreground # +############################################################################## + +else + +# +# compile user subroutine if present +# +if test "$link" +then + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_mp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTRANMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTRANMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi +# first remove all .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi + +$RUN_JOB + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + else + echo " " > /dev/null + fi + else + if test "$host" + then + mpdcleanup -a -f $jid.mfile + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.mfile 2> /dev/null + else + mpdcleanup -a -f $jid.hosts + /bin/rm $jid.hosts 2> /dev/null + fi + fi + fi +fi + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi + + +fi +fi diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/run_marc.org b/installation/mods_MarcMentat/2013.1/Marc_tools/run_marc.org new file mode 100644 index 000000000..f7cd7def5 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Marc_tools/run_marc.org @@ -0,0 +1,4105 @@ +#!/bin/ksh +############################################################################## +# # +# run_marc - run a marc job # +# ------------------------- # +# # +# usage: run_marc -j jid { options } # +# # +# where standard options are: required: defaults: # +# -------------------------- # +# # +# -j* jid job id number. ** YES ** . # +# -pr* prog program name. . marc # +# -v* y|n do or do not verify inputs. . yes # +# -q* s|l|v|b|f batch queue name or background, . short # +# foreground. # +# -b* as alternative to option -q* # +# # +# ( batch queues only : # +# -pq* intra queue priority. . . # +# -at DATE/TIME delay start of job. . . # +# format : January,1,1990,12:31 # +# or : today,5pm # +# -cpu* secs job CPU limit . . ) # +# # +# -r* rid restart file job id. . . # +# -si* sid substructure file id. . . # +# -pi* post post file job id. . . # +# -de* did defaults file . no # +# -vf vid viewfactor . no # +# # +# -u* user user subroutine. . . # +# -obj obj user objects or libraries. . . # +# -sa* y|n do or do not save load module. . no # +# -autorst auto restart flag for auto forge . no # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo selects i4 or i8 version # +# default: i4 or via defaults file run_marc_defaults # +# the -mo option will override # +# -mpi selects MPI version # +# each platform has a default MPI version and some # +# have an alternative version. see the include file # +# for the respective platform # +# MPI_DEFAULT defines the default MPI version # +# MPI_OTHER defines versions one can switch to # +# -dcoup for contact decoupling # +# currently not supported # +# -dir directory where the job i/o should take place. # +# defaults to current directory. # +# -sdir directory where scratch files are created # +# defaults to current directory. # +# # +# -alloc only perform memory allocation test, no analysis # +# -list y only list options in the input file, no analysis # +# -fe num set feature number "num" for the run. only one allowed # +# -dytran flag to switch from Dytran to Marc # +# dytran = 0, program will run w/o Marc-Dytran Switch # +# = 1, program will restart Marc after Dytran run # +# >= 2, Not supported yet. # +# currently not supported # +# -ou force analysis to use out-of-core control # +# =0, not used # +# =1, element storage out-of-core # +# -dll run marc using shared library libmarc.so and exe_marc # +# =1, used # +# =2, do not free streaming input memory # +# =3, run with marc input deck # +# -trk run marc for post-tracking # +# -gpuid run marc using GPGPU capability # +# specify gpuid on to be used in the analysis. Multiple # +# IDs may be assigned for DDM runs. # +# Separate a list of IDs with a colon. Each DMP # +# process will be assigned a GPU ID in round robin fastion# +# = 0 # +# = 0:1 etc... # +# # +# where parallel options are: # +# -------------------------- # +# # +# itree, host, and comp options are available for the domain # +# decomposition only. # +# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # +# # +# # +# -nprocd number of domains. # +# defaults to single domain solution. # +# -nprocds number of domains if single input file. # +# defaults to single domain solution. # +# -nps same as -nprocds. # +# -nsolver number of solver tasks for solver types 12 and 13 # +# these are distributed tasks operating via MPI # +# -nthread_elem number of threads for element assembly and recovery # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by element assembly # +# recovery. # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_elem option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_elem specified. # +# -nthread_solver number of threads for solver types 6, 8, and 11 # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by 6, 8, and 11 # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_solver option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_solver specified. # +# -nthread Same as -nthread_solver. # +# -itree message passing tree type for domain decomposition. # +# for debugging purposes; should not normally be used. # +# -host hostfile name for distributed execution on network. # +# defaults to no hostfile, unless jobid.defhost exists. # +# if jobid.defhost exists, only -np(s) necessary # +# -comp* y|n to be used with user routines on a network of # +# incompatible machines. # +# if set to no, a separate executable will be created # +# for each machine on the network. # +# if set to yes, the executable located on the machine # +# from which marc is started will be used on all machines.# +# defaults to no if O/S versions different on machines. # +# # +# -ci y|n copy input files to remote hosts (default: yes) # +# if "yes", input files are automatically copied to # +# remote hosts for a network run if necessary. # +# -cr y|n copy post files from remote hosts (default: yes) # +# if "yes", post files are automatically copied back from # +# remote hosts for a network run if necessary. # +############################################################################## +# set DIR to the directory in which this script is +REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" +DIR=`dirname $REALCOM` +# make sure DIR has an absolute path +case $DIR in + \/*) + ;; + *) + DIR=`pwd`/$DIR + ;; +esac +DIRSCRIPT=$DIR +AWK=awk +ARCH=`uname -a | cut -f 1 -d " "` +# Sun has a bad awk, use nawk instead +if test $ARCH = "SunOS" +then + AWK=nawk +fi +BASENAME=basename +# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists +if test $ARCH = "SunOS" +then + if test -x /usr/ucb/basename + then + BASENAME=/usr/ucb/basename + fi +fi + +# echo command line in the case of ECHO_COMMAND is true +if test "$ECHO_COMMAND" = true ; then + echo command "$0" "$@" +fi + +# +# "mode" selects version, i4 or i8 +# default is i4 +# this can be changed by a file run_marc_defaults +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MODE i8 +# it can also be set by the environmental variable MARC_INTEGER_SIZE +# and by the command line option "-mo" +# +mode= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + mode=i4 + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -f $HOME/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + mode=i4 + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -n "$MARC_INTEGER_SIZE" ; then + mode=$MARC_INTEGER_SIZE +fi +if test -z "$mode" ; then + mode=i8 +fi +case $mode in + i4) + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "error, version mode must be i4 or i8" + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i4 or i8" + echo " " + echo " use -mo i4 or -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + setmode=true + fi + if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + fi + if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +done + +# set to i4 version for 32 bit Linux +if test "`uname -s`" = "Linux"; then + if test "`uname -m`" = "i686"; then + mode=i4 + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +fi + + +. "$DIR/getarch" + +. $MARC_INCLUDE +# + +# +# Dynamically determine the echo syntax +# + +case "`echo '\c'`" in + '\c') + ECHO='echo -n' + ECHOTXT=' ' + ;; + *) + ECHO='echo' + ECHOTXT=' \c' + ;; +esac + +# +# Variables for the MARC environment +# + +PRODUCT="Marc" +EXITMSG=$MARC_TOOLS/MESSAGES +export EXITMSG +FLEXDIR=$DIR/../flexlm/licenses +export FLEXDIR +TIMCHK=3600 +export TIMCHK +BINDIR=$MARC_BIN +export BINDIR +AFMATDAT=$MARC_RUNTIME/AF_flowmat/ +export AFMATDAT +# +# define directory path to global unified material database +# +MATFILE= +export MATFILE + +# +# define memory limit +# first set to MEMLIMIT from include +# -ml option overrules if specified +memlimit=$MEMLIMIT +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +# +if test $MACHINENAME = "HP" +then + SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH + export SHLIB_PATH +fi +# the one for IBM is defined futher down + +LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH +LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH +export LD_LIBRARY_PATH +export LD_LIBRARY64_PATH +export LD_LIBRARYN32_PATH + +atexit() { +kill -15 $$ +# +if test $MPITYPE = "myrinet" +then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi +fi +} + +trap "atexit" 2 + +# +# defaults +# + +prog=marc +exefile=marc +jid= +rid= +pid= +sid= +did= +vid= +user= +usersubname= +objs= +qid=background +cpu= +priority= +att= +trk= +verify=yes +prgsav=no +rmdll=no +cpdll=no +progdll= +pathdll= +error= +nprocd=0 +nprocdddm=1 +nprocdddmprint= +icreated=0 +nprocdarg= +nsolver=0 +nsolverarg=-ns +if test $nprocds +then + if test $nprocds -gt 1 + then + nprocdddm=$nprocds + nprocdddmprint=$nprocds + icreated=1 + nprocdarg=-nprocds + fi +fi +ntprint=0 +nt=-1 +nte=-1 +nts=-1 +ntarg=-nt +ntearg=-nte +ntsarg=-nts +nteprint= +ntsprint= +gpuids= +nauto=0 +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +link= +trkrun=0 +DIRJOB=`pwd` +DIRSCR=$DIRJOB +DIRSCRSET= +autoforge=0 +dotdat=.dat +dotdefhost=.defhost +host= +numhost= +mfile= +userhost= +makebdf= +cpinput=yes +cpresults=yes +marcdll=libmarc.$EXT_DLL +# define hostname and strip off extensions (alpha.aaa.com) +thishost=`hostname` +thishost=${thishost%%.*} +compatible=unknown +numfield=1 +justlist= +feature= +mpioption=false +MDSRCLIB=$MARC_LIB/mdsrc.a +# +# check run_marc_defaults file for default MPI setting +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MPI +# +value= +file= +if test -f $DIRSCRIPT/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$DIRSCRIPT/run_marc_defaults + fi +fi +if test -f $HOME/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$HOME/run_marc_defaults + fi +fi +if test -n "$value"; then + MARC_MPITYPE=$value + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + echo " " + echo " error, incorrect option for MARC_MPI" + echo " defined in $file: $MARC_MPITYPE" + echo " valid options: $MPI_DEFAULT $MPI_OTHER" + echo " " + exit + fi + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + fi +fi +# +# +# allow scratch directory to be specified with environmental variable +# MARCSCRATCH +if test $MARCSCRATCH +then + if test -d $MARCSCRATCH + then + DIRSCR=$MARCSCRATCH + else + echo "error, scratch directory '$MARCSCRATCH'" + echo " specified via environmental variable MARCSCRATCH does not exist" + exit + fi +fi +# +############################################################################## +# parse input - arguments always come in pairs # +############################################################################## + +arg=$1 +if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + shift + arg=$1 +fi +while [ -n "$arg" ] +do + shift + value=$1 + case $arg in + -al* | -AL*) + LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + $MARC_BIN/marc -alloc 1 + exit + ;; + -li* | -LI*) + justlist=yes + ;; + -fe* | -FE*) + feature=$value + ;; + -pr* | -PR*) + if test `dirname $value` = '.' + then + prog=`$BASENAME $value .marc` + progdll=`$BASENAME $value` + else + prog=`dirname $value`/`$BASENAME $value .marc` + progdll=`dirname $value`/`$BASENAME $value` + fi + prdir=`dirname $value` + case $prdir in + \/*) + ;; + *) + prog=`pwd`/$prdir/$prog + ;; + esac + ;; + -j* | -J*) + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + ;; + -r* | -R*) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + -si* | -SI*) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + -pi* | -PI*) + if test -f $value.t19 + then + pid=`$BASENAME $value .t19` + else + pid=`$BASENAME $value .t16` + fi + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + -bdf | -BDF) + makebdf=1 + ;; + -de* | -DE*) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + -vf | -VF) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + -u* | -U*) + user=`dirname $value`/`$BASENAME $value .f` + basefile=`$BASENAME $value` + if test ${basefile##*.} = F + then + user=`dirname $value`/`$BASENAME $value .F` + fi + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + if test -f $user.f + then + usersubname=$user.f + elif test -f $user.F + then + usersubname=$user.F + else + usersubname=$user + fi + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -at | -AT) + att=$value + ;; + -cpu* | -CPU*) + cpu=$value + ;; + -pq | -PQ*) + priority=$value + ;; + -v* | -V*) + verify=$value + ;; + -sa* | -SA*) + prgsav=$value + ;; + -np* | -NP*) + nprocdddm=$value + nprocdddmprint=$value + case $arg in + -nps* | -NPS* | -nprocds* | -NPROCDS*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + case $arg in + -np | -NP | -nprocd | -NPROCD) + icreated=0 + nprocdarg=-nprocd + ;; + esac + ;; + -ns* | -NS*) + nsolver=$value + ;; + -nt* | -NT*) + case $arg in + -nte | -NTE | -nthread_e* | -NTHREAD_E*) + nte=$value + ;; + esac + case $arg in + -nts | -NTS | -nthread_s* | -NTHREAD_S*) + nts=$value + ;; + esac + case $arg in + -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) + nt=$value + ;; + esac + ;; + -gp* | -GP*) + gpuids=$value + ;; + -it* | -IT*) + itree=$value + ;; + -iam | -IAM) + iam=$value + ;; + -au* | -AU*) + nauto=$value + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -me | -ME ) + mesh=$value + ;; + -ml | -ML ) + memlimit=$value + ;; + -mo | -MO ) + ;; + -mpi | -MPI ) + mpioption=true + MARC_MPITYPE=$value + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + fi + fi + ;; + -dir* | -DIR*) + DIRJOB=$value + case $DIRJOB in + \/*) + ;; + *) + DIRJOB=`pwd`/$DIRJOB + ;; + esac + if test -z "$DIRSCRSET" + then + DIRSCR=$DIRJOB + fi + ;; + -sd* | -SD*) + DIRSCR=$value + DIRSCRSET=yes + case $DIRSCR in + \/*) + ;; + *) + DIRSCR=`pwd`/$DIRSCR + ;; + esac + ;; + -ho* | -HO*) + host=$value + ;; + -co* | -CO*) + compatible=$value + ;; + -ci* | -CI*) + cpinput=$value + ;; + -cr* | -CR*) + cpresults=$value + ;; + *) + error="$error +$arg: invalid option" + break + ;; + esac + case $value in + -*) + error="$error +$arg: invalid name $value" + break + ;; + esac + shift + arg=$1 + if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + shift + arg=$1 + fi +done +argc=`expr $# % 2` +if test $argc -eq 1 +then +# +# odd number of arguments +# + error="$error +argument list incomplete" +fi + +if test $nprocdddm -gt 0 +then +nprocd=$nprocdddm +fi + +if test $nsolver -gt 0 +then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi +fi +# Set defaults +if test $nt -eq -1 +then +nt=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nt -lt 0 +then +nt=0 +fi +if test $nte -eq -1 +then +nte=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nte -lt 0 +then +nte=0 +fi +if test $nts -eq -1 +then +nts=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nts -lt 0 +then +nts=0 +fi +# +# set number of element loop threads +# +ntprint=$nt +nteprint=$nte +# copy from -nprocd[s] +if test $nprocdddm -gt 1 +then + nteprint=$nprocdddm +fi +# override with -nthread_elem option +if test $nte -ne 0 +then +nteprint=$nte +fi +# check for minimum 1 threads per processes for DDM +if test $nprocdddm -gt 1 +then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi +fi +nte=$nteprint +# +# set number of Solver threads +# +ntsprint=$nts +# copy from -nthread or -nprocd[s] +if test $ntprint -ne 0 +then + ntsprint=$ntprint +else + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +fi +# override with -nthread_solver option +if test $nts -ne 0 +then + ntsprint=$nts +fi +# check for minimum 1 threads per solver process. +if test $nsolver -lt $nprocdddm +then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi +else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi +fi +if test $ntsprint -eq 1 +then + set ntsprint=0 +fi +nts=$ntsprint + +# set stack size for multi-threading. +export KMP_MONITOR_STACKSIZE=7M +export OMP_STACKSIZE=7M + +# +# deprecate -nthread option at arugment of marc +nt=0 +# Reset nprocdddmm, nsolver and threads if not given. +if test $nprocdddm -eq 0 +then + nprocdarg= +fi +if test $nprocdddm -eq 0 +then + nprocdddmprint= +fi +if test $nprocdddm -eq 0 +then + nprocdddm= +fi + +if test $nsolver -eq 0 +then + nsolverprint= +fi +# end of threads setting. +gpuoption= +if test "$gpuids" = "" ; then + gpuoption= +else + gpuoption="-gp $gpuids" +fi + +if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH +else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH +fi +# Linux 64 + HPMPI, Below code is taken from include_linux64 +if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" +then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +fi + +if test $nprocd -gt 1; then + if test -f $jid$dotdefhost; then + if test "$host" = ""; then + host=$jid$dotdefhost + fi + fi + if test -f hostfile_qa_$nprocd; then + if test "$host" = ""; then + host=hostfile_qa_$nprocd + fi + fi +fi + +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then + dotdat=.inp + fi + + if test "$progdll"; then + /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll + rmdll=yes + pathdll=yes + progdll=${progdll}_$marcdll + else + progdll=$marcdll + fi + + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + pathdll=yes + fi +fi + +############################################################################## +# check parameter validity # +############################################################################## + +while test forever; do + +# +# check for input file existence +# +if test $nprocdddm -gt 1 -a $icreated -eq 0; then + if test ! -f $DIRJID/1$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/1$jid$dotdat not accessible" + fi + fi +else + if test ! -f $DIRJID/$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/$jid$dotdat not accessible" + fi + fi +fi + if test $nprocd -gt 1; then + if test "$host" ; then + if test ! -f $host; then + error="$error +host name file $host not accessible" + fi + fi + fi + +# +# check if the job is already running in the background +# +if test -f $DIRJOB/$jid.pid; then + error="$error +job is already running (the file $jid.pid exists)" +fi + +# +# if the program name is other than marc, then +# assume that this is a program in the users local directory +# + +bd=$MARC_BIN/ + +case $prog in + marc | MARC | $exefile) + program=$exefile + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$usersubname" + then + if test ! -f $usersubname + then + error="$error +user subroutine file $usersubname not accessible" + fi + fi + if test "$objs" + then + missingobjs= + for o in $objs + do + if test ! -f "$o" + then + if test -z "$missingobjs" + then + missingobjs="$o" + else + missingobjs="$missingobjs $o" + fi + fi + done + if test -n "$missingobjs" + then + error="$error +user object/library file(s) $missingobjs not accessible" + fi + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$vid" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRVID/1$vid.vfs + then + error="$error +view factor file $DIRVID/1$vid.vfs not accessible" + fi + else + if test ! -f $DIRVID/$vid.vfs + then + error="$error +view factor file $DIRVID/$vid.vfs not accessible" + fi + fi + fi + if $mpioption + then + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" + fi + fi + ;; + *) + program=$prog.marc + case $prog in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + error="$error +program option may not be used with user subroutine" + fi + if test "$objs" + then + error="$error +program option may not be used with user objects or libraries" + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$nauto" + then + if test $nauto -gt 2 + then + error="$error +incorrect option for auto restart " + fi + fi + if test "$ndcoup" + then + if test $ndcoup -gt 3 + then + error="$error +incorrect option for contact decoupling " + fi + fi + if test "$ndytran" + then + if test $ndytran -gt 1 + then + error="$error +incorrect option for Marc-Dytran Switch " + fi + fi + if $mpioption + then + if test ! -x $MARC_BIN/$exefile + then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE " + fi + fi + ;; +esac + +############################################################################## +# check argument integrity # +############################################################################## + +if test "$jid" +then + : +else + error="$error +job id required" +fi + +if test $nprocd -gt 1 +then + if test $nauto -gt 0 + then + error="$error +cannot run DDM job with auto restart (-au) option " + fi +fi +case $qid in + S* | s*) + qid=short + ;; + L* | l*) + qid=long + ;; + V* | v*) + qid=verylong + ;; + B* | b*) + qid=background + ;; + F* | f*) + qid=foreground + ;; + A* | a*) + qid=at + ;; + *) + error="$error +bad value for queue_id option" + ;; +esac + +case $prgsav in + N* | n*) + prgsav=no + ;; + Y* | y*) + prgsav=yes + ;; + *) + error="$error +bad value for save option" + ;; +esac + +case $verify in + N* | n*) + verify=no + ;; + Y* | y*) + verify=yes + ;; + *) + error="$error +bad value for verify option" + ;; +esac + +case $nprocdddm in + -* ) + error="$error +bad value for nprocd option" + ;; +esac + +case $nt in + -* ) + error="$error +bad value for nt option" + ;; +esac + +case $itree in + -* ) + error="$error +bad value for itree option" + ;; +esac +case $iam in + -* ) + error="$error +bad value for iam option" + ;; +esac +case $compatible in + N* | n*) + compatible=no + ;; + Y* | y*) + compatible=yes + ;; + unknown) + ;; + *) + error="$error +bad value for comp option" + ;; +esac +case $cpinput in + N* | n*) + cpinput=no + ;; + Y* | y*) + cpinput=yes + ;; + *) + error="$error +bad value for copy input option" + ;; +esac +case $cpresults in + N* | n*) + cpresults=no + ;; + Y* | y*) + cpresults=yes + ;; + *) + error="$error +bad value for copy results option" + ;; +esac + +# +# check for external file to run +# +if test -f $MARC_TOOLS/run_marc_check +then + . $MARC_TOOLS/run_marc_check +fi + +# +# pick up version data from bin/VERSION if it exists +# +if test -f $MARC_BIN/VERSION; then + ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` + if test -n "$ppp" ;then + PRODUCT=$ppp + fi + ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` + if test -n "$ppp" ;then + REVISION=", Build $ppp" + fi +fi +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +deletelog=yes +if test $qid = background -a $verify = no +then +echo \ +" +$PRODUCT $REVISION $MACHINE version +----------------------------- +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $usersubname +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto " > $jid.log +deletelog=no +fi +echo \ +" +$PRODUCT $REVISION $MACHINE version +----------------------------- +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $usersubname +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto" + + +case $qid in + s* | S* | l* | L* | v* | V* ) + echo \ +"Queue priority : $priority +Queue CPU limit : $cpu +Queue start time : $att" + ;; +# * ) +# echo \ +#" " +# ;; +esac + +if test "$error" +then + if test $verify = yes + then + $ECHO "$error + +Please correct or quit(correct,quit,): $ECHOTXT" + error= + read answer + case $answer in + q* | Q*) + answer=quit + ;; + *) + answer=correct + ;; + esac + else + $ECHO "$error + $ECHOTXT" + echo " " + if test "$deletelog" = no + then + $ECHO "$error + $ECHOTXT" >> $jid.log + echo " " >> $jid.log + fi + answer=quit + fi +else + if test $verify = yes + then + $ECHO " +Are these parameters correct (yes,no,quit,)? $ECHOTXT" + read answer + case $answer in + q* | Q*) + answer=quit + ;; + y* | Y*) + answer=yes + ;; + *) + answer=no + ;; + esac + else + answer=yes + fi +fi + +case $answer in + no | correct) + +############################################################################## +# prompt for each value # +############################################################################## + + $ECHO " +Program name ($prog)? $ECHOTXT" + read value + if test "$value" + then + prog=$value + fi + $ECHO "Job ID ($jid)? $ECHOTXT" + read value + if test "$value" + then + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + fi + $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=`dirname $value`/`$BASENAME $value .f` + basefile=`$BASENAME $value` + if test ${basefile##*.} = F + then + user=`dirname $value`/`$BASENAME $value .F` + fi + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + if test -f $user.f + then + usersubname=$user.f + elif test -f $user.F + then + usersubname=$user.F + else + usersubname=$user + fi + ;; + esac + fi + $ECHO "User objects or libraries ($objs)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + objs= + ;; + *) + objs="$value" + ;; + esac + fi + $ECHO "Restart File Job ID ($rid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + rid= + ;; + *) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + esac + fi + $ECHO "Substructure File ID ($sid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + sid= + ;; + *) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + esac + fi + $ECHO "Post File Job ID ($pid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + pid= + ;; + *) + pid=$value + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + esac + fi + $ECHO "Defaults File ID ($did)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + did= + ;; + *) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + esac + fi + $ECHO "View Factor File ID ($vid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + vid= + ;; + *) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + esac + fi + $ECHO "Save generated module ($prgsav)? $ECHOTXT" + read value + if test "$value" + then + prgsav=$value + fi + $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" + read value + if test "$value" + then + nprocdddm=$value + nprocdddmprint=$value + fi + $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" + read value + if test "$value" + then + nte=$value + fi + $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" + read value + if test "$value" + then + nsolver=$value + fi + $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" + read value + if test "$value" + then + nts=$value + fi +# + if test $nprocdddm -gt 0 + then + nprocd=$nprocdddm + fi + if test $nsolver -gt 0 + then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi + fi +# Element loop threads. + if test $nte -eq -1 + then + nte=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nte -lt 0 + then + nte=0 + fi + nteprint=$nte +# Copy from ddm + if test $nprocdddm -gt 1 + then + nteprint=$nprocdddm + fi +# override with -nthread_elem option + if test $nte -ne 0 + then + nteprint=$nte + fi +# check for minimum 1 threads per processes for DDM + if test $nprocdddm -ne 0 + then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi + fi + nte=$nteprint +# Solver threads. + if test $nts -eq -1 + then + nts=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nts -lt 0 + then + nts=0 + fi + ntsprint=$nts +# Copy from ddm + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +# override with -nthread_solver option + if test $nts -ne 0 + then + ntsprint=$nts + fi +# check for minimum 1 threads per solver process. + if test $nsolver -lt $nprocdddm + then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi + else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi + fi + if test $ntsprint -eq 1 + then + set ntsprint=0 + fi + nts=$ntsprint + $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" + read value + if test "$value" + then + gpuids=$value + fi + if test "$gpuids" = "" ; then + gpuoption= + else + gpuoption="-gp $gpuids" + fi + if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH + fi + if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + fi +# + if test $nprocd -gt 1 + then + $ECHO "Message passing type ($itree)? $ECHOTXT" + read value + if test "$value" + then + itree=$value + fi + $ECHO "Host file name ($host)? $ECHOTXT" + read value + if test "$value" + then + host=$value + fi + if test $nprocdddm -gt 1 + then + $ECHO "Single input file? $ECHOTXT" + read value + case $value in + y* | Y*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" + read value + if test "$value" + then + compatible=$value + fi + $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" + read value + if test "$value" + then + cpinput=$value + fi + $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" + read value + if test "$value" + then + cpresults=$value + fi + fi + fi + $ECHO "Run the job in the queue ($qid)? $ECHOTXT" + read value + if test "$value" + then + qid=$value + fi + case $qid in + s* | S* | l* | L* | v* | V* ) + $ECHO "Queue priority ($priority)? $ECHOTXT" + read value + if test "$value" + then + priority=$value + fi + $ECHO "Job starts at ($att)? $ECHOTXT" + read value + if test "$value" + then + att=$value + fi + $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" + read value + if test "$value" + then + cpu=$value + fi + ;; + * ) + ;; + esac + $ECHO "Auto Restart option ($nauto)? $ECHOTXT" + read value + if test "$value" + then + nauto=$value + fi + $ECHO "Run directory ($DIRJOB)? $ECHOTXT" + read value + if test "$value" + then + DIRJOB=$value + DIRSCR=$DIRJOB + fi + $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" + read value + if test "$value" + then + DIRSCR=$value + fi + ;; + quit) + exit 1 + ;; + *) + break + ;; + +esac + + if test $nt -eq -1 + then + nt=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nt -lt 0 + then + nt=0 + fi + +done +# +if test $nt -eq 0 +then + ntarg= +fi +if test $nt -eq 0 +then + ntprint= +fi +if test $nt -eq 0 +then + nt= +fi + +if test $nte -eq 0 +then + ntearg= +fi +if test $nte -eq 0 +then + nteprint= +fi +if test $nte -eq 0 +then + nte= +fi + +if test $nts -eq 0 +then + ntsarg= +fi +if test $nts -eq 0 +then + ntsprint= +fi +if test $nts -eq 0 +then + nts= +fi +# +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + pathdll=yes + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + fi + + if test "$pathdll"; then +# +# reset share lib path +# + if test $MACHINENAME = "HP" + then + SHLIB_PATH=$DIRJOB:$SHLIB_PATH + export SHLIB_PATH + fi + if test $MACHINENAME = "IBM" + then + LIBPATH=$DIRJOB:$LIBPATH + export LIBPATH + fi +# + LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH + LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH + LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH + export LD_LIBRARY_PATH + export LD_LIBRARY64_PATH + export LD_LIBRARYN32_PATH + fi +fi +# end of dllrun>0 + + +if test $program = $exefile -o $program = $prog.marc +then + +# delete the old .log file unless we run in the background +if test "$deletelog" = yes +then + /bin/rm $jid.log 2>/dev/null +else + echo + echo running the job in the background, see $jid.log + echo +fi + +# +# check if this is an autoforge or rezoning or radiation job +# +if test $nprocd -eq 1 +then + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` + if test "$line" + then + autoforge=1 + fi +fi +# +# check that jobname for restarted run is not the same +# as restart file basename +# +if test "$rid" +then + if test "$jid" = "$rid" + then + echo " " + echo "ERROR: job name of current run is the same as job name" + echo " of the restarted job" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "ERROR: job name of current run is the same as job name" >> $jid.log + echo " of the restarted job" >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi +fi + +# +# user objects/libraries used +# + + if test "$objs" + then + program="$DIRJOB/$jid.marc" + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# user subroutine used +# + + if test "$user" + then +# program=$user.marc + program=$DIRJOB/`$BASENAME $user .f`.marc + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# Special case for IBM using POE but not an SP machine +# in this case we always need a host file, also for serial jobs. +# +if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP +then + MP_HOSTFILE=${jid}.host + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $nprocd -gt 1 + then + numdom=$nprocd + while test $numdom -gt 0 + do + hostname -s >> $MP_HOSTFILE + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + else + hostname -s > $MP_HOSTFILE + fi +fi +# +# check ssh for all hosts in host file +# +if test $nprocd -gt 1 +then +if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" + then +# get host list + if test "$host" + then + line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` +# count failing hosts + counter=0 + for i in $line + do + $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n + status=$? + if [[ $status != 0 ]] ; then + counter=$((counter+1)) + if [ "$counter" = "1" ]; then + echo " " + echo " error - connection test failed... " + echo " " + fi + echo " " + echo " connection test with ssh failed on host $i" + echo " check the following command: ssh $i uname -n " + echo " " + fi + done +# echo error message and quit + if test $counter -ne 0 + then + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. Note that this is the case " + echo " also for running on a single machine. " + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. ">> $jid.log + echo " The ssh command must be working correctly between ">> $jid.log + echo " the computers used in the analysis. Furthermore, ">> $jid.log + echo " it must be set up such that it does not prompt the ">> $jid.log + echo " user for a password. Note that this is the case ">> $jid.log + echo " also for running on a single machine. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + else + counter=1 +# test ssh `hostname` + if test $counter -ne 0 + then + line=`hostname` + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi +# test ssh `hostname` + if test $counter -ne 0 + then + line=`hostname -s` + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi +# test ssh localhost + if test $counter -ne 0 + then + line=localhost + $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n + status=$? + if [[ $status != 0 ]] ; then + echo ssh login failed for $line machine. > /dev/null + else + counter=0 + fi + fi + if test $counter -ne 0 + then + echo " error - connection test failed... " + echo " " + echo " ssh needs to work on the machine without asking for a password." + echo " check the following command: ssh localhost uname -n" + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. Note that this is the case " + echo " also for running on a single machine. " + echo " " + if test "$deletelog" = no + then + echo " error - connection test failed... " >> $jid.log + echo " " >> $jid.log + echo " ssh needs to work on the machine without asking for a password." >> $jid.log + echo " check the following command: ssh localhost uname -n" >> $jid.log + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. " >> $jid.log + echo " The ssh command must be working correctly between " >> $jid.log + echo " the computers used in the analysis. Furthermore, " >> $jid.log + echo " it must be set up such that it does not prompt the " >> $jid.log + echo " user for a password. Note that this is the case " >> $jid.log + echo " also for running on a single machine. " >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + echo $line $nprocd > $jid.hosts + host=$jid.hosts + fi + fi +fi +fi +# +# check correctness of host file; fix for user sub +# + if test $nprocd -gt 1 + then + +# construct the path name to the executable (execpath) + execpath=$MARC_BIN/$exefile + usersub=0 + if test $program = $prog.marc + then + execpath=$prog.marc + usersub=1 + fi + if test "$objs" + then + execpath="$DIRJOB/$jid.marc" + usersub=1 + fi + if test "$user" + then + execpath=$DIRJOB/`$BASENAME $user .f`.marc + usersub=1 + fi + export execpath + execname=`$BASENAME $execpath` + + if test "$host" + then + userhost=$host + case $userhost in + \/* | \.\/*) + ;; + *) + userhost=`pwd`/$userhost + ;; + esac + +# check that the number of processes specified in the hostfile is +# equal to nprocd specified by -nprocd. + numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` + if test $nprocd -ne $numproc + then + echo " " + echo "error, the number of processes specified in the host file" + echo "must be equal to the number of processes given by -nprocd/-nsolver" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, the number of processes specified in the host file" >> $jid.log + echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + +# check for Myrinet that the number of processes per host is +# less than number of available user ports, 5 +# .gmpi directory must exist in user's home directory +# and must have write permission from remote hosts + if test $MPITYPE = "myrinet" + then + numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` + if test $numproc -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes specified " + echo "in the hostfile must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes specified " >> $jid.log + echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + if test ! -d ~/.gmpi + then + echo " " + echo "error, for Myrinet a .gmpi directory must exist " + echo "under the user's home directory" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log + echo "under the user's home directory" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + homedir=`echo ~` + for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + echo " " + echo "error, for Myrinet a shared .gmpi directory must exist " + echo "under the user's home directory " + echo "with remote write permission" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log + echo "under the user's home directory " >> $jid.log + echo "with remote write permission" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + /bin/rm tmp.$$ + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + fi + fi + done + fi + fi + +# construct the host file $jid.host which is used by mpirun +# skip lines starting with # and only consider lines with more than +# one word in them. Note that the hostfile given to this script +# has two columns: the host name and the number of shared processes +# to run on this host. mpirun wants the number of _other_ +# processes to run in addition to the one being run on the machine +# on which the job is started. hence the $2-1 for fnr == 1. + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then +# HPMPI or HP hardware MPI + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ + -v mpihpspecial="$MPIHPSPECIAL" \ +'{if ( NF > 0) {\ + fnr++ ; \ + printf("-h %s -np %s",$1,$2); \ + printf(" %s",mpihpspecial); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ + if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ + }\ + }' > $jid.host +# end HPMPI or HP hardware MPI + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then +# IBM using hardware MPI (POE) + MP_HOSTFILE=$jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host +# end IBM using hardware MPI (POE) +# for Intel MPI, need to create a machinefile for DMP + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then +# Intel MPI + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + /bin/cp $host $jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Intel MPI for DMP +# for Solaris HPC 7.1, need to create a machinefile for DMP + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then +# Solaris HPC 7.1 + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Solaris HPC 7.1 for DMP +# for Myrinet, construct a configuration file in ~/.gmpi +# this must be readable by each process +# format is (hostname) (port number) for each process + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + grep -v '^#' $host | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ +{if ( NF > 0 ) \ + for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ +}' >> ~/.gmpi/$jid.host + else +# this is for mpich-1.2.5 and later, using the -pg option +# format: host nproc executable user arguments +# the arguments are added later + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s %s\n",path,user);\ + if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ + }\ + }' > $jid.host + fi +# end Myrinet + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then +# Compaq MPI via Memory Channel + grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host +# end Compaq MPI + else +# MPICH + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ + }\ + }' > $jid.host + fi +# define the variable host and host_filt +# host_filt is used for loops over hosts +# for Myrinet we need to use a filtered variant of userhost +# for others we can use $host + if test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + host=~/.gmpi/$jid.host + host_filt=$jid.host_tMp + grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt + else + host=$jid.host + host_filt=$host + fi + else + host=$jid.host + host_filt=$host + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + host_filt=$jid.mfile + fi + fi +# figure out if the machines in the hostfile are nfs mounted +# or distributed and set the variable "dirstatus" accordingly. +# only perform the check if user subroutine is used +# or a user subroutine executable is used + + numfield=1 + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + numfield=2 + fi + DIR1=$DIRJOB + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + counter=0 + echo " " + echo "checking if local or shared directories for host" + if test "$deletelog" = no + then + echo "checking if local or shared directories for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + dirstatus[$counter]="shared" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + dirstatus[$counter]="local" + /bin/rm tmp.$$ + else + if test ! -f $jid.$$ + then + dirstatus[$counter]="local" + $RSH $i /bin/rm $DIR1/$jid.$$ + else + /bin/rm $jid.$$ + fi + fi + if test -f tmp.$$ + then + /bin/rm tmp.$$ + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + echo " ${dirstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${dirstatus[$counter]}" >> $jid.log + fi + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + fi + +# figure out if this is a compatible set of machines +# unless explicitly specified with flag -comp +# only perform the check if user subroutine is used +# or a user subroutine executable is used +# Myrinet does not support heterogeneous + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + if test $compatible = "unknown" + then + thisname=$ARCH + compatible=yes + counter=0 + echo "checking if machines are compatible for host" + if test "$deletelog" = no + then + echo "checking if machines are compatible for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]="yes" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + othername=`$RSH $i uname -a | cut -f 1 -d " "` + if test $thisname != $othername + then + compatible=no + compstatus[$counter]="no" + fi + fi + echo " ${compstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${compstatus[$counter]}" >> $jid.log + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + else + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]=$compatible + fi + done + if test $compatible = "no" + then + echo "all machines assumed incompatible" + if test "$deletelog" = no + then + echo "all machines assumed incompatible" >> $jid.log + fi + else + echo "all machines compatible" + if test "$deletelog" = no + then + echo "all machines compatible" >> $jid.log + fi + fi + fi +# error out if user objects or libraries are used on incompatible machines + if test "$compatible" = "no" -a -n "$objs" + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" + if test "$deletelog" = no + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log + fi + exit 1 + fi +# modify new host file if NFS mounted heterogeneous machine + doit= + if test $program = $prog.marc + then + doit=yes + fi + if test "$user" + then + doit=yes + fi + if test "$doit" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + $AWK -v hst=$i '{fnr++ ; \ +if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ +printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} + /bin/mv $jid.host{$$} $jid.host + host=$jid.host + fi + fi + done + fi + fi # if test $program = $prog.marc -o $user -o $obj + + else # if test $host + # assume shared memory machine if no hostfile given and + # MPITYPE is set to mpich or Myrinet + # check for Myrinet that the total number of processes is + # less than number of available user ports, 5 + if test $MPITYPE = "mpich" -o $MPITYPE = "scali" + then + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + host=$jid.host + elif test $MPITYPE = "myrinet" + then + if test $nprocd -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes " + echo "must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes " >> $jid.log + echo "must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + echo `hostname` $nprocd | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ + {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ +' >> ~/.gmpi/$jid.host + host=~/.gmpi/$jid.host + else + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + + fi + fi # if test myrinet + + fi # if test $host + + fi # if test $nprocd -gt 1 + +fi # if test $program = $exefile -o $program = $prog.marc + +############################################################################## +# construct run stream (Marc only) # +############################################################################## + +# set maximum message length for ddm to a large number +# for vendor provided mpi +if test $itree -eq 0 -a $MPITYPE = hardware +then + itree=100000000 + if test $MACHINENAME = SGI + then + itree=100000001 + fi +fi +if test $itree -eq 0 -a $MPITYPE = hpmpi +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = myrinet +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = nec +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = scali +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = intelmpi +then + itree=100000000 +fi +if test $nprocdddm -lt 2 +then + nprocdarg= +else + nprocdarg="$nprocdarg $nprocdddm" +fi +if test $nsolver -eq 0 +then + nsolverarg= +else + nsolverarg="$nsolverarg $nsolver" +fi +if test $nprocdddm -lt 2 -a $nsolver -eq 0 +then +nprocd=0 +fi +if test $nprocd -gt 0 +then + if test "$host" + then + if test -z "$RUN_JOB2" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then + RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" + RUN_JOB=" -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + numhost=`uniq $jid.mfile | wc -l` + if test "$INTELMPI_VERSION" = "HYDRA" + then + RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n $numhost -r $RSH -f $jid.mfile + RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" + fi + +# intelmpi uses configfile. format: +# -host host1 -n n1 executable marcargs +# one such line per host +# collect the marcargs in RUN_JOB and construct the config file later +# collect the run stream in RUN_JOB_TMP + RUN_JOB="-jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + + + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then + RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test "$userhost" + then + RUN_JOB="$RUN_JOB -mhost $userhost" + fi + if test $MPITYPE = "scali" + then +# set default working directory to /tmp to allow +# different directory names + SCAMPI_WORKING_DIRECTORY=/tmp + export SCAMPI_WORKING_DIRECTORY + fi + else + if test -z "$RUN_JOB1" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + RUNNPROCD=$nprocd + if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" + then + RUNNPROCD= + MP_PROCS=$nprocd + export MP_PROCS + fi + if test $MPITYPE = "myrinet" + then + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + echo " " > /dev/null + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n 1 -f $jid.hosts + fi + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + fi +else + if test $nauto -gt 0 -o $ndcoup -gt 0 + then + RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else +# this is for a serial job without auto restart: + RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi +fi +if test "$rid" +then + RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" +fi +if test "$pid" +then + RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" +fi +if test "$sid" +then + RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" +fi +if test "$did" +then + RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" +fi +if test "$vid" +then + RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" +fi +if test $nauto -gt 0 +then + RUN_JOB="$RUN_JOB -autorst $nauto " +fi +if test $ndcoup -gt 0 +then + RUN_JOB="$RUN_JOB -dcoup $ndcoup " +fi +if test $ndytran -gt 0 +then + RUN_JOB="$RUN_JOB -dytran $ndytran " +fi +if test $mesh -gt 0 +then + RUN_JOB="$RUN_JOB -me $mesh " +fi +if test $noutcore -gt 0 +then + RUN_JOB="$RUN_JOB -outcore $noutcore " +fi +if test "$dllrun" -gt 0 +then + RUN_JOB="$RUN_JOB -dll $dllrun " +fi +if test "$trkrun" -gt 0 +then + RUN_JOB="$RUN_JOB -trk $trkrun " +fi +if test "$iam" +then + RUN_JOB="$RUN_JOB -iam $iam " +fi +if test "$justlist" +then + RUN_JOB="$RUN_JOB -list 1 " +fi +if test "$feature" +then + RUN_JOB="$RUN_JOB -feature $feature " +fi +if test "$memlimit" -ne 0 +then + RUN_JOB="$RUN_JOB -ml $memlimit " +fi +if test "$cpinput" +then + RUN_JOB="$RUN_JOB -ci $cpinput " +fi +if test "$cpresults" +then + RUN_JOB="$RUN_JOB -cr $cpresults " +fi +if test "$DIRSCR" != "$DIRJOB" +then + RUN_JOB="$RUN_JOB -dirscr $DIRSCR" +else + DIRSCR=$DIRJOB +fi +if test "$makebdf" +then + RUN_JOB="$RUN_JOB -bdf $makebdf " +fi +if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" +then + # append $RUN_JOB to all lines of the host file + # and set RUN_JOB + $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ + /bin/mv $host.$$ $host + RUN_JOB=$RUN_JOB_TMP +fi +if test $MPITYPE = "intelmpi" -a "$host" +then + # construct config file, append $RUN_JOB to all lines of the config file + # and set RUN_JOB + if test "$INTELMPI_VERSION" = "HYDRA" + then + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + else + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-host %s -n %s",$1,$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + fi + RUN_JOB=$RUN_JOB_TMP +fi +echo " " +echo "Final run stream value" +echo " RUNJOB="$RUN_JOB +if test "$deletelog" = no +then +echo " " >> $jid.log +echo "Final run stream value" >> $jid.log +echo " RUNJOB="$RUN_JOB >> $jid.log +fi + + +############################################################################## +# run marc using valgrind # +############################################################################## +#RUN_JOB="valgrind $RUN_JOB" +#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" +############################################################################## + + +############################################################################## +# run the requested program in a queue # +############################################################################## + +if test "$deletelog" = yes +then + echo + date +else + echo >> $jid.log + date >> $jid.log +fi +if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] +then + +/bin/rm -f $jid.runmarcscript + + +# +# compile user subroutine if present +# +if test "$link" +then + if test "$user" + then + userobj=$DIRJOB/`$BASENAME $user .f`.o + basefile=`$BASENAME $usersubname` + if test ${basefile##*.} = f + then + usersub=$DIRJOB/`$BASENAME $user .f`.F + ln -sf "$user.f" "$usersub" + else + usersub=$usersubname + fi + + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then + if test ${basefile##*.} = f + then + ln -sf "$user.f" "$usersub" + fi + if test $MACHINENAME = "CRAY" + then + $FORTRAN $usersub || \ + { + echo "$0: compile failed for $user.f" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $FORTRAN $usersub -o $userobj || \ + { + echo "$0: compile failed for $user.f" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + if test ${basefile##*.} = f + then + /bin/rm -f "$usersub" + fi + fi + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } +END4 +else + prgsav=yes +fi +/bin/rm $userobj 2>/dev/null + +# +# run marc +# + +cat >> $jid.runmarcscript << END5 + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# first remove all .out files and incremental restart files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null + /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null +fi + +if test $nprocdddm -gt 1 +then + $RUN_JOB 2>>$jid.log +else + $RUN_JOB 2>>$jid.log +fi + +if test $dllrun -eq 0; then + if test $prgsav = no + then + /bin/rm -f $bd$program 2>/dev/null + fi +else + if test $cpdll = yes; then + filename=`basename $usersubname .f` + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes + then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +END5 + + +# Submit to marc batch queue +# +if [ $qid = at ] +then +QUENAME=at +SUBMCMD= +else +# +# Submit to qsub queue +# +QUENAME=qsub +SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" +if test "$priority" +then + SUBMCMD=$SUBMCMD" -p $priority" +fi +if test "$att" +then + SUBMCMD=$SUBMCMD" -a $att" +fi +if test "$cpu" +then + SUBMCMD=$SUBMCMD" -lt $cpu" +fi + +fi +echo $QUENAME $SUBMCMD +#cat $jid.runmarcscript +$QUENAME $SUBMCMD < $jid.runmarcscript + +/bin/rm -f $jid.runmarcscript + +############################################################################## +# run the requested program in the background # +############################################################################## + +else +if test $qid = background +then + +# +# first remove all old .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi +# +# compile user subroutine if present +# +( +if test "$link" +then + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user.f $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user.f on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser.f 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user.f on host `hostname`" + fi + userobj=$DIRJOB/`$BASENAME $user .f`.o + basefile=`$BASENAME $usersubname` + if test ${basefile##*.} = f + then + usersub=$DIRJOB/`$BASENAME $user .f`.F + ln -sf "$user.f" "$usersub" + else + usersub=$usersubname + fi + if test $MACHINENAME = "CRAY" + then + $FORTRAN $usersub || \ + { + echo "$0: compile failed for $user.f" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $FORTRAN $usersub -o $userobj || \ + { + echo "$0: compile failed for $user.f" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + if test ${basefile##*.} = f + then + /bin/rm -f "$usersub" + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null + +# +# run marc + +# + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +$RUN_JOB & + +marcpid=$! +echo $marcpid > $DIRJOB/$jid.pid +wait $marcpid + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + fi + fi + fi +fi + + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=`basename $usersubname .f` + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +) 1>>$jid.log 2>&1 & + + +############################################################################## +# run the requested program in the foreground # +############################################################################## + +else + +# +# compile user subroutine if present +# +if test "$link" +then + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user.f $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user.f on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser.f 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user.f on host `hostname`" + fi + userobj=$DIRJOB/`$BASENAME $user .f`.o + basefile=`$BASENAME $usersubname` + if test ${basefile##*.} = f + then + usersub=$DIRJOB/`$BASENAME $user .f`.F + ln -sf "$user.f" "$usersub" + else + usersub=$usersubname + fi + if test $MACHINENAME = "CRAY" + then + $FORTRAN $usersub || \ + { + echo "$0: compile failed for $user.f" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $FORTRAN $usersub -o $userobj || \ + { + echo "$0: compile failed for $user.f" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + if test ${basefile##*.} = f + then + /bin/rm -f "$usersub" + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $SYSLIBS \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null + +# +# run marc +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi +# first remove all .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi + +$RUN_JOB + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + else + echo " " > /dev/null + fi + else + if test "$host" + then + mpdcleanup -a -f $jid.mfile + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.mfile 2> /dev/null + else + mpdcleanup -a -f $jid.hosts + /bin/rm $jid.hosts 2> /dev/null + fi + fi + fi +fi + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=`basename $usersubname .f` + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi + + +fi +fi diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/edit_window b/installation/mods_MarcMentat/2013.1/Mentat_bin/edit_window new file mode 100644 index 000000000..b732a7694 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/edit_window @@ -0,0 +1,5 @@ +#!/bin/sh +# This script opens a window running an editor. +# The command to invoke the editor is specified during DAMASK installation + +%EDITOR% $* \ No newline at end of file diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/edit_window.org b/installation/mods_MarcMentat/2013.1/Mentat_bin/edit_window.org new file mode 100644 index 000000000..64c0a68d0 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/edit_window.org @@ -0,0 +1,18 @@ +#!/bin/sh +# This script opens a window running an editor. The default window is an +# xterm, and the default editor is vi. These may be customized. + +dir= +for d in /usr/bin /usr/bin/X11; do + if test -x "$d/xterm"; then + dir="$d" + break + fi +done + +if test -z "$dir"; then + echo "$0: Could not find xterm" + exit 1 +fi + +"$dir/xterm" -T "vi $*" -n "vi $*" -e vi $* diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill4 b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill4 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill4 @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "usage: $0 job_name" + exit 1 +fi + +echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill5 b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill5 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill5 @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "usage: $0 job_name" + exit 1 +fi + +echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill6 b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill6 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill6 @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "usage: $0 job_name" + exit 1 +fi + +echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill7 b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill7 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill7 @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "usage: $0 job_name" + exit 1 +fi + +echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill8 b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill8 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill8 @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "usage: $0 job_name" + exit 1 +fi + +echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill9 b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill9 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill9 @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "usage: $0 job_name" + exit 1 +fi + +echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit1.org b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit1.org new file mode 100644 index 000000000..f3b2f5c1c --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit1.org @@ -0,0 +1,185 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=/msc/marc2013.1 +if test $MARCDIR1 +then + DIR=$MARCDIR1 +fi + +if test -z "$DIR"; then + REALCOM="`ls -l $0 |awk '{ print $NF; }'`" + DIRSCRIPT=`dirname $REALCOM` + case $DIRSCRIPT in + \/*) + ;; + *) + DIRSCRIPT=`pwd`/$DIRSCRIPT + ;; + esac + . $DIRSCRIPT/getarch + + DIR="$MENTAT_MARCDIR" +fi + +SRCEXT=.f +RSTEXT=.t08 +PSTEXT=.t19 +PSTEXTB=.t16 +VWFCEXT=.vfs + +slv=$1 +version=$2 +ndom_fea_solver=$3 +ndom_preprocessor=$4 +hostfile=$5 +compat=$6 +job=$7 +srcfile=$8 +srcmeth=$9 +shift 9 # cannot use $10, $11, ... +restart=$1 +postfile=$2 +viewfactorsfile=$3 +autorst=$4 +copy_datfile="-ci $5" +copy_postfile="-cr $6" +scr_dir=$7 +dcoup=$8 +assem_recov_nthread=$9 +shift 9 # cannot use $10, $11, ... +nthread=$1 +nsolver=$2 +mode=$3 +gpu=$4 + +if [ "$slv" != "" -a "$slv" != "marc" ]; then + slv="-iam sfm" +else + slv="" +fi + +if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then + nprocds="-nprocds $ndom_fea_solver" +else + nprocd="" + if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then + nprocd="-nprocd $ndom_preprocessor" + else + nprocd="" + fi +fi + +if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then + srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` + case "$srcmeth" in + -) + srcfile="-u $srcfile" + ;; + compsave) + srcfile="-u $srcfile -save y" + ;; + runsaved) + srcfile="-prog $srcfile" + ;; + esac +else + srcfile="" +fi + +if [ "$restart" != "" -a "$restart" != "-" ]; then + restart=`echo $restart | sed "s/$RSTEXT$//"` + restart="-r $restart" +else + restart="" +fi + +if [ "$postfile" != "" -a "$postfile" != "-" ]; then + postfile=`echo $postfile | sed "s/$PSTEXT$//"` + postfile=`echo $postfile | sed "s/$PSTEXTB$//"` + postfile="-pid $postfile" +else + postfile="" +fi + +if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then + viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` + viewfactorsfile="-vf $viewfactorsfile" +else + viewfactorsfile="" +fi + +if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then + hostfile="-ho $hostfile" +else + hostfile="" +fi + +if [ "$compat" != "" -a "$compat" != "-" ]; then + compat="-co $compat" +else + compat="" +fi + +if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then + scr_dir="-sd $scr_dir" +else + scr_dir="" +fi + +if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then + dcoup="-dcoup $dcoup" +else + dcoup="" +fi + +if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then + assem_recov_nthread="-nthread_elem $assem_recov_nthread" +else + assem_recov_nthread="" +fi + +if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then + nthread="-nthread $nthread" +else + nthread="" +fi + +if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then + nsolver="-nsolver $nsolver" +else + nsolver="" +fi + +case "$mode" in + 4) mode="-mo i4" ;; + 8) mode="-mo i8" ;; + *) mode= ;; +esac + +if [ "$gpu" != "" -a "$gpu" != "-" ]; then + gpu="-gpu $gpu" +else + gpu="" +fi + +rm -f $job.cnt +rm -f $job.sts +rm -f $job.out +rm -f $job.log + +# To prevent a mismatch with the python version used by the solver +# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH +# unset environment variables PYTHONHOME and PYTHONPATH +unset PYTHONHOME +unset PYTHONPATH + +"${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 +sleep 1 +exit 0 diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit4 b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit4 new file mode 100644 index 000000000..8d985d09a --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit4 @@ -0,0 +1,186 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc%VERSION% +if test $MARCDIR1 +then + DIR=$MARCDIR1 +fi + +if test -z "$DIR"; then + REALCOM="`ls -l $0 |awk '{ print $NF; }'`" + DIRSCRIPT=`dirname $REALCOM` + case $DIRSCRIPT in + \/*) + ;; + *) + DIRSCRIPT=`pwd`/$DIRSCRIPT + ;; + esac + . $DIRSCRIPT/getarch + + DIR="$MENTAT_MARCDIR" +fi + +SRCEXT=.f +RSTEXT=.t08 +PSTEXT=.t19 +PSTEXTB=.t16 +VWFCEXT=.vfs + +slv=$1 +version=$2 +ndom_fea_solver=$3 +ndom_preprocessor=$4 +hostfile=$5 +compat=$6 +job=$7 +srcfile=$8 +srcmeth=$9 +shift 9 # cannot use $10, $11, ... +restart=$1 +postfile=$2 +viewfactorsfile=$3 +autorst=$4 +copy_datfile="-ci $5" +copy_postfile="-cr $6" +scr_dir=$7 +dcoup=$8 +assem_recov_nthread=$9 +shift 9 # cannot use $10, $11, ... +nthread=$1 +nsolver=$2 +mode=$3 +gpu=$4 + +if [ "$slv" != "" -a "$slv" != "marc" ]; then + slv="-iam sfm" +else + slv="" +fi + +if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then + nprocds="-nprocds $ndom_fea_solver" +else + nprocd="" + if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then + nprocd="-nprocd $ndom_preprocessor" + else + nprocd="" + fi +fi + +if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then +# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` + case "$srcmeth" in + -) + srcfile="-u $srcfile" + ;; + compsave) + srcfile="-u $srcfile -save y" + ;; + runsaved) + srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +else + srcfile="" +fi + +if [ "$restart" != "" -a "$restart" != "-" ]; then + restart=`echo $restart | sed "s/$RSTEXT$//"` + restart="-r $restart" +else + restart="" +fi + +if [ "$postfile" != "" -a "$postfile" != "-" ]; then + postfile=`echo $postfile | sed "s/$PSTEXT$//"` + postfile=`echo $postfile | sed "s/$PSTEXTB$//"` + postfile="-pid $postfile" +else + postfile="" +fi + +if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then + viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` + viewfactorsfile="-vf $viewfactorsfile" +else + viewfactorsfile="" +fi + +if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then + hostfile="-ho $hostfile" +else + hostfile="" +fi + +if [ "$compat" != "" -a "$compat" != "-" ]; then + compat="-co $compat" +else + compat="" +fi + +if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then + scr_dir="-sd $scr_dir" +else + scr_dir="" +fi + +if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then + dcoup="-dcoup $dcoup" +else + dcoup="" +fi + +if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then + assem_recov_nthread="-nthread_elem $assem_recov_nthread" +else + assem_recov_nthread="" +fi + +if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then + nthread="-nthread $nthread" +else + nthread="" +fi + +if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then + nsolver="-nsolver $nsolver" +else + nsolver="" +fi + +case "$mode" in + 4) mode="-mo i4" ;; + 8) mode="-mo i8" ;; + *) mode= ;; +esac + +if [ "$gpu" != "" -a "$gpu" != "-" ]; then + gpu="-gpu $gpu" +else + gpu="" +fi + +rm -f $job.cnt +rm -f $job.sts +rm -f $job.out +rm -f $job.log + +# To prevent a mismatch with the python version used by the solver +# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH +# unset environment variables PYTHONHOME and PYTHONPATH +unset PYTHONHOME +unset PYTHONPATH + +"${DIR}/tools/run_damask_hmp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 +sleep 1 +exit 0 diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit5 b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit5 new file mode 100644 index 000000000..f78ef9511 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit5 @@ -0,0 +1,186 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc%VERSION% +if test $MARCDIR1 +then + DIR=$MARCDIR1 +fi + +if test -z "$DIR"; then + REALCOM="`ls -l $0 |awk '{ print $NF; }'`" + DIRSCRIPT=`dirname $REALCOM` + case $DIRSCRIPT in + \/*) + ;; + *) + DIRSCRIPT=`pwd`/$DIRSCRIPT + ;; + esac + . $DIRSCRIPT/getarch + + DIR="$MENTAT_MARCDIR" +fi + +SRCEXT=.f +RSTEXT=.t08 +PSTEXT=.t19 +PSTEXTB=.t16 +VWFCEXT=.vfs + +slv=$1 +version=$2 +ndom_fea_solver=$3 +ndom_preprocessor=$4 +hostfile=$5 +compat=$6 +job=$7 +srcfile=$8 +srcmeth=$9 +shift 9 # cannot use $10, $11, ... +restart=$1 +postfile=$2 +viewfactorsfile=$3 +autorst=$4 +copy_datfile="-ci $5" +copy_postfile="-cr $6" +scr_dir=$7 +dcoup=$8 +assem_recov_nthread=$9 +shift 9 # cannot use $10, $11, ... +nthread=$1 +nsolver=$2 +mode=$3 +gpu=$4 + +if [ "$slv" != "" -a "$slv" != "marc" ]; then + slv="-iam sfm" +else + slv="" +fi + +if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then + nprocds="-nprocds $ndom_fea_solver" +else + nprocd="" + if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then + nprocd="-nprocd $ndom_preprocessor" + else + nprocd="" + fi +fi + +if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then +# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` + case "$srcmeth" in + -) + srcfile="-u $srcfile" + ;; + compsave) + srcfile="-u $srcfile -save y" + ;; + runsaved) + srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +else + srcfile="" +fi + +if [ "$restart" != "" -a "$restart" != "-" ]; then + restart=`echo $restart | sed "s/$RSTEXT$//"` + restart="-r $restart" +else + restart="" +fi + +if [ "$postfile" != "" -a "$postfile" != "-" ]; then + postfile=`echo $postfile | sed "s/$PSTEXT$//"` + postfile=`echo $postfile | sed "s/$PSTEXTB$//"` + postfile="-pid $postfile" +else + postfile="" +fi + +if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then + viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` + viewfactorsfile="-vf $viewfactorsfile" +else + viewfactorsfile="" +fi + +if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then + hostfile="-ho $hostfile" +else + hostfile="" +fi + +if [ "$compat" != "" -a "$compat" != "-" ]; then + compat="-co $compat" +else + compat="" +fi + +if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then + scr_dir="-sd $scr_dir" +else + scr_dir="" +fi + +if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then + dcoup="-dcoup $dcoup" +else + dcoup="" +fi + +if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then + assem_recov_nthread="-nthread_elem $assem_recov_nthread" +else + assem_recov_nthread="" +fi + +if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then + nthread="-nthread $nthread" +else + nthread="" +fi + +if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then + nsolver="-nsolver $nsolver" +else + nsolver="" +fi + +case "$mode" in + 4) mode="-mo i4" ;; + 8) mode="-mo i8" ;; + *) mode= ;; +esac + +if [ "$gpu" != "" -a "$gpu" != "-" ]; then + gpu="-gpu $gpu" +else + gpu="" +fi + +rm -f $job.cnt +rm -f $job.sts +rm -f $job.out +rm -f $job.log + +# To prevent a mismatch with the python version used by the solver +# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH +# unset environment variables PYTHONHOME and PYTHONPATH +unset PYTHONHOME +unset PYTHONPATH + +"${DIR}/tools/run_damask_mp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 +sleep 1 +exit 0 diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit6 b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit6 new file mode 100644 index 000000000..058a00aa1 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit6 @@ -0,0 +1,186 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc%VERSION% +if test $MARCDIR1 +then + DIR=$MARCDIR1 +fi + +if test -z "$DIR"; then + REALCOM="`ls -l $0 |awk '{ print $NF; }'`" + DIRSCRIPT=`dirname $REALCOM` + case $DIRSCRIPT in + \/*) + ;; + *) + DIRSCRIPT=`pwd`/$DIRSCRIPT + ;; + esac + . $DIRSCRIPT/getarch + + DIR="$MENTAT_MARCDIR" +fi + +SRCEXT=.f +RSTEXT=.t08 +PSTEXT=.t19 +PSTEXTB=.t16 +VWFCEXT=.vfs + +slv=$1 +version=$2 +ndom_fea_solver=$3 +ndom_preprocessor=$4 +hostfile=$5 +compat=$6 +job=$7 +srcfile=$8 +srcmeth=$9 +shift 9 # cannot use $10, $11, ... +restart=$1 +postfile=$2 +viewfactorsfile=$3 +autorst=$4 +copy_datfile="-ci $5" +copy_postfile="-cr $6" +scr_dir=$7 +dcoup=$8 +assem_recov_nthread=$9 +shift 9 # cannot use $10, $11, ... +nthread=$1 +nsolver=$2 +mode=$3 +gpu=$4 + +if [ "$slv" != "" -a "$slv" != "marc" ]; then + slv="-iam sfm" +else + slv="" +fi + +if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then + nprocds="-nprocds $ndom_fea_solver" +else + nprocd="" + if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then + nprocd="-nprocd $ndom_preprocessor" + else + nprocd="" + fi +fi + +if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then +# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` + case "$srcmeth" in + -) + srcfile="-u $srcfile" + ;; + compsave) + srcfile="-u $srcfile -save y" + ;; + runsaved) + srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +else + srcfile="" +fi + +if [ "$restart" != "" -a "$restart" != "-" ]; then + restart=`echo $restart | sed "s/$RSTEXT$//"` + restart="-r $restart" +else + restart="" +fi + +if [ "$postfile" != "" -a "$postfile" != "-" ]; then + postfile=`echo $postfile | sed "s/$PSTEXT$//"` + postfile=`echo $postfile | sed "s/$PSTEXTB$//"` + postfile="-pid $postfile" +else + postfile="" +fi + +if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then + viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` + viewfactorsfile="-vf $viewfactorsfile" +else + viewfactorsfile="" +fi + +if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then + hostfile="-ho $hostfile" +else + hostfile="" +fi + +if [ "$compat" != "" -a "$compat" != "-" ]; then + compat="-co $compat" +else + compat="" +fi + +if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then + scr_dir="-sd $scr_dir" +else + scr_dir="" +fi + +if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then + dcoup="-dcoup $dcoup" +else + dcoup="" +fi + +if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then + assem_recov_nthread="-nthread_elem $assem_recov_nthread" +else + assem_recov_nthread="" +fi + +if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then + nthread="-nthread $nthread" +else + nthread="" +fi + +if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then + nsolver="-nsolver $nsolver" +else + nsolver="" +fi + +case "$mode" in + 4) mode="-mo i4" ;; + 8) mode="-mo i8" ;; + *) mode= ;; +esac + +if [ "$gpu" != "" -a "$gpu" != "-" ]; then + gpu="-gpu $gpu" +else + gpu="" +fi + +rm -f $job.cnt +rm -f $job.sts +rm -f $job.out +rm -f $job.log + +# To prevent a mismatch with the python version used by the solver +# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH +# unset environment variables PYTHONHOME and PYTHONPATH +unset PYTHONHOME +unset PYTHONPATH + +"${DIR}/tools/run_damask_lmp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 +sleep 1 +exit 0 diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit7 b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit7 new file mode 100644 index 000000000..59e2b74e3 --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit7 @@ -0,0 +1,186 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc%VERSION% +if test $MARCDIR1 +then + DIR=$MARCDIR1 +fi + +if test -z "$DIR"; then + REALCOM="`ls -l $0 |awk '{ print $NF; }'`" + DIRSCRIPT=`dirname $REALCOM` + case $DIRSCRIPT in + \/*) + ;; + *) + DIRSCRIPT=`pwd`/$DIRSCRIPT + ;; + esac + . $DIRSCRIPT/getarch + + DIR="$MENTAT_MARCDIR" +fi + +SRCEXT=.f +RSTEXT=.t08 +PSTEXT=.t19 +PSTEXTB=.t16 +VWFCEXT=.vfs + +slv=$1 +version=$2 +ndom_fea_solver=$3 +ndom_preprocessor=$4 +hostfile=$5 +compat=$6 +job=$7 +srcfile=$8 +srcmeth=$9 +shift 9 # cannot use $10, $11, ... +restart=$1 +postfile=$2 +viewfactorsfile=$3 +autorst=$4 +copy_datfile="-ci $5" +copy_postfile="-cr $6" +scr_dir=$7 +dcoup=$8 +assem_recov_nthread=$9 +shift 9 # cannot use $10, $11, ... +nthread=$1 +nsolver=$2 +mode=$3 +gpu=$4 + +if [ "$slv" != "" -a "$slv" != "marc" ]; then + slv="-iam sfm" +else + slv="" +fi + +if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then + nprocds="-nprocds $ndom_fea_solver" +else + nprocd="" + if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then + nprocd="-nprocd $ndom_preprocessor" + else + nprocd="" + fi +fi + +if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then +# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` + case "$srcmeth" in + -) + srcfile="-u $srcfile" + ;; + compsave) + srcfile="-u $srcfile -save y" + ;; + runsaved) + srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +else + srcfile="" +fi + +if [ "$restart" != "" -a "$restart" != "-" ]; then + restart=`echo $restart | sed "s/$RSTEXT$//"` + restart="-r $restart" +else + restart="" +fi + +if [ "$postfile" != "" -a "$postfile" != "-" ]; then + postfile=`echo $postfile | sed "s/$PSTEXT$//"` + postfile=`echo $postfile | sed "s/$PSTEXTB$//"` + postfile="-pid $postfile" +else + postfile="" +fi + +if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then + viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` + viewfactorsfile="-vf $viewfactorsfile" +else + viewfactorsfile="" +fi + +if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then + hostfile="-ho $hostfile" +else + hostfile="" +fi + +if [ "$compat" != "" -a "$compat" != "-" ]; then + compat="-co $compat" +else + compat="" +fi + +if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then + scr_dir="-sd $scr_dir" +else + scr_dir="" +fi + +if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then + dcoup="-dcoup $dcoup" +else + dcoup="" +fi + +if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then + assem_recov_nthread="-nthread_elem $assem_recov_nthread" +else + assem_recov_nthread="" +fi + +if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then + nthread="-nthread $nthread" +else + nthread="" +fi + +if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then + nsolver="-nsolver $nsolver" +else + nsolver="" +fi + +case "$mode" in + 4) mode="-mo i4" ;; + 8) mode="-mo i8" ;; + *) mode= ;; +esac + +if [ "$gpu" != "" -a "$gpu" != "-" ]; then + gpu="-gpu $gpu" +else + gpu="" +fi + +rm -f $job.cnt +rm -f $job.sts +rm -f $job.out +rm -f $job.log + +# To prevent a mismatch with the python version used by the solver +# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH +# unset environment variables PYTHONHOME and PYTHONPATH +unset PYTHONHOME +unset PYTHONPATH + +"${DIR}/tools/run_damask_h" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 +sleep 1 +exit 0 diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit8 b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit8 new file mode 100644 index 000000000..f8fe07a7d --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit8 @@ -0,0 +1,186 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc%VERSION% +if test $MARCDIR1 +then + DIR=$MARCDIR1 +fi + +if test -z "$DIR"; then + REALCOM="`ls -l $0 |awk '{ print $NF; }'`" + DIRSCRIPT=`dirname $REALCOM` + case $DIRSCRIPT in + \/*) + ;; + *) + DIRSCRIPT=`pwd`/$DIRSCRIPT + ;; + esac + . $DIRSCRIPT/getarch + + DIR="$MENTAT_MARCDIR" +fi + +SRCEXT=.f +RSTEXT=.t08 +PSTEXT=.t19 +PSTEXTB=.t16 +VWFCEXT=.vfs + +slv=$1 +version=$2 +ndom_fea_solver=$3 +ndom_preprocessor=$4 +hostfile=$5 +compat=$6 +job=$7 +srcfile=$8 +srcmeth=$9 +shift 9 # cannot use $10, $11, ... +restart=$1 +postfile=$2 +viewfactorsfile=$3 +autorst=$4 +copy_datfile="-ci $5" +copy_postfile="-cr $6" +scr_dir=$7 +dcoup=$8 +assem_recov_nthread=$9 +shift 9 # cannot use $10, $11, ... +nthread=$1 +nsolver=$2 +mode=$3 +gpu=$4 + +if [ "$slv" != "" -a "$slv" != "marc" ]; then + slv="-iam sfm" +else + slv="" +fi + +if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then + nprocds="-nprocds $ndom_fea_solver" +else + nprocd="" + if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then + nprocd="-nprocd $ndom_preprocessor" + else + nprocd="" + fi +fi + +if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then +# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` + case "$srcmeth" in + -) + srcfile="-u $srcfile" + ;; + compsave) + srcfile="-u $srcfile -save y" + ;; + runsaved) + srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +else + srcfile="" +fi + +if [ "$restart" != "" -a "$restart" != "-" ]; then + restart=`echo $restart | sed "s/$RSTEXT$//"` + restart="-r $restart" +else + restart="" +fi + +if [ "$postfile" != "" -a "$postfile" != "-" ]; then + postfile=`echo $postfile | sed "s/$PSTEXT$//"` + postfile=`echo $postfile | sed "s/$PSTEXTB$//"` + postfile="-pid $postfile" +else + postfile="" +fi + +if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then + viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` + viewfactorsfile="-vf $viewfactorsfile" +else + viewfactorsfile="" +fi + +if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then + hostfile="-ho $hostfile" +else + hostfile="" +fi + +if [ "$compat" != "" -a "$compat" != "-" ]; then + compat="-co $compat" +else + compat="" +fi + +if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then + scr_dir="-sd $scr_dir" +else + scr_dir="" +fi + +if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then + dcoup="-dcoup $dcoup" +else + dcoup="" +fi + +if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then + assem_recov_nthread="-nthread_elem $assem_recov_nthread" +else + assem_recov_nthread="" +fi + +if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then + nthread="-nthread $nthread" +else + nthread="" +fi + +if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then + nsolver="-nsolver $nsolver" +else + nsolver="" +fi + +case "$mode" in + 4) mode="-mo i4" ;; + 8) mode="-mo i8" ;; + *) mode= ;; +esac + +if [ "$gpu" != "" -a "$gpu" != "-" ]; then + gpu="-gpu $gpu" +else + gpu="" +fi + +rm -f $job.cnt +rm -f $job.sts +rm -f $job.out +rm -f $job.log + +# To prevent a mismatch with the python version used by the solver +# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH +# unset environment variables PYTHONHOME and PYTHONPATH +unset PYTHONHOME +unset PYTHONPATH + +"${DIR}/tools/run_damask" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 +sleep 1 +exit 0 diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit9 b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit9 new file mode 100644 index 000000000..b6dcb75be --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit9 @@ -0,0 +1,186 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc%VERSION% +if test $MARCDIR1 +then + DIR=$MARCDIR1 +fi + +if test -z "$DIR"; then + REALCOM="`ls -l $0 |awk '{ print $NF; }'`" + DIRSCRIPT=`dirname $REALCOM` + case $DIRSCRIPT in + \/*) + ;; + *) + DIRSCRIPT=`pwd`/$DIRSCRIPT + ;; + esac + . $DIRSCRIPT/getarch + + DIR="$MENTAT_MARCDIR" +fi + +SRCEXT=.f +RSTEXT=.t08 +PSTEXT=.t19 +PSTEXTB=.t16 +VWFCEXT=.vfs + +slv=$1 +version=$2 +ndom_fea_solver=$3 +ndom_preprocessor=$4 +hostfile=$5 +compat=$6 +job=$7 +srcfile=$8 +srcmeth=$9 +shift 9 # cannot use $10, $11, ... +restart=$1 +postfile=$2 +viewfactorsfile=$3 +autorst=$4 +copy_datfile="-ci $5" +copy_postfile="-cr $6" +scr_dir=$7 +dcoup=$8 +assem_recov_nthread=$9 +shift 9 # cannot use $10, $11, ... +nthread=$1 +nsolver=$2 +mode=$3 +gpu=$4 + +if [ "$slv" != "" -a "$slv" != "marc" ]; then + slv="-iam sfm" +else + slv="" +fi + +if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then + nprocds="-nprocds $ndom_fea_solver" +else + nprocd="" + if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then + nprocd="-nprocd $ndom_preprocessor" + else + nprocd="" + fi +fi + +if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then +# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` + case "$srcmeth" in + -) + srcfile="-u $srcfile" + ;; + compsave) + srcfile="-u $srcfile -save y" + ;; + runsaved) + srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +else + srcfile="" +fi + +if [ "$restart" != "" -a "$restart" != "-" ]; then + restart=`echo $restart | sed "s/$RSTEXT$//"` + restart="-r $restart" +else + restart="" +fi + +if [ "$postfile" != "" -a "$postfile" != "-" ]; then + postfile=`echo $postfile | sed "s/$PSTEXT$//"` + postfile=`echo $postfile | sed "s/$PSTEXTB$//"` + postfile="-pid $postfile" +else + postfile="" +fi + +if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then + viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` + viewfactorsfile="-vf $viewfactorsfile" +else + viewfactorsfile="" +fi + +if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then + hostfile="-ho $hostfile" +else + hostfile="" +fi + +if [ "$compat" != "" -a "$compat" != "-" ]; then + compat="-co $compat" +else + compat="" +fi + +if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then + scr_dir="-sd $scr_dir" +else + scr_dir="" +fi + +if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then + dcoup="-dcoup $dcoup" +else + dcoup="" +fi + +if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then + assem_recov_nthread="-nthread_elem $assem_recov_nthread" +else + assem_recov_nthread="" +fi + +if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then + nthread="-nthread $nthread" +else + nthread="" +fi + +if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then + nsolver="-nsolver $nsolver" +else + nsolver="" +fi + +case "$mode" in + 4) mode="-mo i4" ;; + 8) mode="-mo i8" ;; + *) mode= ;; +esac + +if [ "$gpu" != "" -a "$gpu" != "-" ]; then + gpu="-gpu $gpu" +else + gpu="" +fi + +rm -f $job.cnt +rm -f $job.sts +rm -f $job.out +rm -f $job.log + +# To prevent a mismatch with the python version used by the solver +# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH +# unset environment variables PYTHONHOME and PYTHONPATH +unset PYTHONHOME +unset PYTHONPATH + +"${DIR}/tools/run_damask_l" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 +sleep 1 +exit 0 diff --git a/installation/mods_MarcMentat/2013.1/Mentat_menus/job_run.ms b/installation/mods_MarcMentat/2013.1/Mentat_menus/job_run.ms new file mode 100644 index 000000000..728951cef --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_menus/job_run.ms @@ -0,0 +1,3281 @@ +#ifndef AUTOFORGE +popmenu job_title_pm file jobs.ms +popdown job_title_ok file jobs.ms +#ifndef QT_MENTAT +popmenu marc_input_style_pm file job_common.ms +popmenu marc_input_style_run_adv_pm file job_common.ms +popmenu marc_version_run_pm file job_common.ms +#endif + +group job_solver_gr file job_common.ms +group user_domains_gr file domain_decomposition.ms +group user_domains_generate_gr file domain_decomposition.ms +group user_domains_tail_gr file domain_decomposition.ms +group job_solver_opts_gr file job_common.ms +popmenu ddm_options file job_common.ms + +#ifdef QT_MENTAT +browser edit_browser file file.ms +browser directory_browser file file.ms +screen domains file domain_decomposition.ms +#else +popmenu edit_browser_popmenu file file.ms +popmenu directory_browser_popmenu file file.ms +#endif + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu usersub_file_browser_pm { + + group { +#endif + + browser usersub_file_browser { + position 0 0 + size 82 72 + text "$usersub_file_browser_label" ($usersub_file_browser_label) + filter "*.f *.f90" + nvisible 10 + select_files true + cancel_action popdown + ok_action popdown + command "$usersub_file_browser_command" ($usersub_file_browser_command) + } +#ifndef QT_MENTAT + } + + window { + title " Select MARC User Subroutine File" + origin 30 30 + size 82 72 + } + + mode dialog + disable_right_mouse_button +} +#endif + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu host_file_browser_pm { + + group { +#endif + + browser host_file_browser { + position 0 0 + size 82 72 + text "$host_file_browser_label" ($host_file_browser_label) + filter "*" + nvisible 10 + select_files true + cancel_action popdown + ok_action popdown + command "$host_file_browser_command" ($host_file_browser_command) + } +#ifndef QT_MENTAT + } + + window { + title " Select MARC Host File" + origin 30 30 + size 82 72 + } + + mode dialog + disable_right_mouse_button +} +#endif + + +#-------------------------------------------------------------------------------------------------- +popmenu job_run_popmenu { + +#ifdef QT_MENTAT + text "RUN JOB" +#endif + + group { + +#ifndef QT_MENTAT + label { + position 0 0 + size 52 4 + text "RUN JOB" + } +#endif + +#ifdef QT_MENTAT + label { + position 0 0 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } +#endif + + button { +#ifdef QT_MENTAT + position 1 9 +#else + position 1 5 +#endif + size 24 4 + text "USER SUBROUTINE FILE" +#ifdef QT_MENTAT + browser usersub_file_browser +#else + popmenu usersub_file_browser_pm +#endif + settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" + set $usersub_file_browser_command "*job_usersub_file" + help job_usersub_file + } + + toggle { + position +26 = + size 22 4 + text "SELECTED USER SUBS" + toggle job_usersubs + help job_run_seluser + visible job_usersubs + popmenu job_usersub_pm + } + + display { + position 1 +4 + size 50 4 + display job_usersub_file + } + + button { + position 1 +4 + size 12 4 + text "EDIT" + command "*job_edit_usersub_file" + visible job_usersub_file + } + + button { + position +12 = + size 12 4 + text "CLEAR" + command "*job_clear_usersub_file" + visible job_usersub_file + } + + roller { + position +12 = + size 26 4 + nvalues 3 + texts "COMPILE / NO SAVE" + "COMPILE AND SAVE" + "RUN SAVED EXECUTABLE" + help job_run_compile + roller "job_option user_source" + visible job_usersub_file +#ifdef QT_MENTAT + commands "*job_option user_source:compile_nosave" + "*job_option user_source:compile_save" + "*job_option user_source:run_saved" +#else + popmenu job_user_source_pm +#endif + } + + toggle { + position 1 +6 + size 22 4 + text "PARALLELIZATION/\{GPU}" + help job_run_parallel + toggle "or(*job_option parallel:on, \ + *job_option assem_recov_multi_threading:on, \ + solver_multi_procs, \ + solver_multi_threads, \ + and(job_solver_mfront_sparse,\ + job_nonsym_off,\ + *job_option solver_use_gpu:on))" + popmenu job_run_parallelization_pm + set $popname2 "job_run_parallelization_pm" + } + + frame { + position +22 = + size 28 16 + border_width 1 + border_color black + + group { + + display { + position 0 0 + size 28 4 + display job_ddm_domains + } + + display { + position = +4 + size 28 4 + display job_assem_recov_nthreads + } + + display { + position = +4 + size 28 4 + display job_solver_procs + visible solver_allows_multi_procs + } + + display { + position = = + size 28 4 + display job_solver_threads + visible "and(solver_allows_multi_threads,\ + not(and(job_solver_mfront_sparse,\ + *job_option parallel:on)))" + } + + display { + position = +4 + size 28 4 + display job_solver_gpu + visible "and(job_solver_mfront_sparse,job_nonsym_off)" + } + } + } + + button { + position 1 +18 + size 8 4 + text "TITLE" + popmenu job_title_pm + command "*job_title" + } + +# see also job_common.ms +# see also the ADVANCED JOB SUBMISSION popmenu in this file + + label { + position +10 = + size 7 4 + text "STYLE" + border_width 1 + border_color black + } + + roller { + position +7 = + size 18 4 + nvalues 3 + texts "TABLE-DRIVEN" + "MULTI-PHYSICS" + "OLD" + rollers "job_input_style_table_driven" + "job_input_style_multi_physics" + "job_input_style_old" +#ifdef QT_MENTAT + commands "*job_option input_style:new *job_option input_physics_style:old" + "*job_option input_physics_style:new *job_option input_style:new" + "*job_option input_style:old *job_option input_physics_style:old" + visibles "job_allows_input_style_table_driven" + "job_allows_input_style_multi_physics" + "job_allows_input_style_old" +#else + popmenu marc_input_style_pm +#endif + help job_option_input_style + } + + button { + position +20 = + size 13 4 + text "SAVE MODEL" + command "*save_model" + } + + button { + position 1 +6 + size 16 6 + text "SUBMIT (1)" + command "*submit_job 1 *monitor_job" + } + + button { + position +16 = + size 16 6 + text "ADV. JOB SUBM." + popmenu job_submit_adv_pm + } + + button { + position +16 = + size 18 6 + text "DAMASK" + popmenu damask + } + + button { + position 1 +6 + size 16 6 + text "UPDATE" + command "*update_job" + } + + button { + position +16 = + size 16 6 + text "MONITOR" + command "*monitor_job" + } + + button { + position +16 = + size 18 6 + text "KILL" + command "*kill_job *monitor_job" + } + + label { + position 1 +7 + size 32 4 + text "STATUS" + border_width 1 + border_color black + } + + display { + position +32 = + size 18 4 + display "job_status" + } + + label { + position -32 +4 + size 32 4 + text "CURRENT INCREMENT (CYCLE)" + border_width 1 + border_color black + } + + display { + position +32 = + size 18 4 + display "job_increment" + } + + label { + position -32 +4 + size 32 4 + text "SINGULARITY RATIO" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_singularity_ratio" + } + + label { + position -32 +4 + size 32 4 + text "CONVERGENCE RATIO" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_convergence_ratio" + } + + label { + position 1 +4 + size 32 4 + text "ANALYSIS TIME" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_analysis_time" + } + + label { + position -32 +4 + size 32 4 + text "WALL TIME" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_time" + } + + frame { + position 1 +4 + size 50 8 + + group { + + frame { + position 0 0 + size 50 8 + text "TOTAL" + border_width 1 + border_color black + group { + + label { + position +6 = + size 13 4 + text "CYCLES" + border_width 1 + border_color black + } + + integer { + position +13 = + size 10 4 + display "acc_job_cycles" + border_width 1 + border_color black + } + + label { + position -13 +4 + size 13 4 + text "SEPARATIONS" + border_width 1 + border_color black + } + + integer { + position +13 = + size 10 4 + display "acc_job_separations" + border_width 1 + border_color black + } + + label { + position +10 -4 + size 11 4 + text "CUT BACKS" + border_width 1 + border_color black + } + + integer { + position +11 = + size 10 4 + display "acc_job_cut_backs" + border_width 1 + border_color black + } + + label { + position -11 +4 + size 11 4 + text "REMESHES" + border_width 1 + border_color black + } + + integer { + position +11 = + size 10 4 + display "acc_job_remeshes" + border_width 1 + border_color black + } + } + } + } + } + + label { + position 1 +8 + size 19 4 + text "EXIT NUMBER" + border_width 1 + border_color black + } + + integer { + position +19 = + size 10 4 + display "job_exit" + } + + button { + position +10 = + size 21 4 + text "EXIT MESSAGE" + popmenu job_exit_msg_pm + help exit_message + } + + label { + position 1 +6 + size 7 4 + text "EDIT" + border_width 1 + border_color black + } + + button { + position +7 = + size 12 4 + text "OUTPUT FILE" + command "*job_edit_output" + } + + button { + position +12 = + size 9 4 + text "LOG FILE" + command "*job_edit_log_file" + } + + button { + position +9 = + size 12 4 + text "STATUS FILE" + command "*job_edit_status_file" + } + + button { + position +12 = + size 10 4 + text "ANY FILE" + settext $edit_browser_label "EDIT FILE" + set $edit_browser_command "*edit_file" +#ifdef QT_MENTAT + browser edit_browser +#else + popmenu edit_browser_popmenu +#endif + help edit_file + } + + popdown { + position 1 +6 + size 32 4 +#ifdef QT_MENTAT + text "OPEN POST FILE (MODEL PLOT RESULTS MENU)" + command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" +#else + text "OPEN POST FILE (RESULTS MENU)" + screen results + command "*post_open_default" +#endif + } + + button { + position 1 +6 + size 12 8 + text "RESET" + command "*job_submit_reset" + } + + popdown { + position +38 = + size 12 8 + text "OK" + } + } + + window job_run_wi { + parent mentat + origin 35 1 + size 52 115 + background_color body + border_width 1 + border_color border + buffering single + } + +#ifdef QT_MENTAT + mode permanent +#else + mode dialog +#endif +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_usersub_pm { + +#ifdef QT_MENTAT + text "CURRENTLY SELECTED USER SUBROUTINES" +#endif + + group { + +#ifndef QT_MENTAT + label { + position 0 0 + size 66 4 + text "CURRENTLY SELECTED USER SUBROUTINES" + } +#endif + + display { + position 1 +5 + size 64 86 + display "job_usersubs" + } + + popdown { + position 27 +88 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 8 + size 66 102 + background_color body + border_width 1 + border_color border + buffering single + } + + mode dialog +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_submit_adv_pm { + +#ifdef QT_MENTAT + text "ADVANCED JOB SUBMISSION" +#endif + + group { + +#ifndef QT_MENTAT + label { + position 0 0 + size 50 4 + text "ADVANCED JOB SUBMISSION" + } +#endif + +#ifdef QT_MENTAT + label { + position 0 0 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } +#endif + + label { +#ifdef QT_MENTAT + position 1 9 +#else + position 1 5 +#endif + size 19 4 + text "INITIAL ALLOCATION" + border_width 1 + border_color black + } +#ifdef QT_MENTAT + label { + position +19 = + size 15 4 + text "GENERAL MEMORY" + help job_param_general_init_allocation + } +#else + button { + position +19 = + size 15 4 + text "GENERAL MEMORY" + help job_param_general_init_allocation + command "*job_param general_init_allocation" + } +#endif + text { + position +15 = + size 10 4 + display "job_param_value_general_init_allocation" + command "*job_param general_init_allocation" + help job_param_general_init_allocation + } + + label { + position +10 = + size 4 4 + text "MB" + border_width 1 + border_color black + } + + toggle { + position 1 +5 + size 32 4 + text "OUT-OF-CORE ELEMENT STORAGE" + help job_param_elsto + toggle "*job_option elsto:on" + true_command "*job_option elsto:on" + false_command "*job_option elsto:off" + } + + toggle { + position 1 +4 + size 32 4 + text "OUT-OF-CORE INCREMENTAL BACKUP" + help job_param_inc_backup_storage + toggle "*job_option inc_backup_storage:out_of_core" + true_command "*job_option inc_backup_storage:out_of_core" + false_command "*job_option inc_backup_storage:in_core" + } + + toggle { + position +34 = + size 14 4 + text "CHECK SIZES" + help job_run_check + toggle "*job_option check:on" + true_command "*job_option check:on" + false_command "*job_option check:off" + } + + label { + position 1 +6 + size 16 4 + text "INTEGER SIZE" + border_width 1 + border_color black + } + + roller { + position +16 = + size 32 4 + nvalues 3 + texts "DEFAULT" + "4-BYTE INTEGERS" + "8-BYTE INTEGERS" +#ifdef QT_MENTAT + commands "*job_option marc_integer_size:default" + "*job_option marc_integer_size:i4" + "*job_option marc_integer_size:i8" +#else + popmenu marc_integer_size_pm +#endif + help job_run_intsize + roller "job_option marc_integer_size" + } + + frame { + position 1 +6 + size 48 12 + text "MARC INPUT FILE" + border_width 1 + border_color black + + group { + + label { + position 0 4 + size 9 4 + text "VERSION" + border_width 1 + border_color black + } + + roller { + position +9 = + size 14 4 + nvalues 17 + nvisible 17 + texts "DEFAULT" +#if 0 + "2013.1" +#endif + "2013" + "2012" + "2011" + "2010.2" + "2010" + "2008" + "2007" + "2005R3" + "2005" + "2003" + "2001" + "2000" +#if 0 + "8" +#endif + "K7" + "K6.2" + "K5" + "K4" + help job_param_version + rollers "job_input_version_default" +#if 0 + "job_input_version_2013.1" +#endif + "job_input_version_2013" + "job_input_version_2012" + "job_input_version_2011" + "job_input_version_2010.2" + "job_input_version_2010" + "job_input_version_2008" + "job_input_version_2007" + "job_input_version_2005r3" + "job_input_version_2005" + "job_input_version_2003" + "job_input_version_2001" + "job_input_version_2000" +#if 0 + "job_input_version_8" +#endif + "job_input_version_k7" + "job_input_version_k6" + "job_input_version_k5" + "job_input_version_k4" +#ifdef QT_MENTAT + commands "*job_option version:default" +#if 0 + "*job_option version:2013.1" +#endif + "*job_option version:2013" + "*job_option version:2012" + "*job_option version:2011" + "*job_option version:2010.2" + "*job_option version:2010" + "*job_option version:2008" + "*job_option version:2007" + "*job_option version:2005r3" + "*job_option version:2005" + "*job_option version:2003" + "*job_option version:2001" + "*job_option version:2000" +#if 0 + "*job_option version:8" +#endif + "*job_option version:k7" + "*job_option version:k6" + "*job_option version:k5" + "*job_option version:k4" + visibles "job_allows_input_version_default" +#if 0 + "job_allows_input_version_2013.1" +#endif + "job_allows_input_version_2013" + "job_allows_input_version_2012" + "job_allows_input_version_2011" + "job_allows_input_version_2010.2" + "job_allows_input_version_2010" + "job_allows_input_version_2008" + "job_allows_input_version_2007" + "job_allows_input_version_2005r3" + "job_allows_input_version_2005" + "job_allows_input_version_2003" + "job_allows_input_version_2001" + "job_allows_input_version_2000" +#if 0 + "job_allows_input_version_8" +#endif + "job_allows_input_version_k7" + "job_allows_input_version_k6" + "job_allows_input_version_k5" + "job_allows_input_version_k4" +#else + popmenu marc_version_run_pm +#endif + } + +# see also job_common.ms +# see also the RUN JOB popmenu in this file + + label { + position +14 = + size 7 4 + text "STYLE" + border_width 1 + border_color black + } + + roller { + position +7 = + size 18 4 + nvalues 3 + texts "TABLE-DRIVEN" + "MULTI-PHYSICS" + "OLD" + rollers "job_input_style_table_driven" + "job_input_style_multi_physics" + "job_input_style_old" +#ifdef QT_MENTAT + commands "*job_option input_style:new *job_option input_physics_style:old" + "*job_option input_physics_style:new *job_option input_style:new" + "*job_option input_style:old *job_option input_physics_style:old" + visibles "job_allows_input_style_table_driven" + "job_allows_input_style_multi_physics" + "job_allows_input_style_old" +#else + popmenu marc_input_style_run_adv_pm +#endif + help job_option_input_style + } + + toggle { + position 0 +4 + size 48 4 + text "EXTENDED PRECISION" + help job_run_precision + toggle "*job_option inp_file_prec:extended" + true_command "*job_option inp_file_prec:extended" + false_command "*job_option inp_file_prec:normal" + } + } + } + + button { + position 1 +14 + size 24 4 + text "SCRATCH DIRECTORY" + settext $directory_browser_label "JOB SCRATCH DIRECTORY" + set $directory_browser_command "*job_scratch_directory" +#ifdef QT_MENTAT + browser directory_browser +#else + popmenu directory_browser_popmenu +#endif + help job_scratch_directory + } + + button { + position +24 = + size 24 4 + text "CLEAR" + command "*job_clear_scratch_directory" + visible job_scratch_directory + } + + text { + position 1 +4 + size 48 4 + display job_scratch_dir + command "*job_scratch_directory" + } + +#ifdef DCOM + toggle { + position 1 +6 + size 8 4 + text "\{DCOM}" + toggle "*job_option dcom:on" + help job_run_dcom + true_command "*job_option dcom:on" + false_command "*job_option dcom:off" + visible win32_available + } + + button { + position +8 = + size 12 4 + text "HOSTNAME" + command "*job_dcom_hostname" + visible "and(win32_available, *job_option dcom:on)" + } + + text job_dcom_hostname { + position +12 = + size 28 4 + display "job_dcom_hostname" + command "*job_dcom_hostname" + visible "and(win32_available, *job_option dcom:on)" + } +#endif + + button { + position 1 +6 + size 24 4 + text "TITLE" + popmenu job_title_pm + command "*job_title" + } + + button { + position +24 = + size 24 4 + text "SAVE MODEL" + command "*save_model" + } + + button { + position +4 +6 + size 20 4 + text "WRITE INPUT FILE" + command "*job_write_input" + } + + button { + position = +4 + size 20 4 + text "EDIT INPUT FILE" + command "*job_edit_input" + } + + popdown { + position 1 +5 + size 20 6 + text "SUBMIT 1" + command "*submit_job 1 *monitor_job" + } + + popdown { + position +28 = + size 20 6 + text "EXECUTE 1" + command "*execute_job 1 *monitor_job" + } + + popdown { + position -28 +6 + size 20 6 + text "SUBMIT 2" + command "*submit_job 2 *monitor_job" + } + + popdown { + position +28 = + size 20 6 + text "EXECUTE 2" + command "*execute_job 2 *monitor_job" + } + + popdown { + position -28 +6 + size 20 6 + text "SUBMIT 3" + command "*submit_job 3 *monitor_job" + } + + popdown { + position +28 = + size 20 6 + text "EXECUTE 3" + command "*execute_job 3 *monitor_job" + } + + popdown { + position 19 +8 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 8 +#ifdef DCOM + size 50 100 +#else + size 50 94 +#endif + background_color body + border_width 1 + border_color border + buffering single + } + +#ifdef QT_MENTAT + mode permanent +#else + mode dialog +#endif +} + +#-------------------------------------------------------------------------------------------------- +popmenu damask { + +#ifdef QT_MENTAT + text "DAMASK.MPIE.DE" +#endif + + group { +#ifndef QT_MENTAT + label { + position 0 0 + size 50 4 + text "DAMASK.MPIE.DE" + } +#endif + + label { + position 1 6 + size 13 6 + text "Optimzation" + border_width 1 + border_color black + } + + label { + position +13 = + size 20 6 + text "write Input" + border_width 1 + border_color black + } + + label { + position +18 = + size 30 6 + text "do not write Inp." + border_width 1 + border_color black + } + + label { + position -32 +6 + size 12 6 + text "O2 / OpenMP" + border_width 1 + border_color black + } + + popdown { + position +12 = + size 20 6 + text "Submit" + command "*submit_job 4 *monitor_job" + } + + popdown { + position +20 = + size 20 6 + text "Execute" + command "*execute_job 4 *monitor_job" + } + + label { + position -32 +6 + size 12 6 + text "O1 / OpenMP" + border_width 1 + border_color black + } + + popdown { + position +12 = + size 20 6 + text "Submit" + command "*submit_job 5 *monitor_job" + } + + popdown { + position +20 = + size 20 6 + text "Execute" + command "*execute_job 5 *monitor_job" + } + + label { + position -32 +6 + size 12 6 + text "O0 / OpenMP" + border_width 1 + border_color black + } + + popdown { + position +12 = + size 20 6 + text "Submit" + command "*submit_job 6 *monitor_job" + } + + popdown { + position +20 = + size 20 6 + text "Execute" + command "*execute_job 6 *monitor_job" + } + + label { + position -29 +8 + size 9 6 + text "O2" + border_width 1 + border_color black + } + + popdown { + position +9 = + size 20 6 + text "Submit" + command "*submit_job 7 *monitor_job" + } + + popdown { + position +20 = + size 20 6 + text "Execute" + command "*execute_job 7 *monitor_job" + } + + label { + position -29 +6 + size 9 6 + text "O1" + border_width 1 + border_color black + } + + popdown { + position +9 = + size 20 6 + text "Submit" + command "*submit_job 8 *monitor_job" + } + + popdown { + position +20 = + size 20 6 + text "Execute" + command "*execute_job 8 *monitor_job" + } + + label { + position -29 +6 + size 9 6 + text "O0" + border_width 1 + border_color black + } + + popdown { + position +9 = + size 20 6 + text "Submit" + command "*submit_job 9 *monitor_job" + } + + popdown { + position +20 = + size 20 6 + text "Execute" + command "*execute_job 9 *monitor_job" + } + + popdown { + position 19 +8 + size 12 8 + text "CANCEL" + } +} + + + + window { + parent mentat + origin 38 8 +#ifdef DCOM + size 50 100 +#else + size 50 94 +#endif + background_color body + border_width 1 + border_color border + buffering single + } + mode dialog +} + +#-------------------------------------------------------------------------------------------------- +popmenu job_exit_msg_pm { + +#ifdef QT_MENTAT + text "EXIT MESSAGE" +#endif + + group { + +#ifndef QT_MENTAT + label { + position 0 0 + size 86 4 + text "EXIT MESSAGE" + } + + display { + position 1 5 + size 84 74 + display "job_exit_msg" + } +#endif + +#ifdef QT_MENTAT + + text { + position 1 5 + size 84 74 + multiline + readonly + display "job_exit_msg" + } + +#endif + popdown { + position 37 +76 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 8 + size 86 90 + background_color body + border_width 1 + border_color border + buffering single + } + + mode dialog +} + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu job_user_source_pm { + + window { + parent job_run_wi + origin 25 17 + size 26 17 + border_width 1 + border_color border + background_color body + } + mode dialog + + group job_user_source_gr +} + + +#-------------------------------------------------------------------------------------------------- +group job_user_source_gr { + popdown { + position 0 0 + size 26 4 + text "COMPILE / NO SAVE" + command "*job_option user_source:compile_nosave" + } + + popdown { + position = +4 + size 26 4 + text "COMPILE AND SAVE" + command "*job_option user_source:compile_save" + } + + popdown { + position = +4 + size 26 4 + text "RUN SAVED EXECUTABLE" + command "*job_option user_source:run_saved" + } + + popdown { + position = +5 + size 26 4 + text "CANCEL" + } +} +#endif + + +#-------------------------------------------------------------------------------------------------- +popmenu job_run_parallelization_pm { + +#ifdef QT_MENTAT + text "PARALLELIZATION/\{GPU}" +#endif + + group { + +#ifndef QT_MENTAT + label { + position 0 0 + size 60 4 + text "PARALLELIZATION/GPU" + } +#endif + +#ifdef QT_MENTAT + label { + position 0 0 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } +#endif + + frame { +#ifdef QT_MENTAT + position 1 9 +#else + position 1 5 +#endif + size 48 28 + group job_ddm_gr + text "DOMAIN DECOMPOSITION" + border_width 1 + border_color black + } + + frame { + position 1 +29 + size 36 13 + group job_assem_recov_gr + text "ASSEMBLY AND RECOVERY" + border_width 1 + border_color black + } + + frame { + position 1 +14 + size 58 31 + group job_parallel_matrix_solver_gr + text "MATRIX SOLVER" + border_width 1 + border_color black + } + + frame { + position 1 +32 + size 48 28 + group job_parallel_env_gr + text "PARALLELIZATION ENVIRONMENT" + border_width 1 + border_color black + visible "or(*job_option parallel:on, \ + solver_multi_procs)" + } + + popdown { + position 24 +30 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 1 + size 60 119 + background_color body + border_width 1 + border_color border + buffering single + } +#ifdef QT_MENTAT + mode permanent +#else + mode dialog +#endif +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_gr { + + toggle { + position 1 4 + size 30 4 + text "USE \{DDM}" + toggle "*job_option parallel:on" + help job_run_ddm_use + true_command "*job_option parallel:on" + false_command "*job_option parallel:off" + } + + frame { + position +2 +5 + size 44 18 + group job_ddm_use_gr + visible "*job_option parallel:on" + } +} + +group job_ddm_use_gr { + roller { + position 0 0 + size 30 4 + nvalues 2 + texts "DECOMPOSITION IN MARC" + "DECOMPOSITION IN MENTAT" + roller "job_option ddm_generator" +#ifdef QT_MENTAT + commands "*job_option ddm_generator:fea_solver" + "*job_option ddm_generator:preprocessor" +#else + popmenu job_ddm_generator_pm +#endif + help job_run_ddm_generator + } + + frame { + position 0 +5 + size 44 8 + group job_ddm_fea_solver_gr + visible "*job_option ddm_generator:fea_solver" + } + + frame { + position = = + size 44 8 + group job_ddm_preprocessor_gr + visible "*job_option ddm_generator:preprocessor" + } + + text { + position 0 +9 + size 22 4 +#ifdef QT_MENTAT + text "Single Input File" +#else + text "SINGLE INPUT FILE" +#endif + readonly + visible "*job_option ddm_generator:fea_solver" + } + + roller { + position = = + size 22 4 + nvalues 2 + texts "MULTIPLE INPUT FILES" + "SINGLE INPUT FILE" + roller "job_option ddm_single_input" + commands "*job_option ddm_single_input:off" + "*job_option ddm_single_input:on" + visible "*job_option ddm_generator:preprocessor" + help job_run_ddm_single_input + } + + roller { + position +23 = + size 21 4 + nvalues 2 + texts "MULTIPLE POST FILES" + "SINGLE POST FILE" + roller "job_option ddm_single_post" + commands "*job_option ddm_single_post:off" + "*job_option ddm_single_post:on" + help job_run_ddm_single_post + } +} + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu job_ddm_generator_pm { + + window { + parent mentat + origin 42 19 + size 30 13 + border_width 1 + border_color border + background_color body + } + + mode dialog + + group job_ddm_generator_gr +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_generator_gr { + + popdown { + position 0 0 + size 30 4 + text "DECOMPOSITION IN MARC" + command "*job_option ddm_generator:fea_solver" + help job_run_ddm_generator + } + + popdown { + position = +4 + size 30 4 + text "DECOMPOSITION IN MENTAT" + command "*job_option ddm_generator:preprocessor" + help job_run_ddm_generator + } + + popdown { + position = +5 + size 30 4 + text "CANCEL" + help job_run_ddm_generator + } +} +#endif + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_fea_solver_gr { + +#ifdef QT_MENTAT + label { + position 0 0 + size 10 4 + text "# DOMAINS" + help job_param + } +#else + button { + position 0 0 + size 10 4 + text "# DOMAINS" + command "*job_param ndomains" + } +#endif + + text { + position +10 = + size 4 4 + display "job_param_value_ndomains" + command "*job_param ndomains" + } + + label { + position +4 = + size 7 4 + text "METHOD" + border_width 1 + border_color black + } + + roller { + position +7 = + size 23 4 + nvalues 7 + texts "METIS BEST" + "METIS ELEMENT" + "METIS NODE" + "REC. COORD. BISECTION" + "VECTOR" + "RADIAL" + "ANGULAR" + help set_job_decomp_type + rollers "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" +#ifdef QT_MENTAT + commands "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" +#else + popmenu job_ddm_method_pm +#endif + } + + button { + position +4 +4 + size 19 4 + text "ADVANCED SETTINGS" +#ifdef QT_MENTAT + popmenu job_ddm_fea_solver_pm +#else + screen job_ddm_fea_solver_sc + command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) +#endif + } +} + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu job_ddm_method_pm { + + window { + parent mentat + origin 56 24 + size 30 33 + border_width 1 + border_color border + background_color body + } + + mode dialog + + group job_ddm_method_gr +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_method_gr { + + popdown { + position 0 0 + size 30 4 + text "METIS BEST" + command "*job_option ddm_method:metis_best" + } + + popdown { + position = +4 + size 30 4 + text "METIS ELEMENT BASED" + command "*job_option ddm_method:metis_element_based" + } + + popdown { + position = +4 + size 30 4 + text "METIS NODE BASED" + command "*job_option ddm_method:metis_node_based" + } + + popdown { + position = +4 + size 30 4 + text "RECURSIVE COORDINATE BISECTION" + command "*job_option ddm_method:recur_coord_bisect" + } + + popdown { + position = +4 + size 30 4 + text "VECTOR" + command "*job_option ddm_method:vector" + } + + popdown { + position = +4 + size 30 4 + text "RADIAL" + command "*job_option ddm_method:radial" + } + + popdown { + position = +4 + size 30 4 + text "ANGULAR" + command "*job_option ddm_method:angular" + } + + popdown { + position = +5 + size 30 4 + text "CANCEL" + } +} +#endif + + +#ifdef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu job_ddm_fea_solver_pm { + + text "JOB PARALLELIZATION" +#else +screen job_ddm_fea_solver_sc { + + menu { +#endif + + group { + units 32 120 + +#ifndef QT_MENTAT + label { + position 0 0 + size 32 4 + text "JOB PARALLELIZATION" + } +#endif + + label { + position 0 5 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + +#ifdef QT_MENTAT + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } +#endif + + frame { + +#ifdef QT_MENTAT + position 0 +9 +#else + position 0 +5 +#endif + size 32 76 + text "ADVANCED DECOMPOSITION IN MARC" + border_width 1 + border_color black + + group { + +#ifdef QT_MENTAT + label { + position 1 4 + size 16 4 + text "# DOMAINS" + help job_param + } +#else + button { + position 1 4 + size 16 4 + text "# DOMAINS" + command "*job_param ndomains" + } +#endif + + text { + position +16 = + size 14 4 + display "job_param_value_ndomains" + command "*job_param ndomains" + } + + label { + position 1 +4 + size 7 4 + text "METHOD" + border_width 1 + border_color black + } + + roller { + position +7 = + size 23 4 + nvalues 7 + texts "METIS BEST" + "METIS ELEMENT" + "METIS NODE" + "REC. COORD. BISECTION" + "VECTOR" + "RADIAL" + "ANGULAR" + help set_job_decomp_type + rollers "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" +#ifdef QT_MENTAT + commands "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" +#else + popmenu job_ddm_method2_pm +#endif + } + + frame { + position 1 +5 + size 30 20 + group job_ddm_direction_gr + visible "or(*job_option ddm_method:vector, \ + *job_option ddm_method:radial, \ + *job_option ddm_method:angular)" + } + + toggle { + position 1 +21 + size 30 4 + text "DOMAIN ISLAND REMOVAL" + toggle "*job_option ddm_island_removal:on" + true_command "*job_option ddm_island_removal:on" + false_command "*job_option ddm_island_removal:off" + } + + label { + position 1 +4 + size 15 4 + border_width 1 + border_color black + text "GRAPH" + } + + roller { + position +15 = + size 15 4 + nvalues 2 + texts "COARSE" + "FINE" + help ddm_decomp_coarse_graph + rollers "*job_option ddm_graph:coarse" + "*job_option ddm_graph:fine" + commands "*job_option ddm_graph:coarse" + "*job_option ddm_graph:fine" + visible "or(*job_option ddm_method:metis_best, \ + *job_option ddm_method:metis_element_based, \ + *job_option ddm_method:metis_node_based)" + } + + label { + position 1 +4 + size 15 4 + border_width 1 + border_color black + text "QUADRATIC ELEMENTS" + } + + roller { + position +15 = + size 15 4 + nvalues 2 + texts "GENUINE" + "LINEARIZED" + help job_run_ddm_decomp_linearized + rollers "*job_option ddm_quadr_elems:genuine" + "*job_option ddm_quadr_elems:linearized" + commands "*job_option ddm_quadr_elems:genuine" + "*job_option ddm_quadr_elems:linearized" + } + +#ifdef QT_MENTAT + label { + position 1 +5 + size 15 4 + text "ELEMENT WEIGHT FACTOR" + help job_param + } +#else + button { + position 1 +5 + size 15 4 + text "ELEMENT WEIGHT FACTOR" + command "*job_param ddm_elem_weight_factor" + help job_run_ddm_decomp_element_weight_factor + } +#endif + + text { + position +15 = + size 15 4 + display "job_param_value_ddm_elem_weight_factor" + command "*job_param ddm_elem_weight_factor" + help job_run_ddm_decomp_element_weight_factor + } + + toggle { + position 1 +5 + size 30 4 + text "DETECT CONTACT" + toggle "*job_option ddm_detect_contact:on" + true_command "*job_option ddm_detect_contact:on" + false_command "*job_option ddm_detect_contact:off" + visible "or(*job_option ddm_method:metis_best, \ + *job_option ddm_method:metis_element_based, \ + *job_option ddm_method:metis_node_based)" + help job_run_ddm_decomp_detect_contact + } + +#ifdef QT_MENTAT + label { + position = +5 + size 15 4 + text "CONTACT TOLERANCE" + visible "*job_option ddm_detect_contact:on" + } +#else + button { + position = +5 + size 15 4 + text "CONTACT TOLERANCE" + command "*job_param ddm_contact_tolerance" + visible "*job_option ddm_detect_contact:on" + help job_run_ddm_decomp_contact_tolerance + } +#endif + + text { + position +15 = + size 15 4 + command "*set_ddm_contact_tolerance" + display "job_param_value_ddm_contact_tolerance" + command "*job_param ddm_contact_tolerance" + visible "*job_option ddm_detect_contact:on" + help job_run_ddm_decomp_contact_tolerance + } + +#ifdef QT_MENTAT + label { + position -15 +4 + size 15 4 + text "CONTACT CONSTR FACTOR" + visible "*job_option ddm_detect_contact:on" + } +#else + button { + position -15 +4 + size 15 4 + text "CONTACT CONSTR FACTOR" + command "*job_param ddm_contact_constr_factor" + visible "*job_option ddm_detect_contact:on" + help job_run_ddm_decomp_contact_constraint_factor + } +#endif + + text { + position +15 = + size 15 4 + display "job_param_value_ddm_contact_constr_factor" + command "*job_param ddm_contact_constr_factor" + visible "*job_option ddm_detect_contact:on" + help job_run_ddm_decomp_contact_constraint_factor + } + } + } + +#ifdef QT_MENTAT + popdown { + position 0 +77 + size 32 8 + text "OK" + } +#else + frame { + position 0 +77 + size 32 8 + group ok2_gr + } + + frame select_frame + frame inactive_return +#endif + } +#ifndef QT_MENTAT + window main_window + disable_right_mouse_button + } + + menu transform +} # job_ddm_fea_solver_sc +#else + mode permanent +} # job_ddm_fea_solver_pm +#endif + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu job_ddm_method2_pm { + + window { + parent mentat + origin 1 22 + size 30 33 + border_width 1 + border_color border + background_color body + } + + mode dialog + + group job_ddm_method_gr +} +#endif + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_direction_gr { + + button { + position 0 0 + size 15 4 + text "DIRECTION" + command "*job_vector ddm_sort_direction_x" + visible "*job_option ddm_method:vector" + } + + button { + position = = + size 15 4 + text "DIRECTION" + command "*job_vector ddm_sort_direction_x" + visible "not(*job_option ddm_method:vector)" + } + + button { + position +15 = + size 15 4 + text "FROM / TO" + command "*job_vector_from_to ddm_sort_direction_x" + } + + text { + position -15 +4 + size 10 4 + command "*job_param ddm_sort_direction_x" + display "job_param_value_ddm_sort_direction_x" + help ddm_job_decomp_user_direction_x + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_direction_y" + display "job_param_value_ddm_sort_direction_y" + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_direction_z" + display "job_param_value_ddm_sort_direction_z" + } + + frame { + position 0 +4 + size 30 8 + group job_ddm_sort_point_gr + visible "not(*job_option ddm_method:vector)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_sort_point_gr { + + label { + position 0 0 + size 14 4 + border_width 1 + border_color black + text "POINT ON AXIS" + } + + roller { + position +14 = + size 10 4 + nvalues 2 + texts "DEFAULT" + "USER" + roller "job_option ddm_sort_point" +#ifdef QT_MENTAT + commands "*job_option ddm_sort_point:default" + "*job_option ddm_sort_point:user" +#else + popmenu job_ddm_sort_point_meth_pm +#endif + } + + button { + position +10 = + size 6 4 + text "SET" + command "*job_position ddm_sort_point_x" + visible "*job_option ddm_sort_point:user" + } + + text { + position 0 +4 + size 10 4 + command "*job_param ddm_sort_point_x" + display "job_param_value_ddm_sort_point_x" + visible "*job_option ddm_sort_point:user" + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_point_y" + display "job_param_value_ddm_sort_point_y" + visible "*job_option ddm_sort_point:user" + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_point_z" + display "job_param_value_ddm_sort_point_z" + visible "*job_option ddm_sort_point:user" + } +} + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu job_ddm_sort_point_meth_pm { + + window { + parent mentat + origin 15 35 + size 14 13 + border_width 1 + border_color border + background_color body + } + + mode dialog + + group job_ddm_sort_point_meth_gr +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_sort_point_meth_gr { + + popdown { + position 0 0 + size 14 4 + text "DEFAULT" + command "*job_option ddm_sort_point:default" + } + + popdown { + position = +4 + size 14 4 + text "USER DEFINED" + command "*job_option ddm_sort_point:user" + } + + popdown { + position = +5 + size 14 4 + text "CANCEL" + } +} +#endif + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_preprocessor_gr { + + label { + position 0 0 + size 10 4 + text "# DOMAINS" + border_width 1 + border_color black + } + + integer { + position +10 = + size 4 4 + display valid_domains + } + + button { + position +4 = + size 30 4 + text "USER DOMAINS" +#ifdef QT_MENTAT + screen domains +#else + screen job_ddm_user_domains_sc + command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) +#endif + help job_run_ddm_user_domains + } +} + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +screen job_ddm_user_domains_sc { + + menu { + + group { + units 32 120 + + label { + position 0 0 + size 32 4 + text "USER DOMAINS" + } + + frame { + position 0 5 + size 32 28 + group user_domains_gr + } + + frame { + position 0 +29 + size 32 49 + group user_domains_generate_gr + } + + frame { + position 0 +50 + size 32 8 + group user_domains_tail_gr + } + + frame { + position 0 92 + size 32 8 + group ok2_gr + } + + frame select_frame + frame inactive_return + } + window main_window + disable_right_mouse_button + + } + + menu transform + +} # job_ddm_user_domains_sc +#endif + + +#-------------------------------------------------------------------------------------------------- +group job_assem_recov_gr { + + toggle { + position 1 +4 + size 30 4 + text "MULTIPLE THREADS" + true_command "*job_option assem_recov_multi_threading:on" + false_command "*job_option assem_recov_multi_threading:off" + toggle "*job_option assem_recov_multi_threading:on" + } + +#ifdef QT_MENTAT + label { + position +2 +4 + size 12 4 + text "# THREADS" + visible "*job_option assem_recov_multi_threading:on" + } +#else + button { + position +2 +4 + size 12 4 + text "# THREADS" + command "*job_param assem_recov_nthreads" + visible "*job_option assem_recov_multi_threading:on" + } +#endif + + text { + position +12 = + size 4 4 + display "job_param_value_assem_recov_nthreads" + command "*job_param assem_recov_nthreads" + visible "*job_option assem_recov_multi_threading:on" + } + + label { + position +4 = + size 12 4 + visible "and(*job_option assem_recov_multi_threading:on, \ + *job_option parallel:on)" + text "PER DOMAIN" + border_width 1 + border_color black + } + + display { + position +12 = + size 4 4 + display "job_assem_recov_nthreads_dom" + visible "and(*job_option assem_recov_multi_threading:on, \ + *job_option parallel:on)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_matrix_solver_gr { + + label { + position 3 4 + size 12 4 + text "SOLUTION" + border_width 1 + border_color black + } + + roller { + position +12 = + size 18 4 + nvalues 2 + texts "SYMMETRIC" + "NONSYMMETRIC" + rollers job_nonsym_off + job_nonsym_on + commands "*job_option solver_nonsym:off" + "*job_option solver_nonsym:on" + help job_param_solver_method + } + + label { + position -12 +4 + size 6 4 + text "TYPE" + border_width 1 + border_color black + } + + roller { + position +6 = + size 24 4 + nvalues 9 + help job_param_solver_method + texts "MULTIFRONTAL SPARSE" + "MIXED DIRECT-ITERATIVE" + "CASI ITERATIVE" + "PARDISO DIRECT SPARSE" + "MUMPS PARALLEL DIRECT" + "HARDWARE SPARSE" + "ITERATIVE SPARSE" + "DIRECT PROFILE" + "DIRECT SPARSE" + rollers job_solver_mfront_sparse + job_solver_mixed_direct_iterative + job_solver_it_ext + job_solver_pardiso + job_solver_mumps + job_solver_sparse + job_solver_it_sparse + job_solver_dir_profile + job_solver_dir_sparse +#ifdef QT_MENTAT + commands "*job_option solver:mfront_sparse" + "*job_option solver:mixed_direct_iterative" + "*job_option solver:it_ext" + "*job_option solver:pardiso" + "*job_option solver:mumps" + "*job_option solver:sparse" + "*job_option solver:it_sparse" + "*job_option solver:dir_profile" + "*job_option solver:dir_sparse" + visibles job_allows_solver_mfront_sparse + job_allows_solver_mixed_direct_iterative + job_allows_solver_it_ext + job_allows_solver_pardiso + job_allows_solver_mumps + job_allows_solver_sparse + job_allows_solver_it_sparse + job_allows_solver_dir_profile + job_allows_solver_dir_sparse + help job_param_solver_method +#else + popmenu job_set_parallel_matrix_solver_pm +#endif + } + + button { + position +24 = + size 10 4 + text "OPTIONS" + popmenu job_parallel_matrix_solver_opt_pm + } + + frame { + position +10 = + size 14 4 + group job_run_solver_ddm_opts_gr + visible "*job_option parallel:on" + } + + frame { + position 1 +5 + size 46 8 + group job_solver_multi_procs_gr + visible solver_allows_multi_procs + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_gr + visible solver_allows_multi_threads + } + + frame { + position 1 +9 + size 46 8 + group job_solver_gpu_gr + visible "and(job_solver_mfront_sparse,job_nonsym_off)" + } +} + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu job_set_parallel_matrix_solver_pm { + window { + parent mentat + origin 48 61 + size 24 42 + border_width 1 + border_color border + background_color body + } + mode dialog + + group job_solver_gr +} +#endif + + +#-------------------------------------------------------------------------------------------------- +popmenu job_parallel_matrix_solver_opt_pm { + +#ifdef QT_MENTAT + text "MATRIX SOLVER OPTIONS" +#endif + + group { + +#ifndef QT_MENTAT + label { + position 0 0 + size 38 4 + text "MATRIX SOLVER OPTIONS" + } +#endif + + frame { + position 1 5 + size 36 23 + group job_solver_opts_gr + } + + popdown { + position 13 +25 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 41 12 + size 38 39 + border_width 1 + border_color border + background_color body + } + mode dialog +} + + +#-------------------------------------------------------------------------------------------------- +group job_run_solver_ddm_opts_gr { + + button { + position 0 0 + size 14 4 + text "\{DDM} OPTIONS" + popmenu ddm_options +# see also job_common.ms! + visible "not(or(job_solver_it_sparse, \ + job_solver_it_ext, \ + job_solver_mixed_direct_iterative, \ + job_solver_pardiso, \ + job_solver_mumps))" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_procs_gr { + frame { + position 0 0 + size 46 8 + group job_solver_multi_procs_parallel_off_gr + visible "*job_option parallel:off" + } + + frame { + position = = + size 46 8 + group job_solver_multi_procs_parallel_on_gr + visible "*job_option parallel:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_procs_parallel_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE SOLVER PROCESSES" + true_command "*job_option nsolver_procs_serial:on" + false_command "*job_option nsolver_procs_serial:off" + toggle "*job_option nsolver_procs_serial:on" + help job_run_multithreading + } + +#ifdef QT_MENTAT + label { + position +2 +4 + size 14 4 + text "# PROCESSES" + visible "*job_option nsolver_procs_serial:on" + help job_param + } +#else + button { + position +2 +4 + size 14 4 + text "# PROCESSES" + command "*job_param nsolver_procs" + visible "*job_option nsolver_procs_serial:on" + } +#endif + + text { + position +14 = + size 14 4 + display "job_param_value_nsolver_procs" + command "*job_param nsolver_procs" + visible "*job_option nsolver_procs_serial:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_procs_parallel_on_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE SOLVER PROCESSES" + help job_run_multithreading + toggle true +#ifdef QT_MENTAT + set $dummy dummy +#endif + } + + label { + position +2 +4 + size 14 4 + text "# PROCESSES" + border_width 1 + border_color black + } + + roller { + position +14 = + size 14 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option nsolver_procs_ddm:automatic" + "*job_option nsolver_procs_ddm:user" + help job_run_multithreading + rollers "*job_option nsolver_procs_ddm:automatic" + "*job_option nsolver_procs_ddm:user" + } + + frame { + position +14 = + size 16 4 + group job_nsolver_procs_ddm_automatic_gr + visible "*job_option nsolver_procs_ddm:automatic" + } + + frame { + position = = + size 16 4 + group job_nsolver_procs_ddm_user_gr + visible "*job_option nsolver_procs_ddm:user" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_nsolver_procs_ddm_automatic_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + border_width 1 + border_color black + } + + integer { + position +8 = + size 8 4 + display valid_domains + visible "*job_option ddm_generator:preprocessor" + } + + integer { + position = = + size 8 4 + display "job_param_ndomains" + visible "*job_option ddm_generator:fea_solver" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_nsolver_procs_ddm_user_gr { + +#ifdef QT_MENTAT + label { + position 0 0 + size 8 4 + text "VALUE" + help job_param + } +#else + button { + position 0 0 + size 8 4 + text "VALUE" + command "*job_param nsolver_procs" + } +#endif + + text { + position +8 = + size 8 4 + display "job_param_value_nsolver_procs" + command "*job_param nsolver_procs" + } +} + +group job_solver_multi_threads_gr { + frame { + position 0 0 + size 30 8 + group job_solver_multi_threads_mfront_sparse_gr + visible "and(job_solver_mfront_sparse,*job_option parallel:off)" + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_pardiso_parallel_off_gr + visible "and(job_solver_pardiso,*job_option parallel:off)" + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_pardiso_parallel_on_gr + visible "and(job_solver_pardiso,*job_option parallel:on)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_mfront_sparse_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option mfront_sparse_multi_threading:on" + true_command "*job_option mfront_sparse_multi_threading:on" + false_command "*job_option mfront_sparse_multi_threading:off" + help job_run_multithreading + } + +#ifdef QT_MENTAT + label { + position +2 +4 + size 14 4 + text "# THREADS" + visible "*job_option mfront_sparse_multi_threading:on" + help job_param + } +#else + button { + position +2 +4 + size 14 4 + text "# THREADS" + command "*job_param nthreads" + visible "*job_option mfront_sparse_multi_threading:on" + } +#endif + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option mfront_sparse_multi_threading:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_gpu_gr { + + toggle { + position 0 0 + size 30 4 + text "USE \{GPU(s)}" + toggle "*job_option solver_use_gpu:on" + true_command "*job_option solver_use_gpu:on" + false_command "*job_option solver_use_gpu:off" + help job_solver_gpu + } + + label { + position +2 +4 + size 16 4 + text "\{GPU} SELECTION" + border_width 1 + border_color black + visible "*job_option solver_use_gpu:on" + } + + roller { + position +16 = + size 12 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option solver_gpus:automatic" + "*job_option solver_gpus:user" + rollers "*job_option solver_gpus:automatic" + "*job_option solver_gpus:user" + visible "*job_option solver_use_gpu:on" + help job_solver_gpu + } + + text { + position +12 = + size 16 4 + display job_solver_gpus + command "*clear_job_solver_gpus *job_solver_gpus" + visible "and(*job_option solver_use_gpu:on,*job_option solver_gpus:user)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_pardiso_parallel_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option pardiso_multi_threading:on" + true_command "*job_option pardiso_multi_threading:on" + false_command "*job_option pardiso_multi_threading:off" + help job_run_multithreading + } + +#ifdef QT_MENTAT + label { + position +2 +4 + size 14 4 + text "# THREADS" + visible "*job_option pardiso_multi_threading:on" + help job_param + } +#else + button { + position +2 +4 + size 14 4 + text "# THREADS" + command "*job_param nthreads" + visible "*job_option pardiso_multi_threading:on" + } +#endif + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option pardiso_multi_threading:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_pardiso_parallel_on_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + help job_run_multithreading + toggle true +#ifdef QT_MENTAT + set $dummy dummy +#endif + } + + label { + position +2 +4 + size 14 4 + text "# THREADS" + border_color black + border_width 1 + } + + roller { + position +14 = + size 14 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option pardiso_multi_threading_ddm:automatic" + "*job_option pardiso_multi_threading_ddm:user" + help job_run_multithreading + rollers "*job_option pardiso_multi_threading_ddm:automatic" + "*job_option pardiso_multi_threading_ddm:user" + } + + frame { + position +14 = + size 16 4 + group job_pardiso_multi_threads_ddm_automatic_gr + visible "*job_option pardiso_multi_threading_ddm:automatic" + } + + frame { + position = = + size 16 4 + group job_pardiso_multi_threads_ddm_user_gr + visible "*job_option pardiso_multi_threading_ddm:user" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_pardiso_multi_threads_ddm_automatic_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + border_width 1 + border_color black + } + + integer { + position +8 = + size 8 4 + display valid_domains + visible "*job_option ddm_generator:preprocessor" + } + + integer { + position = = + size 8 4 + display "job_param_ndomains" + visible "*job_option ddm_generator:fea_solver" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_pardiso_multi_threads_ddm_user_gr { + +#ifdef QT_MENTAT + label { + position 0 0 + size 8 4 + text "VALUE" + help job_param + } +#else + button { + position 0 0 + size 8 4 + text "VALUE" + command "*job_param nthreads" + } +#endif + + text { + position +8 = + size 8 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_env_gr { + + roller { + position 1 4 + size 30 4 + nvalues 2 + texts "SINGLE MACHINE" + "NETWORK" + help job_run_ddm_setup + roller "job_option parallel_setup" + commands "*job_option parallel_setup:single" + "*job_option parallel_setup:network" + } + + frame { + position +2 +5 + size 44 18 + group job_parallel_env_network_gr + visible "*job_option parallel_setup:network" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_env_network_gr { + + button { + position 0 0 + size 28 4 + text "HOST FILE" +#ifdef QT_MENTAT + browser host_file_browser +#else + popmenu host_file_browser_pm +#endif + settext $host_file_browser_label "SELECT HOST FILE" + set $host_file_browser_command "*job_host_file" + help job_host_file + } + + button { + position +28 = + size 8 4 + text "EDIT" + command "*job_edit_host_file" + help job_edit_host_file + visible job_host_file + } + + button { + position +8 = + size 8 4 + text "CLEAR" + command "*job_clear_host_file" + help job_clear_host_file + visible job_host_file + } + + display { + position 0 +4 + size 44 4 + display job_host_file + } + + frame { + position 0 +5 + size 44 9 + group job_parallel_env_network_ddm_gr + visible "*job_option parallel:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_env_network_ddm_gr { + + toggle { + position 0 0 + size 22 4 + text "COPY INPUT FILE" + toggle "*job_option copy_input_file:on" + true_command "*job_option copy_input_file:on" + false_command "*job_option copy_input_file:off" + help job_host_copy_inputfile + } + + toggle { + position +23 = + size 21 4 + text "COPY POST FILE" + toggle "*job_option copy_post_file:on" + true_command "*job_option copy_post_file:on" + false_command "*job_option copy_post_file:off" + help job_host_copy_inputfile + } + + label { + position 0 +5 + size 10 4 + text "HOSTS" + border_width 1 + border_color black + visible job_usersub_file + } + + roller { + position +10 = + size 18 4 + nvalues 2 + texts "COMPATIBLE" + "INCOMPATIBLE" + roller "job_option network_hosts" + commands "*job_option network_hosts:compatible" + "*job_option network_hosts:incompatible" + help job_host_comp + visible job_usersub_file + } +} + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu marc_integer_size_pm { + + window { + parent mentat + origin 55 32 + size 32 17 + border_width 1 + border_color border + background_color body + } + mode dialog + + group marc_integer_size_gr +} + + +#-------------------------------------------------------------------------------------------------- +group marc_integer_size_gr { + + popdown { + position 0 0 + size 32 4 + text "DEFAULT" + command "*job_option marc_integer_size:default" + help job_run_intsize + } + + popdown { + position = +4 + size 32 4 + text "4-BYTE INTEGERS" + command "*job_option marc_integer_size:i4" + help job_run_intsize + } + + popdown { + position = +4 + size 32 4 + text "8-BYTE INTEGERS" + command "*job_option marc_integer_size:i8" + help job_run_intsize + } + + popdown { + position = +5 + size 32 4 + text "CANCEL" + help job_run_intsize + } +} +#endif +#endif diff --git a/installation/mods_MarcMentat/2013.1/Mentat_menus/job_run.ms.org b/installation/mods_MarcMentat/2013.1/Mentat_menus/job_run.ms.org new file mode 100644 index 000000000..4c8dde20a --- /dev/null +++ b/installation/mods_MarcMentat/2013.1/Mentat_menus/job_run.ms.org @@ -0,0 +1,3078 @@ +#ifndef AUTOFORGE +popmenu job_title_pm file jobs.ms +popdown job_title_ok file jobs.ms +#ifndef QT_MENTAT +popmenu marc_input_style_pm file job_common.ms +popmenu marc_input_style_run_adv_pm file job_common.ms +popmenu marc_version_run_pm file job_common.ms +#endif + +group job_solver_gr file job_common.ms +group user_domains_gr file domain_decomposition.ms +group user_domains_generate_gr file domain_decomposition.ms +group user_domains_tail_gr file domain_decomposition.ms +group job_solver_opts_gr file job_common.ms +popmenu ddm_options file job_common.ms + +#ifdef QT_MENTAT +browser edit_browser file file.ms +browser directory_browser file file.ms +screen domains file domain_decomposition.ms +#else +popmenu edit_browser_popmenu file file.ms +popmenu directory_browser_popmenu file file.ms +#endif + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu usersub_file_browser_pm { + + group { +#endif + + browser usersub_file_browser { + position 0 0 + size 82 72 + text "$usersub_file_browser_label" ($usersub_file_browser_label) + filter "*.f *.F" + nvisible 10 + select_files true + cancel_action popdown + ok_action popdown + command "$usersub_file_browser_command" ($usersub_file_browser_command) + } +#ifndef QT_MENTAT + } + + window { + title " Select MARC User Subroutine File" + origin 30 30 + size 82 72 + } + + mode dialog + disable_right_mouse_button +} +#endif + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu host_file_browser_pm { + + group { +#endif + + browser host_file_browser { + position 0 0 + size 82 72 + text "$host_file_browser_label" ($host_file_browser_label) + filter "*" + nvisible 10 + select_files true + cancel_action popdown + ok_action popdown + command "$host_file_browser_command" ($host_file_browser_command) + } +#ifndef QT_MENTAT + } + + window { + title " Select MARC Host File" + origin 30 30 + size 82 72 + } + + mode dialog + disable_right_mouse_button +} +#endif + + +#-------------------------------------------------------------------------------------------------- +popmenu job_run_popmenu { + +#ifdef QT_MENTAT + text "RUN JOB" +#endif + + group { + +#ifndef QT_MENTAT + label { + position 0 0 + size 52 4 + text "RUN JOB" + } +#endif + +#ifdef QT_MENTAT + label { + position 0 0 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } +#endif + + button { +#ifdef QT_MENTAT + position 1 9 +#else + position 1 5 +#endif + size 24 4 + text "USER SUBROUTINE FILE" +#ifdef QT_MENTAT + browser usersub_file_browser +#else + popmenu usersub_file_browser_pm +#endif + settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" + set $usersub_file_browser_command "*job_usersub_file" + help job_usersub_file + } + + toggle { + position +26 = + size 22 4 + text "SELECTED USER SUBS" + toggle job_usersubs + help job_run_seluser + visible job_usersubs + popmenu job_usersub_pm + } + + display { + position 1 +4 + size 50 4 + display job_usersub_file + } + + button { + position 1 +4 + size 12 4 + text "EDIT" + command "*job_edit_usersub_file" + visible job_usersub_file + } + + button { + position +12 = + size 12 4 + text "CLEAR" + command "*job_clear_usersub_file" + visible job_usersub_file + } + + roller { + position +12 = + size 26 4 + nvalues 3 + texts "COMPILE / NO SAVE" + "COMPILE AND SAVE" + "RUN SAVED EXECUTABLE" + help job_run_compile + roller "job_option user_source" + visible job_usersub_file +#ifdef QT_MENTAT + commands "*job_option user_source:compile_nosave" + "*job_option user_source:compile_save" + "*job_option user_source:run_saved" +#else + popmenu job_user_source_pm +#endif + } + + toggle { + position 1 +6 + size 22 4 + text "PARALLELIZATION/\{GPU}" + help job_run_parallel + toggle "or(*job_option parallel:on, \ + *job_option assem_recov_multi_threading:on, \ + solver_multi_procs, \ + solver_multi_threads, \ + and(job_solver_mfront_sparse,\ + job_nonsym_off,\ + *job_option solver_use_gpu:on))" + popmenu job_run_parallelization_pm + set $popname2 "job_run_parallelization_pm" + } + + frame { + position +22 = + size 28 16 + border_width 1 + border_color black + + group { + + display { + position 0 0 + size 28 4 + display job_ddm_domains + } + + display { + position = +4 + size 28 4 + display job_assem_recov_nthreads + } + + display { + position = +4 + size 28 4 + display job_solver_procs + visible solver_allows_multi_procs + } + + display { + position = = + size 28 4 + display job_solver_threads + visible "and(solver_allows_multi_threads,\ + not(and(job_solver_mfront_sparse,\ + *job_option parallel:on)))" + } + + display { + position = +4 + size 28 4 + display job_solver_gpu + visible "and(job_solver_mfront_sparse,job_nonsym_off)" + } + } + } + + button { + position 1 +18 + size 8 4 + text "TITLE" + popmenu job_title_pm + command "*job_title" + } + +# see also job_common.ms +# see also the ADVANCED JOB SUBMISSION popmenu in this file + + label { + position +10 = + size 7 4 + text "STYLE" + border_width 1 + border_color black + } + + roller { + position +7 = + size 18 4 + nvalues 3 + texts "TABLE-DRIVEN" + "MULTI-PHYSICS" + "OLD" + rollers "job_input_style_table_driven" + "job_input_style_multi_physics" + "job_input_style_old" +#ifdef QT_MENTAT + commands "*job_option input_style:new *job_option input_physics_style:old" + "*job_option input_physics_style:new *job_option input_style:new" + "*job_option input_style:old *job_option input_physics_style:old" + visibles "job_allows_input_style_table_driven" + "job_allows_input_style_multi_physics" + "job_allows_input_style_old" +#else + popmenu marc_input_style_pm +#endif + help job_option_input_style + } + + button { + position +20 = + size 13 4 + text "SAVE MODEL" + command "*save_model" + } + + button { + position 1 +6 + size 16 6 + text "SUBMIT (1)" + command "*submit_job 1 *monitor_job" + } + + button { + position +16 = + size 34 6 + text "ADVANCED JOB SUBMISSION" + popmenu job_submit_adv_pm + } + + button { + position 1 +6 + size 16 6 + text "UPDATE" + command "*update_job" + } + + button { + position +16 = + size 16 6 + text "MONITOR" + command "*monitor_job" + } + + button { + position +16 = + size 18 6 + text "KILL" + command "*kill_job *monitor_job" + } + + label { + position 1 +7 + size 32 4 + text "STATUS" + border_width 1 + border_color black + } + + display { + position +32 = + size 18 4 + display "job_status" + } + + label { + position -32 +4 + size 32 4 + text "CURRENT INCREMENT (CYCLE)" + border_width 1 + border_color black + } + + display { + position +32 = + size 18 4 + display "job_increment" + } + + label { + position -32 +4 + size 32 4 + text "SINGULARITY RATIO" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_singularity_ratio" + } + + label { + position -32 +4 + size 32 4 + text "CONVERGENCE RATIO" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_convergence_ratio" + } + + label { + position 1 +4 + size 32 4 + text "ANALYSIS TIME" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_analysis_time" + } + + label { + position -32 +4 + size 32 4 + text "WALL TIME" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_time" + } + + frame { + position 1 +4 + size 50 8 + + group { + + frame { + position 0 0 + size 50 8 + text "TOTAL" + border_width 1 + border_color black + group { + + label { + position +6 = + size 13 4 + text "CYCLES" + border_width 1 + border_color black + } + + integer { + position +13 = + size 10 4 + display "acc_job_cycles" + border_width 1 + border_color black + } + + label { + position -13 +4 + size 13 4 + text "SEPARATIONS" + border_width 1 + border_color black + } + + integer { + position +13 = + size 10 4 + display "acc_job_separations" + border_width 1 + border_color black + } + + label { + position +10 -4 + size 11 4 + text "CUT BACKS" + border_width 1 + border_color black + } + + integer { + position +11 = + size 10 4 + display "acc_job_cut_backs" + border_width 1 + border_color black + } + + label { + position -11 +4 + size 11 4 + text "REMESHES" + border_width 1 + border_color black + } + + integer { + position +11 = + size 10 4 + display "acc_job_remeshes" + border_width 1 + border_color black + } + } + } + } + } + + label { + position 1 +8 + size 19 4 + text "EXIT NUMBER" + border_width 1 + border_color black + } + + integer { + position +19 = + size 10 4 + display "job_exit" + } + + button { + position +10 = + size 21 4 + text "EXIT MESSAGE" + popmenu job_exit_msg_pm + help exit_message + } + + label { + position 1 +6 + size 7 4 + text "EDIT" + border_width 1 + border_color black + } + + button { + position +7 = + size 12 4 + text "OUTPUT FILE" + command "*job_edit_output" + } + + button { + position +12 = + size 9 4 + text "LOG FILE" + command "*job_edit_log_file" + } + + button { + position +9 = + size 12 4 + text "STATUS FILE" + command "*job_edit_status_file" + } + + button { + position +12 = + size 10 4 + text "ANY FILE" + settext $edit_browser_label "EDIT FILE" + set $edit_browser_command "*edit_file" +#ifdef QT_MENTAT + browser edit_browser +#else + popmenu edit_browser_popmenu +#endif + help edit_file + } + + popdown { + position 1 +6 + size 32 4 +#ifdef QT_MENTAT + text "OPEN POST FILE (MODEL PLOT RESULTS MENU)" + command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" +#else + text "OPEN POST FILE (RESULTS MENU)" + screen results + command "*post_open_default" +#endif + } + + button { + position 1 +6 + size 12 8 + text "RESET" + command "*job_submit_reset" + } + + popdown { + position +38 = + size 12 8 + text "OK" + } + } + + window job_run_wi { + parent mentat + origin 35 1 + size 52 115 + background_color body + border_width 1 + border_color border + buffering single + } + +#ifdef QT_MENTAT + mode permanent +#else + mode dialog +#endif +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_usersub_pm { + +#ifdef QT_MENTAT + text "CURRENTLY SELECTED USER SUBROUTINES" +#endif + + group { + +#ifndef QT_MENTAT + label { + position 0 0 + size 66 4 + text "CURRENTLY SELECTED USER SUBROUTINES" + } +#endif + + display { + position 1 +5 + size 64 86 + display "job_usersubs" + } + + popdown { + position 27 +88 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 8 + size 66 102 + background_color body + border_width 1 + border_color border + buffering single + } + + mode dialog +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_submit_adv_pm { + +#ifdef QT_MENTAT + text "ADVANCED JOB SUBMISSION" +#endif + + group { + +#ifndef QT_MENTAT + label { + position 0 0 + size 50 4 + text "ADVANCED JOB SUBMISSION" + } +#endif + +#ifdef QT_MENTAT + label { + position 0 0 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } +#endif + + label { +#ifdef QT_MENTAT + position 1 9 +#else + position 1 5 +#endif + size 19 4 + text "INITIAL ALLOCATION" + border_width 1 + border_color black + } +#ifdef QT_MENTAT + label { + position +19 = + size 15 4 + text "GENERAL MEMORY" + help job_param_general_init_allocation + } +#else + button { + position +19 = + size 15 4 + text "GENERAL MEMORY" + help job_param_general_init_allocation + command "*job_param general_init_allocation" + } +#endif + text { + position +15 = + size 10 4 + display "job_param_value_general_init_allocation" + command "*job_param general_init_allocation" + help job_param_general_init_allocation + } + + label { + position +10 = + size 4 4 + text "MB" + border_width 1 + border_color black + } + + toggle { + position 1 +5 + size 32 4 + text "OUT-OF-CORE ELEMENT STORAGE" + help job_param_elsto + toggle "*job_option elsto:on" + true_command "*job_option elsto:on" + false_command "*job_option elsto:off" + } + + toggle { + position 1 +4 + size 32 4 + text "OUT-OF-CORE INCREMENTAL BACKUP" + help job_param_inc_backup_storage + toggle "*job_option inc_backup_storage:out_of_core" + true_command "*job_option inc_backup_storage:out_of_core" + false_command "*job_option inc_backup_storage:in_core" + } + + toggle { + position +34 = + size 14 4 + text "CHECK SIZES" + help job_run_check + toggle "*job_option check:on" + true_command "*job_option check:on" + false_command "*job_option check:off" + } + + label { + position 1 +6 + size 16 4 + text "INTEGER SIZE" + border_width 1 + border_color black + } + + roller { + position +16 = + size 32 4 + nvalues 3 + texts "DEFAULT" + "4-BYTE INTEGERS" + "8-BYTE INTEGERS" +#ifdef QT_MENTAT + commands "*job_option marc_integer_size:default" + "*job_option marc_integer_size:i4" + "*job_option marc_integer_size:i8" +#else + popmenu marc_integer_size_pm +#endif + help job_run_intsize + roller "job_option marc_integer_size" + } + + frame { + position 1 +6 + size 48 12 + text "MARC INPUT FILE" + border_width 1 + border_color black + + group { + + label { + position 0 4 + size 9 4 + text "VERSION" + border_width 1 + border_color black + } + + roller { + position +9 = + size 14 4 + nvalues 17 + nvisible 17 + texts "DEFAULT" +#if 0 + "2013.1" +#endif + "2013" + "2012" + "2011" + "2010.2" + "2010" + "2008" + "2007" + "2005R3" + "2005" + "2003" + "2001" + "2000" +#if 0 + "8" +#endif + "K7" + "K6.2" + "K5" + "K4" + help job_param_version + rollers "job_input_version_default" +#if 0 + "job_input_version_2013.1" +#endif + "job_input_version_2013" + "job_input_version_2012" + "job_input_version_2011" + "job_input_version_2010.2" + "job_input_version_2010" + "job_input_version_2008" + "job_input_version_2007" + "job_input_version_2005r3" + "job_input_version_2005" + "job_input_version_2003" + "job_input_version_2001" + "job_input_version_2000" +#if 0 + "job_input_version_8" +#endif + "job_input_version_k7" + "job_input_version_k6" + "job_input_version_k5" + "job_input_version_k4" +#ifdef QT_MENTAT + commands "*job_option version:default" +#if 0 + "*job_option version:2013.1" +#endif + "*job_option version:2013" + "*job_option version:2012" + "*job_option version:2011" + "*job_option version:2010.2" + "*job_option version:2010" + "*job_option version:2008" + "*job_option version:2007" + "*job_option version:2005r3" + "*job_option version:2005" + "*job_option version:2003" + "*job_option version:2001" + "*job_option version:2000" +#if 0 + "*job_option version:8" +#endif + "*job_option version:k7" + "*job_option version:k6" + "*job_option version:k5" + "*job_option version:k4" + visibles "job_allows_input_version_default" +#if 0 + "job_allows_input_version_2013.1" +#endif + "job_allows_input_version_2013" + "job_allows_input_version_2012" + "job_allows_input_version_2011" + "job_allows_input_version_2010.2" + "job_allows_input_version_2010" + "job_allows_input_version_2008" + "job_allows_input_version_2007" + "job_allows_input_version_2005r3" + "job_allows_input_version_2005" + "job_allows_input_version_2003" + "job_allows_input_version_2001" + "job_allows_input_version_2000" +#if 0 + "job_allows_input_version_8" +#endif + "job_allows_input_version_k7" + "job_allows_input_version_k6" + "job_allows_input_version_k5" + "job_allows_input_version_k4" +#else + popmenu marc_version_run_pm +#endif + } + +# see also job_common.ms +# see also the RUN JOB popmenu in this file + + label { + position +14 = + size 7 4 + text "STYLE" + border_width 1 + border_color black + } + + roller { + position +7 = + size 18 4 + nvalues 3 + texts "TABLE-DRIVEN" + "MULTI-PHYSICS" + "OLD" + rollers "job_input_style_table_driven" + "job_input_style_multi_physics" + "job_input_style_old" +#ifdef QT_MENTAT + commands "*job_option input_style:new *job_option input_physics_style:old" + "*job_option input_physics_style:new *job_option input_style:new" + "*job_option input_style:old *job_option input_physics_style:old" + visibles "job_allows_input_style_table_driven" + "job_allows_input_style_multi_physics" + "job_allows_input_style_old" +#else + popmenu marc_input_style_run_adv_pm +#endif + help job_option_input_style + } + + toggle { + position 0 +4 + size 48 4 + text "EXTENDED PRECISION" + help job_run_precision + toggle "*job_option inp_file_prec:extended" + true_command "*job_option inp_file_prec:extended" + false_command "*job_option inp_file_prec:normal" + } + } + } + + button { + position 1 +14 + size 24 4 + text "SCRATCH DIRECTORY" + settext $directory_browser_label "JOB SCRATCH DIRECTORY" + set $directory_browser_command "*job_scratch_directory" +#ifdef QT_MENTAT + browser directory_browser +#else + popmenu directory_browser_popmenu +#endif + help job_scratch_directory + } + + button { + position +24 = + size 24 4 + text "CLEAR" + command "*job_clear_scratch_directory" + visible job_scratch_directory + } + + text { + position 1 +4 + size 48 4 + display job_scratch_dir + command "*job_scratch_directory" + } + +#ifdef DCOM + toggle { + position 1 +6 + size 8 4 + text "\{DCOM}" + toggle "*job_option dcom:on" + help job_run_dcom + true_command "*job_option dcom:on" + false_command "*job_option dcom:off" + visible win32_available + } + + button { + position +8 = + size 12 4 + text "HOSTNAME" + command "*job_dcom_hostname" + visible "and(win32_available, *job_option dcom:on)" + } + + text job_dcom_hostname { + position +12 = + size 28 4 + display "job_dcom_hostname" + command "*job_dcom_hostname" + visible "and(win32_available, *job_option dcom:on)" + } +#endif + + button { + position 1 +6 + size 24 4 + text "TITLE" + popmenu job_title_pm + command "*job_title" + } + + button { + position +24 = + size 24 4 + text "SAVE MODEL" + command "*save_model" + } + + button { + position +4 +6 + size 20 4 + text "WRITE INPUT FILE" + command "*job_write_input" + } + + button { + position = +4 + size 20 4 + text "EDIT INPUT FILE" + command "*job_edit_input" + } + + popdown { + position 1 +5 + size 20 6 + text "SUBMIT 1" + command "*submit_job 1 *monitor_job" + } + + popdown { + position +28 = + size 20 6 + text "EXECUTE 1" + command "*execute_job 1 *monitor_job" + } + + popdown { + position -28 +6 + size 20 6 + text "SUBMIT 2" + command "*submit_job 2 *monitor_job" + } + + popdown { + position +28 = + size 20 6 + text "EXECUTE 2" + command "*execute_job 2 *monitor_job" + } + + popdown { + position -28 +6 + size 20 6 + text "SUBMIT 3" + command "*submit_job 3 *monitor_job" + } + + popdown { + position +28 = + size 20 6 + text "EXECUTE 3" + command "*execute_job 3 *monitor_job" + } + + popdown { + position 19 +8 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 8 +#ifdef DCOM + size 50 100 +#else + size 50 94 +#endif + background_color body + border_width 1 + border_color border + buffering single + } + +#ifdef QT_MENTAT + mode permanent +#else + mode dialog +#endif +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_exit_msg_pm { + +#ifdef QT_MENTAT + text "EXIT MESSAGE" +#endif + + group { + +#ifndef QT_MENTAT + label { + position 0 0 + size 86 4 + text "EXIT MESSAGE" + } + + display { + position 1 5 + size 84 74 + display "job_exit_msg" + } +#endif + +#ifdef QT_MENTAT + + text { + position 1 5 + size 84 74 + multiline + readonly + display "job_exit_msg" + } + +#endif + popdown { + position 37 +76 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 8 + size 86 90 + background_color body + border_width 1 + border_color border + buffering single + } + + mode dialog +} + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu job_user_source_pm { + + window { + parent job_run_wi + origin 25 17 + size 26 17 + border_width 1 + border_color border + background_color body + } + mode dialog + + group job_user_source_gr +} + + +#-------------------------------------------------------------------------------------------------- +group job_user_source_gr { + popdown { + position 0 0 + size 26 4 + text "COMPILE / NO SAVE" + command "*job_option user_source:compile_nosave" + } + + popdown { + position = +4 + size 26 4 + text "COMPILE AND SAVE" + command "*job_option user_source:compile_save" + } + + popdown { + position = +4 + size 26 4 + text "RUN SAVED EXECUTABLE" + command "*job_option user_source:run_saved" + } + + popdown { + position = +5 + size 26 4 + text "CANCEL" + } +} +#endif + + +#-------------------------------------------------------------------------------------------------- +popmenu job_run_parallelization_pm { + +#ifdef QT_MENTAT + text "PARALLELIZATION/\{GPU}" +#endif + + group { + +#ifndef QT_MENTAT + label { + position 0 0 + size 60 4 + text "PARALLELIZATION/GPU" + } +#endif + +#ifdef QT_MENTAT + label { + position 0 0 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } +#endif + + frame { +#ifdef QT_MENTAT + position 1 9 +#else + position 1 5 +#endif + size 48 28 + group job_ddm_gr + text "DOMAIN DECOMPOSITION" + border_width 1 + border_color black + } + + frame { + position 1 +29 + size 36 13 + group job_assem_recov_gr + text "ASSEMBLY AND RECOVERY" + border_width 1 + border_color black + } + + frame { + position 1 +14 + size 58 31 + group job_parallel_matrix_solver_gr + text "MATRIX SOLVER" + border_width 1 + border_color black + } + + frame { + position 1 +32 + size 48 28 + group job_parallel_env_gr + text "PARALLELIZATION ENVIRONMENT" + border_width 1 + border_color black + visible "or(*job_option parallel:on, \ + solver_multi_procs)" + } + + popdown { + position 24 +30 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 1 + size 60 119 + background_color body + border_width 1 + border_color border + buffering single + } +#ifdef QT_MENTAT + mode permanent +#else + mode dialog +#endif +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_gr { + + toggle { + position 1 4 + size 30 4 + text "USE \{DDM}" + toggle "*job_option parallel:on" + help job_run_ddm_use + true_command "*job_option parallel:on" + false_command "*job_option parallel:off" + } + + frame { + position +2 +5 + size 44 18 + group job_ddm_use_gr + visible "*job_option parallel:on" + } +} + +group job_ddm_use_gr { + roller { + position 0 0 + size 30 4 + nvalues 2 + texts "DECOMPOSITION IN MARC" + "DECOMPOSITION IN MENTAT" + roller "job_option ddm_generator" +#ifdef QT_MENTAT + commands "*job_option ddm_generator:fea_solver" + "*job_option ddm_generator:preprocessor" +#else + popmenu job_ddm_generator_pm +#endif + help job_run_ddm_generator + } + + frame { + position 0 +5 + size 44 8 + group job_ddm_fea_solver_gr + visible "*job_option ddm_generator:fea_solver" + } + + frame { + position = = + size 44 8 + group job_ddm_preprocessor_gr + visible "*job_option ddm_generator:preprocessor" + } + + text { + position 0 +9 + size 22 4 +#ifdef QT_MENTAT + text "Single Input File" +#else + text "SINGLE INPUT FILE" +#endif + readonly + visible "*job_option ddm_generator:fea_solver" + } + + roller { + position = = + size 22 4 + nvalues 2 + texts "MULTIPLE INPUT FILES" + "SINGLE INPUT FILE" + roller "job_option ddm_single_input" + commands "*job_option ddm_single_input:off" + "*job_option ddm_single_input:on" + visible "*job_option ddm_generator:preprocessor" + help job_run_ddm_single_input + } + + roller { + position +23 = + size 21 4 + nvalues 2 + texts "MULTIPLE POST FILES" + "SINGLE POST FILE" + roller "job_option ddm_single_post" + commands "*job_option ddm_single_post:off" + "*job_option ddm_single_post:on" + help job_run_ddm_single_post + } +} + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu job_ddm_generator_pm { + + window { + parent mentat + origin 42 19 + size 30 13 + border_width 1 + border_color border + background_color body + } + + mode dialog + + group job_ddm_generator_gr +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_generator_gr { + + popdown { + position 0 0 + size 30 4 + text "DECOMPOSITION IN MARC" + command "*job_option ddm_generator:fea_solver" + help job_run_ddm_generator + } + + popdown { + position = +4 + size 30 4 + text "DECOMPOSITION IN MENTAT" + command "*job_option ddm_generator:preprocessor" + help job_run_ddm_generator + } + + popdown { + position = +5 + size 30 4 + text "CANCEL" + help job_run_ddm_generator + } +} +#endif + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_fea_solver_gr { + +#ifdef QT_MENTAT + label { + position 0 0 + size 10 4 + text "# DOMAINS" + help job_param + } +#else + button { + position 0 0 + size 10 4 + text "# DOMAINS" + command "*job_param ndomains" + } +#endif + + text { + position +10 = + size 4 4 + display "job_param_value_ndomains" + command "*job_param ndomains" + } + + label { + position +4 = + size 7 4 + text "METHOD" + border_width 1 + border_color black + } + + roller { + position +7 = + size 23 4 + nvalues 7 + texts "METIS BEST" + "METIS ELEMENT" + "METIS NODE" + "REC. COORD. BISECTION" + "VECTOR" + "RADIAL" + "ANGULAR" + help set_job_decomp_type + rollers "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" +#ifdef QT_MENTAT + commands "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" +#else + popmenu job_ddm_method_pm +#endif + } + + button { + position +4 +4 + size 19 4 + text "ADVANCED SETTINGS" +#ifdef QT_MENTAT + popmenu job_ddm_fea_solver_pm +#else + screen job_ddm_fea_solver_sc + command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) +#endif + } +} + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu job_ddm_method_pm { + + window { + parent mentat + origin 56 24 + size 30 33 + border_width 1 + border_color border + background_color body + } + + mode dialog + + group job_ddm_method_gr +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_method_gr { + + popdown { + position 0 0 + size 30 4 + text "METIS BEST" + command "*job_option ddm_method:metis_best" + } + + popdown { + position = +4 + size 30 4 + text "METIS ELEMENT BASED" + command "*job_option ddm_method:metis_element_based" + } + + popdown { + position = +4 + size 30 4 + text "METIS NODE BASED" + command "*job_option ddm_method:metis_node_based" + } + + popdown { + position = +4 + size 30 4 + text "RECURSIVE COORDINATE BISECTION" + command "*job_option ddm_method:recur_coord_bisect" + } + + popdown { + position = +4 + size 30 4 + text "VECTOR" + command "*job_option ddm_method:vector" + } + + popdown { + position = +4 + size 30 4 + text "RADIAL" + command "*job_option ddm_method:radial" + } + + popdown { + position = +4 + size 30 4 + text "ANGULAR" + command "*job_option ddm_method:angular" + } + + popdown { + position = +5 + size 30 4 + text "CANCEL" + } +} +#endif + + +#ifdef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu job_ddm_fea_solver_pm { + + text "JOB PARALLELIZATION" +#else +screen job_ddm_fea_solver_sc { + + menu { +#endif + + group { + units 32 120 + +#ifndef QT_MENTAT + label { + position 0 0 + size 32 4 + text "JOB PARALLELIZATION" + } +#endif + + label { + position 0 5 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + +#ifdef QT_MENTAT + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } +#endif + + frame { + +#ifdef QT_MENTAT + position 0 +9 +#else + position 0 +5 +#endif + size 32 76 + text "ADVANCED DECOMPOSITION IN MARC" + border_width 1 + border_color black + + group { + +#ifdef QT_MENTAT + label { + position 1 4 + size 16 4 + text "# DOMAINS" + help job_param + } +#else + button { + position 1 4 + size 16 4 + text "# DOMAINS" + command "*job_param ndomains" + } +#endif + + text { + position +16 = + size 14 4 + display "job_param_value_ndomains" + command "*job_param ndomains" + } + + label { + position 1 +4 + size 7 4 + text "METHOD" + border_width 1 + border_color black + } + + roller { + position +7 = + size 23 4 + nvalues 7 + texts "METIS BEST" + "METIS ELEMENT" + "METIS NODE" + "REC. COORD. BISECTION" + "VECTOR" + "RADIAL" + "ANGULAR" + help set_job_decomp_type + rollers "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" +#ifdef QT_MENTAT + commands "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" +#else + popmenu job_ddm_method2_pm +#endif + } + + frame { + position 1 +5 + size 30 20 + group job_ddm_direction_gr + visible "or(*job_option ddm_method:vector, \ + *job_option ddm_method:radial, \ + *job_option ddm_method:angular)" + } + + toggle { + position 1 +21 + size 30 4 + text "DOMAIN ISLAND REMOVAL" + toggle "*job_option ddm_island_removal:on" + true_command "*job_option ddm_island_removal:on" + false_command "*job_option ddm_island_removal:off" + } + + label { + position 1 +4 + size 15 4 + border_width 1 + border_color black + text "GRAPH" + } + + roller { + position +15 = + size 15 4 + nvalues 2 + texts "COARSE" + "FINE" + help ddm_decomp_coarse_graph + rollers "*job_option ddm_graph:coarse" + "*job_option ddm_graph:fine" + commands "*job_option ddm_graph:coarse" + "*job_option ddm_graph:fine" + visible "or(*job_option ddm_method:metis_best, \ + *job_option ddm_method:metis_element_based, \ + *job_option ddm_method:metis_node_based)" + } + + label { + position 1 +4 + size 15 4 + border_width 1 + border_color black + text "QUADRATIC ELEMENTS" + } + + roller { + position +15 = + size 15 4 + nvalues 2 + texts "GENUINE" + "LINEARIZED" + help job_run_ddm_decomp_linearized + rollers "*job_option ddm_quadr_elems:genuine" + "*job_option ddm_quadr_elems:linearized" + commands "*job_option ddm_quadr_elems:genuine" + "*job_option ddm_quadr_elems:linearized" + } + +#ifdef QT_MENTAT + label { + position 1 +5 + size 15 4 + text "ELEMENT WEIGHT FACTOR" + help job_param + } +#else + button { + position 1 +5 + size 15 4 + text "ELEMENT WEIGHT FACTOR" + command "*job_param ddm_elem_weight_factor" + help job_run_ddm_decomp_element_weight_factor + } +#endif + + text { + position +15 = + size 15 4 + display "job_param_value_ddm_elem_weight_factor" + command "*job_param ddm_elem_weight_factor" + help job_run_ddm_decomp_element_weight_factor + } + + toggle { + position 1 +5 + size 30 4 + text "DETECT CONTACT" + toggle "*job_option ddm_detect_contact:on" + true_command "*job_option ddm_detect_contact:on" + false_command "*job_option ddm_detect_contact:off" + visible "or(*job_option ddm_method:metis_best, \ + *job_option ddm_method:metis_element_based, \ + *job_option ddm_method:metis_node_based)" + help job_run_ddm_decomp_detect_contact + } + +#ifdef QT_MENTAT + label { + position = +5 + size 15 4 + text "CONTACT TOLERANCE" + visible "*job_option ddm_detect_contact:on" + } +#else + button { + position = +5 + size 15 4 + text "CONTACT TOLERANCE" + command "*job_param ddm_contact_tolerance" + visible "*job_option ddm_detect_contact:on" + help job_run_ddm_decomp_contact_tolerance + } +#endif + + text { + position +15 = + size 15 4 + command "*set_ddm_contact_tolerance" + display "job_param_value_ddm_contact_tolerance" + command "*job_param ddm_contact_tolerance" + visible "*job_option ddm_detect_contact:on" + help job_run_ddm_decomp_contact_tolerance + } + +#ifdef QT_MENTAT + label { + position -15 +4 + size 15 4 + text "CONTACT CONSTR FACTOR" + visible "*job_option ddm_detect_contact:on" + } +#else + button { + position -15 +4 + size 15 4 + text "CONTACT CONSTR FACTOR" + command "*job_param ddm_contact_constr_factor" + visible "*job_option ddm_detect_contact:on" + help job_run_ddm_decomp_contact_constraint_factor + } +#endif + + text { + position +15 = + size 15 4 + display "job_param_value_ddm_contact_constr_factor" + command "*job_param ddm_contact_constr_factor" + visible "*job_option ddm_detect_contact:on" + help job_run_ddm_decomp_contact_constraint_factor + } + } + } + +#ifdef QT_MENTAT + popdown { + position 0 +77 + size 32 8 + text "OK" + } +#else + frame { + position 0 +77 + size 32 8 + group ok2_gr + } + + frame select_frame + frame inactive_return +#endif + } +#ifndef QT_MENTAT + window main_window + disable_right_mouse_button + } + + menu transform +} # job_ddm_fea_solver_sc +#else + mode permanent +} # job_ddm_fea_solver_pm +#endif + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu job_ddm_method2_pm { + + window { + parent mentat + origin 1 22 + size 30 33 + border_width 1 + border_color border + background_color body + } + + mode dialog + + group job_ddm_method_gr +} +#endif + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_direction_gr { + + button { + position 0 0 + size 15 4 + text "DIRECTION" + command "*job_vector ddm_sort_direction_x" + visible "*job_option ddm_method:vector" + } + + button { + position = = + size 15 4 + text "DIRECTION" + command "*job_vector ddm_sort_direction_x" + visible "not(*job_option ddm_method:vector)" + } + + button { + position +15 = + size 15 4 + text "FROM / TO" + command "*job_vector_from_to ddm_sort_direction_x" + } + + text { + position -15 +4 + size 10 4 + command "*job_param ddm_sort_direction_x" + display "job_param_value_ddm_sort_direction_x" + help ddm_job_decomp_user_direction_x + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_direction_y" + display "job_param_value_ddm_sort_direction_y" + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_direction_z" + display "job_param_value_ddm_sort_direction_z" + } + + frame { + position 0 +4 + size 30 8 + group job_ddm_sort_point_gr + visible "not(*job_option ddm_method:vector)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_sort_point_gr { + + label { + position 0 0 + size 14 4 + border_width 1 + border_color black + text "POINT ON AXIS" + } + + roller { + position +14 = + size 10 4 + nvalues 2 + texts "DEFAULT" + "USER" + roller "job_option ddm_sort_point" +#ifdef QT_MENTAT + commands "*job_option ddm_sort_point:default" + "*job_option ddm_sort_point:user" +#else + popmenu job_ddm_sort_point_meth_pm +#endif + } + + button { + position +10 = + size 6 4 + text "SET" + command "*job_position ddm_sort_point_x" + visible "*job_option ddm_sort_point:user" + } + + text { + position 0 +4 + size 10 4 + command "*job_param ddm_sort_point_x" + display "job_param_value_ddm_sort_point_x" + visible "*job_option ddm_sort_point:user" + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_point_y" + display "job_param_value_ddm_sort_point_y" + visible "*job_option ddm_sort_point:user" + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_point_z" + display "job_param_value_ddm_sort_point_z" + visible "*job_option ddm_sort_point:user" + } +} + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu job_ddm_sort_point_meth_pm { + + window { + parent mentat + origin 15 35 + size 14 13 + border_width 1 + border_color border + background_color body + } + + mode dialog + + group job_ddm_sort_point_meth_gr +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_sort_point_meth_gr { + + popdown { + position 0 0 + size 14 4 + text "DEFAULT" + command "*job_option ddm_sort_point:default" + } + + popdown { + position = +4 + size 14 4 + text "USER DEFINED" + command "*job_option ddm_sort_point:user" + } + + popdown { + position = +5 + size 14 4 + text "CANCEL" + } +} +#endif + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_preprocessor_gr { + + label { + position 0 0 + size 10 4 + text "# DOMAINS" + border_width 1 + border_color black + } + + integer { + position +10 = + size 4 4 + display valid_domains + } + + button { + position +4 = + size 30 4 + text "USER DOMAINS" +#ifdef QT_MENTAT + screen domains +#else + screen job_ddm_user_domains_sc + command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) +#endif + help job_run_ddm_user_domains + } +} + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +screen job_ddm_user_domains_sc { + + menu { + + group { + units 32 120 + + label { + position 0 0 + size 32 4 + text "USER DOMAINS" + } + + frame { + position 0 5 + size 32 28 + group user_domains_gr + } + + frame { + position 0 +29 + size 32 49 + group user_domains_generate_gr + } + + frame { + position 0 +50 + size 32 8 + group user_domains_tail_gr + } + + frame { + position 0 92 + size 32 8 + group ok2_gr + } + + frame select_frame + frame inactive_return + } + window main_window + disable_right_mouse_button + + } + + menu transform + +} # job_ddm_user_domains_sc +#endif + + +#-------------------------------------------------------------------------------------------------- +group job_assem_recov_gr { + + toggle { + position 1 +4 + size 30 4 + text "MULTIPLE THREADS" + true_command "*job_option assem_recov_multi_threading:on" + false_command "*job_option assem_recov_multi_threading:off" + toggle "*job_option assem_recov_multi_threading:on" + } + +#ifdef QT_MENTAT + label { + position +2 +4 + size 12 4 + text "# THREADS" + visible "*job_option assem_recov_multi_threading:on" + } +#else + button { + position +2 +4 + size 12 4 + text "# THREADS" + command "*job_param assem_recov_nthreads" + visible "*job_option assem_recov_multi_threading:on" + } +#endif + + text { + position +12 = + size 4 4 + display "job_param_value_assem_recov_nthreads" + command "*job_param assem_recov_nthreads" + visible "*job_option assem_recov_multi_threading:on" + } + + label { + position +4 = + size 12 4 + visible "and(*job_option assem_recov_multi_threading:on, \ + *job_option parallel:on)" + text "PER DOMAIN" + border_width 1 + border_color black + } + + display { + position +12 = + size 4 4 + display "job_assem_recov_nthreads_dom" + visible "and(*job_option assem_recov_multi_threading:on, \ + *job_option parallel:on)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_matrix_solver_gr { + + label { + position 3 4 + size 12 4 + text "SOLUTION" + border_width 1 + border_color black + } + + roller { + position +12 = + size 18 4 + nvalues 2 + texts "SYMMETRIC" + "NONSYMMETRIC" + rollers job_nonsym_off + job_nonsym_on + commands "*job_option solver_nonsym:off" + "*job_option solver_nonsym:on" + help job_param_solver_method + } + + label { + position -12 +4 + size 6 4 + text "TYPE" + border_width 1 + border_color black + } + + roller { + position +6 = + size 24 4 + nvalues 9 + help job_param_solver_method + texts "MULTIFRONTAL SPARSE" + "MIXED DIRECT-ITERATIVE" + "CASI ITERATIVE" + "PARDISO DIRECT SPARSE" + "MUMPS PARALLEL DIRECT" + "HARDWARE SPARSE" + "ITERATIVE SPARSE" + "DIRECT PROFILE" + "DIRECT SPARSE" + rollers job_solver_mfront_sparse + job_solver_mixed_direct_iterative + job_solver_it_ext + job_solver_pardiso + job_solver_mumps + job_solver_sparse + job_solver_it_sparse + job_solver_dir_profile + job_solver_dir_sparse +#ifdef QT_MENTAT + commands "*job_option solver:mfront_sparse" + "*job_option solver:mixed_direct_iterative" + "*job_option solver:it_ext" + "*job_option solver:pardiso" + "*job_option solver:mumps" + "*job_option solver:sparse" + "*job_option solver:it_sparse" + "*job_option solver:dir_profile" + "*job_option solver:dir_sparse" + visibles job_allows_solver_mfront_sparse + job_allows_solver_mixed_direct_iterative + job_allows_solver_it_ext + job_allows_solver_pardiso + job_allows_solver_mumps + job_allows_solver_sparse + job_allows_solver_it_sparse + job_allows_solver_dir_profile + job_allows_solver_dir_sparse + help job_param_solver_method +#else + popmenu job_set_parallel_matrix_solver_pm +#endif + } + + button { + position +24 = + size 10 4 + text "OPTIONS" + popmenu job_parallel_matrix_solver_opt_pm + } + + frame { + position +10 = + size 14 4 + group job_run_solver_ddm_opts_gr + visible "*job_option parallel:on" + } + + frame { + position 1 +5 + size 46 8 + group job_solver_multi_procs_gr + visible solver_allows_multi_procs + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_gr + visible solver_allows_multi_threads + } + + frame { + position 1 +9 + size 46 8 + group job_solver_gpu_gr + visible "and(job_solver_mfront_sparse,job_nonsym_off)" + } +} + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu job_set_parallel_matrix_solver_pm { + window { + parent mentat + origin 48 61 + size 24 42 + border_width 1 + border_color border + background_color body + } + mode dialog + + group job_solver_gr +} +#endif + + +#-------------------------------------------------------------------------------------------------- +popmenu job_parallel_matrix_solver_opt_pm { + +#ifdef QT_MENTAT + text "MATRIX SOLVER OPTIONS" +#endif + + group { + +#ifndef QT_MENTAT + label { + position 0 0 + size 38 4 + text "MATRIX SOLVER OPTIONS" + } +#endif + + frame { + position 1 5 + size 36 23 + group job_solver_opts_gr + } + + popdown { + position 13 +25 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 41 12 + size 38 39 + border_width 1 + border_color border + background_color body + } + mode dialog +} + + +#-------------------------------------------------------------------------------------------------- +group job_run_solver_ddm_opts_gr { + + button { + position 0 0 + size 14 4 + text "\{DDM} OPTIONS" + popmenu ddm_options +# see also job_common.ms! + visible "not(or(job_solver_it_sparse, \ + job_solver_it_ext, \ + job_solver_mixed_direct_iterative, \ + job_solver_pardiso, \ + job_solver_mumps))" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_procs_gr { + frame { + position 0 0 + size 46 8 + group job_solver_multi_procs_parallel_off_gr + visible "*job_option parallel:off" + } + + frame { + position = = + size 46 8 + group job_solver_multi_procs_parallel_on_gr + visible "*job_option parallel:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_procs_parallel_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE SOLVER PROCESSES" + true_command "*job_option nsolver_procs_serial:on" + false_command "*job_option nsolver_procs_serial:off" + toggle "*job_option nsolver_procs_serial:on" + help job_run_multithreading + } + +#ifdef QT_MENTAT + label { + position +2 +4 + size 14 4 + text "# PROCESSES" + visible "*job_option nsolver_procs_serial:on" + help job_param + } +#else + button { + position +2 +4 + size 14 4 + text "# PROCESSES" + command "*job_param nsolver_procs" + visible "*job_option nsolver_procs_serial:on" + } +#endif + + text { + position +14 = + size 14 4 + display "job_param_value_nsolver_procs" + command "*job_param nsolver_procs" + visible "*job_option nsolver_procs_serial:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_procs_parallel_on_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE SOLVER PROCESSES" + help job_run_multithreading + toggle true +#ifdef QT_MENTAT + set $dummy dummy +#endif + } + + label { + position +2 +4 + size 14 4 + text "# PROCESSES" + border_width 1 + border_color black + } + + roller { + position +14 = + size 14 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option nsolver_procs_ddm:automatic" + "*job_option nsolver_procs_ddm:user" + help job_run_multithreading + rollers "*job_option nsolver_procs_ddm:automatic" + "*job_option nsolver_procs_ddm:user" + } + + frame { + position +14 = + size 16 4 + group job_nsolver_procs_ddm_automatic_gr + visible "*job_option nsolver_procs_ddm:automatic" + } + + frame { + position = = + size 16 4 + group job_nsolver_procs_ddm_user_gr + visible "*job_option nsolver_procs_ddm:user" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_nsolver_procs_ddm_automatic_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + border_width 1 + border_color black + } + + integer { + position +8 = + size 8 4 + display valid_domains + visible "*job_option ddm_generator:preprocessor" + } + + integer { + position = = + size 8 4 + display "job_param_ndomains" + visible "*job_option ddm_generator:fea_solver" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_nsolver_procs_ddm_user_gr { + +#ifdef QT_MENTAT + label { + position 0 0 + size 8 4 + text "VALUE" + help job_param + } +#else + button { + position 0 0 + size 8 4 + text "VALUE" + command "*job_param nsolver_procs" + } +#endif + + text { + position +8 = + size 8 4 + display "job_param_value_nsolver_procs" + command "*job_param nsolver_procs" + } +} + +group job_solver_multi_threads_gr { + frame { + position 0 0 + size 30 8 + group job_solver_multi_threads_mfront_sparse_gr + visible "and(job_solver_mfront_sparse,*job_option parallel:off)" + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_pardiso_parallel_off_gr + visible "and(job_solver_pardiso,*job_option parallel:off)" + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_pardiso_parallel_on_gr + visible "and(job_solver_pardiso,*job_option parallel:on)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_mfront_sparse_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option mfront_sparse_multi_threading:on" + true_command "*job_option mfront_sparse_multi_threading:on" + false_command "*job_option mfront_sparse_multi_threading:off" + help job_run_multithreading + } + +#ifdef QT_MENTAT + label { + position +2 +4 + size 14 4 + text "# THREADS" + visible "*job_option mfront_sparse_multi_threading:on" + help job_param + } +#else + button { + position +2 +4 + size 14 4 + text "# THREADS" + command "*job_param nthreads" + visible "*job_option mfront_sparse_multi_threading:on" + } +#endif + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option mfront_sparse_multi_threading:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_gpu_gr { + + toggle { + position 0 0 + size 30 4 + text "USE \{GPU(s)}" + toggle "*job_option solver_use_gpu:on" + true_command "*job_option solver_use_gpu:on" + false_command "*job_option solver_use_gpu:off" + help job_solver_gpu + } + + label { + position +2 +4 + size 16 4 + text "\{GPU} SELECTION" + border_width 1 + border_color black + visible "*job_option solver_use_gpu:on" + } + + roller { + position +16 = + size 12 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option solver_gpus:automatic" + "*job_option solver_gpus:user" + rollers "*job_option solver_gpus:automatic" + "*job_option solver_gpus:user" + visible "*job_option solver_use_gpu:on" + help job_solver_gpu + } + + text { + position +12 = + size 16 4 + display job_solver_gpus + command "*clear_job_solver_gpus *job_solver_gpus" + visible "and(*job_option solver_use_gpu:on,*job_option solver_gpus:user)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_pardiso_parallel_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option pardiso_multi_threading:on" + true_command "*job_option pardiso_multi_threading:on" + false_command "*job_option pardiso_multi_threading:off" + help job_run_multithreading + } + +#ifdef QT_MENTAT + label { + position +2 +4 + size 14 4 + text "# THREADS" + visible "*job_option pardiso_multi_threading:on" + help job_param + } +#else + button { + position +2 +4 + size 14 4 + text "# THREADS" + command "*job_param nthreads" + visible "*job_option pardiso_multi_threading:on" + } +#endif + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option pardiso_multi_threading:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_pardiso_parallel_on_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + help job_run_multithreading + toggle true +#ifdef QT_MENTAT + set $dummy dummy +#endif + } + + label { + position +2 +4 + size 14 4 + text "# THREADS" + border_color black + border_width 1 + } + + roller { + position +14 = + size 14 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option pardiso_multi_threading_ddm:automatic" + "*job_option pardiso_multi_threading_ddm:user" + help job_run_multithreading + rollers "*job_option pardiso_multi_threading_ddm:automatic" + "*job_option pardiso_multi_threading_ddm:user" + } + + frame { + position +14 = + size 16 4 + group job_pardiso_multi_threads_ddm_automatic_gr + visible "*job_option pardiso_multi_threading_ddm:automatic" + } + + frame { + position = = + size 16 4 + group job_pardiso_multi_threads_ddm_user_gr + visible "*job_option pardiso_multi_threading_ddm:user" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_pardiso_multi_threads_ddm_automatic_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + border_width 1 + border_color black + } + + integer { + position +8 = + size 8 4 + display valid_domains + visible "*job_option ddm_generator:preprocessor" + } + + integer { + position = = + size 8 4 + display "job_param_ndomains" + visible "*job_option ddm_generator:fea_solver" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_pardiso_multi_threads_ddm_user_gr { + +#ifdef QT_MENTAT + label { + position 0 0 + size 8 4 + text "VALUE" + help job_param + } +#else + button { + position 0 0 + size 8 4 + text "VALUE" + command "*job_param nthreads" + } +#endif + + text { + position +8 = + size 8 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_env_gr { + + roller { + position 1 4 + size 30 4 + nvalues 2 + texts "SINGLE MACHINE" + "NETWORK" + help job_run_ddm_setup + roller "job_option parallel_setup" + commands "*job_option parallel_setup:single" + "*job_option parallel_setup:network" + } + + frame { + position +2 +5 + size 44 18 + group job_parallel_env_network_gr + visible "*job_option parallel_setup:network" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_env_network_gr { + + button { + position 0 0 + size 28 4 + text "HOST FILE" +#ifdef QT_MENTAT + browser host_file_browser +#else + popmenu host_file_browser_pm +#endif + settext $host_file_browser_label "SELECT HOST FILE" + set $host_file_browser_command "*job_host_file" + help job_host_file + } + + button { + position +28 = + size 8 4 + text "EDIT" + command "*job_edit_host_file" + help job_edit_host_file + visible job_host_file + } + + button { + position +8 = + size 8 4 + text "CLEAR" + command "*job_clear_host_file" + help job_clear_host_file + visible job_host_file + } + + display { + position 0 +4 + size 44 4 + display job_host_file + } + + frame { + position 0 +5 + size 44 9 + group job_parallel_env_network_ddm_gr + visible "*job_option parallel:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_env_network_ddm_gr { + + toggle { + position 0 0 + size 22 4 + text "COPY INPUT FILE" + toggle "*job_option copy_input_file:on" + true_command "*job_option copy_input_file:on" + false_command "*job_option copy_input_file:off" + help job_host_copy_inputfile + } + + toggle { + position +23 = + size 21 4 + text "COPY POST FILE" + toggle "*job_option copy_post_file:on" + true_command "*job_option copy_post_file:on" + false_command "*job_option copy_post_file:off" + help job_host_copy_inputfile + } + + label { + position 0 +5 + size 10 4 + text "HOSTS" + border_width 1 + border_color black + visible job_usersub_file + } + + roller { + position +10 = + size 18 4 + nvalues 2 + texts "COMPATIBLE" + "INCOMPATIBLE" + roller "job_option network_hosts" + commands "*job_option network_hosts:compatible" + "*job_option network_hosts:incompatible" + help job_host_comp + visible job_usersub_file + } +} + + +#ifndef QT_MENTAT +#-------------------------------------------------------------------------------------------------- +popmenu marc_integer_size_pm { + + window { + parent mentat + origin 55 32 + size 32 17 + border_width 1 + border_color border + background_color body + } + mode dialog + + group marc_integer_size_gr +} + + +#-------------------------------------------------------------------------------------------------- +group marc_integer_size_gr { + + popdown { + position 0 0 + size 32 4 + text "DEFAULT" + command "*job_option marc_integer_size:default" + help job_run_intsize + } + + popdown { + position = +4 + size 32 4 + text "4-BYTE INTEGERS" + command "*job_option marc_integer_size:i4" + help job_run_intsize + } + + popdown { + position = +4 + size 32 4 + text "8-BYTE INTEGERS" + command "*job_option marc_integer_size:i8" + help job_run_intsize + } + + popdown { + position = +5 + size 32 4 + text "CANCEL" + help job_run_intsize + } +} +#endif +#endif diff --git a/installation/mods_MarcMentat/apply_DAMASK_modifications b/installation/mods_MarcMentat/apply_DAMASK_modifications index 78e552df8..02e4191ce 100755 --- a/installation/mods_MarcMentat/apply_DAMASK_modifications +++ b/installation/mods_MarcMentat/apply_DAMASK_modifications @@ -1,6 +1,6 @@ #!/bin/bash -DEFAULT_VERSION='2013' +DEFAULT_VERSION='2013.1' WORKINGDIR=`dirname $0` diff --git a/installation/mods_MarcMentat/installation.txt b/installation/mods_MarcMentat/installation.txt index 9a1b4c488..3f0b23c20 100644 --- a/installation/mods_MarcMentat/installation.txt +++ b/installation/mods_MarcMentat/installation.txt @@ -1,16 +1,16 @@ -Install MPIE modifications to use DAMASK_marc2010/11/12 +Install MPIE modifications to use DAMASK_marc2010/11/12/13 Refer to http://damask.mpie.de for complete installation instructions. Usually you will need to be root for this to work! -This is for the Linux64 version of Marc/Mentat2010(.2)/11/12/13. +This is for the Linux64 version of Marc/Mentat2010(.2)/11/12/13(.1). See Marc and Mentat Release Guide for List of Build and Supported Platforms! -The Intel Fortran compiler needs to be installed. The 2010 release of Marc/Mentat relies on Intel Fortran 10.1(_18)! The 2011/2012/2013 release of Marc/Mentat relies on Intel Fortran 12.0! Make sure that ifort (the compiler executable) is in the PATH and that LD_LIBRARY_PATH is set correctly, refer to the Intel installation guide for instructions on how to do this. +The Intel Fortran compiler needs to be installed. The 2010 release of Marc/Mentat relies on Intel Fortran 10.1(_18)! The 2011/2012/2013 releases of Marc/Mentat relies on Intel Fortran 12.0! Make sure that ifort (the compiler executable) is in the PATH and that LD_LIBRARY_PATH is set correctly, refer to the Intel installation guide for instructions on how to do this. The AMD Core Math Library or an other BLAS implementation (currently IMKL and LAPACK are supported) needs to be installed! -Add acml path to LD_LIBRARY_PATH, to do so either use the script setup_shellrc.py in the installstion folder or for a systemwide setup edit /etc/csh.cshrc.local and/or /etc/bash.bashrc.local. +Add acml path to LD_LIBRARY_PATH, to do so either use the script setup_shellrc.py in the installation folder or for a system wide setup edit /etc/csh.cshrc.local and/or /etc/bash.bashrc.local. Assuming ACML is installed in path ACMLDIR the path should read: /ACMLDIR/ifort64_mp/lib (this is the version using paralllization, ie openmp): for bash: LD_LIBRARY_PATH="/ACMLDIR/ifort64_mp/lib:${LD_LIBRARY_PATH}"; export LD_LIBRARY_PATH for csh: setenv LD_LIBRARY_PATH /ACMLDIR/ifort64_mp/lib:${LD_LIBRARY_PATH} diff --git a/lib/MarcInclude/concom2013.1 b/lib/MarcInclude/concom2013.1 new file mode 100644 index 000000000..2072929ab --- /dev/null +++ b/lib/MarcInclude/concom2013.1 @@ -0,0 +1,224 @@ +! common block definition file taken from respective MSC.Marc release and reformated to free format +!*********************************************************************** +! +! File: concom.cmn +! +! MSC.Marc include file +! +integer(pInt) & + iacous, iasmbl, iautth, ibear, icompl, iconj, icreep, ideva, idyn, idynt,& + ielas, ielcma, ielect, iform, ifour, iharm, ihcps, iheat, iheatt, ihresp,& + ijoule, ilem, ilnmom, iloren, inc, incext, incsub, ipass, iplres, ipois,& + ipoist, irpflo, ismall, ismalt, isoil, ispect, ispnow, istore, iswep, ithcrp,& + itherm, iupblg, iupdat, jacflg, jel, jparks, largst, lfond, loadup, loaduq,& + lodcor, lovl, lsub, magnet, ncycle, newtnt, newton, noshr, linear, ivscpl,& + icrpim, iradrt, ipshft, itshr, iangin, iupmdr, iconjf, jincfl, jpermg, jhour,& + isolvr, jritz, jtable, jshell, jdoubl, jform, jcentr, imini, kautth, iautof,& + ibukty, iassum, icnstd, icnstt, kmakmas, imethvp, iradrte, iradrtp, iupdate, iupdatp,& + ncycnt, marmen , idynme, ihavca, ispf, kmini, imixex, largtt, kdoela, iautofg,& + ipshftp, idntrc, ipore, jtablm, jtablc, isnecma, itrnspo, imsdif, jtrnspo, mcnear,& + imech, imecht, ielcmat, ielectt, magnett, imsdift, noplas, jtabls, jactch, jtablth,& + kgmsto , jpzo, ifricsh, iremkin, iremfor, ishearp, jspf, machining, jlshell, icompsol,& + iupblgfo, jcondir, nstcrp, nactive, ipassref, nstspnt, ibeart, icheckmpc, noline, icuring,& + ishrink, ioffsflg, isetoff, ioffsetm,iharmt, inc_incdat, iautspc, ibrake, icbush, istream_input,& + iprsinp, ivlsinp, ifirst_time,ipin_m, jgnstr_glb, imarc_return,iqvcinp, nqvceid, istpnx, imicro1,& + iaxisymm, jbreakglue,iglstif, jfastasm,iwear, iwearcf, imixmeth, ielcmadyn, idinout, igena_meth,& + magf_meth, non_assumed, iredoboudry, ioffsz0,icomplt, mesh_dual, iactrp, mgnewton, iusedens +dimension :: ideva(60) +integer(pInt) num_concom +parameter(num_concom=238) +common/marc_concom/& + iacous, iasmbl, iautth, ibear, icompl, iconj, icreep, ideva, idyn, idynt,& + ielas, ielcma, ielect, iform, ifour, iharm, ihcps, iheat, iheatt, ihresp,& + ijoule, ilem, ilnmom, iloren, inc, incext, incsub, ipass, iplres, ipois,& + ipoist, irpflo, ismall, ismalt, isoil, ispect, ispnow, istore, iswep, ithcrp,& + itherm, iupblg, iupdat, jacflg, jel, jparks, largst, lfond, loadup, loaduq,& + lodcor, lovl, lsub, magnet, ncycle, newtnt, newton, noshr, linear, ivscpl,& + icrpim, iradrt, ipshft, itshr, iangin, iupmdr, iconjf, jincfl, jpermg, jhour,& + isolvr, jritz, jtable, jshell, jdoubl, jform, jcentr, imini, kautth, iautof,& + ibukty, iassum, icnstd, icnstt, kmakmas, imethvp, iradrte, iradrtp, iupdate, iupdatp,& + ncycnt, marmen, idynme, ihavca, ispf, kmini, imixex, largtt, kdoela, iautofg,& + ipshftp, idntrc, ipore, jtablm, jtablc, isnecma, itrnspo, imsdif, jtrnspo, mcnear,& + imech, imecht, ielcmat, ielectt, magnett, imsdift, noplas, jtabls, jactch, jtablth,& + kgmsto , jpzo, ifricsh, iremkin, iremfor, ishearp, jspf, machining, jlshell, icompsol,& + iupblgfo, jcondir, nstcrp, nactive, ipassref, nstspnt, ibeart, icheckmpc, noline, icuring,& + ishrink, ioffsflg, isetoff, ioffsetm,iharmt, inc_incdat, iautspc, ibrake, icbush , istream_input,& + iprsinp, ivlsinp, ifirst_time,ipin_m, jgnstr_glb, imarc_return,iqvcinp, nqvceid, istpnx, imicro1,& + iaxisymm, jbreakglue,iglstif, jfastasm,iwear, iwearcf, imixmeth, ielcmadyn, idinout,igena_meth,& + magf_meth, non_assumed, iredoboudry, ioffsz0,icomplt, mesh_dual, iactrp, mgnewton, iusedens +! +! comments of variables: +! +! ideva(60) - debug print out flag +! 1 print element stiffness matrices, mass matrix +! 2 output matrices used in tying +! 3 force the solution of a nonpositive definite matrix +! 4 print info of connections to each node +! 5 info of gap convergence, internal heat generated, contact +! touching and separation +! 6 nodal value array during rezoning +! 7 tying info in CONRAD GAP option, fluid element numbers in +! CHANNEL option +! 8 output incremental displacements in local coord. system +! 9 latent heat output +! 10 stress-strain in local coord. system +! 11 additional info on interlaminar stress +! 12 output right hand side and solution vector +! 13 info of CPU resources used and memory available on NT +! 14 info of mesh adaption process, 2D outline information +! info of penetration checking for remeshing +! save .fem files after afmesh3d meshing +! 15 surface energy balance flag +! 16 print info regarding pyrolysis +! 17 print info of "streamline topology" +! 18 print mesh data changes after remeshing +! 19 print material flow stress data read in from *.mat file +! if unit flag is on, print out flow stress after conversion +! 20 print information on table input +! 21 print out information regarding kinematic boundary conditions +! 22 print out information regarding dist loads, point loads, film +! and foundations +! 23 print out information about automatic domain decomposition +! 24 print out iteration information in SuperForm status report file +! 25 print out information for ablation +! 26 print out information for films - Table input +! 27 print out the tying forces +! 28 print out for CASI solver, convection, +! 29 DDM single file debug printout +! 30 print out cavity debug info +! 31 print out welding related info +! 32 prints categorized DDM memory usage +! 33 print out the cutting info regarding machining feature +! 34 print out the list of quantities which can be defined via a table +! and for each quantity the supported independent variables +! 35 print out detailed coupling region info +! 36 print out solver debug info level 1 (Least Detailed) +! 37 print out solver debug info level 1 (Medium Detailed) +! 38 print out solver debug info level 1 (Very Detailed) +! 39 print detailed memory allocation info +! 40 print out marc-adams debug info +! 41 output rezone mapping post file for debugging +! 42 output post file after calling oprofos() for debugging +! 43 debug printout for vcct +! 44 debug printout for progressive failure +! 45 print out automatically generated midside node coordinates (arecrd) +! 46 print out message about routine and location, where the ibort is raised (ibort_inc) +! 47 print out summary message of element variables on a +! group-basis after all the automatic changes have been +! made (em_ellibp) +! 48 Automatically generate check results based on max and min vals. +! These vals are stored in the checkr file, which is inserted +! into the *dat file by the generate_check_results script from /marc/tools +! 49 Automatically generate check results based on the real calculated values +! at the sppecified check result locations. +! These vals are stored in the checkr file, which is inserted +! into the *dat file by the update_check_results script from /marc/tools +! 50 generate a file containing the resistance or capacity matrix; +! this file can be used to compare results with a reference file +! 51 print out detailed information for segment-to-segment contact +! 52 print out detailed relative displacement information +! for uniaxial sliding contact +! 53 print out detailed sliding direction information for +! uniaxial sliding contact +! 54 print out detailed information for edges attached to a curve +! 55 print information related to viscoelasticity calculations +! 56 print out detailed information for element coloring for multithreading +! 57 print out extra overheads due to multi-threading. +! These overhead includes (i) time and (ii) memory. +! The memory report will be summed over all the children. +! +! +! irpflo global flag for rigid plastic flow analysis +! = 1 eularian formulation +! = 2 regular formulation; rigid material present in the analysis +! +! jactch = 1 or 2 if elements are activated or deactivated +! = 3 if elements are adaptively remeshed or rezoned +! = 0 normally / reset to 0 when assembly is done +! ifricsh = 0 call to fricsh in otest not needed +! = 1 call to fricsh (nodal friction) in otest needed +! iremkin = 0 remove deactivated kinematic boundary conditions +! immediately - only in new input format (this is default) +! = 1 remove deactivated kinematic boundary conditions +! gradually - only in new input format +! iremfor = 0 remove force boundary conditions immediately - +! only in new input format (this is default) +! = 1 remove force boundary conditions gradually - +! only in new input format (this is default) +! ishearp set to 1 if shear panel elements are present in the model +! +! jspf = 0 not in spf loadcase +! > 0 in spf loadcase (jspf=1 during first increment) +! machining = 1 if the metal cutting feature is used, for memory allocation purpose +! = 0 (default) if no metal cutting feature required +! +! jlshell = 1 if there is a shell element in the mesh +! icompsol = 1 if there is a composite solid element in the mesh +! iupblgfo = 1 if follower force for point loads +! jcondir = 1 if contact priority option is used +! nstcrp = 0 (default) steady state creep flag (undocumented feature. +! if not 0, turns off special ncycle = 0 code in radial.f) +! nactive = number of active passes, if =1 then it's not a coupled analysis +! ipassref = reference ipass, if not in a multiphysics pass ipass=ipassref +! icheckmpc = value of mpc-check parameter option +! noline = set to 1 in osolty if no line seacrh should be done in ogetst +! icuring = set to 1 if the curing is included for the heat transfer analysis. +! ishrink = set to 1 if shrinkage strain is included for mechancial analysis. +! ioffsflg = 1 for small displacement beam/shell offsets +! = 2 for large displacement beam/shell offsets +! isetoff = 0 - do not apply beam/shell offsets +! = 1 - apply beam/shell offsets +! ioffsetm = min. value of offset flag +! iharmt = 1 global flag if a coupled analysis contains an harmonic pass +! inc_incdat = flag to record increment number of a new loadcase in incdat.f +! iautspc = flag for AutoSPC option +! ibrake = brake squeal in this increment +! icbush = set to 1 if cbush elements present in model +! istream_input = set to 1 for streaming input calling Marc as library +! iprsinp = set to 1 if pressure input, introduced so other variables +! such as h could be a function of pressure +! ivlsinp = set to 1 if velocity input, introduced so other variables +! such as h could be a function of velocity +! ipin_m = # of beam element with PIN flag +! jgnstr_glb = global control over pre or fast integrated composite shells +! imarc_return = Marc return flag for streaming input control +! iqvcimp = if non-zero, then the number of QVECT boundary conditions +! nqvceid = number of QVECT boundary conditions, where emisivity/absorbtion id entered +! istpnx = 1 if to stop at end of increment +! imicro1 = 1 if micro1 interface is used +! iaxisymm = set to 1 if axisymmetric analysis +! jbreakglue = set to 1 if breaking glued option is used +! iglstif = 1 if ddm and global stiffness matrix formed (sgi solver 6 or solver9) +! jfastasm = 1 do fast assembly using SuperForm code +! iwear = set to 1 if wear model, set to 2 if wear model and coordinates updated +! iwearcf = set to 1 to store nodal coefficient of friction for wear calculation +! imixmeth = set=1 then use nonlinear mixture material - allocate memory +! ielcmadyn = flag for magnetodynamics +! 0 - electromagnetics using newmark beta +! 1 - transient magnetics using backward euler +! idinout = flag to control if inside out elements should be deactivated +! igena_meth = 0 - generalized alpha parameters depend on whether or not contact +! is flagged (dynamic,7) +! 10 - generalized alpha parameters are optimized for a contact +! analysis (dynamic,8) +! 11 - generalized alpha parameters are optimized for an analysis +! without contact (dynamic,8) +! magf_meth = - Method to compute force in magnetostatic - structural +! = 1 - Virtual work method based on finite difference for the force computation +! = 2 - Maxwell stress tensor +! = 3 - Virtual work method based on local derivative for the force computation +! non_assumed = 1 no assumed strain formulation (forced) +! iredoboudry set to 1 if contact boundary needs to be recalculated +! ioffsz0 = 1 if composite are used with reference position.ne.0 +! icomplt = 1 global flag if a coupled analysis contains an complex pass +! mesh_dual = 1 two independent meshes are used in magnetodynamic/thermal/structural +! one for magnetodynamic and the other for the remaining passes +! iactrp = 1 in an analysis with global remeshing, include inactive +! rigid bodies on post file +! mgnewton = 1 Use full Newton Raphson iteration for magnetostatic pass +! +! iusedens > 0 if mass density is used in the analysis (dynamics, mass dependent loading) +! +!*********************************************************************** +!$omp threadprivate(/marc_concom/) +!! diff --git a/lib/MarcInclude/creeps2013.1 b/lib/MarcInclude/creeps2013.1 new file mode 100644 index 000000000..cc2581ae6 --- /dev/null +++ b/lib/MarcInclude/creeps2013.1 @@ -0,0 +1,31 @@ +! common block definition file taken from respective MSC.Marc release and reformated to free format +!*********************************************************************** +! +! File: creeps.cmn +! +! MSC.Marc include file +! +real(pReal) cptim,timinc,timinc_p,timinc_s,timincm,timinc_a,timinc_b +integer(pInt) icptim,icfte,icfst,icfeq,icftm,icetem,mcreep,jcreep,icpa,icftmp,icfstr,& + icfqcp,icfcpm,icrppr,icrcha,icpb,iicpmt,iicpa +real(pReal) time_beg_lcase,time_beg_inc,fractol,time_beg_pst +! +integer(pInt) num_creepsr,num_creepsi,num_creeps2r +parameter(num_creepsr=7) +parameter(num_creepsi=18) +parameter(num_creeps2r=4) +common/marc_creeps/cptim,timinc,timinc_p,timinc_s,timincm,timinc_a,timinc_b,icptim,icfte,icfst,& + icfeq,icftm,icetem,mcreep,jcreep,icpa,icftmp,icfstr,icfqcp,icfcpm,icrppr,icrcha,icpb,iicpmt,iicpa +common/marc_creeps2/time_beg_lcase,time_beg_inc,fractol,time_beg_pst +! +! time_beg_lcase time at the beginning of the current load case +! time_beg_inc time at the beginning of the current increment +! fractol fraction of loadcase or increment time when we +! consider it to be finished +! time_beg_pst time corresponding to first increment to be +! read in from thermal post file for auto step +! +!*********************************************************************** +!$omp threadprivate(/marc_creeps/) +!$omp threadprivate(/marc_creeps2/) +!!