From c3e94cf1feb18ebaec087016738aed155a648c18 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Fri, 9 Jul 2021 08:59:04 +0200 Subject: [PATCH 01/36] Marc2021.2 is out! --- .../2021.2/Marc_tools/comp_damask_hmp | 53 + .../2021.2/Marc_tools/comp_damask_lmp | 53 + .../2021.2/Marc_tools/comp_damask_mp | 53 + .../2021.2/Marc_tools/comp_user.original | 41 + .../2021.2/Marc_tools/include_linux64 | 846 ++++ .../Marc_tools/include_linux64.original | 817 ++++ .../2021.2/Marc_tools/run_damask_hmp | 4129 ++++++++++++++++ .../2021.2/Marc_tools/run_damask_lmp | 4129 ++++++++++++++++ .../2021.2/Marc_tools/run_damask_mp | 4129 ++++++++++++++++ .../2021.2/Marc_tools/run_marc.original | 4207 +++++++++++++++++ .../MarcMentat/2021.2/Mentat_bin/edit_window | 5 + .../2021.2/Mentat_bin/edit_window.original | 18 + .../2021.2/Mentat_bin/kill1.original | 8 + .../MarcMentat/2021.2/Mentat_bin/kill4 | 8 + .../MarcMentat/2021.2/Mentat_bin/kill5 | 8 + .../MarcMentat/2021.2/Mentat_bin/kill6 | 8 + .../2021.2/Mentat_bin/submit1.original | 189 + .../MarcMentat/2021.2/Mentat_bin/submit4 | 191 + .../MarcMentat/2021.2/Mentat_bin/submit5 | 191 + .../MarcMentat/2021.2/Mentat_bin/submit6 | 191 + .../MarcMentat/2021.2/Mentat_menus/job_run.ms | 3109 ++++++++++++ .../2021.2/Mentat_menus/job_run.ms.original | 2973 ++++++++++++ src/Marc/include/concom2021.2 | 447 ++ src/Marc/include/creeps2021.2 | 66 + 24 files changed, 25869 insertions(+) create mode 100644 installation/MarcMentat/2021.2/Marc_tools/comp_damask_hmp create mode 100644 installation/MarcMentat/2021.2/Marc_tools/comp_damask_lmp create mode 100644 installation/MarcMentat/2021.2/Marc_tools/comp_damask_mp create mode 100644 installation/MarcMentat/2021.2/Marc_tools/comp_user.original create mode 100644 installation/MarcMentat/2021.2/Marc_tools/include_linux64 create mode 100644 installation/MarcMentat/2021.2/Marc_tools/include_linux64.original create mode 100644 installation/MarcMentat/2021.2/Marc_tools/run_damask_hmp create mode 100644 installation/MarcMentat/2021.2/Marc_tools/run_damask_lmp create mode 100644 installation/MarcMentat/2021.2/Marc_tools/run_damask_mp create mode 100644 installation/MarcMentat/2021.2/Marc_tools/run_marc.original create mode 100644 installation/MarcMentat/2021.2/Mentat_bin/edit_window create mode 100644 installation/MarcMentat/2021.2/Mentat_bin/edit_window.original create mode 100644 installation/MarcMentat/2021.2/Mentat_bin/kill1.original create mode 100644 installation/MarcMentat/2021.2/Mentat_bin/kill4 create mode 100644 installation/MarcMentat/2021.2/Mentat_bin/kill5 create mode 100644 installation/MarcMentat/2021.2/Mentat_bin/kill6 create mode 100644 installation/MarcMentat/2021.2/Mentat_bin/submit1.original create mode 100644 installation/MarcMentat/2021.2/Mentat_bin/submit4 create mode 100644 installation/MarcMentat/2021.2/Mentat_bin/submit5 create mode 100644 installation/MarcMentat/2021.2/Mentat_bin/submit6 create mode 100644 installation/MarcMentat/2021.2/Mentat_menus/job_run.ms create mode 100644 installation/MarcMentat/2021.2/Mentat_menus/job_run.ms.original create mode 100644 src/Marc/include/concom2021.2 create mode 100644 src/Marc/include/creeps2021.2 diff --git a/installation/MarcMentat/2021.2/Marc_tools/comp_damask_hmp b/installation/MarcMentat/2021.2/Marc_tools/comp_damask_hmp new file mode 100644 index 000000000..de6fce745 --- /dev/null +++ b/installation/MarcMentat/2021.2/Marc_tools/comp_damask_hmp @@ -0,0 +1,53 @@ +#!/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 + /bin/rm $DIRJOB/*.smod diff --git a/installation/MarcMentat/2021.2/Marc_tools/comp_damask_lmp b/installation/MarcMentat/2021.2/Marc_tools/comp_damask_lmp new file mode 100644 index 000000000..6d063adf3 --- /dev/null +++ b/installation/MarcMentat/2021.2/Marc_tools/comp_damask_lmp @@ -0,0 +1,53 @@ +#!/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 + /bin/rm $DIRJOB/*.smod diff --git a/installation/MarcMentat/2021.2/Marc_tools/comp_damask_mp b/installation/MarcMentat/2021.2/Marc_tools/comp_damask_mp new file mode 100644 index 000000000..871b8a449 --- /dev/null +++ b/installation/MarcMentat/2021.2/Marc_tools/comp_damask_mp @@ -0,0 +1,53 @@ +#!/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 + /bin/rm $DIRJOB/*.smod diff --git a/installation/MarcMentat/2021.2/Marc_tools/comp_user.original b/installation/MarcMentat/2021.2/Marc_tools/comp_user.original new file mode 100644 index 000000000..8679bb041 --- /dev/null +++ b/installation/MarcMentat/2021.2/Marc_tools/comp_user.original @@ -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/MarcMentat/2021.2/Marc_tools/include_linux64 b/installation/MarcMentat/2021.2/Marc_tools/include_linux64 new file mode 100644 index 000000000..30385f569 --- /dev/null +++ b/installation/MarcMentat/2021.2/Marc_tools/include_linux64 @@ -0,0 +1,846 @@ +# +# General definitions for the Marc 2021.1 version +# +# EM64T +# +# Linux RedHat 7.7 / SuSE 12 SP4 +# +# 64 bit MPI version +# +# Intel(R) Fortran Intel(R) 64 Compiler XE for applications +# running on Intel(R) 64, Version 19.0.4.243 Build 20190416 +# +# Intel(R) C Intel(R) 64 Compiler XE for applications +# running on Intel(R) 64, Version 19.0.4.243 Build 20190416 +# +# To check the O/S level, type: +# uname -a +# +# Distributed parallel MPI libraries: +# Intel MPI 2019 Update 10 +# To check the mpi version, type: +# mpiexec.hydra -version +# +# 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 program. 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 +# +# Flag for performance improvement +# +if ! grep -i -q Intel /proc/cpuinfo ; then + export MKL_DEBUG_CPU_TYPE=5 +fi +# integer size +if test "$MARC_INTEGER_SIZE" = "" ; then + INTEGER_PATH= +else + INTEGER_PATH=/$MARC_INTEGER_SIZE +fi + +FCOMP=ifort +INTELPATH="/opt/intel/compilers_and_libraries_2019/linux" +if test -z "$MARC_INTELMPI"; then + INTELMPIPATH="$INTELPATH/mpi/intel64" +else + INTELMPIPATH="$MARC_INTELMPI/bin" +fi +if test -d /opt/intel/compilers_and_libraries_2018.1.163 ; then + INTELMPIPATH="/opt/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64" +fi + +# find the root directory of the compiler installation: +# - if ifort is found in $PATH, then the root directory is derived +# from the path to ifort +# - if ifort is not found in $PATH, the root directory is assumed +# to be $INTELPATH and the directory in which ifort is found is +# added to $PATH +FCOMPPATH=`which "$FCOMP" 2>/dev/null` +if test -n "$FCOMPPATH"; then + # derive the root directory from $FCOMPPATH + FCOMPROOT="${FCOMPPATH%/bin/intel64/$FCOMP}" + if test "$FCOMPROOT" = "$FCOMPPATH"; then + FCOMPROOT="${FCOMPPATH%/bin/$FCOMP}" + fi + if test "$FCOMPROOT" = "$FCOMPPATH"; then + FCOMPROOT= + fi +elif test -d "$INTELPATH"; then + # check for compiler in $INTELPATH + if test -d "$INTELPATH/bin/intel64" -a \ + -x "$INTELPATH/bin/intel64/$FCOMP" ; then + FCOMPROOT="$INTELPATH" + PATH="$INTELPATH/bin/intel64:$PATH" + elif test -d "$INTELPATH/bin" -a \ + -x "$INTELPATH/bin/$FCOMP"; then + FCOMPROOT="$INTELPATH" + PATH="$INTELPATH/bin:$PATH" + else + FCOMPROOT= + fi +else + FCOMPROOT= +fi + +# Cosim Adapter +if test "$MSCCOSIM_HOME" = ""; then + MARC_COSIM_LIB= +else + MARC_COSIM_LIB="$MSCCOSIM_HOME/CoSim2021/Dcosim2021/lib" +fi +if test "$MSCCOSIM_VERSION" = ""; then + MSCCOSIM_VERSION="2020" +fi + +# DAMASK uses the HDF5 compiler wrapper around the Intel compiler +H5FC="$(h5fc -shlib -show)" +HDF5_LIB=${H5FC//ifort/} +FCOMP="$H5FC -DDAMASK_HDF5" + +# AEM +if test "$MARCDLLOUTDIR" = ""; then + DLLOUTDIR="$MARC_LIB" +else + DLLOUTDIR="$MARCDLLOUTDIR" +fi + +# settings for MKL +if test "$IMKLDIR" = ""; then + MARC_MKL="$FCOMPROOT/mkl/lib/intel64" +else + MARC_MKL=$IMKLDIR/lib/intel64 +fi + +# check for oneAPI +if test "$FCOMPPATH" = "" ; then + if test -d /opt/intel/oneapi; then + PATH="/opt/intel/oneapi/compiler/latest/linux/bin/intel64:$PATH" + MARC_MKL=/opt/intel/oneapi/mkl/latest/lib/intel64 + LD_LIBRARY_PATH=$MARC_MKL:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + FCOMPROOT=/opt/intel/oneapi/compiler/latest/linux/bin/intel64 + fi +fi + +# +# settings for Metis +# +METIS="-I$METIS_SOURCE/include" +METISLIBS="$METISLIB_DIR/libmarcddm.a $METISLIB_DIR/libmarcmetis.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= + +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 + +# Edit following lines to build solver 2 with GPU support +SOLVER2GPU=GPU +#SOLVER2GPU=NONE + +# Edit following lines to set the openssl library +if test "$OPENSSL" != "NONE" +then + OPENSSL_LIB="$MARC_LIB/libcrypto.a" +fi +OPENSSL_INCLUDE=-I"$MARC_OPENSSL/include/" + +MARCHDF_HDF=HDF +#MARCHDF_HDF=NONE + +# activate contact component build if flagged +AEM_DLL=0 +if test "$AEM_BUILD" = "ON" ; then + AEM_DLL=1 + LINK_MARC_DLL="-shared -fPIC" + EXT_DLL="so" + MPITYPE=none + MPI_OTHER= + MARCHDF_HDF=NONE + BCSGPUSOLVER=NONE + SOLVER2GPU=NONE + MUMPSSOLVER=NONE + CASISOLVER=NONE +fi + +if test "$MARCHDF_HDF" = "HDF"; then + HDF_INCLUDE="-I$MARC_HDF/include" + HDF_LIBS="$MARC_LIB/libhdf5_fortran.so.100 $MARC_LIB/libhdf5.so.103" +fi + +SOLVERFLAGS= +if test "$BCSGPUSOLVER" = BCSGPU +then + SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" + BCS_DIR=bcsgpusolver +else + BCS_DIR=bcssolver +fi +# +# settings for MPI +# +DDM= +if test $MPITYPE != none +then + if test $MPITYPE = intelmpi + then + INTELMPI_VERSION=HYDRA + FCOMPMPI=mpiifort + if test -n "$MARC_INTELMPI" ; then + MPI_ROOT=$MARC_INTELMPI + else + MPI_ROOT=$INTELMPIPATH + MARC_INTELMPI=$MPI_ROOT + fi + DDM="-I${MPI_ROOT}/include -DDDM" + PATH=$MPI_ROOT/bin:$PATH + export PATH + LD_LIBRARY_PATH=$MPI_ROOT/lib:$MPI_ROOT/lib/release:$MPI_ROOT/libfabric/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + if test $INTELMPI_VERSION = HYDRA + then + RUN_JOB1="${MPI_ROOT}/bin/mpiexec.hydra -genvall -n " + RUN_JOB2="${MPI_ROOT}/bin/mpiexec.hydra -genvall" + else + RUN_JOB1="${MPI_ROOT}/bin/mpiexec -n " + RUN_JOB2="${MPI_ROOT}/bin/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 + FI_PROVIDER_PATH=$MPI_ROOT/libfabric/lib/prov + export FI_PROVIDER_PATH + if test -f "/etc/SuSE-release"; then + FI_PROVIDER=sockets + export FI_PROVIDER + fi + I_MPI_WAIT_MODE=1 + export I_MPI_WAIT_MODE + 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 +if test "$MARC_CASISOLVER" = "NONE" ; then + CASISOLVER=NONE +fi +#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 + +# Edit following lines to enable zlib support +ZLIB=ZLIB +if test "$MARC_ZLIB" = "NONE"; then + ZLIB=NONE +fi +#ZLIB=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 + SOLVER2GPU=NONE + MARC_DLL=NONE + ZLIB=NONE +fi +if test "$AEM_DLL" -eq 1 +then + VKISOLVER=NONE + CASISOLVER=NONE + MF2SOLVER=NONE + INTELSOLVER=NONE + MUMPSSOLVER=NONE + BCSGPUSOLVER=NONE + SOLVER2GPU=NONE + ZLIB=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 + +if test "$SOLVER2GPU" = GPU +then + SOLVERFLAGS="$SOLVERFLAGS -DSOLVER2GPU" +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" + +MARCCODEPROF= +#MARCCODEPROF="ON" + +if test "$MARC_INTEGER_SIZE" = "i4" ; then + I8FFLAGS= + I8DEFINES= + I8CDEFINES= +else + I8FFLAGS="-i8 -integer-size 64" + I8DEFINES="-DI64 -DINT=8" + I8CDEFINES="-U_DOUBLE -D_SINGLE" +fi + +MTHREAD=OPENMP +if test "$MARC_OPENMP" = "NONE" ; then + MTHREAD=NONE +fi +#MTHREAD=NONE +if test "$_OEM_NASTRAN" -ne 0 +then +MTHREAD=NONE +fi +if test "$AEM_DLL" -eq 1 +then + MTHREAD=NONE + CASISOLVER=NONE + VKISOLVER=NONE + MF2SOLVER=NONE + INTELSOLVER=NONE + BCSGPUSOLVER=NONE + SOLVER2GPU=NONE + OPENSSL_LIB= + MARC_DLL=NONE + METISLIBS= +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" + +if test "$AEM_DLL" -eq 1 +then + FDEFINES="$FDEFINES -D_AEMNL -DAAA" + CDEFINES="$CDEFINES -D_AEMNL -DAAA" +fi + +CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS -I$LAPI_IMPORTS/common/include" +if test "$_OEM_NASTRAN" -ne 0 +then + CINCL="$CINCL -I../../include" +fi + +CC_OPT= +if test "$MTHREAD" = "OPENMP" +then + CC_OPT=" $CC_OPT -qopenmp" +fi + +if test "$ZLIB" = "ZLIB"; then + FDEFINES="$FDEFINES -DENABLE_ZLIB" + CDEFINES="$CDEFINES -DENABLE_ZLIB" + CINCL="$CINCL -I$ZLIB_INCLUDE" +fi + +CC="icc -c $CC_OPT -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " +CCLOW="icc -c $CC_OPT -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " +CCHIGH="icc -c $CC_OPT -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " + +CC_TETMESH="icpc -c -O2 -I$TETMESHDIR/include -qopenmp -ansi-alias -m64 -pipe -fPIC -falign-functions=16 -fstrict-aliasing -fno-jump-tables -MMD -DLINUX -D_CRT_SECURE_NO_WARNINGS -DX64 -DMESHINGAPI_LIB -DNDEBUG" +CC_CAEFATIGUE="icpc -c -O2 -I$CAEFATIGUEDIR/linux64/include -qopenmp -ansi-alias -m64 -pipe -fPIC -falign-functions=16 -fstrict-aliasing -fno-jump-tables -MMD -DLINUX -D_CRT_SECURE_NO_WARNINGS -DX64 -DNDEBUG" + +if test "$MARCDEBUG" = "ON" +then + CC="icc -c $CC_OPT -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " + CCLOW="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " + CCHIGH="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " +fi + +LOAD_CC="icc $CC_OPT -O1 -DLinux -DLINUX -DLinux_intel" +CCT="$CC" +CCTLOW="$CCLOW" +CCTHIGH="$CCHIGH" + +#PROFILE="-Mprof=func" +#PROFILE="-Mprof=lines" +#PROFILE="-Mprof=func,mpi" +PROFILE= +#PROFILE="-init=snan,arrays -CB -traceback -fpe0 -fp-stack-check -check all -check uninit -ftrapuv" +if test "$MARCCODECOV" = "ON" +then +PROFILE="-prof-gen=srcpos" +fi +if test "$MARCCODEPROF" = "ON" +then +PROFILE=" $PROFILE -pg" +fi + +FORT_OPT="-c -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr -mp1 -WB -fp-model source" +if test "$MTHREAD" = "OPENMP" +then + FORT_OPT=" $FORT_OPT -qopenmp" + if test "$OMP_COMPAT" = "YES" + then + FORT_OPT=" $FORT_OPT -qopenmp-threadprivate=compat" + fi +else +# FORT_OPT=" $FORT_OPT -auto " + FORT_OPT=" $FORT_OPT -save -zero" +fi +if test "$MARCHDF_HDF" = "HDF"; then + FORT_OPT="$FORT_OPT -DMARCHDF=$MARCHDF_HDF" +fi + +FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" +FORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" +FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" +FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" +# for compiling free form f90 files. high opt, integer(4) +FORTF90="$FCOMP -c -O3" + +# determine DAMASK version +if test -n "$DAMASK_USER"; then + DAMASKROOT=`dirname $DAMASK_USER`/.. + read DAMASKVERSION < $DAMASKROOT/VERSION + DAMASKVERSION="'"$DAMASKVERSION"'" +else + DAMASKVERSION="'N/A'" +fi + + +# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3 +DFORTLOWMP="$FCOMP -c -O0 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ + -qopenmp -qopenmp-threadprivate=compat\ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" -I$MARC_MOD" +DFORTRANMP="$FCOMP -c -O1 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ + -qopenmp -qopenmp-threadprivate=compat\ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" -I$MARC_MOD" +DFORTHIGHMP="$FCOMP -c -O3 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ + -qopenmp -qopenmp-threadprivate=compat\ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" -I$MARC_MOD" + +if test "$MARCDEBUG" = "ON" +then + FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" + FORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" + FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" + FORTNA="$FCOMP $FORT_OPT -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_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" + +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/include -I$VT_ROOT/include" +# LOAD="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " +# LOADT="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " +# fi + if test $MPITYPE = intelmpi + then + LOAD="ifort $PROFILE $LINK_OPT -o " + LOADT="ifort $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" + 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 + +if test "$AEM_DLL" -eq 1 +then + FORTLOW="$FORTLOW -fpp -fPIC" + FORTRAN="$FORTRAN -fpp -fPIC" + FORTHIGH="$FORTHIGH -fpp -fPIC" + FORTRANMNF="$FORTRANMNF -fpp -fPIC" + CC="$CC -fPIC" + CCMNF="$CCMNF -fPIC" + LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide" + 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="$CASILIB_DIR/libmarccasi.a $CASILIB_DIR/libcasi.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 "$MUMPSSOLVER" = MUMPS +then + MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps.a" + if test $MPITYPE = intelmpi + then + MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.a" + fi +else + MUMPSSOLVERLIBS= +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 +else + BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " +fi + +SOLVER2LIBS= +if test "$SOLVER2GPU" = GPU +then + SOLVER2LIBS="-L$MARC_LIB/cuda_dummy -lsolver2gpu" +fi + +if test "$AEM_DLL" -eq 1 +then + BCSSOLVERLIBS= +fi + + +SECLIBS="-L$MARC_LIB -llapi" + +SOLVERLIBS="${BCSSOLVERLIBS} ${VKISOLVERLIBS} ${CASISOLVERLIBS} ${MF2SOLVERLIBS} \ + -L$MARC_MKL \ + $MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a $KDTREE2_LIB/libkdtree2.a $MARC_LIB/libtetmeshinterface.a $MARC_LIB/libcaefatigueinterface.a -L$MARC_LIB -lmkl_blacs_intelmpi_ilp64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -ltetmesh -lmeshgems -lmg-tetra -lmeshgems_stubs $HDF5_LIB $SOLVER2LIBS" + +SOLVERLIBS_DLL=${SOLVERLIBS} +if test "$AEM_DLL" -eq 1 +then +SOLVERLIBS_DLL="-L$MARC_MKL -lmkl_blacs_intelmpi_ilp64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 $MARC_LIB/blas_src.a" +fi +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" +SFLIB="-L$SFMATDIR -lMBA_Grain" +OPENMP="-qopenmp" + +if test "$AEM_DLL" -eq 1 +then + LOAD_DLL=$LOAD + OPENMP= + LIBMNF= + OPENSSL=NONE +fi + +SYSLIBS=" $OPENMP -lpthread -cxxlib" + +# 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}/lib/release -lmpi -L${MPI_ROOT}/lib -lmpifort -lrt $OPENMP -threads -lpthread -cxxlib" +fi + +if test "$ZLIB" = "ZLIB"; then + SYSLIBS="$SYSLIBS $ZLIB_LIB/libz.a" +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 cosim_begin.f" +if test "$MARC_INTEGER_SIZE" = "i8" ; then + LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" +fi + +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 dpsmsah.f tpsmsah.f cn_qsort4_11.f \ + prei11.f prei12.f prei31.f prei32.f prei41.f prei42.f prei61.f prei62.f \ + prei1n.f prei2n.f cgfullnts1.f cgfullnts2.f cg1n.f cg2n.f cg3n.f \ + cg4n.f cg5n.f cg6n.f cgnn.f sortab.f sortab1.f triann1.f preinv_nts.f \ + cn_sur_patchl.f cn_quad_3e.f" + + + +MAXNUM=1000000 diff --git a/installation/MarcMentat/2021.2/Marc_tools/include_linux64.original b/installation/MarcMentat/2021.2/Marc_tools/include_linux64.original new file mode 100644 index 000000000..bf34f5f50 --- /dev/null +++ b/installation/MarcMentat/2021.2/Marc_tools/include_linux64.original @@ -0,0 +1,817 @@ +# +# General definitions for the Marc 2021.1 version +# +# EM64T +# +# Linux RedHat 7.7 / SuSE 12 SP4 +# +# 64 bit MPI version +# +# Intel(R) Fortran Intel(R) 64 Compiler XE for applications +# running on Intel(R) 64, Version 19.0.4.243 Build 20190416 +# +# Intel(R) C Intel(R) 64 Compiler XE for applications +# running on Intel(R) 64, Version 19.0.4.243 Build 20190416 +# +# To check the O/S level, type: +# uname -a +# +# Distributed parallel MPI libraries: +# Intel MPI 2019 Update 10 +# To check the mpi version, type: +# mpiexec.hydra -version +# +# 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 program. 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 +# +# Flag for performance improvement +# +if ! grep -i -q Intel /proc/cpuinfo ; then + export MKL_DEBUG_CPU_TYPE=5 +fi +# integer size +if test "$MARC_INTEGER_SIZE" = "" ; then + INTEGER_PATH= +else + INTEGER_PATH=/$MARC_INTEGER_SIZE +fi + +FCOMP=ifort +INTELPATH="/opt/intel/compilers_and_libraries_2019/linux" +if test -z "$MARC_INTELMPI"; then + INTELMPIPATH="$INTELPATH/mpi/intel64" +else + INTELMPIPATH="$MARC_INTELMPI/bin" +fi +if test -d /opt/intel/compilers_and_libraries_2018.1.163 ; then + INTELMPIPATH="/opt/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64" +fi + +# find the root directory of the compiler installation: +# - if ifort is found in $PATH, then the root directory is derived +# from the path to ifort +# - if ifort is not found in $PATH, the root directory is assumed +# to be $INTELPATH and the directory in which ifort is found is +# added to $PATH +FCOMPPATH=`which "$FCOMP" 2>/dev/null` +if test -n "$FCOMPPATH"; then + # derive the root directory from $FCOMPPATH + FCOMPROOT="${FCOMPPATH%/bin/intel64/$FCOMP}" + if test "$FCOMPROOT" = "$FCOMPPATH"; then + FCOMPROOT="${FCOMPPATH%/bin/$FCOMP}" + fi + if test "$FCOMPROOT" = "$FCOMPPATH"; then + FCOMPROOT= + fi +elif test -d "$INTELPATH"; then + # check for compiler in $INTELPATH + if test -d "$INTELPATH/bin/intel64" -a \ + -x "$INTELPATH/bin/intel64/$FCOMP" ; then + FCOMPROOT="$INTELPATH" + PATH="$INTELPATH/bin/intel64:$PATH" + elif test -d "$INTELPATH/bin" -a \ + -x "$INTELPATH/bin/$FCOMP"; then + FCOMPROOT="$INTELPATH" + PATH="$INTELPATH/bin:$PATH" + else + FCOMPROOT= + fi +else + FCOMPROOT= +fi + +# Cosim Adapter +if test "$MSCCOSIM_HOME" = ""; then + MARC_COSIM_LIB= +else + MARC_COSIM_LIB="$MSCCOSIM_HOME/CoSim2021/Dcosim2021/lib" +fi +if test "$MSCCOSIM_VERSION" = ""; then + MSCCOSIM_VERSION="2020" +fi + +# AEM +if test "$MARCDLLOUTDIR" = ""; then + DLLOUTDIR="$MARC_LIB" +else + DLLOUTDIR="$MARCDLLOUTDIR" +fi + +# settings for MKL +if test "$IMKLDIR" = ""; then + MARC_MKL="$FCOMPROOT/mkl/lib/intel64" +else + MARC_MKL=$IMKLDIR/lib/intel64 +fi + +# check for oneAPI +if test "$FCOMPPATH" = "" ; then + if test -d /opt/intel/oneapi; then + PATH="/opt/intel/oneapi/compiler/latest/linux/bin/intel64:$PATH" + MARC_MKL=/opt/intel/oneapi/mkl/latest/lib/intel64 + LD_LIBRARY_PATH=$MARC_MKL:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + FCOMPROOT=/opt/intel/oneapi/compiler/latest/linux/bin/intel64 + fi +fi + +# +# settings for Metis +# +METIS="-I$METIS_SOURCE/include" +METISLIBS="$METISLIB_DIR/libmarcddm.a $METISLIB_DIR/libmarcmetis.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= + +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 + +# Edit following lines to build solver 2 with GPU support +SOLVER2GPU=GPU +#SOLVER2GPU=NONE + +# Edit following lines to set the openssl library +if test "$OPENSSL" != "NONE" +then + OPENSSL_LIB="$MARC_LIB/libcrypto.a" +fi +OPENSSL_INCLUDE=-I"$MARC_OPENSSL/include/" + +MARCHDF_HDF=HDF +#MARCHDF_HDF=NONE + +# activate contact component build if flagged +AEM_DLL=0 +if test "$AEM_BUILD" = "ON" ; then + AEM_DLL=1 + LINK_MARC_DLL="-shared -fPIC" + EXT_DLL="so" + MPITYPE=none + MPI_OTHER= + MARCHDF_HDF=NONE + BCSGPUSOLVER=NONE + SOLVER2GPU=NONE + MUMPSSOLVER=NONE + CASISOLVER=NONE +fi + +if test "$MARCHDF_HDF" = "HDF"; then + HDF_INCLUDE="-I$MARC_HDF/include" + HDF_LIBS="$MARC_LIB/libhdf5_fortran.so.100 $MARC_LIB/libhdf5.so.103" +fi + +SOLVERFLAGS= +if test "$BCSGPUSOLVER" = BCSGPU +then + SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" + BCS_DIR=bcsgpusolver +else + BCS_DIR=bcssolver +fi +# +# settings for MPI +# +DDM= +if test $MPITYPE != none +then + if test $MPITYPE = intelmpi + then + INTELMPI_VERSION=HYDRA + FCOMPMPI=mpiifort + if test -n "$MARC_INTELMPI" ; then + MPI_ROOT=$MARC_INTELMPI + else + MPI_ROOT=$INTELMPIPATH + MARC_INTELMPI=$MPI_ROOT + fi + DDM="-I${MPI_ROOT}/include -DDDM" + PATH=$MPI_ROOT/bin:$PATH + export PATH + LD_LIBRARY_PATH=$MPI_ROOT/lib:$MPI_ROOT/lib/release:$MPI_ROOT/libfabric/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + if test $INTELMPI_VERSION = HYDRA + then + RUN_JOB1="${MPI_ROOT}/bin/mpiexec.hydra -genvall -n " + RUN_JOB2="${MPI_ROOT}/bin/mpiexec.hydra -genvall" + else + RUN_JOB1="${MPI_ROOT}/bin/mpiexec -n " + RUN_JOB2="${MPI_ROOT}/bin/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 + FI_PROVIDER_PATH=$MPI_ROOT/libfabric/lib/prov + export FI_PROVIDER_PATH + if test -f "/etc/SuSE-release"; then + FI_PROVIDER=sockets + export FI_PROVIDER + fi + I_MPI_WAIT_MODE=1 + export I_MPI_WAIT_MODE + 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 +if test "$MARC_CASISOLVER" = "NONE" ; then + CASISOLVER=NONE +fi +#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 + +# Edit following lines to enable zlib support +ZLIB=ZLIB +if test "$MARC_ZLIB" = "NONE"; then + ZLIB=NONE +fi +#ZLIB=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 + SOLVER2GPU=NONE + MARC_DLL=NONE + ZLIB=NONE +fi +if test "$AEM_DLL" -eq 1 +then + VKISOLVER=NONE + CASISOLVER=NONE + MF2SOLVER=NONE + INTELSOLVER=NONE + MUMPSSOLVER=NONE + BCSGPUSOLVER=NONE + SOLVER2GPU=NONE + ZLIB=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 + +if test "$SOLVER2GPU" = GPU +then + SOLVERFLAGS="$SOLVERFLAGS -DSOLVER2GPU" +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" + +MARCCODEPROF= +#MARCCODEPROF="ON" + +if test "$MARC_INTEGER_SIZE" = "i4" ; then + I8FFLAGS= + I8DEFINES= + I8CDEFINES= +else + I8FFLAGS="-i8" + I8DEFINES="-DI64" + I8CDEFINES="-U_DOUBLE -D_SINGLE" +fi + +MTHREAD=OPENMP +if test "$MARC_OPENMP" = "NONE" ; then + MTHREAD=NONE +fi +#MTHREAD=NONE +if test "$_OEM_NASTRAN" -ne 0 +then +MTHREAD=NONE +fi +if test "$AEM_DLL" -eq 1 +then + MTHREAD=NONE + CASISOLVER=NONE + VKISOLVER=NONE + MF2SOLVER=NONE + INTELSOLVER=NONE + BCSGPUSOLVER=NONE + SOLVER2GPU=NONE + OPENSSL_LIB= + MARC_DLL=NONE + METISLIBS= +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" + +if test "$AEM_DLL" -eq 1 +then + FDEFINES="$FDEFINES -D_AEMNL -DAAA" + CDEFINES="$CDEFINES -D_AEMNL -DAAA" +fi + +CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS -I$LAPI_IMPORTS/common/include" +if test "$_OEM_NASTRAN" -ne 0 +then + CINCL="$CINCL -I../../include" +fi + +CC_OPT= +if test "$MTHREAD" = "OPENMP" +then + CC_OPT=" $CC_OPT -qopenmp" +fi + +if test "$ZLIB" = "ZLIB"; then + FDEFINES="$FDEFINES -DENABLE_ZLIB" + CDEFINES="$CDEFINES -DENABLE_ZLIB" + CINCL="$CINCL -I$ZLIB_INCLUDE" +fi + +CC="icc -c $CC_OPT -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " +CCLOW="icc -c $CC_OPT -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " +CCHIGH="icc -c $CC_OPT -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " + +CC_TETMESH="icpc -c -O2 -I$TETMESHDIR/include -qopenmp -ansi-alias -m64 -pipe -fPIC -falign-functions=16 -fstrict-aliasing -fno-jump-tables -MMD -DLINUX -D_CRT_SECURE_NO_WARNINGS -DX64 -DMESHINGAPI_LIB -DNDEBUG" +CC_CAEFATIGUE="icpc -c -O2 -I$CAEFATIGUEDIR/linux64/include -qopenmp -ansi-alias -m64 -pipe -fPIC -falign-functions=16 -fstrict-aliasing -fno-jump-tables -MMD -DLINUX -D_CRT_SECURE_NO_WARNINGS -DX64 -DNDEBUG" + +if test "$MARCDEBUG" = "ON" +then + CC="icc -c $CC_OPT -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " + CCLOW="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " + CCHIGH="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " +fi + +LOAD_CC="icc $CC_OPT -O1 -DLinux -DLINUX -DLinux_intel" +CCT="$CC" +CCTLOW="$CCLOW" +CCTHIGH="$CCHIGH" + +#PROFILE="-Mprof=func" +#PROFILE="-Mprof=lines" +#PROFILE="-Mprof=func,mpi" +PROFILE= +#PROFILE="-init=snan,arrays -CB -traceback -fpe0 -fp-stack-check -check all -check uninit -ftrapuv" +if test "$MARCCODECOV" = "ON" +then +PROFILE="-prof-gen=srcpos" +fi +if test "$MARCCODEPROF" = "ON" +then +PROFILE=" $PROFILE -pg" +fi + +FORT_OPT="-c -assume byterecl -safe_cray_ptr -mp1 -WB -fp-model source" +if test "$MTHREAD" = "OPENMP" +then + FORT_OPT=" $FORT_OPT -qopenmp" + if test "$OMP_COMPAT" = "YES" + then + FORT_OPT=" $FORT_OPT -qopenmp-threadprivate=compat" + fi +else +# FORT_OPT=" $FORT_OPT -auto " + FORT_OPT=" $FORT_OPT -save -zero" +fi +if test "$MARCHDF_HDF" = "HDF"; then + FORT_OPT="$FORT_OPT -DMARCHDF_HDF=$MARCHDF_HDF $HDF_INCLUDE" +fi + +FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" +FORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" +FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" +FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" +# for compiling free form f90 files. high opt, integer(4) +FORTF90="$FCOMP -c -O3" + +if test "$MARCDEBUG" = "ON" +then + FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" + FORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" + FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" + FORTNA="$FCOMP $FORT_OPT -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + $MUMPS_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" + +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/include -I$VT_ROOT/include" +# LOAD="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " +# LOADT="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " +# fi + if test $MPITYPE = intelmpi + then + LOAD="ifort $PROFILE $LINK_OPT -o " + LOADT="ifort $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" + 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 + +if test "$AEM_DLL" -eq 1 +then + FORTLOW="$FORTLOW -fpp -fPIC" + FORTRAN="$FORTRAN -fpp -fPIC" + FORTHIGH="$FORTHIGH -fpp -fPIC" + FORTRANMNF="$FORTRANMNF -fpp -fPIC" + CC="$CC -fPIC" + CCMNF="$CCMNF -fPIC" + LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide" + 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="$CASILIB_DIR/libmarccasi.a $CASILIB_DIR/libcasi.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 "$MUMPSSOLVER" = MUMPS +then + MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps.a" + if test $MPITYPE = intelmpi + then + MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.a" + fi +else + MUMPSSOLVERLIBS= +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 +else + BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " +fi + +SOLVER2LIBS= +if test "$SOLVER2GPU" = GPU +then + SOLVER2LIBS="-L$MARC_LIB/cuda_dummy -lsolver2gpu" +fi + +if test "$AEM_DLL" -eq 1 +then + BCSSOLVERLIBS= +fi + + +SECLIBS="-L$MARC_LIB -llapi" + +SOLVERLIBS="${BCSSOLVERLIBS} ${VKISOLVERLIBS} ${CASISOLVERLIBS} ${MF2SOLVERLIBS} \ + -L$MARC_MKL \ + $MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a $KDTREE2_LIB/libkdtree2.a $MARC_LIB/libtetmeshinterface.a $MARC_LIB/libcaefatigueinterface.a -L$MARC_LIB -lmkl_blacs_intelmpi_ilp64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -ltetmesh -lmeshgems -lmg-tetra -lmeshgems_stubs $HDF_LIBS $SOLVER2LIBS" + +SOLVERLIBS_DLL=${SOLVERLIBS} +if test "$AEM_DLL" -eq 1 +then +SOLVERLIBS_DLL="-L$MARC_MKL -lmkl_blacs_intelmpi_ilp64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 $MARC_LIB/blas_src.a" +fi +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" +SFLIB="-L$SFMATDIR -lMBA_Grain" +OPENMP="-qopenmp" + +if test "$AEM_DLL" -eq 1 +then + LOAD_DLL=$LOAD + OPENMP= + LIBMNF= + OPENSSL=NONE +fi + +SYSLIBS=" $OPENMP -lpthread -shared-intel -cxxlib" + +# 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}/lib/release -lmpi -L${MPI_ROOT}/lib -lmpifort -lrt $OPENMP -threads -lpthread -shared-intel -cxxlib" +fi + +if test "$ZLIB" = "ZLIB"; then + SYSLIBS="$SYSLIBS $ZLIB_LIB/libz.a" +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 cosim_begin.f" +if test "$MARC_INTEGER_SIZE" = "i8" ; then + LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" +fi + +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 dpsmsah.f tpsmsah.f cn_qsort4_11.f \ + prei11.f prei12.f prei31.f prei32.f prei41.f prei42.f prei61.f prei62.f \ + prei1n.f prei2n.f cgfullnts1.f cgfullnts2.f cg1n.f cg2n.f cg3n.f \ + cg4n.f cg5n.f cg6n.f cgnn.f sortab.f sortab1.f triann1.f preinv_nts.f \ + cn_sur_patchl.f cn_quad_3e.f" + + + +MAXNUM=1000000 diff --git a/installation/MarcMentat/2021.2/Marc_tools/run_damask_hmp b/installation/MarcMentat/2021.2/Marc_tools/run_damask_hmp new file mode 100644 index 000000000..524bac7c1 --- /dev/null +++ b/installation/MarcMentat/2021.2/Marc_tools/run_damask_hmp @@ -0,0 +1,4129 @@ +#!/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 # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo This option is deprecated. As of Marc 2015, only # +# the integer*8 version is available. # +# -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. # +# -dl y|n delete log file, if "yes" an old exisitng log file is # +# deleted, no new log is created. If "no" a new log file # +# is created. For job running in the background, the log # +# file is always created. Default is "yes" # +############################################################################## +# 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= +modeerror= +modeoption= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + 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 $1}}' $HOME/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + 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) + modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + modeoption=error + echo $modeerror + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i8" + echo " " + echo " use -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + echo + echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available + echo + 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 + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + 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" + + +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) +. $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 +export MESHERDIR +MSC_LICENSE_FINPROC=0 +export MSC_LICENSE_FINPROC +# +# 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_COSIM_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH:$SFMATDIR +if test -f "/etc/redhat-release"; then + ver=`cat /etc/redhat-release | sed 's/.* release \([0-9]\).\([0-9]\+\) .*/\1\2/'` + case "$ver" in + 6*) LD_LIBRARY_PATH="${MARC_LIB_SHARED}rh67:$LD_LIBRARY_PATH" ;; + esac +fi +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$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= +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +ddm_arc=0 +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 +iprintsimufact= +SRCLIB=$MARC_LIB/srclib.a +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_OTHER $MPI_DEFAULT" + 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="$MUMPSLIB_DIR/libmumps_$value.a" + 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 # +############################################################################## +deletelog=yes +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 + ;; + -dl | -DL) + case $value in + y* | Y*) + deletelog=yes + ;; + n* | N*) + deletelog=no + ;; + *) + ;; + 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 + case $value in + sfg | sfm | sim) + iprintsimufact=true + ;; + esac + ;; + -au* | -AU*) + nauto=$value + echo + echo warning: the option -au is no longer supported and will be ignored + echo + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -ddm | -DDM) + ddm_arc=$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="$MUMPSLIB_DIR/libmumps_$value.a" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.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 + +nsolverprint=$nsolver +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 "$iam" = sim ; then + SFLIB="-L$SFMATDIR -lMBA_Grain" +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 $MPI_DEFAULT)" + 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 "$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 + if test "$user" + then +# allow user sub without giving job id + qid=foreground + verify=no + else + error="$error +job id required" +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 + +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +if test $qid = background -a $verify = no +then + deletelog=no +fi + +if test "$deletelog" = no +then +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid$extra_job_info +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" > $jid.log +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log +fi +echo \ +"Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit" >> $jid.log +fi +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid$extra_job_info +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" +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" +fi +echo \ +"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" + + +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 "$modeoption" +then + error=$modeerror +fi + +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 +# Update print variable for -nsolver option + nsolverprint=$nsolver + if test $nsolver -eq 0 + then + nsolverprint= + fi + $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 "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 + if test "$jid" + then + /bin/rm $jid.log 2>/dev/null + fi +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 -a "$jid" + +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 DAMASK options for linking + DAMASK="-lstdc++" + + 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. " + 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. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + 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 -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 $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 $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(" -host %s",$1); \ + printf(" -n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + 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 ) printf(" -wdir %s ",$3); \ + 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 + + +# +# check for external file to run using valgrind +# +if test -f $MARC_TOOLS/run_marc_valgrind +then + . $MARC_TOOLS/run_marc_valgrind +fi + + +############################################################################## +# 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 -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + 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 \ + $SRCLIB \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $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 +/bin/rm $DIRJOB/*.smod 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 -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + 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 \ + $SRCLIB \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $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 +/bin/rm $DIRJOB/*.smod 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 + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " +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 + if test -f "$host_filt" + then + 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 +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 + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 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 + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 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 -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + 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 \ + $SRCLIB \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $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 +/bin/rm $DIRJOB/*.smod 2>/dev/null +# done if no job id given +if test -z "$jid" +then + echo + echo only compilation requested + echo + exit +fi +# +# 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 + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " +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 + if test -f "$host_filt" + then + 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 +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 + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 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 + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi + + +fi +fi diff --git a/installation/MarcMentat/2021.2/Marc_tools/run_damask_lmp b/installation/MarcMentat/2021.2/Marc_tools/run_damask_lmp new file mode 100644 index 000000000..951bd3aab --- /dev/null +++ b/installation/MarcMentat/2021.2/Marc_tools/run_damask_lmp @@ -0,0 +1,4129 @@ +#!/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 # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo This option is deprecated. As of Marc 2015, only # +# the integer*8 version is available. # +# -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. # +# -dl y|n delete log file, if "yes" an old exisitng log file is # +# deleted, no new log is created. If "no" a new log file # +# is created. For job running in the background, the log # +# file is always created. Default is "yes" # +############################################################################## +# 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= +modeerror= +modeoption= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + 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 $1}}' $HOME/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + 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) + modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + modeoption=error + echo $modeerror + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i8" + echo " " + echo " use -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + echo + echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available + echo + 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 + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + 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" + + +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) +. $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 +export MESHERDIR +MSC_LICENSE_FINPROC=0 +export MSC_LICENSE_FINPROC +# +# 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_COSIM_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH:$SFMATDIR +if test -f "/etc/redhat-release"; then + ver=`cat /etc/redhat-release | sed 's/.* release \([0-9]\).\([0-9]\+\) .*/\1\2/'` + case "$ver" in + 6*) LD_LIBRARY_PATH="${MARC_LIB_SHARED}rh67:$LD_LIBRARY_PATH" ;; + esac +fi +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$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= +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +ddm_arc=0 +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 +iprintsimufact= +SRCLIB=$MARC_LIB/srclib.a +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_OTHER $MPI_DEFAULT" + 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="$MUMPSLIB_DIR/libmumps_$value.a" + 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 # +############################################################################## +deletelog=yes +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 + ;; + -dl | -DL) + case $value in + y* | Y*) + deletelog=yes + ;; + n* | N*) + deletelog=no + ;; + *) + ;; + 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 + case $value in + sfg | sfm | sim) + iprintsimufact=true + ;; + esac + ;; + -au* | -AU*) + nauto=$value + echo + echo warning: the option -au is no longer supported and will be ignored + echo + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -ddm | -DDM) + ddm_arc=$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="$MUMPSLIB_DIR/libmumps_$value.a" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.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 + +nsolverprint=$nsolver +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 "$iam" = sim ; then + SFLIB="-L$SFMATDIR -lMBA_Grain" +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 $MPI_DEFAULT)" + 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 "$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 + if test "$user" + then +# allow user sub without giving job id + qid=foreground + verify=no + else + error="$error +job id required" +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 + +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +if test $qid = background -a $verify = no +then + deletelog=no +fi + +if test "$deletelog" = no +then +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid$extra_job_info +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" > $jid.log +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log +fi +echo \ +"Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit" >> $jid.log +fi +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid$extra_job_info +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" +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" +fi +echo \ +"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" + + +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 "$modeoption" +then + error=$modeerror +fi + +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 +# Update print variable for -nsolver option + nsolverprint=$nsolver + if test $nsolver -eq 0 + then + nsolverprint= + fi + $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 "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 + if test "$jid" + then + /bin/rm $jid.log 2>/dev/null + fi +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 -a "$jid" + +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 DAMASK options for linking + DAMASK="-lstdc++" + + 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. " + 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. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + 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 -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 $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 $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(" -host %s",$1); \ + printf(" -n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + 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 ) printf(" -wdir %s ",$3); \ + 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 + + +# +# check for external file to run using valgrind +# +if test -f $MARC_TOOLS/run_marc_valgrind +then + . $MARC_TOOLS/run_marc_valgrind +fi + + +############################################################################## +# 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 -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + 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 \ + $SRCLIB \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $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 +/bin/rm $DIRJOB/*.smod 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 -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + 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 \ + $SRCLIB \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $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 +/bin/rm $DIRJOB/*.smod 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 + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " +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 + if test -f "$host_filt" + then + 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 +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 + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 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 + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 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 -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + 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 \ + $SRCLIB \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $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 +/bin/rm $DIRJOB/*.smod 2>/dev/null +# done if no job id given +if test -z "$jid" +then + echo + echo only compilation requested + echo + exit +fi +# +# 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 + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " +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 + if test -f "$host_filt" + then + 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 +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 + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 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 + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi + + +fi +fi diff --git a/installation/MarcMentat/2021.2/Marc_tools/run_damask_mp b/installation/MarcMentat/2021.2/Marc_tools/run_damask_mp new file mode 100644 index 000000000..d912b9622 --- /dev/null +++ b/installation/MarcMentat/2021.2/Marc_tools/run_damask_mp @@ -0,0 +1,4129 @@ +#!/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 # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo This option is deprecated. As of Marc 2015, only # +# the integer*8 version is available. # +# -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. # +# -dl y|n delete log file, if "yes" an old exisitng log file is # +# deleted, no new log is created. If "no" a new log file # +# is created. For job running in the background, the log # +# file is always created. Default is "yes" # +############################################################################## +# 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= +modeerror= +modeoption= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + 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 $1}}' $HOME/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + 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) + modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + modeoption=error + echo $modeerror + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i8" + echo " " + echo " use -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + echo + echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available + echo + 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 + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + 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" + + +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) +. $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 +export MESHERDIR +MSC_LICENSE_FINPROC=0 +export MSC_LICENSE_FINPROC +# +# 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_COSIM_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH:$SFMATDIR +if test -f "/etc/redhat-release"; then + ver=`cat /etc/redhat-release | sed 's/.* release \([0-9]\).\([0-9]\+\) .*/\1\2/'` + case "$ver" in + 6*) LD_LIBRARY_PATH="${MARC_LIB_SHARED}rh67:$LD_LIBRARY_PATH" ;; + esac +fi +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$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= +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +ddm_arc=0 +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 +iprintsimufact= +SRCLIB=$MARC_LIB/srclib.a +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_OTHER $MPI_DEFAULT" + 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="$MUMPSLIB_DIR/libmumps_$value.a" + 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 # +############################################################################## +deletelog=yes +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 + ;; + -dl | -DL) + case $value in + y* | Y*) + deletelog=yes + ;; + n* | N*) + deletelog=no + ;; + *) + ;; + 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 + case $value in + sfg | sfm | sim) + iprintsimufact=true + ;; + esac + ;; + -au* | -AU*) + nauto=$value + echo + echo warning: the option -au is no longer supported and will be ignored + echo + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -ddm | -DDM) + ddm_arc=$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="$MUMPSLIB_DIR/libmumps_$value.a" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.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 + +nsolverprint=$nsolver +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 "$iam" = sim ; then + SFLIB="-L$SFMATDIR -lMBA_Grain" +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 $MPI_DEFAULT)" + 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 "$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 + if test "$user" + then +# allow user sub without giving job id + qid=foreground + verify=no + else + error="$error +job id required" +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 + +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +if test $qid = background -a $verify = no +then + deletelog=no +fi + +if test "$deletelog" = no +then +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid$extra_job_info +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" > $jid.log +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log +fi +echo \ +"Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit" >> $jid.log +fi +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid$extra_job_info +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" +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" +fi +echo \ +"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" + + +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 "$modeoption" +then + error=$modeerror +fi + +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 +# Update print variable for -nsolver option + nsolverprint=$nsolver + if test $nsolver -eq 0 + then + nsolverprint= + fi + $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 "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 + if test "$jid" + then + /bin/rm $jid.log 2>/dev/null + fi +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 -a "$jid" + +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 DAMASK options for linking + DAMASK="-lstdc++" + + 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. " + 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. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + 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 -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 $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 $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(" -host %s",$1); \ + printf(" -n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + 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 ) printf(" -wdir %s ",$3); \ + 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 + + +# +# check for external file to run using valgrind +# +if test -f $MARC_TOOLS/run_marc_valgrind +then + . $MARC_TOOLS/run_marc_valgrind +fi + + +############################################################################## +# 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 -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + 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 \ + $SRCLIB \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $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 +/bin/rm $DIRJOB/*.smod 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 -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + 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 \ + $SRCLIB \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $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 +/bin/rm $DIRJOB/*.smod 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 + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " +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 + if test -f "$host_filt" + then + 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 +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 + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 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 + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 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 -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + 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 \ + $SRCLIB \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $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 +/bin/rm $DIRJOB/*.smod 2>/dev/null +# done if no job id given +if test -z "$jid" +then + echo + echo only compilation requested + echo + exit +fi +# +# 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 + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " +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 + if test -f "$host_filt" + then + 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 +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 + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 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 + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi + + +fi +fi diff --git a/installation/MarcMentat/2021.2/Marc_tools/run_marc.original b/installation/MarcMentat/2021.2/Marc_tools/run_marc.original new file mode 100644 index 000000000..23e9e0d9c --- /dev/null +++ b/installation/MarcMentat/2021.2/Marc_tools/run_marc.original @@ -0,0 +1,4207 @@ +#!/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 # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo This option is deprecated. As of Marc 2015, only # +# the integer*8 version is available. # +# -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. # +# -dl y|n delete log file, if "yes" an old exisitng log file is # +# deleted, no new log is created. If "no" a new log file # +# is created. For job running in the background, the log # +# file is always created. Default is "yes" # +############################################################################## +# 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= +modeerror= +modeoption= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + 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 $1}}' $HOME/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + 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) + modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + modeoption=error + echo $modeerror + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i8" + echo " " + echo " use -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + echo + echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available + echo + 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 + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + 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 +export MESHERDIR +MSC_LICENSE_FINPROC=0 +export MSC_LICENSE_FINPROC +# +# 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_COSIM_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH:$SFMATDIR +if test -f "/etc/redhat-release"; then + ver=`cat /etc/redhat-release | sed 's/.* release \([0-9]\).\([0-9]\+\) .*/\1\2/'` + case "$ver" in + 6*) LD_LIBRARY_PATH="${MARC_LIB_SHARED}rh67:$LD_LIBRARY_PATH" ;; + esac +fi +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$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= +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +ddm_arc=0 +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 +iprintsimufact= +SRCLIB=$MARC_LIB/srclib.a +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_OTHER $MPI_DEFAULT" + 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="$MUMPSLIB_DIR/libmumps_$value.a" + 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 # +############################################################################## +deletelog=yes +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` + usersubname=$user + basefile=`$BASENAME $value` + if test ${basefile##*.} = f + then + user=`dirname $value`/`$BASENAME $value .f` + usersubname=$user.f + elif test ${basefile##*.} = F + then + user=`dirname $value`/`$BASENAME $value .F` + usersubname=$user.F + elif test ${basefile##*.} = f90 + then + user=`dirname $value`/`$BASENAME $value .f90` + usersubname=$user.f90 + elif test ${basefile##*.} = F90 + then + user=`dirname $value`/`$BASENAME $value .F90` + usersubname=$user.F90 + fi + case $user in + \/*) + ;; + *) + user=`pwd`/$user + usersubname=`pwd`/$usersubname + ;; + esac + if test ! -f $usersubname + then + if test -f $usersubname.f + then + usersubname=$usersubname.f + elif test -f $usersubname.F + then + usersubname=$usersubname.F + elif test -f $usersubname.f90 + then + usersubname=$usersubname.f90 + elif test -f $usersubname.F90 + then + usersubname=$usersubname.F90 + fi + fi + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -dl | -DL) + case $value in + y* | Y*) + deletelog=yes + ;; + n* | N*) + deletelog=no + ;; + *) + ;; + 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 + case $value in + sfg | sfm | sim) + iprintsimufact=true + ;; + esac + ;; + -au* | -AU*) + nauto=$value + echo + echo warning: the option -au is no longer supported and will be ignored + echo + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -ddm | -DDM) + ddm_arc=$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="$MUMPSLIB_DIR/libmumps_$value.a" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.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 + +nsolverprint=$nsolver +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 "$iam" = sim ; then + SFLIB="-L$SFMATDIR -lMBA_Grain" +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 $MPI_DEFAULT)" + 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 "$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 + if test "$user" + then +# allow user sub without giving job id + qid=foreground + verify=no + else + error="$error +job id required" + 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 + +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +if test $qid = background -a $verify = no +then + deletelog=no +fi + +if test "$deletelog" = no +then +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid$extra_job_info +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" > $jid.log +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log +fi +echo \ +"Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit" >> $jid.log +fi +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid$extra_job_info +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" +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" +fi +echo \ +"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" + + +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 "$modeoption" +then + error=$modeerror +fi + +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 ($usersubname)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=`dirname $value`/`$BASENAME $value .f` + usersubname=$user + basefile=`$BASENAME $value` + if test ${basefile##*.} = f + then + user=`dirname $value`/`$BASENAME $value .f` + usersubname=$user.f + elif test ${basefile##*.} = F + then + user=`dirname $value`/`$BASENAME $value .F` + usersubname=$user.F + elif test ${basefile##*.} = f90 + then + user=`dirname $value`/`$BASENAME $value .f90` + usersubname=$user.f90 + elif test ${basefile##*.} = F90 + then + user=`dirname $value`/`$BASENAME $value .F90` + usersubname=$user.F90 + fi + case $user in + \/*) + ;; + *) + user=`pwd`/$user + usersubname=`pwd`/$usersubname + ;; + esac + if test ! -f $usersubname + then + if test -f $usersubname.f + then + usersubname=$usersubname.f + elif test -f $usersubname.F + then + usersubname=$usersubname.F + elif test -f $usersubname.f90 + then + usersubname=$usersubname.f90 + elif test -f $usersubname.F90 + then + usersubname=$usersubname.F90 + fi + 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 +# Update print variable for -nsolver option + nsolverprint=$nsolver + if test $nsolver -eq 0 + then + nsolverprint= + fi + $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 "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 + if test "$jid" + then + /bin/rm $jid.log 2>/dev/null + fi +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 -a "$jid" + +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. " + 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. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + 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 -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 $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 $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(" -host %s",$1); \ + printf(" -n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + 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 ) printf(" -wdir %s ",$3); \ + 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 + + +# +# check for external file to run using valgrind +# +if test -f $MARC_TOOLS/run_marc_valgrind +then + . $MARC_TOOLS/run_marc_valgrind +fi + + +############################################################################## +# 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 -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + 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 \ + $SRCLIB \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $SFLIB \ + $OPENSSL_LIB \ + $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 -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + 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 \ + $SRCLIB \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $SFLIB \ + $OPENSSL_LIB \ + $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 + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " +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 + if test -f "$host_filt" + then + 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 +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 + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 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 + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 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 -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + 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 \ + $SRCLIB \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $SFLIB \ + $OPENSSL_LIB \ + $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 + +# done if no job id given +if test -z "$jid" +then + echo + echo only compilation requested + echo + exit +fi +# +# 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 + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " +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 + if test -f "$host_filt" + then + 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 +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 + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 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 + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi + + +fi +fi diff --git a/installation/MarcMentat/2021.2/Mentat_bin/edit_window b/installation/MarcMentat/2021.2/Mentat_bin/edit_window new file mode 100644 index 000000000..b732a7694 --- /dev/null +++ b/installation/MarcMentat/2021.2/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/MarcMentat/2021.2/Mentat_bin/edit_window.original b/installation/MarcMentat/2021.2/Mentat_bin/edit_window.original new file mode 100644 index 000000000..64c0a68d0 --- /dev/null +++ b/installation/MarcMentat/2021.2/Mentat_bin/edit_window.original @@ -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/MarcMentat/2021.2/Mentat_bin/kill1.original b/installation/MarcMentat/2021.2/Mentat_bin/kill1.original new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/MarcMentat/2021.2/Mentat_bin/kill1.original @@ -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/MarcMentat/2021.2/Mentat_bin/kill4 b/installation/MarcMentat/2021.2/Mentat_bin/kill4 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/MarcMentat/2021.2/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/MarcMentat/2021.2/Mentat_bin/kill5 b/installation/MarcMentat/2021.2/Mentat_bin/kill5 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/MarcMentat/2021.2/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/MarcMentat/2021.2/Mentat_bin/kill6 b/installation/MarcMentat/2021.2/Mentat_bin/kill6 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/MarcMentat/2021.2/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/MarcMentat/2021.2/Mentat_bin/submit1.original b/installation/MarcMentat/2021.2/Mentat_bin/submit1.original new file mode 100644 index 000000000..5eb7dc1b2 --- /dev/null +++ b/installation/MarcMentat/2021.2/Mentat_bin/submit1.original @@ -0,0 +1,189 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=/nethome/f.roters/temp/msc/Marc2021.2/marc2021.2 +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 +SRCEXTC=.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 +copy_datfile="-ci $4" +copy_postfile="-cr $5" +scr_dir=$6 +dcoup=$7 +assem_recov_nthread=$8 +nthread=$9 +shift 9 # cannot use $10, $11, ... +nsolver=$1 +mode=$2 +gpu=$3 + +if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then + slv="-iam sfm" +fi +if [ "$slv" == "marc" ]; then + slv="" +fi +if [ "$slv" == "datfit" ]; then + slv="-iam datfit" +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$//" | sed "s/$SRCEXTC$//"` + 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 \ + $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/MarcMentat/2021.2/Mentat_bin/submit4 b/installation/MarcMentat/2021.2/Mentat_bin/submit4 new file mode 100644 index 000000000..eea3495da --- /dev/null +++ b/installation/MarcMentat/2021.2/Mentat_bin/submit4 @@ -0,0 +1,191 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc2021.2 + +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 +SRCEXTC=.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 +copy_datfile="-ci $4" +copy_postfile="-cr $5" +scr_dir=$6 +dcoup=$7 +assem_recov_nthread=$8 +nthread=$9 +shift 9 # cannot use $10, $11, ... +nsolver=$1 +mode=$2 +gpu=$3 + +if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then + slv="-iam sfm" +fi +if [ "$slv" = "marc" ]; then + slv="" +fi +if [ "$slv" = "datfit" ]; then + slv="-iam datfit" +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$//" | sed "s/$SRCEXTC$//"` + 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 \ + $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/MarcMentat/2021.2/Mentat_bin/submit5 b/installation/MarcMentat/2021.2/Mentat_bin/submit5 new file mode 100644 index 000000000..8fc6d326c --- /dev/null +++ b/installation/MarcMentat/2021.2/Mentat_bin/submit5 @@ -0,0 +1,191 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc2021.2 + +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 +SRCEXTC=.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 +copy_datfile="-ci $4" +copy_postfile="-cr $5" +scr_dir=$6 +dcoup=$7 +assem_recov_nthread=$8 +nthread=$9 +shift 9 # cannot use $10, $11, ... +nsolver=$1 +mode=$2 +gpu=$3 + +if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then + slv="-iam sfm" +fi +if [ "$slv" = "marc" ]; then + slv="" +fi +if [ "$slv" = "datfit" ]; then + slv="-iam datfit" +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$//" | sed "s/$SRCEXTC$//"` + 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 \ + $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/MarcMentat/2021.2/Mentat_bin/submit6 b/installation/MarcMentat/2021.2/Mentat_bin/submit6 new file mode 100644 index 000000000..08007dc87 --- /dev/null +++ b/installation/MarcMentat/2021.2/Mentat_bin/submit6 @@ -0,0 +1,191 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc2021.2 + +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 +SRCEXTC=.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 +copy_datfile="-ci $4" +copy_postfile="-cr $5" +scr_dir=$6 +dcoup=$7 +assem_recov_nthread=$8 +nthread=$9 +shift 9 # cannot use $10, $11, ... +nsolver=$1 +mode=$2 +gpu=$3 + +if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then + slv="-iam sfm" +fi +if [ "$slv" = "marc" ]; then + slv="" +fi +if [ "$slv" = "datfit" ]; then + slv="-iam datfit" +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$//" | sed "s/$SRCEXTC$//"` + 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 \ + $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/MarcMentat/2021.2/Mentat_menus/job_run.ms b/installation/MarcMentat/2021.2/Mentat_menus/job_run.ms new file mode 100644 index 000000000..59d4cc90b --- /dev/null +++ b/installation/MarcMentat/2021.2/Mentat_menus/job_run.ms @@ -0,0 +1,3109 @@ +#ifndef AUTOFORGE +popmenu job_title_pm file jobs.ms +popdown job_title_ok file jobs.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 matrix_solver_gr file job_common.ms +popmenu ddm_options file job_common.ms + +browser edit_browser file file.ms +browser directory_browser file file.ms +screen domains file domain_decomposition.ms + +frame job_properties_subm_header_fr file job_common.ms +frame job_properties_subm_footer_fr file job_common.ms + + +browser usersub_file_browser { + text "$usersub_file_browser_label" ($usersub_file_browser_label) + filter "*.f *.F *.f90 *.F90" + select_files true + command "$usersub_file_browser_command" ($usersub_file_browser_command) +} + + + +browser host_file_browser { + text "$host_file_browser_label" ($host_file_browser_label) + filter "*" + select_files true + command "$host_file_browser_command" ($host_file_browser_command) +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_run_popmenu { + + text "RUN JOB" + + group { + + frame { + position 1 1 + size 60 4 + group { + label { + position 0 1 + size 15 4 + text "NAME" + help job_run + } + display { + position +12 = + size 45 4 + display "job_name" + } + label { + position 0 +4 + size 15 4 + text "TYPE" + help job_run + } + display { + position +12 = + size 45 4 + display job_class_label + } + } + } + + frame { + text "USER SUBROUTINES" + position 1 +4 + size 60 4 + group { + button { + position 0 0 + size 30 4 + text "FORTRAN SOURCE FILE" + help "job_run#User Subroutines" + browser usersub_file_browser + settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" + set $usersub_file_browser_command "*job_usersub_file" + } + toggle { + position +30 = + size 30 4 + text "SELECTED USER SUBS" + help "job_run#User Subroutines" + toggle job_usersubs + active job_usersubs + popmenu job_usersub_pm + } + display { + position 0 +4 + size 60 4 + display job_usersub_file + visible job_usersub_file + } + button { + position 0 +4 + size 15 4 + text "EDIT" + help "job_run#User Subroutines" + command "*job_edit_usersub_file" + visible job_usersub_file + } + button { + position +15 = + size 15 4 + text "CLEAR" + help "job_run#User Subroutines" + command "*job_clear_usersub_file" + visible job_usersub_file + } + roller { + position +15 = + size 30 4 + nvalues 3 + texts "COMPILE / NO SAVE" + "COMPILE AND SAVE" + "RUN SAVED EXECUTABLE" + help "job_run#User Subroutines" + roller "job_option user_source" + visible job_usersub_file + commands "*job_option user_source:compile_nosave" + "*job_option user_source:compile_save" + "*job_option user_source:run_saved" + } + } + } + + frame { + text "SOLVER/PARALLELIZATION" + position 1 +4 + size 60 4 + group { + button { + position 0 0 + size 30 4 + text "SETTINGS" + help "job_run#Solver/Parallelization" + popmenu job_run_parallelization_pm + set $popname2 "job_run_parallelization_pm" + } + display { + position 0 +4 + size 30 4 + display job_solver_solution + } + display { + position +30 = + size 30 4 + display job_ddm_domains + } + display { + position 0 +4 + size 30 4 + display job_solver_type + } + display { + position +30 = + size 30 4 + display job_assem_recov_nthreads + } + display { + position = +4 + size 30 4 + display job_solver_procs + visible solver_allows_multi_procs + } + display { + position = = + size 18 4 + display job_solver_threads + visible "and(solver_allows_multi_threads,\ + not(and(job_solver_mfront_sparse,\ + *job_option parallel:on)),\ + *job_option solver_use_gpu:off)" + } + display { + position +18 = + size 12 4 + display job_solver_gpu + visible "or(and(job_solver_mfront_sparse,job_nonsym_off), \ + and(job_solver_it_sparse,job_nonsym_off))" + } + } + } + + frame { + text "INPUT STYLE AND JOB TITLE" + position 1 +4 + size 60 4 + group { + +# see also job_common.ms +# see also the ADVANCED JOB SUBMISSION popmenu in this file + + label { + position 0 0 + size 8 4 + text "STYLE" + help "job_run#Input Style And Job Title" + border_width 1 + border_color black + } + roller { + position +8 = + size 22 4 + nvalues 3 + texts "TABLE-DRIVEN" + "MULTI-PHYSICS" + "OLD" + rollers "job_input_style_table_driven" + "job_input_style_multi_physics" + "job_input_style_old" + 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" + help "job_run#Input Style And Job Title" + } + button { + position +22 = + size 15 4 + text "TITLE" + help "job_run#Input Style And Job Title" + popmenu job_title_pm + command "*job_title" + } + button { + position +15 = + size 15 4 + text "SAVE MODEL" + help "job_run#Input Style And Job Title" + command "*save_model" + } + } + } + + frame { + text "JOB SUBMISSION AND CONTROL" + position 1 +4 + size 60 4 + group { + frame { + position 1 1 + size 50 4 + group { + button { + position 0 0 + size 25 4 + text "SUBMIT (1)" + help "job_run#Job Submission And Control" + command "*submit_job 1 *monitor_job" + } + button { + position +25 = + size 18 4 + text "ADVANCED JOB SUBMISSION" + help "job_run#Job Submission And Control" + popmenu job_submit_adv_pm + } + button { + position +18 = + size 7 4 + text "DAMASK" + help "damask_run#Job Submission And Control" + popmenu damask + } + button { + position 0 +4 + size 12 4 + text "UPDATE" + help "job_run#Job Submission And Control" + command "*update_job" + } + button { + position +12 = + size 13 4 + text "MONITOR" + help "job_run#Job Submission And Control" + command "*monitor_job" + } + button { + position +13 = + size 12 4 + text "RESET" + help "job_run#Job Submission And Control" + command "*job_submit_reset" + } + button { + position +12 = + size 13 4 + text "KILL" + help "job_run#Job Submission And Control" + command "*kill_job *monitor_job" + active "job_status_running" + } + } + } + + frame { + position 1 5 + size 50 4 + group { + label { + position 0 +4 + size 25 4 + text "STATUS" + help "job_run#Status" + border_width 1 + border_color black + } + display { + position +25 = + size 25 4 + display "job_status" + } + label { + position 0 +4 + size 25 4 + text "CURRENT INCREMENT (CYCLE)" + help "job_run#Current Increment" + border_width 1 + border_color black + } + display { + position +25 = + size 25 4 + display "job_increment" + } + label { + position 0 +4 + size 25 4 + text "SINGULARITY RATIO" + help "job_run#Singularity Ratio" + border_width 1 + border_color black + } + float { + position +25 = + size 25 4 + display "job_singularity_ratio" + } + label { + position 0 +4 + size 25 4 + text "CONVERGENCE RATIO" + help "job_run#Convergence Ratio" + border_width 1 + border_color black + } + float { + position +25 = + size 25 4 + display "job_convergence_ratio" + } + label { + position 0 +4 + size 25 4 + text "FRACTION OF INCREMENT (CONTACT)" + help "job_run#IPC" + border_width 1 + border_color black + } + float { + position +25 = + size 25 4 + display "job_ipc_fraction" + } + label { + position 0 +4 + size 25 4 + text "ANALYSIS TIME" + help "job_run#Analysis Time" + border_width 1 + border_color black + } + float { + position +25 = + size 25 4 + display "job_analysis_time" + } + } + } + + frame { + position 1 +4 + size 50 4 + group { + + frame { + position 0 0 + size 50 4 + text "ACCUMULATED ANALYSIS STATISTICS" + border_width 1 + border_color black + group { + label { + position 0 0 + size 12 4 + text "CYCLES" + help "job_run#Cycles" + border_width 1 + border_color black + } + integer { + position +12 = + size 12 4 + display "acc_job_cycles" + border_width 1 + border_color black + } + label { + position -12 +4 + size 12 4 + text "SEPARATIONS" + help "job_run#Separations" + border_width 1 + border_color black + } + integer { + position +12 = + size 12 4 + display "acc_job_separations" + border_width 1 + border_color black + } + label { + position -12 +4 + size 12 4 + text "WARNING MESSAGES" + help "job_run#Warnings" + border_width 1 + border_color black + } + integer { + position +12 = + size 12 4 + display "number_of_warning_messages" + border_width 1 + border_color black + } + label { + position +12 -8 + size 12 4 + text "CUT BACKS" + help "job_run#Cut Backs" + border_width 1 + border_color black + } + integer { + position +12 = + size 12 4 + display "acc_job_cut_backs" + border_width 1 + border_color black + } + label { + position -12 +4 + size 12 4 + text "REMESHES" + help "job_run#Remeshes" + border_width 1 + border_color black + } + integer { + position +12 = + size 12 4 + display "acc_job_remeshes" + border_width 1 + border_color black + } + label { + position -12 +4 + size 12 4 + text "WALL TIME" + help "job_run#Wall Time" + border_width 1 + border_color black + } + display { + position +12 = + size 12 4 + display "job_time" + } + } + } + + frame { + position 0 +4 + size 50 4 + text "JOB COMPLETION" + border_width 1 + border_color black + group { + label { + position 0 +4 + size 12 4 + text "EXIT NUMBER" + help "job_run#Exit Number" + border_width 1 + border_color black + } + integer { + position +12 = + size 13 4 + display "job_exit" + } + button { + position +13 = + size 25 4 + text "EXIT MESSAGE" + help "job_run#Exit Number" + popmenu job_exit_msg_pm + } + } + } + } + } + } + } + frame { + text "EDIT FILES" + position 1 +4 + size 60 4 + group { + frame { + position 1 1 + size 60 4 + group { + button { + position 0 +4 + size 15 4 + text "OUTPUT FILE" + help "job_run#Edit Files" + command "*job_edit_output" + } + button { + position +15 = + size 15 4 + text "LOG FILE" + help "job_run#Edit Files" + command "*job_edit_log_file" + } + button { + position +15 = + size 15 4 + text "STATUS FILE" + help "job_run#Edit Files" + command "*job_edit_status_file" + } + button { + position +15 = + size 15 4 + text "ANY FILE" + help "job_run#Edit Files" + settext $edit_browser_label "EDIT FILE" + set $edit_browser_command "*edit_file" + browser edit_browser + } + } + } + } + } + + frame { + position 1 +4 + size 60 4 + group { + layout hbox + spacer { + stretch 1 + } + popdown { + position 0 0 + size 60 4 + text "OPEN POST FILE" + help "job_run#Open Post File" + command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" + visible "not(*job_option write_cont_post_file:on)" + } + popdown { + position 0 0 + size 30 4 + text "OPEN POST FILE" + help "job_run#Open Post File" + command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" + visible "*job_option write_cont_post_file:on" + } + popdown { + position 0 0 + size 30 4 + text "OPEN EXPANDED BEAM POST FILE" + help "job_run#Open Expanded Beam Post File" + command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_con_default" + visible "*job_option write_cont_post_file:on" + } + spacer { + stretch 1 + } + } + } + + frame { + position 1 +5 + size 60 4 + group { + layout hbox + spacer { + stretch 1 + } + popdown { + size 12 4 + text "OK" + } + spacer { + stretch 1 + } + } + } + } + + window job_run_wi { + parent mentat + origin 35 1 + size 52 115 + background_color body + border_width 1 + border_color border + buffering single + } + + mode permanent +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_usersub_pm { + + text "CURRENTLY SELECTED USER SUBROUTINES" + + group { + + + 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 { + + text "ADVANCED JOB SUBMISSION" + + group { + + + 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 + } + + label { + position 1 9 + size 19 4 + text "INITIAL ALLOCATION" + border_width 1 + border_color black + } + label { + position +19 = + size 15 4 + text "GENERAL MEMORY" + help job_param_general_init_allocation + } + text { + position +15 = + size 14 4 + display "job_param_value_general_init_allocation" + command "*job_param general_init_allocation" + help job_param_general_init_allocation + } + + 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" + } + + 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 32 + nvisible 32 + texts "DEFAULT" +#if 0 + "2021.2" +#endif + "2021.1" + "2020.1" + "2020" + "2019.1" + "2019" + "2018.1" + "2018" + "2017.1" + "2017" + "2016" + "2015" + "2014.2" + "2014.1" + "2014" + "2013.1" + "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_2021.2" +#endif + "job_input_version_2021.1" + "job_input_version_2020.1" + "job_input_version_2020" + "job_input_version_2019.1" + "job_input_version_2019" + "job_input_version_2018.1" + "job_input_version_2018" + "job_input_version_2017.1" + "job_input_version_2017" + "job_input_version_2016" + "job_input_version_2015" + "job_input_version_2014.2" + "job_input_version_2014.1" + "job_input_version_2014" + "job_input_version_2013.1" + "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" + commands "*job_option version:default" +#if 0 + "*job_option version:2021.2" +#endif + "*job_option version:2021.1" + "*job_option version:2020.1" + "*job_option version:2020" + "*job_option version:2019.1" + "*job_option version:2019" + "*job_option version:2018.1" + "*job_option version:2018" + "*job_option version:2017.1" + "*job_option version:2017" + "*job_option version:2016" + "*job_option version:2015" + "*job_option version:2014.2" + "*job_option version:2014.1" + "*job_option version:2014" + "*job_option version:2013.1" + "*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_2021.2" +#endif + "job_allows_input_version_2021.1" + "job_allows_input_version_2020.1" + "job_allows_input_version_2020" + "job_allows_input_version_2019.1" + "job_allows_input_version_2019" + "job_allows_input_version_2018.1" + "job_allows_input_version_2018" + "job_allows_input_version_2017.1" + "job_allows_input_version_2017" + "job_allows_input_version_2016" + "job_allows_input_version_2015" + "job_allows_input_version_2014.2" + "job_allows_input_version_2014.1" + "job_allows_input_version_2014" + "job_allows_input_version_2013.1" + "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" + } + +# 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" + 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" + help job_option_input_style + } + + toggle { + position 0 +4 + size 24 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" + } + toggle { + position +24 = + size 24 4 + text "INCLUDE UNUSED TABLES" + toggle "*job_option input_file_tables:all" + true_command "*job_option input_file_tables:all" + false_command "*job_option input_file_tables:used" + } + } + } + + button { + position 1 +14 + size 24 4 + text "SCRATCH DIRECTORY" + settext $directory_browser_label "JOB SCRATCH DIRECTORY" + set $directory_browser_command "*job_scratch_directory" + browser directory_browser + 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 + } + + mode permanent +} + + +#-------------------------------------------------------------------------------------------------- +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" + } + + 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 permanent +} + +#-------------------------------------------------------------------------------------------------- +popmenu job_exit_msg_pm { + + text "EXIT MESSAGE" + + group { + + + + text { + position 1 5 + size 84 74 + multiline + readonly + display "job_exit_msg" + } + + 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 +} + + + + +#-------------------------------------------------------------------------------------------------- +popmenu job_run_parallelization_pm { + + text "SOLVER/PARALLELIZATION" + + group { + layout vbox + frame { + position 0 0 + size 42 8 + group { + + label { + position 0 0 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 36 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 36 4 + display job_class_label + } + } + } + frame { + position 0 8 + size 42 20 + group job_ddm_gr + text "DOMAIN DECOMPOSITION" + border_width 1 + border_color black + } + + frame { + position 0 +20 + size 42 13 + group job_assem_recov_gr + text "ASSEMBLY AND RECOVERY" + border_width 1 + border_color black + } + + frame { + position 0 +14 + size 42 31 + group job_parallel_matrix_solver_gr + text "MATRIX SOLVER" + border_width 1 + border_color black + } + + frame { + position 0 +32 + size 42 28 + group job_parallel_env_gr + text "PARALLELIZATION ENVIRONMENT" + border_width 1 + border_color black + visible "or(*job_option parallel:on, \ + solver_multi_procs)" + } + frame { + position 15 +30 + size 42 8 + group { + layout hbox + + spacer { + stretch 1 + } + popdown { + position 15 0 + size 12 8 + text "OK" + } + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + stretch 1 + } + } + + window { + parent mentat + origin 38 1 + size 60 119 + background_color body + border_width 1 + border_color border + buffering single + } + mode permanent +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_gr { + + toggle { + position 1 4 + size 42 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" + active "and(not(job_solver_it_ext),\ + not(job_solver_mixed_direct_iterative))" + } + + frame { + position = +5 + size 42 4 + group job_ddm_use_gr + visible "*job_option parallel:on" + } +} + +group job_ddm_use_gr { + layout vbox + frame{ + position 0 0 + size 30 4 + group { + layout hbox + label { + position 0 0 + size 12 4 + text "DECOMPOSITION IN" + help job_run_ddm_generator + } + oneonly{ + position +12 = + size 8 4 + text "MARC" + oneonly "*job_option ddm_generator:fea_solver" + command "*job_option ddm_generator:fea_solver" + help job_run_ddm_generator + } + oneonly{ + position +12 = + size 8 4 + text "MENTAT" + oneonly "*job_option ddm_generator:preprocessor" + command "*job_option ddm_generator:preprocessor" + 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" + } + + frame{ + position 0 +5 + size 40 4 + group{ + layout hbox + text { + position 0 0 + size 22 4 + text "Single Input File" + 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 + } + } + } +} + + + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_fea_solver_gr { + + label { + position 0 0 + size 10 4 + text "# DOMAINS" + help job_param + } + + text { + position +10 = + size 4 4 + display "job_param_value_ndomains" + command "*job_param ndomains" + } + + label { + position 0 +4 + size 7 4 + text "METHOD" + border_width 1 + border_color black + } + + roller { + position +7 = + size 18 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" + 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" + } + + button { + position +18 = + size 12 4 + text "ADV. SETTINGS" + popmenu job_ddm_fea_solver_pm + } +} + + + + +#-------------------------------------------------------------------------------------------------- +popmenu job_ddm_fea_solver_pm { + text "JOB PARALLELIZATION" + mode permanent + + group { + layout vbox + spacing 0 + + frame job_properties_subm_header_fr + + spacer { + spacing 2 + } + + frame { + + group { + layout hbox + spacing 0 + + frame { + text "ADVANCED DECOMPOSITION IN MARC" + + group { + layout vbox + spacing 0 + + frame { + + group { + layout hbox + spacing 0 + + label { + size 12 4 + text "# DOMAINS" + help job_param + } + + text { + size 14 4 + display "job_param_value_ndomains" + command "*job_param ndomains" + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame { + + group { + layout hbox + spacing 0 + + label { + size 8 4 + text "METHOD" + } + + roller { + size 32 4 + nvalues 7 + texts "METIS BEST" + "METIS ELEMENT" + "METIS NODE" + "RECURSIVE COORDINATE 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" + 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" + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame { + visible "or(*job_option ddm_method:vector, \ + *job_option ddm_method:radial, \ + *job_option ddm_method:angular)" + + group { + layout hbox + spacing 0 + + frame { + group job_ddm_direction_gr + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame { + + group { + layout hbox + spacing 0 + + toggle { + size 24 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" + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame { + + group { + layout hbox + spacing 0 + + label { + size 8 4 + text "GRAPH" + visible "or(*job_option ddm_method:metis_best, \ + *job_option ddm_method:metis_element_based, \ + *job_option ddm_method:metis_node_based)" + } + + roller { + size 8 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)" + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame { + + group { + layout hbox + spacing 0 + + label { + size 20 4 + text "QUADRATIC ELEMENTS" + } + + roller { + size 12 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" + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame { + + group { + layout hbox + spacing 0 + + label { + position 0 +5 + size 24 4 + text "ELEMENT WEIGHT FACTOR" + help job_param + } + + text { + position +24 = + size 14 4 + display "job_param_value_ddm_elem_weight_factor" + command "*job_param ddm_elem_weight_factor" + help job_run_ddm_decomp_element_weight_factor + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame { + visible "or(*job_option ddm_method:metis_best, \ + *job_option ddm_method:metis_element_based, \ + *job_option ddm_method:metis_node_based)" + + group { + layout hbox + spacing 0 + + frame { + + group { + + toggle { + position 0 0 + size 16 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" + help job_run_ddm_decomp_detect_contact + } + + label { + position = +5 + size 28 4 + text "CONTACT TOLERANCE" + visible "*job_option ddm_detect_contact:on" + } + + text { + position +28 = + size 14 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 + } + + label { + position 0 +4 + size 28 4 + text "CONTACT CONSTRAINT FACTOR" + visible "*job_option ddm_detect_contact:on" + } + + text { + position +28 = + size 14 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 + } + } + } + + spacer { + stretch 1 + } + } + } + } + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame job_properties_subm_footer_fr + } +} # job_ddm_fea_solver_pm + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_direction_gr { + + button { + position 0 0 + size 21 4 + text "DIRECTION" + command "*job_vector ddm_sort_direction_x" + visible "model_anadim_3d" + } + + button { + position = = + size 21 4 + text "DIRECTION" + command "*job_vector_2d ddm_sort_direction_x" + visible "not(model_anadim_3d)" + } + + button { + position +21 = + size 21 4 + text "FROM / TO" + command "*job_vector_from_to ddm_sort_direction_x" + visible "model_anadim_3d" + } + + button { + position = = + size 21 4 + text "FROM / TO" + command "*job_vector_from_to_2d ddm_sort_direction_x" + visible "not(model_anadim_3d)" + } + + frame { + position 0 +4 + size 42 4 + + group { + layout hbox + spacing 0 + + text { + size 14 4 + command "*job_param ddm_sort_direction_x" + display "job_param_value_ddm_sort_direction_x" + help ddm_job_decomp_user_direction_x + } + + text { + size 14 4 + command "*job_param ddm_sort_direction_y" + display "job_param_value_ddm_sort_direction_y" + } + + text { + size 14 4 + command "*job_param ddm_sort_direction_z" + display "job_param_value_ddm_sort_direction_z" + visible "model_anadim_3d" + } + } + } + + frame { + position 0 +4 + size 42 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 16 4 + text "POINT ON AXIS" + } + + roller { + position +16 = + size 10 4 + nvalues 2 + texts "DEFAULT" + "USER" + roller "job_option ddm_sort_point" + commands "*job_option ddm_sort_point:default" + "*job_option ddm_sort_point:user" + } + + button { + position +20 = + size 6 4 + text "SET" + command "*job_position ddm_sort_point_x" + visible "and(*job_option ddm_sort_point:user, model_anadim_3d)" + } + + button { + position = = + size 6 4 + text "SET" + command "*job_position_2d ddm_sort_point_x" + visible "and(*job_option ddm_sort_point:user, not(model_anadim_3d))" + } + + frame { + position 0 +4 + size 42 4 + visible "*job_option ddm_sort_point:user" + + group { + layout hbox + spacing 0 + + text { + size 14 4 + command "*job_param ddm_sort_point_x" + display "job_param_value_ddm_sort_point_x" + } + + text { + size 14 4 + command "*job_param ddm_sort_point_y" + display "job_param_value_ddm_sort_point_y" + } + + text { + size 14 4 + command "*job_param ddm_sort_point_z" + display "job_param_value_ddm_sort_point_z" + visible "model_anadim_3d" + } + } + } +} + + + + +#-------------------------------------------------------------------------------------------------- +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 0 +4 + size 30 4 + text "USER DOMAINS" + popmenu domains_pm + help job_run_ddm_user_domains + } +} + + + + +#-------------------------------------------------------------------------------------------------- +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" + } + + label { + position = +4 + size 12 4 + text "# THREADS" + visible "*job_option assem_recov_multi_threading:on" + } + + 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 10 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)" + } + spacer{ + stretch 2 + } + +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_matrix_solver_gr { + layout vbox + frame { + position 1 0 + size 36 31 + group { + layout hbox + label { + position 3 4 + size 12 4 + text "SOLUTION" + border_width 1 + border_color black + } + oneonly { + position +12 = + size 12 4 + text "SYMMETRIC" + help "job_param_solver_method#symmetric" + oneonly "job_nonsym_off" + command "*job_option solver_nonsym:off" + } + oneonly { + position +12 = + size 12 4 + text "NONSYMMETRIC" + help "job_param_solver_method#symmetric" + oneonly "job_nonsym_on" + command "*job_option solver_nonsym:on" + } + spacer { + stretch 1 + } + } + } + + frame { + position 1 +5 + size 42 23 + group matrix_solver_gr + help job_param_solver + } + + frame { + position +1 = + size 42 4 + group job_run_solver_ddm_opts_gr + visible "*job_option parallel:on" + } + + frame { + position 1 +23 + size 42 8 + group job_solver_multi_procs_gr + visible solver_allows_multi_procs + } + + frame { + position = = + size 42 8 + group job_solver_multi_threads_gr + visible solver_allows_multi_threads + } + + frame { + position 1 +9 + size 42 8 + group job_solver_gpu_gr + visible "or(and(job_solver_mfront_sparse,job_nonsym_off), \ + and(job_solver_it_sparse,job_nonsym_off))" + } + +} + + +#-------------------------------------------------------------------------------------------------- +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))" + } + button { + position = = + size 14 4 + text "\{DDM} OPTIONS" + popmenu ddm_options_mumps + visible "job_solver_mumps" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_procs_gr { + frame { + position 0 0 + size 42 8 + group job_solver_multi_procs_parallel_off_gr + visible "*job_option parallel:off" + } + + frame { + position = = + size 42 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_param_solver_method#mumps" + } + + label { + position +2 +4 + size 14 4 + text "# PROCESSES" + visible "*job_option nsolver_procs_serial:on" + help job_param + } + + 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_param_solver_method#mumps" + toggle true + set $dummy dummy + } + + 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_param_solver_method#mumps" + 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 { + + label { + position 0 0 + size 8 4 + text "VALUE" + help job_param + } + + text { + position +8 = + size 8 4 + display "job_param_value_nsolver_procs" + command "*job_param nsolver_procs" + } +} + +group job_solver_multi_threads_gr { + layout vbox + spacing 0 + + frame { + size 46 8 + group job_solver_multi_threads_it_sparse_parallel_off_gr + visible "and(job_solver_it_sparse,*job_option parallel:off)" + active "*job_option solver_use_gpu:off" + } + + frame { + size 46 8 + group job_solver_multi_threads_mfront_sparse_parallel_off_gr + visible "and(job_solver_mfront_sparse,*job_option parallel:off)" + active "*job_option solver_use_gpu:off" + } + + frame { + size 46 8 + group job_solver_multi_threads_mfront_sparse_parallel_on_gr + visible "and(job_solver_mfront_sparse,*job_option parallel:on)" + } + + frame { + size 46 8 + group job_solver_multi_threads_pardiso_parallel_off_gr + visible "and(job_solver_pardiso,*job_option parallel:off)" + } + + frame { + size 46 8 + group job_solver_multi_threads_pardiso_parallel_on_gr + visible "and(job_solver_pardiso,*job_option parallel:on)" + } + + frame { + size 46 8 + group job_solver_multi_threads_it_ext_off_gr + visible "and(job_solver_it_ext,*job_option parallel:off)" + } + + frame { + size 46 8 + group job_solver_multi_threads_mumps_parallel_off_gr + visible "and(job_solver_mumps,*job_option parallel:off)" + } + + frame { + size 46 8 + group job_solver_multi_threads_mumps_parallel_on_gr + visible "and(job_solver_mumps,*job_option parallel:on)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_it_sparse_parallel_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option it_sparse_multi_threading:on" + true_command "*job_option it_sparse_multi_threading:on" + false_command "*job_option it_sparse_multi_threading:off" + help "job_param_solver_method#iterative" + } + + label { + position = +4 + size 14 4 + text "# THREADS" + visible "*job_option it_sparse_multi_threading:on" + help "job_param_solver_method#iterative" + } + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option it_sparse_multi_threading:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_mfront_sparse_parallel_off_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_param_solver_method#multifrontal" + } + + label { + position = +4 + size 14 4 + text "# THREADS" + visible "*job_option mfront_sparse_multi_threading:on" + help "job_param_solver_method#multifrontal" + } + + 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_multi_threads_mfront_sparse_parallel_on_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + help "job_param_solver_method#multifrontal" + toggle true + set $dummy dummy + } + + label { + position +30 0 + size 12 4 + visible "and( not(*job_option ddm_precond:direct)\ + *job_option parallel:on)" + text "PER DOMAIN" + border_width 1 + border_color black + help "job_param_solver_method#multifrontal" + } + + display { + position +12 0 + size 4 4 + display "job_mfront_sparse_nthreads_dom" + visible "and( not(*job_option ddm_precond:direct)\ + *job_option parallel:on)" + } + + label { + position 0 +4 + size 14 4 + text "# THREADS" + border_color black + border_width 1 + help "job_param_solver_method#multifrontal" + } + + roller { + position +14 = + size 14 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option mfront_sparse_multi_threading_ddm:automatic" + "*job_option mfront_sparse_multi_threading_ddm:user" + help "job_param_solver_method#multifrontal" + rollers "*job_option mfront_sparse_multi_threading_ddm:automatic" + "*job_option mfront_sparse_multi_threading_ddm:user" + visible "not(*job_option solver_use_gpu:on)" + } + + display { + position = = + size 14 4 + text "AUTOMATIC" + visible "*job_option solver_use_gpu:on" + } + + frame { + position +14 = + size 16 4 + group job_mfront_sparse_multi_threads_ddm_automatic_gr + visible "*job_option mfront_sparse_multi_threading_ddm:automatic" + } + + frame { + position = = + size 16 4 + group job_mfront_sparse_multi_threads_ddm_user_gr + visible "*job_option mfront_sparse_multi_threading_ddm:user" + } +} +#-------------------------------------------------------------------------------------------------- +group job_mfront_sparse_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_mfront_sparse_multi_threads_ddm_user_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + help "job_param_solver_method#multifrontal" + } + + text { + position +8 = + size 8 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + } +} + + + +#-------------------------------------------------------------------------------------------------- +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 + } + frame{ + position 0 +4 + size 28 4 + group{ + layout hbox + + label { + position 0 0 + 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 12 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)" + } + spacer { + stretch 1 + } + } + } +} + +#-------------------------------------------------------------------------------------------------- +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_param_solver_method#pardiso" + } + + label { + position = +4 + size 14 4 + text "# THREADS" + visible "*job_option pardiso_multi_threading:on" + help "job_param_solver_method#pardiso" + } + + 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_param_solver_method#pardiso" + toggle true + set $dummy dummy + } + + label { + position = +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_param_solver_method#pardiso" + 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 { + + label { + position 0 0 + size 8 4 + text "VALUE" + help "job_param_solver_method#pardiso" + } + + text { + position +8 = + size 8 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + } +} +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_mumps_parallel_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option nsolver_procs_serial:on" + true_command "*job_option nsolver_procs_serial:on" + false_command "*job_option nsolver_procs_serial:off" + help "job_param_solver_method#mumps" + } + + label { + position = +4 + size 14 4 + text "# THREADS" + visible "*job_option nsolver_procs_serial:on" + help "job_param_solver_method#mumps" + } + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option nsolver_procs_serial:on" + } +} +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_mumps_parallel_on_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + help "job_param_solver_method#mumps" + toggle true + set $dummy dummy + } + + label { + position = +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 nsolver_procs_ddm:automatic" + "*job_option nsolver_procs_ddm:user" + help "job_param_solver_method#mumps" + rollers "*job_option nsolver_procs_ddm:automatic" + "*job_option nsolver_procs_ddm:user" + } + + frame { + position +14 = + size 16 4 + group job_mumps_multi_threads_ddm_automatic_gr + visible "*job_option nsolver_procs_ddm:automatic" + } + + frame { + position = = + size 16 4 + group job_mumps_multi_threads_ddm_user_gr + visible "*job_option nsolver_procs_ddm:user" + } +} +#-------------------------------------------------------------------------------------------------- +group job_mumps_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_mumps_multi_threads_ddm_user_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + help "job_param_solver_method#mumps" + } + + text { + position +8 = + size 8 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_it_ext_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option it_ext_multi_threading:on" + true_command "*job_option it_ext_multi_threading:on" + false_command "*job_option it_ext_multi_threading:off" + help "job_param_solver_method#casi" + } + + label { + position = +4 + size 14 4 + text "# THREADS" + visible "*job_option it_ext_multi_threading:on" + help "job_param_solver_method#casi" + } + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option it_ext_multi_threading:on" + } +} + +#-------------------------------------------------------------------------------------------------- +group job_parallel_env_gr { + + frame{ + position 0 +4 + size 40 4 + group{ + layout hbox + label{ + position 0 0 + size 8 4 + text "SETUP" + help job_run_ddm_setup + } + oneonly { + position +12 = + size 12 4 + text "SINGLE MACHINE" + oneonly "*job_option parallel_setup:single" + command "*job_option parallel_setup:single" + help job_run_ddm_setup + } + oneonly { + position +8 = + size 12 4 + text "NETWORK" + oneonly "*job_option parallel_setup:network" + command "*job_option parallel_setup:network" + help job_run_ddm_setup + } + + spacer { + stretch 1 + } + } + } + + + frame { + position +1 +5 + size 40 16 + 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" + browser host_file_browser + 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 + } +} + + +#endif + diff --git a/installation/MarcMentat/2021.2/Mentat_menus/job_run.ms.original b/installation/MarcMentat/2021.2/Mentat_menus/job_run.ms.original new file mode 100644 index 000000000..6560c0601 --- /dev/null +++ b/installation/MarcMentat/2021.2/Mentat_menus/job_run.ms.original @@ -0,0 +1,2973 @@ +#ifndef AUTOFORGE +popmenu job_title_pm file jobs.ms +popdown job_title_ok file jobs.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 matrix_solver_gr file job_common.ms +popmenu ddm_options file job_common.ms + +browser edit_browser file file.ms +browser directory_browser file file.ms +screen domains file domain_decomposition.ms + +frame job_properties_subm_header_fr file job_common.ms +frame job_properties_subm_footer_fr file job_common.ms + + +browser usersub_file_browser { + text "$usersub_file_browser_label" ($usersub_file_browser_label) + filter "*.f *.F *.f90 *.F90" + select_files true + command "$usersub_file_browser_command" ($usersub_file_browser_command) +} + + + +browser host_file_browser { + text "$host_file_browser_label" ($host_file_browser_label) + filter "*" + select_files true + command "$host_file_browser_command" ($host_file_browser_command) +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_run_popmenu { + + text "RUN JOB" + + group { + + frame { + position 1 1 + size 60 4 + group { + label { + position 0 1 + size 15 4 + text "NAME" + help job_run + } + display { + position +12 = + size 45 4 + display "job_name" + } + label { + position 0 +4 + size 15 4 + text "TYPE" + help job_run + } + display { + position +12 = + size 45 4 + display job_class_label + } + } + } + + frame { + text "USER SUBROUTINES" + position 1 +4 + size 60 4 + group { + button { + position 0 0 + size 30 4 + text "FORTRAN SOURCE FILE" + help "job_run#User Subroutines" + browser usersub_file_browser + settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" + set $usersub_file_browser_command "*job_usersub_file" + } + toggle { + position +30 = + size 30 4 + text "SELECTED USER SUBS" + help "job_run#User Subroutines" + toggle job_usersubs + active job_usersubs + popmenu job_usersub_pm + } + display { + position 0 +4 + size 60 4 + display job_usersub_file + visible job_usersub_file + } + button { + position 0 +4 + size 15 4 + text "EDIT" + help "job_run#User Subroutines" + command "*job_edit_usersub_file" + visible job_usersub_file + } + button { + position +15 = + size 15 4 + text "CLEAR" + help "job_run#User Subroutines" + command "*job_clear_usersub_file" + visible job_usersub_file + } + roller { + position +15 = + size 30 4 + nvalues 3 + texts "COMPILE / NO SAVE" + "COMPILE AND SAVE" + "RUN SAVED EXECUTABLE" + help "job_run#User Subroutines" + roller "job_option user_source" + visible job_usersub_file + commands "*job_option user_source:compile_nosave" + "*job_option user_source:compile_save" + "*job_option user_source:run_saved" + } + } + } + + frame { + text "SOLVER/PARALLELIZATION" + position 1 +4 + size 60 4 + group { + button { + position 0 0 + size 30 4 + text "SETTINGS" + help "job_run#Solver/Parallelization" + popmenu job_run_parallelization_pm + set $popname2 "job_run_parallelization_pm" + } + display { + position 0 +4 + size 30 4 + display job_solver_solution + } + display { + position +30 = + size 30 4 + display job_ddm_domains + } + display { + position 0 +4 + size 30 4 + display job_solver_type + } + display { + position +30 = + size 30 4 + display job_assem_recov_nthreads + } + display { + position = +4 + size 30 4 + display job_solver_procs + visible solver_allows_multi_procs + } + display { + position = = + size 18 4 + display job_solver_threads + visible "and(solver_allows_multi_threads,\ + not(and(job_solver_mfront_sparse,\ + *job_option parallel:on)),\ + *job_option solver_use_gpu:off)" + } + display { + position +18 = + size 12 4 + display job_solver_gpu + visible "or(and(job_solver_mfront_sparse,job_nonsym_off), \ + and(job_solver_it_sparse,job_nonsym_off))" + } + } + } + + frame { + text "INPUT STYLE AND JOB TITLE" + position 1 +4 + size 60 4 + group { + +# see also job_common.ms +# see also the ADVANCED JOB SUBMISSION popmenu in this file + + label { + position 0 0 + size 8 4 + text "STYLE" + help "job_run#Input Style And Job Title" + border_width 1 + border_color black + } + roller { + position +8 = + size 22 4 + nvalues 3 + texts "TABLE-DRIVEN" + "MULTI-PHYSICS" + "OLD" + rollers "job_input_style_table_driven" + "job_input_style_multi_physics" + "job_input_style_old" + 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" + help "job_run#Input Style And Job Title" + } + button { + position +22 = + size 15 4 + text "TITLE" + help "job_run#Input Style And Job Title" + popmenu job_title_pm + command "*job_title" + } + button { + position +15 = + size 15 4 + text "SAVE MODEL" + help "job_run#Input Style And Job Title" + command "*save_model" + } + } + } + + frame { + text "JOB SUBMISSION AND CONTROL" + position 1 +4 + size 60 4 + group { + frame { + position 1 1 + size 50 4 + group { + button { + position 0 0 + size 25 4 + text "SUBMIT (1)" + help "job_run#Job Submission And Control" + command "*submit_job 1 *monitor_job" + } + button { + position +25 = + size 25 4 + text "ADVANCED JOB SUBMISSION" + help "job_run#Job Submission And Control" + popmenu job_submit_adv_pm + } + button { + position 0 +4 + size 12 4 + text "UPDATE" + help "job_run#Job Submission And Control" + command "*update_job" + } + button { + position +12 = + size 13 4 + text "MONITOR" + help "job_run#Job Submission And Control" + command "*monitor_job" + } + button { + position +13 = + size 12 4 + text "RESET" + help "job_run#Job Submission And Control" + command "*job_submit_reset" + } + button { + position +12 = + size 13 4 + text "KILL" + help "job_run#Job Submission And Control" + command "*kill_job *monitor_job" + active "job_status_running" + } + } + } + + frame { + position 1 5 + size 50 4 + group { + label { + position 0 +4 + size 25 4 + text "STATUS" + help "job_run#Status" + border_width 1 + border_color black + } + display { + position +25 = + size 25 4 + display "job_status" + } + label { + position 0 +4 + size 25 4 + text "CURRENT INCREMENT (CYCLE)" + help "job_run#Current Increment" + border_width 1 + border_color black + } + display { + position +25 = + size 25 4 + display "job_increment" + } + label { + position 0 +4 + size 25 4 + text "SINGULARITY RATIO" + help "job_run#Singularity Ratio" + border_width 1 + border_color black + } + float { + position +25 = + size 25 4 + display "job_singularity_ratio" + } + label { + position 0 +4 + size 25 4 + text "CONVERGENCE RATIO" + help "job_run#Convergence Ratio" + border_width 1 + border_color black + } + float { + position +25 = + size 25 4 + display "job_convergence_ratio" + } + label { + position 0 +4 + size 25 4 + text "FRACTION OF INCREMENT (CONTACT)" + help "job_run#IPC" + border_width 1 + border_color black + } + float { + position +25 = + size 25 4 + display "job_ipc_fraction" + } + label { + position 0 +4 + size 25 4 + text "ANALYSIS TIME" + help "job_run#Analysis Time" + border_width 1 + border_color black + } + float { + position +25 = + size 25 4 + display "job_analysis_time" + } + } + } + + frame { + position 1 +4 + size 50 4 + group { + + frame { + position 0 0 + size 50 4 + text "ACCUMULATED ANALYSIS STATISTICS" + border_width 1 + border_color black + group { + label { + position 0 0 + size 12 4 + text "CYCLES" + help "job_run#Cycles" + border_width 1 + border_color black + } + integer { + position +12 = + size 12 4 + display "acc_job_cycles" + border_width 1 + border_color black + } + label { + position -12 +4 + size 12 4 + text "SEPARATIONS" + help "job_run#Separations" + border_width 1 + border_color black + } + integer { + position +12 = + size 12 4 + display "acc_job_separations" + border_width 1 + border_color black + } + label { + position -12 +4 + size 12 4 + text "WARNING MESSAGES" + help "job_run#Warnings" + border_width 1 + border_color black + } + integer { + position +12 = + size 12 4 + display "number_of_warning_messages" + border_width 1 + border_color black + } + label { + position +12 -8 + size 12 4 + text "CUT BACKS" + help "job_run#Cut Backs" + border_width 1 + border_color black + } + integer { + position +12 = + size 12 4 + display "acc_job_cut_backs" + border_width 1 + border_color black + } + label { + position -12 +4 + size 12 4 + text "REMESHES" + help "job_run#Remeshes" + border_width 1 + border_color black + } + integer { + position +12 = + size 12 4 + display "acc_job_remeshes" + border_width 1 + border_color black + } + label { + position -12 +4 + size 12 4 + text "WALL TIME" + help "job_run#Wall Time" + border_width 1 + border_color black + } + display { + position +12 = + size 12 4 + display "job_time" + } + } + } + + frame { + position 0 +4 + size 50 4 + text "JOB COMPLETION" + border_width 1 + border_color black + group { + label { + position 0 +4 + size 12 4 + text "EXIT NUMBER" + help "job_run#Exit Number" + border_width 1 + border_color black + } + integer { + position +12 = + size 13 4 + display "job_exit" + } + button { + position +13 = + size 25 4 + text "EXIT MESSAGE" + help "job_run#Exit Number" + popmenu job_exit_msg_pm + } + } + } + } + } + } + } + frame { + text "EDIT FILES" + position 1 +4 + size 60 4 + group { + frame { + position 1 1 + size 60 4 + group { + button { + position 0 +4 + size 15 4 + text "OUTPUT FILE" + help "job_run#Edit Files" + command "*job_edit_output" + } + button { + position +15 = + size 15 4 + text "LOG FILE" + help "job_run#Edit Files" + command "*job_edit_log_file" + } + button { + position +15 = + size 15 4 + text "STATUS FILE" + help "job_run#Edit Files" + command "*job_edit_status_file" + } + button { + position +15 = + size 15 4 + text "ANY FILE" + help "job_run#Edit Files" + settext $edit_browser_label "EDIT FILE" + set $edit_browser_command "*edit_file" + browser edit_browser + } + } + } + } + } + + frame { + position 1 +4 + size 60 4 + group { + layout hbox + spacer { + stretch 1 + } + popdown { + position 0 0 + size 60 4 + text "OPEN POST FILE" + help "job_run#Open Post File" + command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" + visible "not(*job_option write_cont_post_file:on)" + } + popdown { + position 0 0 + size 30 4 + text "OPEN POST FILE" + help "job_run#Open Post File" + command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" + visible "*job_option write_cont_post_file:on" + } + popdown { + position 0 0 + size 30 4 + text "OPEN EXPANDED BEAM POST FILE" + help "job_run#Open Expanded Beam Post File" + command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_con_default" + visible "*job_option write_cont_post_file:on" + } + spacer { + stretch 1 + } + } + } + + frame { + position 1 +5 + size 60 4 + group { + layout hbox + spacer { + stretch 1 + } + popdown { + size 12 4 + text "OK" + } + spacer { + stretch 1 + } + } + } + } + + window job_run_wi { + parent mentat + origin 35 1 + size 52 115 + background_color body + border_width 1 + border_color border + buffering single + } + + mode permanent +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_usersub_pm { + + text "CURRENTLY SELECTED USER SUBROUTINES" + + group { + + + 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 { + + text "ADVANCED JOB SUBMISSION" + + group { + + + 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 + } + + label { + position 1 9 + size 19 4 + text "INITIAL ALLOCATION" + border_width 1 + border_color black + } + label { + position +19 = + size 15 4 + text "GENERAL MEMORY" + help job_param_general_init_allocation + } + text { + position +15 = + size 14 4 + display "job_param_value_general_init_allocation" + command "*job_param general_init_allocation" + help job_param_general_init_allocation + } + + 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" + } + + 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 32 + nvisible 32 + texts "DEFAULT" +#if 0 + "2021.2" +#endif + "2021.1" + "2020.1" + "2020" + "2019.1" + "2019" + "2018.1" + "2018" + "2017.1" + "2017" + "2016" + "2015" + "2014.2" + "2014.1" + "2014" + "2013.1" + "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_2021.2" +#endif + "job_input_version_2021.1" + "job_input_version_2020.1" + "job_input_version_2020" + "job_input_version_2019.1" + "job_input_version_2019" + "job_input_version_2018.1" + "job_input_version_2018" + "job_input_version_2017.1" + "job_input_version_2017" + "job_input_version_2016" + "job_input_version_2015" + "job_input_version_2014.2" + "job_input_version_2014.1" + "job_input_version_2014" + "job_input_version_2013.1" + "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" + commands "*job_option version:default" +#if 0 + "*job_option version:2021.2" +#endif + "*job_option version:2021.1" + "*job_option version:2020.1" + "*job_option version:2020" + "*job_option version:2019.1" + "*job_option version:2019" + "*job_option version:2018.1" + "*job_option version:2018" + "*job_option version:2017.1" + "*job_option version:2017" + "*job_option version:2016" + "*job_option version:2015" + "*job_option version:2014.2" + "*job_option version:2014.1" + "*job_option version:2014" + "*job_option version:2013.1" + "*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_2021.2" +#endif + "job_allows_input_version_2021.1" + "job_allows_input_version_2020.1" + "job_allows_input_version_2020" + "job_allows_input_version_2019.1" + "job_allows_input_version_2019" + "job_allows_input_version_2018.1" + "job_allows_input_version_2018" + "job_allows_input_version_2017.1" + "job_allows_input_version_2017" + "job_allows_input_version_2016" + "job_allows_input_version_2015" + "job_allows_input_version_2014.2" + "job_allows_input_version_2014.1" + "job_allows_input_version_2014" + "job_allows_input_version_2013.1" + "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" + } + +# 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" + 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" + help job_option_input_style + } + + toggle { + position 0 +4 + size 24 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" + } + toggle { + position +24 = + size 24 4 + text "INCLUDE UNUSED TABLES" + toggle "*job_option input_file_tables:all" + true_command "*job_option input_file_tables:all" + false_command "*job_option input_file_tables:used" + } + } + } + + button { + position 1 +14 + size 24 4 + text "SCRATCH DIRECTORY" + settext $directory_browser_label "JOB SCRATCH DIRECTORY" + set $directory_browser_command "*job_scratch_directory" + browser directory_browser + 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 + } + + mode permanent +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_exit_msg_pm { + + text "EXIT MESSAGE" + + group { + + + + text { + position 1 5 + size 84 74 + multiline + readonly + display "job_exit_msg" + } + + 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 +} + + + + +#-------------------------------------------------------------------------------------------------- +popmenu job_run_parallelization_pm { + + text "SOLVER/PARALLELIZATION" + + group { + layout vbox + frame { + position 0 0 + size 42 8 + group { + + label { + position 0 0 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 36 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 36 4 + display job_class_label + } + } + } + frame { + position 0 8 + size 42 20 + group job_ddm_gr + text "DOMAIN DECOMPOSITION" + border_width 1 + border_color black + } + + frame { + position 0 +20 + size 42 13 + group job_assem_recov_gr + text "ASSEMBLY AND RECOVERY" + border_width 1 + border_color black + } + + frame { + position 0 +14 + size 42 31 + group job_parallel_matrix_solver_gr + text "MATRIX SOLVER" + border_width 1 + border_color black + } + + frame { + position 0 +32 + size 42 28 + group job_parallel_env_gr + text "PARALLELIZATION ENVIRONMENT" + border_width 1 + border_color black + visible "or(*job_option parallel:on, \ + solver_multi_procs)" + } + frame { + position 15 +30 + size 42 8 + group { + layout hbox + + spacer { + stretch 1 + } + popdown { + position 15 0 + size 12 8 + text "OK" + } + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + stretch 1 + } + } + + window { + parent mentat + origin 38 1 + size 60 119 + background_color body + border_width 1 + border_color border + buffering single + } + mode permanent +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_gr { + + toggle { + position 1 4 + size 42 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" + active "and(not(job_solver_it_ext),\ + not(job_solver_mixed_direct_iterative))" + } + + frame { + position = +5 + size 42 4 + group job_ddm_use_gr + visible "*job_option parallel:on" + } +} + +group job_ddm_use_gr { + layout vbox + frame{ + position 0 0 + size 30 4 + group { + layout hbox + label { + position 0 0 + size 12 4 + text "DECOMPOSITION IN" + help job_run_ddm_generator + } + oneonly{ + position +12 = + size 8 4 + text "MARC" + oneonly "*job_option ddm_generator:fea_solver" + command "*job_option ddm_generator:fea_solver" + help job_run_ddm_generator + } + oneonly{ + position +12 = + size 8 4 + text "MENTAT" + oneonly "*job_option ddm_generator:preprocessor" + command "*job_option ddm_generator:preprocessor" + 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" + } + + frame{ + position 0 +5 + size 40 4 + group{ + layout hbox + text { + position 0 0 + size 22 4 + text "Single Input File" + 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 + } + } + } +} + + + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_fea_solver_gr { + + label { + position 0 0 + size 10 4 + text "# DOMAINS" + help job_param + } + + text { + position +10 = + size 4 4 + display "job_param_value_ndomains" + command "*job_param ndomains" + } + + label { + position 0 +4 + size 7 4 + text "METHOD" + border_width 1 + border_color black + } + + roller { + position +7 = + size 18 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" + 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" + } + + button { + position +18 = + size 12 4 + text "ADV. SETTINGS" + popmenu job_ddm_fea_solver_pm + } +} + + + + +#-------------------------------------------------------------------------------------------------- +popmenu job_ddm_fea_solver_pm { + text "JOB PARALLELIZATION" + mode permanent + + group { + layout vbox + spacing 0 + + frame job_properties_subm_header_fr + + spacer { + spacing 2 + } + + frame { + + group { + layout hbox + spacing 0 + + frame { + text "ADVANCED DECOMPOSITION IN MARC" + + group { + layout vbox + spacing 0 + + frame { + + group { + layout hbox + spacing 0 + + label { + size 12 4 + text "# DOMAINS" + help job_param + } + + text { + size 14 4 + display "job_param_value_ndomains" + command "*job_param ndomains" + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame { + + group { + layout hbox + spacing 0 + + label { + size 8 4 + text "METHOD" + } + + roller { + size 32 4 + nvalues 7 + texts "METIS BEST" + "METIS ELEMENT" + "METIS NODE" + "RECURSIVE COORDINATE 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" + 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" + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame { + visible "or(*job_option ddm_method:vector, \ + *job_option ddm_method:radial, \ + *job_option ddm_method:angular)" + + group { + layout hbox + spacing 0 + + frame { + group job_ddm_direction_gr + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame { + + group { + layout hbox + spacing 0 + + toggle { + size 24 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" + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame { + + group { + layout hbox + spacing 0 + + label { + size 8 4 + text "GRAPH" + visible "or(*job_option ddm_method:metis_best, \ + *job_option ddm_method:metis_element_based, \ + *job_option ddm_method:metis_node_based)" + } + + roller { + size 8 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)" + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame { + + group { + layout hbox + spacing 0 + + label { + size 20 4 + text "QUADRATIC ELEMENTS" + } + + roller { + size 12 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" + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame { + + group { + layout hbox + spacing 0 + + label { + position 0 +5 + size 24 4 + text "ELEMENT WEIGHT FACTOR" + help job_param + } + + text { + position +24 = + size 14 4 + display "job_param_value_ddm_elem_weight_factor" + command "*job_param ddm_elem_weight_factor" + help job_run_ddm_decomp_element_weight_factor + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame { + visible "or(*job_option ddm_method:metis_best, \ + *job_option ddm_method:metis_element_based, \ + *job_option ddm_method:metis_node_based)" + + group { + layout hbox + spacing 0 + + frame { + + group { + + toggle { + position 0 0 + size 16 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" + help job_run_ddm_decomp_detect_contact + } + + label { + position = +5 + size 28 4 + text "CONTACT TOLERANCE" + visible "*job_option ddm_detect_contact:on" + } + + text { + position +28 = + size 14 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 + } + + label { + position 0 +4 + size 28 4 + text "CONTACT CONSTRAINT FACTOR" + visible "*job_option ddm_detect_contact:on" + } + + text { + position +28 = + size 14 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 + } + } + } + + spacer { + stretch 1 + } + } + } + } + } + + spacer { + stretch 1 + } + } + } + + spacer { + spacing 2 + } + + frame job_properties_subm_footer_fr + } +} # job_ddm_fea_solver_pm + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_direction_gr { + + button { + position 0 0 + size 21 4 + text "DIRECTION" + command "*job_vector ddm_sort_direction_x" + visible "model_anadim_3d" + } + + button { + position = = + size 21 4 + text "DIRECTION" + command "*job_vector_2d ddm_sort_direction_x" + visible "not(model_anadim_3d)" + } + + button { + position +21 = + size 21 4 + text "FROM / TO" + command "*job_vector_from_to ddm_sort_direction_x" + visible "model_anadim_3d" + } + + button { + position = = + size 21 4 + text "FROM / TO" + command "*job_vector_from_to_2d ddm_sort_direction_x" + visible "not(model_anadim_3d)" + } + + frame { + position 0 +4 + size 42 4 + + group { + layout hbox + spacing 0 + + text { + size 14 4 + command "*job_param ddm_sort_direction_x" + display "job_param_value_ddm_sort_direction_x" + help ddm_job_decomp_user_direction_x + } + + text { + size 14 4 + command "*job_param ddm_sort_direction_y" + display "job_param_value_ddm_sort_direction_y" + } + + text { + size 14 4 + command "*job_param ddm_sort_direction_z" + display "job_param_value_ddm_sort_direction_z" + visible "model_anadim_3d" + } + } + } + + frame { + position 0 +4 + size 42 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 16 4 + text "POINT ON AXIS" + } + + roller { + position +16 = + size 10 4 + nvalues 2 + texts "DEFAULT" + "USER" + roller "job_option ddm_sort_point" + commands "*job_option ddm_sort_point:default" + "*job_option ddm_sort_point:user" + } + + button { + position +20 = + size 6 4 + text "SET" + command "*job_position ddm_sort_point_x" + visible "and(*job_option ddm_sort_point:user, model_anadim_3d)" + } + + button { + position = = + size 6 4 + text "SET" + command "*job_position_2d ddm_sort_point_x" + visible "and(*job_option ddm_sort_point:user, not(model_anadim_3d))" + } + + frame { + position 0 +4 + size 42 4 + visible "*job_option ddm_sort_point:user" + + group { + layout hbox + spacing 0 + + text { + size 14 4 + command "*job_param ddm_sort_point_x" + display "job_param_value_ddm_sort_point_x" + } + + text { + size 14 4 + command "*job_param ddm_sort_point_y" + display "job_param_value_ddm_sort_point_y" + } + + text { + size 14 4 + command "*job_param ddm_sort_point_z" + display "job_param_value_ddm_sort_point_z" + visible "model_anadim_3d" + } + } + } +} + + + + +#-------------------------------------------------------------------------------------------------- +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 0 +4 + size 30 4 + text "USER DOMAINS" + popmenu domains_pm + help job_run_ddm_user_domains + } +} + + + + +#-------------------------------------------------------------------------------------------------- +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" + } + + label { + position = +4 + size 12 4 + text "# THREADS" + visible "*job_option assem_recov_multi_threading:on" + } + + 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 10 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)" + } + spacer{ + stretch 2 + } + +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_matrix_solver_gr { + layout vbox + frame { + position 1 0 + size 36 31 + group { + layout hbox + label { + position 3 4 + size 12 4 + text "SOLUTION" + border_width 1 + border_color black + } + oneonly { + position +12 = + size 12 4 + text "SYMMETRIC" + help "job_param_solver_method#symmetric" + oneonly "job_nonsym_off" + command "*job_option solver_nonsym:off" + } + oneonly { + position +12 = + size 12 4 + text "NONSYMMETRIC" + help "job_param_solver_method#symmetric" + oneonly "job_nonsym_on" + command "*job_option solver_nonsym:on" + } + spacer { + stretch 1 + } + } + } + + frame { + position 1 +5 + size 42 23 + group matrix_solver_gr + help job_param_solver + } + + frame { + position +1 = + size 42 4 + group job_run_solver_ddm_opts_gr + visible "*job_option parallel:on" + } + + frame { + position 1 +23 + size 42 8 + group job_solver_multi_procs_gr + visible solver_allows_multi_procs + } + + frame { + position = = + size 42 8 + group job_solver_multi_threads_gr + visible solver_allows_multi_threads + } + + frame { + position 1 +9 + size 42 8 + group job_solver_gpu_gr + visible "or(and(job_solver_mfront_sparse,job_nonsym_off), \ + and(job_solver_it_sparse,job_nonsym_off))" + } + +} + + +#-------------------------------------------------------------------------------------------------- +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))" + } + button { + position = = + size 14 4 + text "\{DDM} OPTIONS" + popmenu ddm_options_mumps + visible "job_solver_mumps" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_procs_gr { + frame { + position 0 0 + size 42 8 + group job_solver_multi_procs_parallel_off_gr + visible "*job_option parallel:off" + } + + frame { + position = = + size 42 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_param_solver_method#mumps" + } + + label { + position +2 +4 + size 14 4 + text "# PROCESSES" + visible "*job_option nsolver_procs_serial:on" + help job_param + } + + 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_param_solver_method#mumps" + toggle true + set $dummy dummy + } + + 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_param_solver_method#mumps" + 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 { + + label { + position 0 0 + size 8 4 + text "VALUE" + help job_param + } + + text { + position +8 = + size 8 4 + display "job_param_value_nsolver_procs" + command "*job_param nsolver_procs" + } +} + +group job_solver_multi_threads_gr { + layout vbox + spacing 0 + + frame { + size 46 8 + group job_solver_multi_threads_it_sparse_parallel_off_gr + visible "and(job_solver_it_sparse,*job_option parallel:off)" + active "*job_option solver_use_gpu:off" + } + + frame { + size 46 8 + group job_solver_multi_threads_mfront_sparse_parallel_off_gr + visible "and(job_solver_mfront_sparse,*job_option parallel:off)" + active "*job_option solver_use_gpu:off" + } + + frame { + size 46 8 + group job_solver_multi_threads_mfront_sparse_parallel_on_gr + visible "and(job_solver_mfront_sparse,*job_option parallel:on)" + } + + frame { + size 46 8 + group job_solver_multi_threads_pardiso_parallel_off_gr + visible "and(job_solver_pardiso,*job_option parallel:off)" + } + + frame { + size 46 8 + group job_solver_multi_threads_pardiso_parallel_on_gr + visible "and(job_solver_pardiso,*job_option parallel:on)" + } + + frame { + size 46 8 + group job_solver_multi_threads_it_ext_off_gr + visible "and(job_solver_it_ext,*job_option parallel:off)" + } + + frame { + size 46 8 + group job_solver_multi_threads_mumps_parallel_off_gr + visible "and(job_solver_mumps,*job_option parallel:off)" + } + + frame { + size 46 8 + group job_solver_multi_threads_mumps_parallel_on_gr + visible "and(job_solver_mumps,*job_option parallel:on)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_it_sparse_parallel_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option it_sparse_multi_threading:on" + true_command "*job_option it_sparse_multi_threading:on" + false_command "*job_option it_sparse_multi_threading:off" + help "job_param_solver_method#iterative" + } + + label { + position = +4 + size 14 4 + text "# THREADS" + visible "*job_option it_sparse_multi_threading:on" + help "job_param_solver_method#iterative" + } + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option it_sparse_multi_threading:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_mfront_sparse_parallel_off_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_param_solver_method#multifrontal" + } + + label { + position = +4 + size 14 4 + text "# THREADS" + visible "*job_option mfront_sparse_multi_threading:on" + help "job_param_solver_method#multifrontal" + } + + 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_multi_threads_mfront_sparse_parallel_on_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + help "job_param_solver_method#multifrontal" + toggle true + set $dummy dummy + } + + label { + position +30 0 + size 12 4 + visible "and( not(*job_option ddm_precond:direct)\ + *job_option parallel:on)" + text "PER DOMAIN" + border_width 1 + border_color black + help "job_param_solver_method#multifrontal" + } + + display { + position +12 0 + size 4 4 + display "job_mfront_sparse_nthreads_dom" + visible "and( not(*job_option ddm_precond:direct)\ + *job_option parallel:on)" + } + + label { + position 0 +4 + size 14 4 + text "# THREADS" + border_color black + border_width 1 + help "job_param_solver_method#multifrontal" + } + + roller { + position +14 = + size 14 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option mfront_sparse_multi_threading_ddm:automatic" + "*job_option mfront_sparse_multi_threading_ddm:user" + help "job_param_solver_method#multifrontal" + rollers "*job_option mfront_sparse_multi_threading_ddm:automatic" + "*job_option mfront_sparse_multi_threading_ddm:user" + visible "not(*job_option solver_use_gpu:on)" + } + + display { + position = = + size 14 4 + text "AUTOMATIC" + visible "*job_option solver_use_gpu:on" + } + + frame { + position +14 = + size 16 4 + group job_mfront_sparse_multi_threads_ddm_automatic_gr + visible "*job_option mfront_sparse_multi_threading_ddm:automatic" + } + + frame { + position = = + size 16 4 + group job_mfront_sparse_multi_threads_ddm_user_gr + visible "*job_option mfront_sparse_multi_threading_ddm:user" + } +} +#-------------------------------------------------------------------------------------------------- +group job_mfront_sparse_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_mfront_sparse_multi_threads_ddm_user_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + help "job_param_solver_method#multifrontal" + } + + text { + position +8 = + size 8 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + } +} + + + +#-------------------------------------------------------------------------------------------------- +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 + } + frame{ + position 0 +4 + size 28 4 + group{ + layout hbox + + label { + position 0 0 + 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 12 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)" + } + spacer { + stretch 1 + } + } + } +} + +#-------------------------------------------------------------------------------------------------- +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_param_solver_method#pardiso" + } + + label { + position = +4 + size 14 4 + text "# THREADS" + visible "*job_option pardiso_multi_threading:on" + help "job_param_solver_method#pardiso" + } + + 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_param_solver_method#pardiso" + toggle true + set $dummy dummy + } + + label { + position = +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_param_solver_method#pardiso" + 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 { + + label { + position 0 0 + size 8 4 + text "VALUE" + help "job_param_solver_method#pardiso" + } + + text { + position +8 = + size 8 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + } +} +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_mumps_parallel_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option nsolver_procs_serial:on" + true_command "*job_option nsolver_procs_serial:on" + false_command "*job_option nsolver_procs_serial:off" + help "job_param_solver_method#mumps" + } + + label { + position = +4 + size 14 4 + text "# THREADS" + visible "*job_option nsolver_procs_serial:on" + help "job_param_solver_method#mumps" + } + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option nsolver_procs_serial:on" + } +} +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_mumps_parallel_on_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + help "job_param_solver_method#mumps" + toggle true + set $dummy dummy + } + + label { + position = +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 nsolver_procs_ddm:automatic" + "*job_option nsolver_procs_ddm:user" + help "job_param_solver_method#mumps" + rollers "*job_option nsolver_procs_ddm:automatic" + "*job_option nsolver_procs_ddm:user" + } + + frame { + position +14 = + size 16 4 + group job_mumps_multi_threads_ddm_automatic_gr + visible "*job_option nsolver_procs_ddm:automatic" + } + + frame { + position = = + size 16 4 + group job_mumps_multi_threads_ddm_user_gr + visible "*job_option nsolver_procs_ddm:user" + } +} +#-------------------------------------------------------------------------------------------------- +group job_mumps_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_mumps_multi_threads_ddm_user_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + help "job_param_solver_method#mumps" + } + + text { + position +8 = + size 8 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_it_ext_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option it_ext_multi_threading:on" + true_command "*job_option it_ext_multi_threading:on" + false_command "*job_option it_ext_multi_threading:off" + help "job_param_solver_method#casi" + } + + label { + position = +4 + size 14 4 + text "# THREADS" + visible "*job_option it_ext_multi_threading:on" + help "job_param_solver_method#casi" + } + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option it_ext_multi_threading:on" + } +} + +#-------------------------------------------------------------------------------------------------- +group job_parallel_env_gr { + + frame{ + position 0 +4 + size 40 4 + group{ + layout hbox + label{ + position 0 0 + size 8 4 + text "SETUP" + help job_run_ddm_setup + } + oneonly { + position +12 = + size 12 4 + text "SINGLE MACHINE" + oneonly "*job_option parallel_setup:single" + command "*job_option parallel_setup:single" + help job_run_ddm_setup + } + oneonly { + position +8 = + size 12 4 + text "NETWORK" + oneonly "*job_option parallel_setup:network" + command "*job_option parallel_setup:network" + help job_run_ddm_setup + } + + spacer { + stretch 1 + } + } + } + + + frame { + position +1 +5 + size 40 16 + 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" + browser host_file_browser + 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 + } +} + + +#endif + diff --git a/src/Marc/include/concom2021.2 b/src/Marc/include/concom2021.2 new file mode 100644 index 000000000..7a355d3e5 --- /dev/null +++ b/src/Marc/include/concom2021.2 @@ -0,0 +1,447 @@ +! common block definition file taken from respective MSC.Marc release and reformated to free format +!*********************************************************************** +! +! File: concom.cmn +! +! MSC.Marc include file +! +integer & + 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,igsigd0,& + iaem, icosim, inodels, nlharm, iampini, iphasetr, inonlcl, inonlct, iforminp,ispecerror,& + icsprg, imol, imolt, idatafit,iharmpar, inclcase, imultifreq,init_elas, ifatig, iftgmat,& + nchybrid +dimension :: ideva(60) +integer num_concom +parameter(num_concom=261) +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,igsigd0,& + iaem, icosim, inodels, nlharm, iampini, iphasetr, inonlcl, inonlct, iforminp,ispecerror,& + icsprg, imol, imolt, idatafit,iharmpar, inclcase, imultifreq,init_elas, ifatig, iftgmat,& + nchybrid +! +! comments of variables: +! +! iacous Control flag for acoustic analysis. Input data. +! iacous=1 modal acoustic analysis. +! iacous=2 harmonic acoustic-structural analysis. +! iasmbl Control flag to indicate that operator matrix should be +! recalculated. +! iautth Control flag for AUTO THERM option. +! ibear Control flag for bearing analysis. Input data. +! icompl Control variable to indicate that a complex analysis is +! being performed. Either a Harmonic analysis with damping, +! or a harmonic electro-magnetic analysis. Input data. +! iconj Flag for EBE conjugate gradient solver (=solver 1, retired) +! Also used for VKI iterative solver. +! icreep Control flag for creep analysis. Input data. +! 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. +! +! +! 58 debug output for ELSTO usage +! +! idyn Control flag for dynamics. Input data. +! 1 = eigenvalue extraction and / or modal superposition +! 2 = Newmark Beta and Single Step Houbolt (ssh with idynme=1) +! 3 = Houbolt +! 4 = Central difference +! 5 = Newer central difference +! idynt Copy of idyn at begining of increment +! ielas Control flag for ELASTIC analysis. Input data. +! Set by user or automatically turned on by Fourier option. +! Implies that each load case is treated separately. +! In Adaptive meshing analysis , forces re-analysis until +! convergence obtained. +! Also seriously misused to indicate no convergence. +! = 1 elastic option with fourier analysis +! = 2 elastic option without fourier analysis +! =-1 no convergence in recycles or max # increments reached +! Set to 1 if ELASTIC or SUBSTRUC parameter cards are used, +! or if fourier option is used. +! Then set to 2 if not fourier analysis. +! ielcma Control flag for electromagnetic analysis. Input data. +! ielcma = 1 Harmonic formulation +! ielcma = 2 Transient formulation +! ielect Control flag for electrostatic option. Input data. +! iform Control flag indicating that contact will be performed. +! ifour Control flag for Fourier analysis. +! 0 = Odd and even terms. +! 1 = symmetric (cosine) terms +! 2 = antisymmetric (sine) terms. +! iharm Control flag to indicate that a harmonic analysis will +! be performed. May change between passes. +! ihcps Control flag for coupled thermal - stress analysis. +! iheat Control flag for heat transfer analysis. Input data. +! iheatt Permanent control flag for heat transfer analysis. +! Note in coupled analysis iheatt will remain as one, +! but iheat will be zero in stress pass. +! ihresp Control flag to indicate to perform a harmonic subincrement. +! ijoule Control flag for Joule heating. +! ilem Control flag to determin which vector is to be transformed. +! Control flag to see where one is: +! ilem = 1 - elem.f +! ilem = 2 - initst.f +! ilem = 3 - pressr.f +! ilem = 3 - fstif.f +! ilem = 4 - jflux.f +! ilem = 4 - strass.f +! ilem = 5 - mass.f +! ilem = 5 - osolty.f +! ilnmom Control flag for soil - pore pressure calculation. Input data. +! ilnmom = 0 - perform only pore pressure calculation. +! = 1 - couples pore pressure - displacement analysis +! iloren Control flag for DeLorenzi J-Integral evaluation. Input data. +! inc Increment number. +! incext Control flag indicating that currently working on a +! subincrement. +! Could be due to harmonics , damping component (bearing), +! stiffness component (bearing), auto therm creep or +! old viscoplaticity +! incsub Sub-increment number. +! ipass Control flag for which part of coupled analysis. +! ipass = -1 - reset to base values +! ipass = 0 - do nothing +! ipass = 1 - stress part +! ipass = 2 - heat transfer part +! iplres Flag indicating that either second matrix is stored. +! dynamic analysis - mass matrix +! heat transfer - specific heat matrix +! buckle - initial stress stiffness +! ipois Control flag indicating Poisson type analysis +! ipois = 1 for heat transfer +! = 1 for heat transfer part of coupled +! = 1 for bearing +! = 1 for electrostatic +! = 1 for magnetostatic +! ipoist Permanent copy of ipois. In coupled analysis , ipois = 0 +! in stress portion, yet ipoist will still =1. +! irpflo global flag for rigid plastic flow analysis +! = 1 eularian formulation +! = 2 regular formulation; rigid material present in the analysis + +! ismall control flag to indicate small displacement analysis. input data. +! ismall = 0 - large disp included. +! ismall = 1 - small displacement. +! the flag is changing between passes. +! ismalt permanent copy of ismall . in heat transfer portion of +! coupled analysis ismall =0 , but ismalt remains the same. +! isoil control flag indicating that soil / pore pressure +! calculation . input data. +! ispect control flag for response spectrum calculation. input data. +! ispnow control flag to indicate to perform a spectrum response +! calculation now. +! istore store stresses flag. +! istore = 0 in elem.f and if first pass of creep +! convergence checking in ogetst.f +! or harmonic analysis or thruc.f if not +! converged. +! iswep control flag for eigenvalue analysis. +! iswep=1 - go do extraction process +! ithcrp control flag for auto therm creep option. input data. +! itherm control flag for either temperature dependent material +! properties and/or thermal loads. +! iupblg control flag for follower force option. input data. +! iupdat control flag for update lagrange option for current element. +! jacflg control flag for lanczos iteration method. input data. +! jel control flag indicating that total load applied in +! increment, ignore previous solution. +! jel = 1 in increment 0 +! = 1 if elastic or fourier +! = 1 in subincrements with elastic and adaptive +! jparks control flag for j integral by parks method. input data. +! largst control flag for finite strain plasticity. input data. +! lfond control variable that indicates if doing elastic +! foundation or film calculation. influences whether +! this is volumetric or surface integration. +! loadup control flag that indicates that nonlinearity occurred +! during previous increment. +! loaduq control flag that indicates that nonlinearity occurred. +! lodcor control flag for switching on the residual load correction. +! notice in input stage lodcor=0 means no loadcor, +! after omarc lodcor=1 means no loadcor +! lovl control flag for determining which "overlay" is to +! be called from ellib. +! lovl = 1 omarc +! = 2 oaread +! = 3 opress +! = 4 oasemb +! = 5 osolty +! = 6 ogetst +! = 7 oscinc +! = 8 odynam +! = 9 opmesh +! = 10 omesh2 +! = 11 osetz +! = 12 oass +! = 13 oincdt +! = 14 oasmas +! = 15 ofluas +! = 16 ofluso +! = 17 oshtra +! = 18 ocass +! = 19 osoltc +! = 20 orezon +! = 21 otest +! = 22 oeigen +! lsub control variable to determine which part of element +! assembly function is being done. +! lsub = 1 - no longer used +! = 2 - beta* +! = 3 - cons* +! = 4 - ldef* +! = 5 - posw* +! = 6 - theta* +! = 7 - tmarx* +! = 8 - geom* +! magnet control flag for magnetostatic analysis. input data. +! ncycle cycle number. accumulated in osolty.f +! note first time through oasemb.f , ncycle = 0. +! newtnt control flag for permanent copy of newton. +! newton iteration type. input data. +! newton : = 1 full newton raphson +! 2 modified newton raphson +! 3 newton raphson with strain correct. +! 4 direct substitution +! 5 direct substitution followed by n.r. +! 6 direct substitution with line search +! 7 full newton raphson with secant initial stress +! 8 secant method +! 9 full newton raphson with line search +! noshr control flag for calculation interlaminar shears for +! elements 22,45, and 75. input data. +!ees +! +! 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) +! igsigd0 = 1 set varselem(igsigd) to zero in next oasemb +! iaem = 1 if marc is called from aem (0 - off - default) +! icosim = 1 if marc is used in co-simulation software (ADAMS-MARC) +! inodels = 1 nodal integration elements 239/240/241 present +! nlharm = 0 harmonic subincrements are linear +! = 1 harmonic subincrements are nonlinear +! iampini = 0 amplitude of previous harmonic subinc is initial estimate (default) +! = 1 zero amplitude is initial estimate +! iphasetr = 1 phase transformation material model is used +! iforminp flag indicating that contact is switched on via the CONTACT +! option in the input file (as opposed to the case that contact +! is switched on internally due to cyclic symmetry or model +! section creation) +! ispecerror = a+10*b (only for spectrum response analysis with missing mass option) +! a=0 or a=1 (modal shape with non-zero shift) +! b=0 or b=1 (recover with new assembly of stiffness matrix) +! icsprg = set to 1 if spring elements present in model +! imol Control flag for molecualr diffusion pass +! imolt Permanent control flag for molecualr diffusion pass +! Note in coupled analysis imolt will remain as one, +! but imol will be zero in stress pass or thermal pass. +! idatafit = run Marc to fit parameters +! iharmpar = 1 if harmonic parameter option is used +! inclcase load case increment use for cyclic plasticity data fitting +! imultifreq flag to indicate how many harmonic magnetodynamic passes are computed in coupled +! magnetodynamic/thermal(/structural) analyses. +! 0 or 1 one pass 2 two passes 3 or more is not supported +! init_elas use elastic stress-strain law as the material tangent for +! the first cycle of an increment +! ifatig = 1 stress-life fatigue +! = 2 strain-life fatigue +! iftgmat = 0 no fatigue material properties in the dat file +! = 1 fatigue material properties in the dat file +! nchybrid cycle count used for hybrid contact; meant to force an extra iteration +! if the overlap for a node in hybrid contact is too large +! +!*********************************************************************** +!$omp threadprivate(/marc_concom/) +!! diff --git a/src/Marc/include/creeps2021.2 b/src/Marc/include/creeps2021.2 new file mode 100644 index 000000000..09550f501 --- /dev/null +++ b/src/Marc/include/creeps2021.2 @@ -0,0 +1,66 @@ +! 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 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 +real(pReal) fraction_donn,timinc_ol2 +! +integer num_creepsr,num_creepsi,num_creeps2r +parameter(num_creepsr=7) +parameter(num_creepsi=17) +parameter(num_creeps2r=6) +common/marc_creeps/cptim,timinc,timinc_p,timinc_s,timincm,timinc_a,timinc_b,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,fraction_donn,timinc_ol2 +! +! cptim Total time at begining of increment. +! timinc Incremental time for this step. +! icfte Local copy number of slopes of creep strain rate function +! versus temperature. Is -1 if exponent law used. +! icfst Local copy number of slopes of creep strain rate function +! versus equivalent stress. Is -1 if exponent law used. +! icfeq Local copy number of slopes of creep strain rate function +! versus equivalent strain. Is -1 if exponent law used. +! icftm Local copy number of slopes of creep strain rate function +! versus time. Is -1 if exponent law used. +! icetem Element number that needs to be checked for creep convergence +! or, if negative, the number of elements that need to +! be checked. In the latter case the elements to check +! are stored in ielcp. +! mcreep Maximum nuber of iterations for explicit creep. +! jcreep Counter of number of iterations for explicit creep +! procedure. jcreep must be .le. mcreep +! icpa Pointer to constant in creep strain rate expression. +! icftmp Pointer to temperature dependent creep strain rate data. +! icfstr Pointer to equivalent stress dependent creep strain rate data. +! icfqcp Pointer to equivalent creep strain dependent creep strain +! rate data. +! icfcpm Pointer to equivalent creep strain rate dependent +! creep strain rate data. +! icrppr Permanent copy of icreep +! icrcha Control flag for creep convergence checking , if set to +! 1 then testing on absolute change in stress and creep +! strain, not relative testing. Input data. +! icpb Pointer to storage of material id cross reference numbers. +! iicpmt +! iicpa Pointer to constant in creep strain rate expression +! +! 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 +! +! timinc_old Time step of the previous increment +! +!*********************************************************************** +!!$omp threadprivate(/marc_creeps/) +!!$omp threadprivate(/marc_creeps2/) +!! From 72be56860e0c0f2cee60566dc01e8fa49b6756c2 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Fri, 9 Jul 2021 17:51:35 +0200 Subject: [PATCH 02/36] adapted to new directory name --- installation/MarcMentat/apply_DAMASK_modifications.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installation/MarcMentat/apply_DAMASK_modifications.py b/installation/MarcMentat/apply_DAMASK_modifications.py index 38323b3f7..85792a413 100755 --- a/installation/MarcMentat/apply_DAMASK_modifications.py +++ b/installation/MarcMentat/apply_DAMASK_modifications.py @@ -37,7 +37,7 @@ msc_version = args.msc_version print('adapting Marc tools...\n') -src = damask_root/f'installation/mods_MarcMentat/{msc_version}/Marc_tools' +src = damask_root/f'installation/MarcMentat/{msc_version}/Marc_tools' dst = msc_root/f'marc{msc_version}/tools' for in_file in glob.glob(str(src/'*damask*')) + [str(src/'include_linux64')]: copy_and_replace(in_file,dst,args.msc_root,args.editor) @@ -45,12 +45,12 @@ for in_file in glob.glob(str(src/'*damask*')) + [str(src/'include_linux64')]: print('adapting Mentat scripts and menus...\n') -src = damask_root/f'installation/mods_MarcMentat/{msc_version}/Mentat_bin' +src = damask_root/f'installation/MarcMentat/{msc_version}/Mentat_bin' dst = msc_root/f'mentat{msc_version}/bin' for in_file in glob.glob(str(src/'*[!.original]')): copy_and_replace(in_file,dst,args.msc_root,args.editor) -src = damask_root/f'installation/mods_MarcMentat/{msc_version}/Mentat_menus' +src = damask_root/f'installation/MarcMentat/{msc_version}/Mentat_menus' dst = msc_root/f'mentat{msc_version}/menus' for in_file in glob.glob(str(src/'job_run.ms')): copy_and_replace(in_file,dst,args.msc_root,args.editor) From 79420463f222dfdeb8a65ebd46aa011d0963ba28 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Fri, 9 Jul 2021 22:25:56 +0200 Subject: [PATCH 03/36] make xvfb automatically find a free server --- installation/MarcMentat/apply_DAMASK_modifications.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation/MarcMentat/apply_DAMASK_modifications.py b/installation/MarcMentat/apply_DAMASK_modifications.py index 85792a413..6d1630c00 100755 --- a/installation/MarcMentat/apply_DAMASK_modifications.py +++ b/installation/MarcMentat/apply_DAMASK_modifications.py @@ -60,7 +60,7 @@ print('compiling Mentat menu binaries...') executable = msc_root/f'mentat{msc_version}/bin/mentat' menu_file = msc_root/f'mentat{msc_version}/menus/linux64/main.msb' -os.system(f'xvfb-run {executable} -compile {menu_file}') +os.system(f'xvfb-run -a {executable} -compile {menu_file}') print('setting file access rights...\n') From 58e0e5f4f7bc3310ddefefd7113ff3caf8083dfe Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 10 Jul 2021 11:41:33 +0200 Subject: [PATCH 04/36] matches other short names (src, img, ..) --- .gitattributes | 4 ++-- .../MarcMentat/2020/Marc_tools/comp_damask_hmp | 0 .../MarcMentat/2020/Marc_tools/comp_damask_lmp | 0 .../MarcMentat/2020/Marc_tools/comp_damask_mp | 0 .../MarcMentat/2020/Marc_tools/comp_user.original | 0 .../MarcMentat/2020/Marc_tools/include_linux64 | 0 .../MarcMentat/2020/Marc_tools/include_linux64.original | 0 .../MarcMentat/2020/Marc_tools/run_damask_hmp | 0 .../MarcMentat/2020/Marc_tools/run_damask_lmp | 0 .../MarcMentat/2020/Marc_tools/run_damask_mp | 0 .../MarcMentat/2020/Marc_tools/run_marc.original | 0 .../MarcMentat/2020/Mentat_bin/edit_window | 0 .../MarcMentat/2020/Mentat_bin/edit_window.original | 0 .../MarcMentat/2020/Mentat_bin/kill1.original | 0 {installation => install}/MarcMentat/2020/Mentat_bin/kill4 | 0 {installation => install}/MarcMentat/2020/Mentat_bin/kill5 | 0 {installation => install}/MarcMentat/2020/Mentat_bin/kill6 | 0 .../MarcMentat/2020/Mentat_bin/submit1.original | 0 .../MarcMentat/2020/Mentat_bin/submit4 | 0 .../MarcMentat/2020/Mentat_bin/submit5 | 0 .../MarcMentat/2020/Mentat_bin/submit6 | 0 .../MarcMentat/2020/Mentat_menus/job_run.ms | 0 .../MarcMentat/2020/Mentat_menus/job_run.ms.original | 0 .../MarcMentat/2021.2/Marc_tools/comp_damask_hmp | 0 .../MarcMentat/2021.2/Marc_tools/comp_damask_lmp | 0 .../MarcMentat/2021.2/Marc_tools/comp_damask_mp | 0 .../MarcMentat/2021.2/Marc_tools/comp_user.original | 0 .../MarcMentat/2021.2/Marc_tools/include_linux64 | 0 .../MarcMentat/2021.2/Marc_tools/include_linux64.original | 0 .../MarcMentat/2021.2/Marc_tools/run_damask_hmp | 0 .../MarcMentat/2021.2/Marc_tools/run_damask_lmp | 0 .../MarcMentat/2021.2/Marc_tools/run_damask_mp | 0 .../MarcMentat/2021.2/Marc_tools/run_marc.original | 0 .../MarcMentat/2021.2/Mentat_bin/edit_window | 0 .../MarcMentat/2021.2/Mentat_bin/edit_window.original | 0 .../MarcMentat/2021.2/Mentat_bin/kill1.original | 0 .../MarcMentat/2021.2/Mentat_bin/kill4 | 0 .../MarcMentat/2021.2/Mentat_bin/kill5 | 0 .../MarcMentat/2021.2/Mentat_bin/kill6 | 0 .../MarcMentat/2021.2/Mentat_bin/submit1.original | 0 .../MarcMentat/2021.2/Mentat_bin/submit4 | 0 .../MarcMentat/2021.2/Mentat_bin/submit5 | 0 .../MarcMentat/2021.2/Mentat_bin/submit6 | 0 .../MarcMentat/2021.2/Mentat_menus/job_run.ms | 0 .../MarcMentat/2021.2/Mentat_menus/job_run.ms.original | 0 .../MarcMentat/apply_DAMASK_modifications.py | 6 +++--- {installation => install}/MarcMentat/installation.txt | 0 47 files changed, 5 insertions(+), 5 deletions(-) rename {installation => install}/MarcMentat/2020/Marc_tools/comp_damask_hmp (100%) rename {installation => install}/MarcMentat/2020/Marc_tools/comp_damask_lmp (100%) rename {installation => install}/MarcMentat/2020/Marc_tools/comp_damask_mp (100%) rename {installation => install}/MarcMentat/2020/Marc_tools/comp_user.original (100%) rename {installation => install}/MarcMentat/2020/Marc_tools/include_linux64 (100%) rename {installation => install}/MarcMentat/2020/Marc_tools/include_linux64.original (100%) rename {installation => install}/MarcMentat/2020/Marc_tools/run_damask_hmp (100%) rename {installation => install}/MarcMentat/2020/Marc_tools/run_damask_lmp (100%) rename {installation => install}/MarcMentat/2020/Marc_tools/run_damask_mp (100%) rename {installation => install}/MarcMentat/2020/Marc_tools/run_marc.original (100%) rename {installation => install}/MarcMentat/2020/Mentat_bin/edit_window (100%) rename {installation => install}/MarcMentat/2020/Mentat_bin/edit_window.original (100%) rename {installation => install}/MarcMentat/2020/Mentat_bin/kill1.original (100%) rename {installation => install}/MarcMentat/2020/Mentat_bin/kill4 (100%) rename {installation => install}/MarcMentat/2020/Mentat_bin/kill5 (100%) rename {installation => install}/MarcMentat/2020/Mentat_bin/kill6 (100%) rename {installation => install}/MarcMentat/2020/Mentat_bin/submit1.original (100%) rename {installation => install}/MarcMentat/2020/Mentat_bin/submit4 (100%) rename {installation => install}/MarcMentat/2020/Mentat_bin/submit5 (100%) rename {installation => install}/MarcMentat/2020/Mentat_bin/submit6 (100%) rename {installation => install}/MarcMentat/2020/Mentat_menus/job_run.ms (100%) rename {installation => install}/MarcMentat/2020/Mentat_menus/job_run.ms.original (100%) rename {installation => install}/MarcMentat/2021.2/Marc_tools/comp_damask_hmp (100%) rename {installation => install}/MarcMentat/2021.2/Marc_tools/comp_damask_lmp (100%) rename {installation => install}/MarcMentat/2021.2/Marc_tools/comp_damask_mp (100%) rename {installation => install}/MarcMentat/2021.2/Marc_tools/comp_user.original (100%) rename {installation => install}/MarcMentat/2021.2/Marc_tools/include_linux64 (100%) rename {installation => install}/MarcMentat/2021.2/Marc_tools/include_linux64.original (100%) rename {installation => install}/MarcMentat/2021.2/Marc_tools/run_damask_hmp (100%) rename {installation => install}/MarcMentat/2021.2/Marc_tools/run_damask_lmp (100%) rename {installation => install}/MarcMentat/2021.2/Marc_tools/run_damask_mp (100%) rename {installation => install}/MarcMentat/2021.2/Marc_tools/run_marc.original (100%) rename {installation => install}/MarcMentat/2021.2/Mentat_bin/edit_window (100%) rename {installation => install}/MarcMentat/2021.2/Mentat_bin/edit_window.original (100%) rename {installation => install}/MarcMentat/2021.2/Mentat_bin/kill1.original (100%) rename {installation => install}/MarcMentat/2021.2/Mentat_bin/kill4 (100%) rename {installation => install}/MarcMentat/2021.2/Mentat_bin/kill5 (100%) rename {installation => install}/MarcMentat/2021.2/Mentat_bin/kill6 (100%) rename {installation => install}/MarcMentat/2021.2/Mentat_bin/submit1.original (100%) rename {installation => install}/MarcMentat/2021.2/Mentat_bin/submit4 (100%) rename {installation => install}/MarcMentat/2021.2/Mentat_bin/submit5 (100%) rename {installation => install}/MarcMentat/2021.2/Mentat_bin/submit6 (100%) rename {installation => install}/MarcMentat/2021.2/Mentat_menus/job_run.ms (100%) rename {installation => install}/MarcMentat/2021.2/Mentat_menus/job_run.ms.original (100%) rename {installation => install}/MarcMentat/apply_DAMASK_modifications.py (92%) rename {installation => install}/MarcMentat/installation.txt (100%) diff --git a/.gitattributes b/.gitattributes index 0fbe302e9..6bc316a77 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,9 +12,9 @@ *.pbz2 binary # ignore files from MSC.Marc in language statistics -installation/MarcMentat/** linguist-vendored +install/MarcMentat/** linguist-vendored src/Marc/include/* linguist-vendored -installation/MarcMentat/apply_DAMASK_modifications.py linguist-vendored=false +install/MarcMentat/apply_DAMASK_modifications.py linguist-vendored=false # ignore reference files for tests in language statistics python/tests/reference/** linguist-vendored diff --git a/installation/MarcMentat/2020/Marc_tools/comp_damask_hmp b/install/MarcMentat/2020/Marc_tools/comp_damask_hmp similarity index 100% rename from installation/MarcMentat/2020/Marc_tools/comp_damask_hmp rename to install/MarcMentat/2020/Marc_tools/comp_damask_hmp diff --git a/installation/MarcMentat/2020/Marc_tools/comp_damask_lmp b/install/MarcMentat/2020/Marc_tools/comp_damask_lmp similarity index 100% rename from installation/MarcMentat/2020/Marc_tools/comp_damask_lmp rename to install/MarcMentat/2020/Marc_tools/comp_damask_lmp diff --git a/installation/MarcMentat/2020/Marc_tools/comp_damask_mp b/install/MarcMentat/2020/Marc_tools/comp_damask_mp similarity index 100% rename from installation/MarcMentat/2020/Marc_tools/comp_damask_mp rename to install/MarcMentat/2020/Marc_tools/comp_damask_mp diff --git a/installation/MarcMentat/2020/Marc_tools/comp_user.original b/install/MarcMentat/2020/Marc_tools/comp_user.original similarity index 100% rename from installation/MarcMentat/2020/Marc_tools/comp_user.original rename to install/MarcMentat/2020/Marc_tools/comp_user.original diff --git a/installation/MarcMentat/2020/Marc_tools/include_linux64 b/install/MarcMentat/2020/Marc_tools/include_linux64 similarity index 100% rename from installation/MarcMentat/2020/Marc_tools/include_linux64 rename to install/MarcMentat/2020/Marc_tools/include_linux64 diff --git a/installation/MarcMentat/2020/Marc_tools/include_linux64.original b/install/MarcMentat/2020/Marc_tools/include_linux64.original similarity index 100% rename from installation/MarcMentat/2020/Marc_tools/include_linux64.original rename to install/MarcMentat/2020/Marc_tools/include_linux64.original diff --git a/installation/MarcMentat/2020/Marc_tools/run_damask_hmp b/install/MarcMentat/2020/Marc_tools/run_damask_hmp similarity index 100% rename from installation/MarcMentat/2020/Marc_tools/run_damask_hmp rename to install/MarcMentat/2020/Marc_tools/run_damask_hmp diff --git a/installation/MarcMentat/2020/Marc_tools/run_damask_lmp b/install/MarcMentat/2020/Marc_tools/run_damask_lmp similarity index 100% rename from installation/MarcMentat/2020/Marc_tools/run_damask_lmp rename to install/MarcMentat/2020/Marc_tools/run_damask_lmp diff --git a/installation/MarcMentat/2020/Marc_tools/run_damask_mp b/install/MarcMentat/2020/Marc_tools/run_damask_mp similarity index 100% rename from installation/MarcMentat/2020/Marc_tools/run_damask_mp rename to install/MarcMentat/2020/Marc_tools/run_damask_mp diff --git a/installation/MarcMentat/2020/Marc_tools/run_marc.original b/install/MarcMentat/2020/Marc_tools/run_marc.original similarity index 100% rename from installation/MarcMentat/2020/Marc_tools/run_marc.original rename to install/MarcMentat/2020/Marc_tools/run_marc.original diff --git a/installation/MarcMentat/2020/Mentat_bin/edit_window b/install/MarcMentat/2020/Mentat_bin/edit_window similarity index 100% rename from installation/MarcMentat/2020/Mentat_bin/edit_window rename to install/MarcMentat/2020/Mentat_bin/edit_window diff --git a/installation/MarcMentat/2020/Mentat_bin/edit_window.original b/install/MarcMentat/2020/Mentat_bin/edit_window.original similarity index 100% rename from installation/MarcMentat/2020/Mentat_bin/edit_window.original rename to install/MarcMentat/2020/Mentat_bin/edit_window.original diff --git a/installation/MarcMentat/2020/Mentat_bin/kill1.original b/install/MarcMentat/2020/Mentat_bin/kill1.original similarity index 100% rename from installation/MarcMentat/2020/Mentat_bin/kill1.original rename to install/MarcMentat/2020/Mentat_bin/kill1.original diff --git a/installation/MarcMentat/2020/Mentat_bin/kill4 b/install/MarcMentat/2020/Mentat_bin/kill4 similarity index 100% rename from installation/MarcMentat/2020/Mentat_bin/kill4 rename to install/MarcMentat/2020/Mentat_bin/kill4 diff --git a/installation/MarcMentat/2020/Mentat_bin/kill5 b/install/MarcMentat/2020/Mentat_bin/kill5 similarity index 100% rename from installation/MarcMentat/2020/Mentat_bin/kill5 rename to install/MarcMentat/2020/Mentat_bin/kill5 diff --git a/installation/MarcMentat/2020/Mentat_bin/kill6 b/install/MarcMentat/2020/Mentat_bin/kill6 similarity index 100% rename from installation/MarcMentat/2020/Mentat_bin/kill6 rename to install/MarcMentat/2020/Mentat_bin/kill6 diff --git a/installation/MarcMentat/2020/Mentat_bin/submit1.original b/install/MarcMentat/2020/Mentat_bin/submit1.original similarity index 100% rename from installation/MarcMentat/2020/Mentat_bin/submit1.original rename to install/MarcMentat/2020/Mentat_bin/submit1.original diff --git a/installation/MarcMentat/2020/Mentat_bin/submit4 b/install/MarcMentat/2020/Mentat_bin/submit4 similarity index 100% rename from installation/MarcMentat/2020/Mentat_bin/submit4 rename to install/MarcMentat/2020/Mentat_bin/submit4 diff --git a/installation/MarcMentat/2020/Mentat_bin/submit5 b/install/MarcMentat/2020/Mentat_bin/submit5 similarity index 100% rename from installation/MarcMentat/2020/Mentat_bin/submit5 rename to install/MarcMentat/2020/Mentat_bin/submit5 diff --git a/installation/MarcMentat/2020/Mentat_bin/submit6 b/install/MarcMentat/2020/Mentat_bin/submit6 similarity index 100% rename from installation/MarcMentat/2020/Mentat_bin/submit6 rename to install/MarcMentat/2020/Mentat_bin/submit6 diff --git a/installation/MarcMentat/2020/Mentat_menus/job_run.ms b/install/MarcMentat/2020/Mentat_menus/job_run.ms similarity index 100% rename from installation/MarcMentat/2020/Mentat_menus/job_run.ms rename to install/MarcMentat/2020/Mentat_menus/job_run.ms diff --git a/installation/MarcMentat/2020/Mentat_menus/job_run.ms.original b/install/MarcMentat/2020/Mentat_menus/job_run.ms.original similarity index 100% rename from installation/MarcMentat/2020/Mentat_menus/job_run.ms.original rename to install/MarcMentat/2020/Mentat_menus/job_run.ms.original diff --git a/installation/MarcMentat/2021.2/Marc_tools/comp_damask_hmp b/install/MarcMentat/2021.2/Marc_tools/comp_damask_hmp similarity index 100% rename from installation/MarcMentat/2021.2/Marc_tools/comp_damask_hmp rename to install/MarcMentat/2021.2/Marc_tools/comp_damask_hmp diff --git a/installation/MarcMentat/2021.2/Marc_tools/comp_damask_lmp b/install/MarcMentat/2021.2/Marc_tools/comp_damask_lmp similarity index 100% rename from installation/MarcMentat/2021.2/Marc_tools/comp_damask_lmp rename to install/MarcMentat/2021.2/Marc_tools/comp_damask_lmp diff --git a/installation/MarcMentat/2021.2/Marc_tools/comp_damask_mp b/install/MarcMentat/2021.2/Marc_tools/comp_damask_mp similarity index 100% rename from installation/MarcMentat/2021.2/Marc_tools/comp_damask_mp rename to install/MarcMentat/2021.2/Marc_tools/comp_damask_mp diff --git a/installation/MarcMentat/2021.2/Marc_tools/comp_user.original b/install/MarcMentat/2021.2/Marc_tools/comp_user.original similarity index 100% rename from installation/MarcMentat/2021.2/Marc_tools/comp_user.original rename to install/MarcMentat/2021.2/Marc_tools/comp_user.original diff --git a/installation/MarcMentat/2021.2/Marc_tools/include_linux64 b/install/MarcMentat/2021.2/Marc_tools/include_linux64 similarity index 100% rename from installation/MarcMentat/2021.2/Marc_tools/include_linux64 rename to install/MarcMentat/2021.2/Marc_tools/include_linux64 diff --git a/installation/MarcMentat/2021.2/Marc_tools/include_linux64.original b/install/MarcMentat/2021.2/Marc_tools/include_linux64.original similarity index 100% rename from installation/MarcMentat/2021.2/Marc_tools/include_linux64.original rename to install/MarcMentat/2021.2/Marc_tools/include_linux64.original diff --git a/installation/MarcMentat/2021.2/Marc_tools/run_damask_hmp b/install/MarcMentat/2021.2/Marc_tools/run_damask_hmp similarity index 100% rename from installation/MarcMentat/2021.2/Marc_tools/run_damask_hmp rename to install/MarcMentat/2021.2/Marc_tools/run_damask_hmp diff --git a/installation/MarcMentat/2021.2/Marc_tools/run_damask_lmp b/install/MarcMentat/2021.2/Marc_tools/run_damask_lmp similarity index 100% rename from installation/MarcMentat/2021.2/Marc_tools/run_damask_lmp rename to install/MarcMentat/2021.2/Marc_tools/run_damask_lmp diff --git a/installation/MarcMentat/2021.2/Marc_tools/run_damask_mp b/install/MarcMentat/2021.2/Marc_tools/run_damask_mp similarity index 100% rename from installation/MarcMentat/2021.2/Marc_tools/run_damask_mp rename to install/MarcMentat/2021.2/Marc_tools/run_damask_mp diff --git a/installation/MarcMentat/2021.2/Marc_tools/run_marc.original b/install/MarcMentat/2021.2/Marc_tools/run_marc.original similarity index 100% rename from installation/MarcMentat/2021.2/Marc_tools/run_marc.original rename to install/MarcMentat/2021.2/Marc_tools/run_marc.original diff --git a/installation/MarcMentat/2021.2/Mentat_bin/edit_window b/install/MarcMentat/2021.2/Mentat_bin/edit_window similarity index 100% rename from installation/MarcMentat/2021.2/Mentat_bin/edit_window rename to install/MarcMentat/2021.2/Mentat_bin/edit_window diff --git a/installation/MarcMentat/2021.2/Mentat_bin/edit_window.original b/install/MarcMentat/2021.2/Mentat_bin/edit_window.original similarity index 100% rename from installation/MarcMentat/2021.2/Mentat_bin/edit_window.original rename to install/MarcMentat/2021.2/Mentat_bin/edit_window.original diff --git a/installation/MarcMentat/2021.2/Mentat_bin/kill1.original b/install/MarcMentat/2021.2/Mentat_bin/kill1.original similarity index 100% rename from installation/MarcMentat/2021.2/Mentat_bin/kill1.original rename to install/MarcMentat/2021.2/Mentat_bin/kill1.original diff --git a/installation/MarcMentat/2021.2/Mentat_bin/kill4 b/install/MarcMentat/2021.2/Mentat_bin/kill4 similarity index 100% rename from installation/MarcMentat/2021.2/Mentat_bin/kill4 rename to install/MarcMentat/2021.2/Mentat_bin/kill4 diff --git a/installation/MarcMentat/2021.2/Mentat_bin/kill5 b/install/MarcMentat/2021.2/Mentat_bin/kill5 similarity index 100% rename from installation/MarcMentat/2021.2/Mentat_bin/kill5 rename to install/MarcMentat/2021.2/Mentat_bin/kill5 diff --git a/installation/MarcMentat/2021.2/Mentat_bin/kill6 b/install/MarcMentat/2021.2/Mentat_bin/kill6 similarity index 100% rename from installation/MarcMentat/2021.2/Mentat_bin/kill6 rename to install/MarcMentat/2021.2/Mentat_bin/kill6 diff --git a/installation/MarcMentat/2021.2/Mentat_bin/submit1.original b/install/MarcMentat/2021.2/Mentat_bin/submit1.original similarity index 100% rename from installation/MarcMentat/2021.2/Mentat_bin/submit1.original rename to install/MarcMentat/2021.2/Mentat_bin/submit1.original diff --git a/installation/MarcMentat/2021.2/Mentat_bin/submit4 b/install/MarcMentat/2021.2/Mentat_bin/submit4 similarity index 100% rename from installation/MarcMentat/2021.2/Mentat_bin/submit4 rename to install/MarcMentat/2021.2/Mentat_bin/submit4 diff --git a/installation/MarcMentat/2021.2/Mentat_bin/submit5 b/install/MarcMentat/2021.2/Mentat_bin/submit5 similarity index 100% rename from installation/MarcMentat/2021.2/Mentat_bin/submit5 rename to install/MarcMentat/2021.2/Mentat_bin/submit5 diff --git a/installation/MarcMentat/2021.2/Mentat_bin/submit6 b/install/MarcMentat/2021.2/Mentat_bin/submit6 similarity index 100% rename from installation/MarcMentat/2021.2/Mentat_bin/submit6 rename to install/MarcMentat/2021.2/Mentat_bin/submit6 diff --git a/installation/MarcMentat/2021.2/Mentat_menus/job_run.ms b/install/MarcMentat/2021.2/Mentat_menus/job_run.ms similarity index 100% rename from installation/MarcMentat/2021.2/Mentat_menus/job_run.ms rename to install/MarcMentat/2021.2/Mentat_menus/job_run.ms diff --git a/installation/MarcMentat/2021.2/Mentat_menus/job_run.ms.original b/install/MarcMentat/2021.2/Mentat_menus/job_run.ms.original similarity index 100% rename from installation/MarcMentat/2021.2/Mentat_menus/job_run.ms.original rename to install/MarcMentat/2021.2/Mentat_menus/job_run.ms.original diff --git a/installation/MarcMentat/apply_DAMASK_modifications.py b/install/MarcMentat/apply_DAMASK_modifications.py similarity index 92% rename from installation/MarcMentat/apply_DAMASK_modifications.py rename to install/MarcMentat/apply_DAMASK_modifications.py index 6d1630c00..ba605b7db 100755 --- a/installation/MarcMentat/apply_DAMASK_modifications.py +++ b/install/MarcMentat/apply_DAMASK_modifications.py @@ -37,7 +37,7 @@ msc_version = args.msc_version print('adapting Marc tools...\n') -src = damask_root/f'installation/MarcMentat/{msc_version}/Marc_tools' +src = damask_root/f'install/MarcMentat/{msc_version}/Marc_tools' dst = msc_root/f'marc{msc_version}/tools' for in_file in glob.glob(str(src/'*damask*')) + [str(src/'include_linux64')]: copy_and_replace(in_file,dst,args.msc_root,args.editor) @@ -45,12 +45,12 @@ for in_file in glob.glob(str(src/'*damask*')) + [str(src/'include_linux64')]: print('adapting Mentat scripts and menus...\n') -src = damask_root/f'installation/MarcMentat/{msc_version}/Mentat_bin' +src = damask_root/f'install/MarcMentat/{msc_version}/Mentat_bin' dst = msc_root/f'mentat{msc_version}/bin' for in_file in glob.glob(str(src/'*[!.original]')): copy_and_replace(in_file,dst,args.msc_root,args.editor) -src = damask_root/f'installation/MarcMentat/{msc_version}/Mentat_menus' +src = damask_root/f'install/MarcMentat/{msc_version}/Mentat_menus' dst = msc_root/f'mentat{msc_version}/menus' for in_file in glob.glob(str(src/'job_run.ms')): copy_and_replace(in_file,dst,args.msc_root,args.editor) diff --git a/installation/MarcMentat/installation.txt b/install/MarcMentat/installation.txt similarity index 100% rename from installation/MarcMentat/installation.txt rename to install/MarcMentat/installation.txt From 741f81455b09ba47cc9222f4a14d3c98f32df88f Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Tue, 13 Jul 2021 16:43:23 +0200 Subject: [PATCH 05/36] use newest Marc release (2021.2) --- .gitlab-ci.yml | 4 ++-- python/damask/solver/_marc.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6a26b703e..8adb67db9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -64,9 +64,9 @@ variables: PETSc_Intel: "$PETSc3_14_2IMPI2020Intel19_1" PETSc_GNU: "$PETSc3_14_2OMPI4_0GNU10" # ++++++++++++ commercial FEM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - MSC2020: "FEM/MSC/2020" + MSC2021: "FEM/MSC/2021.2" # ------------ Defaults ---------------------------------------------- - MSC: "$MSC2020" + MSC: "$MSC2021" IntelMarc: "$IntelCompiler19_1" HDF5Marc: "HDF5/1.12.0/Intel-19.1.2" diff --git a/python/damask/solver/_marc.py b/python/damask/solver/_marc.py index b09394e67..1e11e0917 100644 --- a/python/damask/solver/_marc.py +++ b/python/damask/solver/_marc.py @@ -3,7 +3,7 @@ import shlex import re from pathlib import Path -_msc_version = 2020 +_msc_version = 2021.2 _msc_root = '/opt/msc' _damask_root = str(Path(__file__).parents[3]) From f993edd218177a42c789931db8ed094b5b3cf7bd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 13 Jul 2021 18:55:17 +0200 Subject: [PATCH 06/36] duplicated quotes --- install/MarcMentat/2021.2/Marc_tools/include_linux64 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install/MarcMentat/2021.2/Marc_tools/include_linux64 b/install/MarcMentat/2021.2/Marc_tools/include_linux64 index 30385f569..3b9c0d180 100644 --- a/install/MarcMentat/2021.2/Marc_tools/include_linux64 +++ b/install/MarcMentat/2021.2/Marc_tools/include_linux64 @@ -598,19 +598,19 @@ else fi -# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3 +# DAMASK compiler calls DFORTLOWMP="$FCOMP -c -O0 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ -qopenmp -qopenmp-threadprivate=compat\ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" -I$MARC_MOD" + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" DFORTRANMP="$FCOMP -c -O1 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ -qopenmp -qopenmp-threadprivate=compat\ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" -I$MARC_MOD" + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" DFORTHIGHMP="$FCOMP -c -O3 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ -qopenmp -qopenmp-threadprivate=compat\ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" -I$MARC_MOD" + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" if test "$MARCDEBUG" = "ON" then From 1d348f0ccf24731aa4fbefc2d262206c209bca70 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 14 Jul 2021 12:15:39 +0200 Subject: [PATCH 07/36] better patch --- .../MarcMentat/apply_DAMASK_modifications.py | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/install/MarcMentat/apply_DAMASK_modifications.py b/install/MarcMentat/apply_DAMASK_modifications.py index ba605b7db..c3a5a18f3 100755 --- a/install/MarcMentat/apply_DAMASK_modifications.py +++ b/install/MarcMentat/apply_DAMASK_modifications.py @@ -3,12 +3,18 @@ import os import glob import argparse +import shutil from pathlib import Path import damask -def copy_and_replace(in_file,dst,msc_root,editor): - with open(in_file) as f_in, open(dst/Path(in_file).name,'w') as f_out: +def copy_and_replace(patch,orig,msc_root,editor): + try: + shutil.copyfile(orig,orig.parent/patch.stem) + except shutil.SameFileError: + pass + damask.execute(f'patch {orig.parent/patch.stem} {patch} -b}') + with open(orig.parent/patch.stem) as f_in, open(orig.parent/patch.stem,'w') as f_out: f_out.write(f_in.read().replace('%INSTALLDIR%',msc_root).replace('%EDITOR%',editor)) @@ -30,31 +36,27 @@ parser.add_argument('--damask-root', dest='damask_root', metavar = 'string', help='DAMASK root directory') args = parser.parse_args() -msc_root = Path(args.msc_root) -damask_root = Path(args.damask_root) -msc_version = args.msc_version +msc_root = Path(args.msc_root).expanduser() +damask_root = Path(args.damask_root).expanduser() +msc_version = int(args.msc_version) if str(args.msc_version).split('.')[1] == '0' else args.msc_version + +matches = {'Marc_tools': [['comp_user','comp_damask_*mp'], + ['run_marc','run_damask_*mp'], + ['include_linux64','include_linux64']], + 'Mentat_bin': [['edit_window','edit_window'], + ['submit1','submit?'], + ['kill1','kill?']], + 'Mentat_menus':[['job_run.ms','job_run.ms']]} -print('adapting Marc tools...\n') - -src = damask_root/f'install/MarcMentat/{msc_version}/Marc_tools' -dst = msc_root/f'marc{msc_version}/tools' -for in_file in glob.glob(str(src/'*damask*')) + [str(src/'include_linux64')]: - copy_and_replace(in_file,dst,args.msc_root,args.editor) - - -print('adapting Mentat scripts and menus...\n') - -src = damask_root/f'install/MarcMentat/{msc_version}/Mentat_bin' -dst = msc_root/f'mentat{msc_version}/bin' -for in_file in glob.glob(str(src/'*[!.original]')): - copy_and_replace(in_file,dst,args.msc_root,args.editor) - -src = damask_root/f'install/MarcMentat/{msc_version}/Mentat_menus' -dst = msc_root/f'mentat{msc_version}/menus' -for in_file in glob.glob(str(src/'job_run.ms')): - copy_and_replace(in_file,dst,args.msc_root,args.editor) +print('patching files...\n') +for directory in glob.glob(str(damask_root/f'install/MarcMentat/{msc_version}/*')): + for orig, mods in matches[Path(directory).name]: + dirs = (msc_root/Path(directory)).name.lower().split('_') + orig = msc_root/f'{dirs[0]}{msc_version}/{dirs[1]}/{orig}' + for patch in glob.glob(f'{directory}/{mods}.patch'): + copy_and_replace(Path(patch),orig,msc_root,editor) print('compiling Mentat menu binaries...') From 8731ab18e3b5c03df963e17e09ae493588aeac74 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 14 Jul 2021 10:13:08 +0200 Subject: [PATCH 08/36] patch, don't copy --- .../2020/Marc_tools/comp_damask_hmp | 53 - .../2020/Marc_tools/comp_damask_hmp.patch | 48 + .../2020/Marc_tools/comp_damask_lmp | 53 - .../2020/Marc_tools/comp_damask_lmp.patch | 48 + .../MarcMentat/2020/Marc_tools/comp_damask_mp | 53 - .../2020/Marc_tools/comp_damask_mp.patch | 48 + .../2020/Marc_tools/comp_user.original | 41 - .../2020/Marc_tools/include_linux64 | 814 ---- .../2020/Marc_tools/include_linux64.original | 785 --- .../2020/Marc_tools/include_linux64.patch | 113 + .../MarcMentat/2020/Marc_tools/run_damask_hmp | 4130 ---------------- .../2020/Marc_tools/run_damask_hmp.patch | 662 +++ .../MarcMentat/2020/Marc_tools/run_damask_lmp | 4130 ---------------- .../2020/Marc_tools/run_damask_lmp.patch | 662 +++ .../MarcMentat/2020/Marc_tools/run_damask_mp | 4130 ---------------- .../2020/Marc_tools/run_damask_mp.patch | 662 +++ .../2020/Marc_tools/run_marc.original | 4208 ----------------- .../MarcMentat/2020/Mentat_bin/edit_window | 5 - .../2020/Mentat_bin/edit_window.original | 18 - .../2020/Mentat_bin/edit_window.patch | 24 + .../MarcMentat/2020/Mentat_bin/kill1.original | 8 - install/MarcMentat/2020/Mentat_bin/kill4 | 8 - .../MarcMentat/2020/Mentat_bin/kill4.patch | 0 install/MarcMentat/2020/Mentat_bin/kill5 | 8 - .../MarcMentat/2020/Mentat_bin/kill5.patch | 0 install/MarcMentat/2020/Mentat_bin/kill6 | 8 - .../MarcMentat/2020/Mentat_bin/kill6.patch | 0 .../2020/Mentat_bin/submit1.original | 189 - install/MarcMentat/2020/Mentat_bin/submit4 | 191 - .../MarcMentat/2020/Mentat_bin/submit4.patch | 42 + install/MarcMentat/2020/Mentat_bin/submit5 | 191 - .../MarcMentat/2020/Mentat_bin/submit5.patch | 42 + install/MarcMentat/2020/Mentat_bin/submit6 | 191 - .../MarcMentat/2020/Mentat_bin/submit6.patch | 42 + .../MarcMentat/2020/Mentat_menus/job_run.ms | 2973 ------------ .../2020/Mentat_menus/job_run.ms.original | 2838 ----------- .../2020/Mentat_menus/job_run.ms.patch | 156 + .../2021.2/Marc_tools/comp_damask_hmp | 53 - .../2021.2/Marc_tools/comp_damask_hmp.patch | 48 + .../2021.2/Marc_tools/comp_damask_lmp | 53 - .../2021.2/Marc_tools/comp_damask_lmp.patch | 48 + .../2021.2/Marc_tools/comp_damask_mp | 53 - .../2021.2/Marc_tools/comp_damask_mp.patch | 48 + .../2021.2/Marc_tools/comp_user.original | 41 - .../2021.2/Marc_tools/include_linux64 | 846 ---- .../Marc_tools/include_linux64.original | 817 ---- .../2021.2/Marc_tools/include_linux64.patch | 101 + .../2021.2/Marc_tools/run_damask_hmp | 4129 ---------------- .../2021.2/Marc_tools/run_damask_hmp.patch | 708 +++ .../2021.2/Marc_tools/run_damask_lmp | 4129 ---------------- .../2021.2/Marc_tools/run_damask_lmp.patch | 708 +++ .../2021.2/Marc_tools/run_damask_mp | 4129 ---------------- .../2021.2/Marc_tools/run_damask_mp.patch | 708 +++ .../2021.2/Marc_tools/run_marc.original | 4207 ---------------- .../MarcMentat/2021.2/Mentat_bin/edit_window | 5 - .../2021.2/Mentat_bin/edit_window.original | 18 - .../2021.2/Mentat_bin/edit_window.patch | 24 + .../2021.2/Mentat_bin/kill1.original | 8 - install/MarcMentat/2021.2/Mentat_bin/kill4 | 8 - .../MarcMentat/2021.2/Mentat_bin/kill4.patch | 0 install/MarcMentat/2021.2/Mentat_bin/kill5 | 8 - .../MarcMentat/2021.2/Mentat_bin/kill5.patch | 0 install/MarcMentat/2021.2/Mentat_bin/kill6 | 8 - .../MarcMentat/2021.2/Mentat_bin/kill6.patch | 0 .../2021.2/Mentat_bin/submit1.original | 189 - install/MarcMentat/2021.2/Mentat_bin/submit4 | 191 - .../2021.2/Mentat_bin/submit4.patch | 42 + install/MarcMentat/2021.2/Mentat_bin/submit5 | 191 - .../2021.2/Mentat_bin/submit5.patch | 42 + install/MarcMentat/2021.2/Mentat_bin/submit6 | 191 - .../2021.2/Mentat_bin/submit6.patch | 42 + .../MarcMentat/2021.2/Mentat_menus/job_run.ms | 3109 ------------ .../2021.2/Mentat_menus/job_run.ms.original | 2973 ------------ .../2021.2/Mentat_menus/job_run.ms.patch | 157 + .../MarcMentat/apply_DAMASK_modifications.py | 2 +- 75 files changed, 5226 insertions(+), 50382 deletions(-) delete mode 100644 install/MarcMentat/2020/Marc_tools/comp_damask_hmp create mode 100644 install/MarcMentat/2020/Marc_tools/comp_damask_hmp.patch delete mode 100644 install/MarcMentat/2020/Marc_tools/comp_damask_lmp create mode 100644 install/MarcMentat/2020/Marc_tools/comp_damask_lmp.patch delete mode 100644 install/MarcMentat/2020/Marc_tools/comp_damask_mp create mode 100644 install/MarcMentat/2020/Marc_tools/comp_damask_mp.patch delete mode 100644 install/MarcMentat/2020/Marc_tools/comp_user.original delete mode 100644 install/MarcMentat/2020/Marc_tools/include_linux64 delete mode 100644 install/MarcMentat/2020/Marc_tools/include_linux64.original create mode 100644 install/MarcMentat/2020/Marc_tools/include_linux64.patch delete mode 100644 install/MarcMentat/2020/Marc_tools/run_damask_hmp create mode 100644 install/MarcMentat/2020/Marc_tools/run_damask_hmp.patch delete mode 100644 install/MarcMentat/2020/Marc_tools/run_damask_lmp create mode 100644 install/MarcMentat/2020/Marc_tools/run_damask_lmp.patch delete mode 100644 install/MarcMentat/2020/Marc_tools/run_damask_mp create mode 100644 install/MarcMentat/2020/Marc_tools/run_damask_mp.patch delete mode 100644 install/MarcMentat/2020/Marc_tools/run_marc.original delete mode 100644 install/MarcMentat/2020/Mentat_bin/edit_window delete mode 100644 install/MarcMentat/2020/Mentat_bin/edit_window.original create mode 100644 install/MarcMentat/2020/Mentat_bin/edit_window.patch delete mode 100644 install/MarcMentat/2020/Mentat_bin/kill1.original delete mode 100644 install/MarcMentat/2020/Mentat_bin/kill4 create mode 100644 install/MarcMentat/2020/Mentat_bin/kill4.patch delete mode 100644 install/MarcMentat/2020/Mentat_bin/kill5 create mode 100644 install/MarcMentat/2020/Mentat_bin/kill5.patch delete mode 100644 install/MarcMentat/2020/Mentat_bin/kill6 create mode 100644 install/MarcMentat/2020/Mentat_bin/kill6.patch delete mode 100644 install/MarcMentat/2020/Mentat_bin/submit1.original delete mode 100644 install/MarcMentat/2020/Mentat_bin/submit4 create mode 100644 install/MarcMentat/2020/Mentat_bin/submit4.patch delete mode 100644 install/MarcMentat/2020/Mentat_bin/submit5 create mode 100644 install/MarcMentat/2020/Mentat_bin/submit5.patch delete mode 100644 install/MarcMentat/2020/Mentat_bin/submit6 create mode 100644 install/MarcMentat/2020/Mentat_bin/submit6.patch delete mode 100644 install/MarcMentat/2020/Mentat_menus/job_run.ms delete mode 100644 install/MarcMentat/2020/Mentat_menus/job_run.ms.original create mode 100644 install/MarcMentat/2020/Mentat_menus/job_run.ms.patch delete mode 100644 install/MarcMentat/2021.2/Marc_tools/comp_damask_hmp create mode 100644 install/MarcMentat/2021.2/Marc_tools/comp_damask_hmp.patch delete mode 100644 install/MarcMentat/2021.2/Marc_tools/comp_damask_lmp create mode 100644 install/MarcMentat/2021.2/Marc_tools/comp_damask_lmp.patch delete mode 100644 install/MarcMentat/2021.2/Marc_tools/comp_damask_mp create mode 100644 install/MarcMentat/2021.2/Marc_tools/comp_damask_mp.patch delete mode 100644 install/MarcMentat/2021.2/Marc_tools/comp_user.original delete mode 100644 install/MarcMentat/2021.2/Marc_tools/include_linux64 delete mode 100644 install/MarcMentat/2021.2/Marc_tools/include_linux64.original create mode 100644 install/MarcMentat/2021.2/Marc_tools/include_linux64.patch delete mode 100644 install/MarcMentat/2021.2/Marc_tools/run_damask_hmp create mode 100644 install/MarcMentat/2021.2/Marc_tools/run_damask_hmp.patch delete mode 100644 install/MarcMentat/2021.2/Marc_tools/run_damask_lmp create mode 100644 install/MarcMentat/2021.2/Marc_tools/run_damask_lmp.patch delete mode 100644 install/MarcMentat/2021.2/Marc_tools/run_damask_mp create mode 100644 install/MarcMentat/2021.2/Marc_tools/run_damask_mp.patch delete mode 100644 install/MarcMentat/2021.2/Marc_tools/run_marc.original delete mode 100644 install/MarcMentat/2021.2/Mentat_bin/edit_window delete mode 100644 install/MarcMentat/2021.2/Mentat_bin/edit_window.original create mode 100644 install/MarcMentat/2021.2/Mentat_bin/edit_window.patch delete mode 100644 install/MarcMentat/2021.2/Mentat_bin/kill1.original delete mode 100644 install/MarcMentat/2021.2/Mentat_bin/kill4 create mode 100644 install/MarcMentat/2021.2/Mentat_bin/kill4.patch delete mode 100644 install/MarcMentat/2021.2/Mentat_bin/kill5 create mode 100644 install/MarcMentat/2021.2/Mentat_bin/kill5.patch delete mode 100644 install/MarcMentat/2021.2/Mentat_bin/kill6 create mode 100644 install/MarcMentat/2021.2/Mentat_bin/kill6.patch delete mode 100644 install/MarcMentat/2021.2/Mentat_bin/submit1.original delete mode 100644 install/MarcMentat/2021.2/Mentat_bin/submit4 create mode 100644 install/MarcMentat/2021.2/Mentat_bin/submit4.patch delete mode 100644 install/MarcMentat/2021.2/Mentat_bin/submit5 create mode 100644 install/MarcMentat/2021.2/Mentat_bin/submit5.patch delete mode 100644 install/MarcMentat/2021.2/Mentat_bin/submit6 create mode 100644 install/MarcMentat/2021.2/Mentat_bin/submit6.patch delete mode 100644 install/MarcMentat/2021.2/Mentat_menus/job_run.ms delete mode 100644 install/MarcMentat/2021.2/Mentat_menus/job_run.ms.original create mode 100644 install/MarcMentat/2021.2/Mentat_menus/job_run.ms.patch diff --git a/install/MarcMentat/2020/Marc_tools/comp_damask_hmp b/install/MarcMentat/2020/Marc_tools/comp_damask_hmp deleted file mode 100644 index de6fce745..000000000 --- a/install/MarcMentat/2020/Marc_tools/comp_damask_hmp +++ /dev/null @@ -1,53 +0,0 @@ -#!/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 - /bin/rm $DIRJOB/*.smod diff --git a/install/MarcMentat/2020/Marc_tools/comp_damask_hmp.patch b/install/MarcMentat/2020/Marc_tools/comp_damask_hmp.patch new file mode 100644 index 000000000..9c20f61d4 --- /dev/null +++ b/install/MarcMentat/2020/Marc_tools/comp_damask_hmp.patch @@ -0,0 +1,48 @@ +--- ++++ +@@ -6,18 +6,27 @@ + 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.f on host `hostname`" ++echo "Compiling and linking user subroutine $user on host `hostname`" + echo "program: $program" +- $FORTRAN $user.f || \ ++ $DFORTHIGHMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null +- userobj=$user.o ++ userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ +@@ -33,9 +42,12 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $BLAS \ + $SYSLIBS || \ + { +- echo "$0: link failed for $user.o on host `hostname`" ++ echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj ++ /bin/rm $DIRJOB/*.mod ++ /bin/rm $DIRJOB/*.smod diff --git a/install/MarcMentat/2020/Marc_tools/comp_damask_lmp b/install/MarcMentat/2020/Marc_tools/comp_damask_lmp deleted file mode 100644 index 6d063adf3..000000000 --- a/install/MarcMentat/2020/Marc_tools/comp_damask_lmp +++ /dev/null @@ -1,53 +0,0 @@ -#!/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 - /bin/rm $DIRJOB/*.smod diff --git a/install/MarcMentat/2020/Marc_tools/comp_damask_lmp.patch b/install/MarcMentat/2020/Marc_tools/comp_damask_lmp.patch new file mode 100644 index 000000000..d92110f13 --- /dev/null +++ b/install/MarcMentat/2020/Marc_tools/comp_damask_lmp.patch @@ -0,0 +1,48 @@ +--- ++++ +@@ -6,18 +6,27 @@ + 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.f on host `hostname`" ++echo "Compiling and linking user subroutine $user on host `hostname`" + echo "program: $program" +- $FORTRAN $user.f || \ ++ $DFORTRANLOWMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null +- userobj=$user.o ++ userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ +@@ -33,9 +42,12 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $BLAS \ + $SYSLIBS || \ + { +- echo "$0: link failed for $user.o on host `hostname`" ++ echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj ++ /bin/rm $DIRJOB/*.mod ++ /bin/rm $DIRJOB/*.smod diff --git a/install/MarcMentat/2020/Marc_tools/comp_damask_mp b/install/MarcMentat/2020/Marc_tools/comp_damask_mp deleted file mode 100644 index 871b8a449..000000000 --- a/install/MarcMentat/2020/Marc_tools/comp_damask_mp +++ /dev/null @@ -1,53 +0,0 @@ -#!/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 - /bin/rm $DIRJOB/*.smod diff --git a/install/MarcMentat/2020/Marc_tools/comp_damask_mp.patch b/install/MarcMentat/2020/Marc_tools/comp_damask_mp.patch new file mode 100644 index 000000000..d9ff8d660 --- /dev/null +++ b/install/MarcMentat/2020/Marc_tools/comp_damask_mp.patch @@ -0,0 +1,48 @@ +--- ++++ +@@ -6,18 +6,27 @@ + 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.f on host `hostname`" ++echo "Compiling and linking user subroutine $user on host `hostname`" + echo "program: $program" +- $FORTRAN $user.f || \ ++ $DFORTRANMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null +- userobj=$user.o ++ userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ +@@ -33,9 +42,12 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $BLAS \ + $SYSLIBS || \ + { +- echo "$0: link failed for $user.o on host `hostname`" ++ echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj ++ /bin/rm $DIRJOB/*.mod ++ /bin/rm $DIRJOB/*.smod diff --git a/install/MarcMentat/2020/Marc_tools/comp_user.original b/install/MarcMentat/2020/Marc_tools/comp_user.original deleted file mode 100644 index 8679bb041..000000000 --- a/install/MarcMentat/2020/Marc_tools/comp_user.original +++ /dev/null @@ -1,41 +0,0 @@ -#!/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/install/MarcMentat/2020/Marc_tools/include_linux64 b/install/MarcMentat/2020/Marc_tools/include_linux64 deleted file mode 100644 index 081042e84..000000000 --- a/install/MarcMentat/2020/Marc_tools/include_linux64 +++ /dev/null @@ -1,814 +0,0 @@ -# -# General definitions for the Marc 2020 version -# -# EM64T -# -# Linux RedHat 7.3 / SuSE 12 SP1 -# -# 64 bit MPI version -# -# Intel(R) Fortran Intel(R) 64 Compiler XE for applications -# running on Intel(R) 64, Version 19.0.4.243 Build 20190416 -# -# Intel(R) C Intel(R) 64 Compiler XE for applications -# running on Intel(R) 64, Version 19.0.4.243 Build 20190416 -# -# To check the O/S level, type: -# uname -a -# -# Distributed parallel MPI libraries: -# Intel MPI 2019 Update 4 -# To check the mpi version, type: -# mpiexec.hydra -version -# -# 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 -INTELPATH="/opt/intel/compilers_and_libraries_2019/linux" - -# find the root directory of the compiler installation: -# - if ifort is found in $PATH, then the root directory is derived -# from the path to ifort -# - if ifort is not found in $PATH, the root directory is assumed -# to be $INTELPATH and the directory in which ifort is found is -# added to $PATH -FCOMPPATH=`which "$FCOMP" 2>/dev/null` -if test -n "$FCOMPPATH"; then - # derive the root directory from $FCOMPPATH - FCOMPROOT="${FCOMPPATH%/bin/intel64/$FCOMP}" - if test "$FCOMPROOT" = "$FCOMPPATH"; then - FCOMPROOT="${FCOMPPATH%/bin/$FCOMP}" - fi - if test "$FCOMPROOT" = "$FCOMPPATH"; then - FCOMPROOT= - fi -elif test -d "$INTELPATH"; then - # check for compiler in $INTELPATH - if test -d "$INTELPATH/bin/intel64" -a \ - -x "$INTELPATH/bin/intel64/$FCOMP" ; then - FCOMPROOT="$INTELPATH" - PATH="$INTELPATH/bin/intel64:$PATH" - elif test -d "$INTELPATH/bin" -a \ - -x "$INTELPATH/bin/$FCOMP"; then - FCOMPROOT="$INTELPATH" - PATH="$INTELPATH/bin:$PATH" - else - FCOMPROOT= - fi -else - FCOMPROOT= -fi - -# DAMASK uses the HDF5 compiler wrapper around the Intel compiler -H5FC="$(h5fc -shlib -show)" -HDF5_LIB=${H5FC//ifort/} -FCOMP="$H5FC -DDAMASK_HDF5" - -# AEM -if test "$MARCDLLOUTDIR" = ""; then - DLLOUTDIR="$MARC_LIB" -else - DLLOUTDIR="$MARCDLLOUTDIR" -fi - -# settings for MKL -if test "$IMKLDIR" = ""; then - MARC_MKL="$FCOMPROOT/mkl/lib/intel64" -else - MARC_MKL=$IMKLDIR/lib/intel64 -fi - -# -# settings for Metis -# -METIS="-I$METIS_SOURCE/include" -METISLIBS="$METISLIB_DIR/libmarcddm.a $METISLIB_DIR/libmarcmetis.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= - -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 - -# Edit following lines to build solver 2 with GPU support -SOLVER2GPU=GPU -#SOLVER2GPU=NONE - -# Edit following lines to set the openssl library -if test "$OPENSSL" != "NONE" -then - OPENSSL_LIB="$MARC_LIB/libcrypto.a" -fi -OPENSSL_INCLUDE=-I"$MARC_OPENSSL/include/" - -MARCHDF_HDF=HDF -#MARCHDF_HDF=NONE - -# activate contact component build if flagged -AEM_DLL=0 -if test "$AEM_BUILD" = "ON" ; then - AEM_DLL=1 - LINK_MARC_DLL="-shared -fPIC" - EXT_DLL="so" - MPITYPE=none - MPI_OTHER= - MARCHDF_HDF=NONE - BCSGPUSOLVER=NONE - SOLVER2GPU=NONE - MUMPSSOLVER=NONE - CASISOLVER=NONE -fi - -if test "$MARCHDF_HDF" = "HDF"; then - HDF_INCLUDE="-I$MARC_HDF/include" - HDF_LIBS="$MARC_LIB/libhdf5_fortran.so.100 $MARC_LIB/libhdf5.so.103" -fi - -SOLVERFLAGS= -if test "$BCSGPUSOLVER" = BCSGPU -then - SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" - BCS_DIR=bcsgpusolver -else - BCS_DIR=bcssolver -fi -# -# settings for MPI -# -DDM= -if test $MPITYPE != none -then - if test $MPITYPE = intelmpi - then - INTELMPI_VERSION=HYDRA - FCOMPMPI=mpiifort - if test -n "$MARC_INTELMPI" ; then - MPI_ROOT=$MARC_INTELMPI - else - MPI_ROOT=/opt/intel/compilers_and_libraries_2019/linux/mpi/intel64 - MARC_INTELMPI=$MPI_ROOT - fi - DDM="-I${MPI_ROOT}/include -DDDM" - PATH=$MPI_ROOT/bin:$PATH - export PATH - LD_LIBRARY_PATH=$MPI_ROOT/lib:$MPI_ROOT/lib/release:$MPI_ROOT/libfabric/lib:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - if test $INTELMPI_VERSION = HYDRA - then - RUN_JOB1="${MPI_ROOT}/bin/mpiexec.hydra -genvall -n " - RUN_JOB2="${MPI_ROOT}/bin/mpiexec.hydra -genvall" - else - RUN_JOB1="${MPI_ROOT}/bin/mpiexec -n " - RUN_JOB2="${MPI_ROOT}/bin/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 - FI_PROVIDER_PATH=$MPI_ROOT/libfabric/lib/prov - export FI_PROVIDER_PATH - 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 -if test "$MARC_CASISOLVER" = "NONE" ; then - CASISOLVER=NONE -fi -#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 - SOLVER2GPU=NONE - MARC_DLL=NONE -fi -if test "$AEM_DLL" -eq 1 -then - VKISOLVER=NONE - CASISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - MUMPSSOLVER=NONE - BCSGPUSOLVER=NONE - SOLVER2GPU=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 - -if test "$SOLVER2GPU" = GPU -then - SOLVERFLAGS="$SOLVERFLAGS -DSOLVER2GPU" -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" - -MARCCODEPROF= -#MARCCODEPROF="ON" - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - I8FFLAGS= - I8DEFINES= - I8CDEFINES= -else - I8FFLAGS="-i8 -integer-size 64" - I8DEFINES="-DI64 -DINT=8" - I8CDEFINES="-U_DOUBLE -D_SINGLE" -fi - -MTHREAD=OPENMP -if test "$MARC_OPENMP" = "NONE" ; then - MTHREAD=NONE -fi -#MTHREAD=NONE -if test "$_OEM_NASTRAN" -ne 0 -then -MTHREAD=NONE -fi -if test "$AEM_DLL" -eq 1 -then - MTHREAD=NONE - CASISOLVER=NONE - VKISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - BCSGPUSOLVER=NONE - SOLVER2GPU=NONE - OPENSSL_LIB= - MARC_DLL=NONE - METISLIBS= -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 $MARC_SIMUFACT" -CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES" - -if test "$AEM_DLL" -eq 1 -then - FDEFINES="$FDEFINES -D_AEMNL -DAAA" - CDEFINES="$CDEFINES -D_AEMNL -DAAA" -fi - -CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS -I$LAPI_IMPORTS/common/include" -if test "$_OEM_NASTRAN" -ne 0 -then - CINCL="$CINCL -I../../include" -fi - -CC_OPT= -if test "$MTHREAD" = "OPENMP" -then - CC_OPT=" $CC_OPT -qopenmp" -fi - -CC="icc -c $CC_OPT -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " -CCLOW="icc -c $CC_OPT -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " -CCHIGH="icc -c $CC_OPT -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " - -if test "$MARCDEBUG" = "ON" -then - CC="icc -c $CC_OPT -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " - CCLOW="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " - CCHIGH="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " -fi - -LOAD_CC="icc $CC_OPT -O1 -DLinux -DLINUX -DLinux_intel" -CCT="$CC" -CCTLOW="$CCLOW" -CCTHIGH="$CCHIGH" - -#PROFILE="-Mprof=func" -#PROFILE="-Mprof=lines" -#PROFILE="-Mprof=func,mpi" -PROFILE= -#PROFILE="-init=snan,arrays -CB -traceback -fpe0 -fp-stack-check -check all -check uninit -ftrapuv" -if test "$MARCCODECOV" = "ON" -then -PROFILE="-prof-gen=srcpos" -fi -if test "$MARCCODEPROF" = "ON" -then -PROFILE=" $PROFILE -pg" -fi - -FORT_OPT="-c -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr -mp1 -WB -fp-model source" -if test "$MTHREAD" = "OPENMP" -then - FORT_OPT=" $FORT_OPT -qopenmp" - if test "$OMP_COMPAT" = "YES" - then - FORT_OPT=" $FORT_OPT -qopenmp-threadprivate=compat" - fi -else -# FORT_OPT=" $FORT_OPT -auto " - FORT_OPT=" $FORT_OPT -save -zero" -fi -if test "$MARCHDF_HDF" = "HDF"; then - FORT_OPT="$FORT_OPT -DMARCHDF=$MARCHDF_HDF" -fi - -FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" -FORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" -FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" -FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" -# for compiling free form f90 files. high opt, integer(4) -FORTF90="$FCOMP -c -O3" - -# determine DAMASK version -if test -n "$DAMASK_USER"; then - DAMASKROOT=`dirname $DAMASK_USER`/.. - read DAMASKVERSION < $DAMASKROOT/VERSION - DAMASKVERSION="'"$DAMASKVERSION"'" -else - DAMASKVERSION="'N/A'" -fi - - -# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3 -DFORTLOWMP="$FCOMP -c -O0 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ - -qopenmp -qopenmp-threadprivate=compat\ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" -DFORTRANMP="$FCOMP -c -O1 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ - -qopenmp -qopenmp-threadprivate=compat\ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" -DFORTHIGHMP="$FCOMP -c -O3 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ - -qopenmp -qopenmp-threadprivate=compat\ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" - -if test "$MARCDEBUG" = "ON" -then - FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" - FORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" - FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" - FORTNA="$FCOMP $FORT_OPT -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_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" - -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/include -I$VT_ROOT/include" -# LOAD="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# LOADT="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# fi - if test $MPITYPE = intelmpi - then - LOAD="ifort $PROFILE $LINK_OPT -o " - LOADT="ifort $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" - 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 - -if test "$AEM_DLL" -eq 1 -then - FORTLOW="$FORTLOW -fpp -fPIC" - FORTRAN="$FORTRAN -fpp -fPIC" - FORTHIGH="$FORTHIGH -fpp -fPIC" - FORTRANMNF="$FORTRANMNF -fpp -fPIC" - CC="$CC -fPIC" - CCMNF="$CCMNF -fPIC" - LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide" - 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="$CASILIB_DIR/libmarccasi.a $CASILIB_DIR/libcasi.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 "$MUMPSSOLVER" = MUMPS -then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps.a" - if test $MPITYPE = none - then - MUMPSSOLVERLIBS2= - echo hello > /dev/null - fi - if test $MPITYPE = intelmpi - then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.a" - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_lp64.a " - else - MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a " - fi - fi - if test $MPITYPE = hpmpi - then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_hpmpi.a" - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_lp64.a" - else - MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a" - 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 -else - BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " -fi - -SOLVER2LIBS= -if test "$SOLVER2GPU" = GPU -then - SOLVER2LIBS="-L$MARC_LIB/cuda_dummy -lsolver2gpu" -fi - -if test "$AEM_DLL" -eq 1 -then - BCSSOLVERLIBS= -fi - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a $MARC_MKL/libmkl_blacs_intelmpi_lp64.a $MUMPSSOLVERLIBS2 -Wl,--end-group" -else - MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a $MUMPSSOLVERLIBS2 -Wl,--end-group" -fi - -SECLIBS="-L$MARC_LIB -llapi" - -SOLVERLIBS="${BCSSOLVERLIBS} ${VKISOLVERLIBS} ${CASISOLVERLIBS} ${MF2SOLVERLIBS} \ - $MKLLIB -L$MARC_MKL -liomp5 \ - $MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a $KDTREE2_LIB/libkdtree2.a $HDF5_LIB $SOLVER2LIBS" - -SOLVERLIBS_DLL=${SOLVERLIBS} -if test "$AEM_DLL" -eq 1 -then -SOLVERLIBS_DLL="$MKLLIB -L$MARC_MKL -liomp5 $MARC_LIB/blas_src.a" -fi -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" -if test "X$MARC_SIMUFACT" != "X" -then - SFLIB="-L$SFMATDIR -lMBA_Grain" -else - SFLIB=" " -fi -OPENMP="-qopenmp" - -if test "$AEM_DLL" -eq 1 -then - LOAD_DLL=$LOAD - OPENMP= - LIBMNF= - OPENSSL=NONE -fi - -SYSLIBS=" $OPENMP -lpthread -cxxlib" - -# 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}/lib/release -lmpi -L${MPI_ROOT}/lib -lmpifort -lrt $OPENMP -threads -lpthread -cxxlib" -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 cosim_begin.f" -if test "$MARC_INTEGER_SIZE" = "i8" ; then - LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" -fi - -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 dpsmsah.f tpsmsah.f cn_qsort4_11.f \ - prei11.f prei12.f prei31.f prei32.f prei41.f prei42.f prei61.f prei62.f \ - prei1n.f prei2n.f cgfullnts1.f cgfullnts2.f cg1n.f cg2n.f cg3n.f \ - cg4n.f cg5n.f cg6n.f cgnn.f sortab.f sortab1.f triann1.f preinv_nts.f \ - cn_sur_patchl.f cn_quad_3e.f" - - - -MAXNUM=1000000 diff --git a/install/MarcMentat/2020/Marc_tools/include_linux64.original b/install/MarcMentat/2020/Marc_tools/include_linux64.original deleted file mode 100644 index 82cac9991..000000000 --- a/install/MarcMentat/2020/Marc_tools/include_linux64.original +++ /dev/null @@ -1,785 +0,0 @@ -# -# General definitions for the Marc 2020 version -# -# EM64T -# -# Linux RedHat 7.3 / SuSE 12 SP1 -# -# 64 bit MPI version -# -# Intel(R) Fortran Intel(R) 64 Compiler XE for applications -# running on Intel(R) 64, Version 19.0.4.243 Build 20190416 -# -# Intel(R) C Intel(R) 64 Compiler XE for applications -# running on Intel(R) 64, Version 19.0.4.243 Build 20190416 -# -# To check the O/S level, type: -# uname -a -# -# Distributed parallel MPI libraries: -# Intel MPI 2019 Update 4 -# To check the mpi version, type: -# mpiexec.hydra -version -# -# 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 -INTELPATH="/opt/intel/compilers_and_libraries_2019/linux" - -# find the root directory of the compiler installation: -# - if ifort is found in $PATH, then the root directory is derived -# from the path to ifort -# - if ifort is not found in $PATH, the root directory is assumed -# to be $INTELPATH and the directory in which ifort is found is -# added to $PATH -FCOMPPATH=`which "$FCOMP" 2>/dev/null` -if test -n "$FCOMPPATH"; then - # derive the root directory from $FCOMPPATH - FCOMPROOT="${FCOMPPATH%/bin/intel64/$FCOMP}" - if test "$FCOMPROOT" = "$FCOMPPATH"; then - FCOMPROOT="${FCOMPPATH%/bin/$FCOMP}" - fi - if test "$FCOMPROOT" = "$FCOMPPATH"; then - FCOMPROOT= - fi -elif test -d "$INTELPATH"; then - # check for compiler in $INTELPATH - if test -d "$INTELPATH/bin/intel64" -a \ - -x "$INTELPATH/bin/intel64/$FCOMP" ; then - FCOMPROOT="$INTELPATH" - PATH="$INTELPATH/bin/intel64:$PATH" - elif test -d "$INTELPATH/bin" -a \ - -x "$INTELPATH/bin/$FCOMP"; then - FCOMPROOT="$INTELPATH" - PATH="$INTELPATH/bin:$PATH" - else - FCOMPROOT= - fi -else - FCOMPROOT= -fi - -# AEM -if test "$MARCDLLOUTDIR" = ""; then - DLLOUTDIR="$MARC_LIB" -else - DLLOUTDIR="$MARCDLLOUTDIR" -fi - -# settings for MKL -if test "$IMKLDIR" = ""; then - MARC_MKL="$FCOMPROOT/mkl/lib/intel64" -else - MARC_MKL=$IMKLDIR/lib/intel64 -fi - -# -# settings for Metis -# -METIS="-I$METIS_SOURCE/include" -METISLIBS="$METISLIB_DIR/libmarcddm.a $METISLIB_DIR/libmarcmetis.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= - -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 - -# Edit following lines to build solver 2 with GPU support -SOLVER2GPU=GPU -#SOLVER2GPU=NONE - -# Edit following lines to set the openssl library -if test "$OPENSSL" != "NONE" -then - OPENSSL_LIB="$MARC_LIB/libcrypto.a" -fi -OPENSSL_INCLUDE=-I"$MARC_OPENSSL/include/" - -MARCHDF_HDF=HDF -#MARCHDF_HDF=NONE - -# activate contact component build if flagged -AEM_DLL=0 -if test "$AEM_BUILD" = "ON" ; then - AEM_DLL=1 - LINK_MARC_DLL="-shared -fPIC" - EXT_DLL="so" - MPITYPE=none - MPI_OTHER= - MARCHDF_HDF=NONE - BCSGPUSOLVER=NONE - SOLVER2GPU=NONE - MUMPSSOLVER=NONE - CASISOLVER=NONE -fi - -if test "$MARCHDF_HDF" = "HDF"; then - HDF_INCLUDE="-I$MARC_HDF/include" - HDF_LIBS="$MARC_LIB/libhdf5_fortran.so.100 $MARC_LIB/libhdf5.so.103" -fi - -SOLVERFLAGS= -if test "$BCSGPUSOLVER" = BCSGPU -then - SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" - BCS_DIR=bcsgpusolver -else - BCS_DIR=bcssolver -fi -# -# settings for MPI -# -DDM= -if test $MPITYPE != none -then - if test $MPITYPE = intelmpi - then - INTELMPI_VERSION=HYDRA - FCOMPMPI=mpiifort - if test -n "$MARC_INTELMPI" ; then - MPI_ROOT=$MARC_INTELMPI - else - MPI_ROOT=/opt/intel/compilers_and_libraries_2019/linux/mpi/intel64 - MARC_INTELMPI=$MPI_ROOT - fi - DDM="-I${MPI_ROOT}/include -DDDM" - PATH=$MPI_ROOT/bin:$PATH - export PATH - LD_LIBRARY_PATH=$MPI_ROOT/lib:$MPI_ROOT/lib/release:$MPI_ROOT/libfabric/lib:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - if test $INTELMPI_VERSION = HYDRA - then - RUN_JOB1="${MPI_ROOT}/bin/mpiexec.hydra -genvall -n " - RUN_JOB2="${MPI_ROOT}/bin/mpiexec.hydra -genvall" - else - RUN_JOB1="${MPI_ROOT}/bin/mpiexec -n " - RUN_JOB2="${MPI_ROOT}/bin/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 - FI_PROVIDER_PATH=$MPI_ROOT/libfabric/lib/prov - export FI_PROVIDER_PATH - 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 -if test "$MARC_CASISOLVER" = "NONE" ; then - CASISOLVER=NONE -fi -#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 - SOLVER2GPU=NONE - MARC_DLL=NONE -fi -if test "$AEM_DLL" -eq 1 -then - VKISOLVER=NONE - CASISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - MUMPSSOLVER=NONE - BCSGPUSOLVER=NONE - SOLVER2GPU=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 - -if test "$SOLVER2GPU" = GPU -then - SOLVERFLAGS="$SOLVERFLAGS -DSOLVER2GPU" -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" - -MARCCODEPROF= -#MARCCODEPROF="ON" - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - I8FFLAGS= - I8DEFINES= - I8CDEFINES= -else - I8FFLAGS="-i8" - I8DEFINES="-DI64" - I8CDEFINES="-U_DOUBLE -D_SINGLE" -fi - -MTHREAD=OPENMP -if test "$MARC_OPENMP" = "NONE" ; then - MTHREAD=NONE -fi -#MTHREAD=NONE -if test "$_OEM_NASTRAN" -ne 0 -then -MTHREAD=NONE -fi -if test "$AEM_DLL" -eq 1 -then - MTHREAD=NONE - CASISOLVER=NONE - VKISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - BCSGPUSOLVER=NONE - SOLVER2GPU=NONE - OPENSSL_LIB= - MARC_DLL=NONE - METISLIBS= -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 $MARC_SIMUFACT" -CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES" - -if test "$AEM_DLL" -eq 1 -then - FDEFINES="$FDEFINES -D_AEMNL -DAAA" - CDEFINES="$CDEFINES -D_AEMNL -DAAA" -fi - -CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS -I$LAPI_IMPORTS/common/include" -if test "$_OEM_NASTRAN" -ne 0 -then - CINCL="$CINCL -I../../include" -fi - -CC_OPT= -if test "$MTHREAD" = "OPENMP" -then - CC_OPT=" $CC_OPT -qopenmp" -fi - -CC="icc -c $CC_OPT -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " -CCLOW="icc -c $CC_OPT -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " -CCHIGH="icc -c $CC_OPT -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " - -if test "$MARCDEBUG" = "ON" -then - CC="icc -c $CC_OPT -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " - CCLOW="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " - CCHIGH="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " -fi - -LOAD_CC="icc $CC_OPT -O1 -DLinux -DLINUX -DLinux_intel" -CCT="$CC" -CCTLOW="$CCLOW" -CCTHIGH="$CCHIGH" - -#PROFILE="-Mprof=func" -#PROFILE="-Mprof=lines" -#PROFILE="-Mprof=func,mpi" -PROFILE= -#PROFILE="-init=snan,arrays -CB -traceback -fpe0 -fp-stack-check -check all -check uninit -ftrapuv" -if test "$MARCCODECOV" = "ON" -then -PROFILE="-prof-gen=srcpos" -fi -if test "$MARCCODEPROF" = "ON" -then -PROFILE=" $PROFILE -pg" -fi - -FORT_OPT="-c -assume byterecl -safe_cray_ptr -mp1 -WB -fp-model source" -if test "$MTHREAD" = "OPENMP" -then - FORT_OPT=" $FORT_OPT -qopenmp" - if test "$OMP_COMPAT" = "YES" - then - FORT_OPT=" $FORT_OPT -qopenmp-threadprivate=compat" - fi -else -# FORT_OPT=" $FORT_OPT -auto " - FORT_OPT=" $FORT_OPT -save -zero" -fi -if test "$MARCHDF_HDF" = "HDF"; then - FORT_OPT="$FORT_OPT -DMARCHDF_HDF=$MARCHDF_HDF $HDF_INCLUDE" -fi - -FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" -FORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" -FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" -FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" -# for compiling free form f90 files. high opt, integer(4) -FORTF90="$FCOMP -c -O3" - -if test "$MARCDEBUG" = "ON" -then - FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" - FORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" - FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" - FORTNA="$FCOMP $FORT_OPT -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_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" - -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/include -I$VT_ROOT/include" -# LOAD="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# LOADT="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# fi - if test $MPITYPE = intelmpi - then - LOAD="ifort $PROFILE $LINK_OPT -o " - LOADT="ifort $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" - 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 - -if test "$AEM_DLL" -eq 1 -then - FORTLOW="$FORTLOW -fpp -fPIC" - FORTRAN="$FORTRAN -fpp -fPIC" - FORTHIGH="$FORTHIGH -fpp -fPIC" - FORTRANMNF="$FORTRANMNF -fpp -fPIC" - CC="$CC -fPIC" - CCMNF="$CCMNF -fPIC" - LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide" - 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="$CASILIB_DIR/libmarccasi.a $CASILIB_DIR/libcasi.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 "$MUMPSSOLVER" = MUMPS -then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps.a" - if test $MPITYPE = none - then - MUMPSSOLVERLIBS2= - echo hello > /dev/null - fi - if test $MPITYPE = intelmpi - then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.a" - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_lp64.a " - else - MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a " - fi - fi - if test $MPITYPE = hpmpi - then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_hpmpi.a" - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_lp64.a" - else - MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a" - 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 -else - BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " -fi - -SOLVER2LIBS= -if test "$SOLVER2GPU" = GPU -then - SOLVER2LIBS="-L$MARC_LIB/cuda_dummy -lsolver2gpu" -fi - -if test "$AEM_DLL" -eq 1 -then - BCSSOLVERLIBS= -fi - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a $MUMPSSOLVERLIBS2 -Wl,--end-group" -else - MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a $MUMPSSOLVERLIBS2 -Wl,--end-group" -fi - -SECLIBS="-L$MARC_LIB -llapi" - -SOLVERLIBS="${BCSSOLVERLIBS} ${VKISOLVERLIBS} ${CASISOLVERLIBS} ${MF2SOLVERLIBS} \ - $MKLLIB -L$MARC_MKL -liomp5 \ - $MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a $KDTREE2_LIB/libkdtree2.a $HDF_LIBS $SOLVER2LIBS" - -SOLVERLIBS_DLL=${SOLVERLIBS} -if test "$AEM_DLL" -eq 1 -then -SOLVERLIBS_DLL="$MKLLIB -L$MARC_MKL -liomp5 $MARC_LIB/blas_src.a" -fi -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" -if test "X$MARC_SIMUFACT" != "X" -then - SFLIB="-L$SFMATDIR -lMBA_Grain" -else - SFLIB=" " -fi -OPENMP="-qopenmp" - -if test "$AEM_DLL" -eq 1 -then - LOAD_DLL=$LOAD - OPENMP= - LIBMNF= - OPENSSL=NONE -fi - -SYSLIBS=" $OPENMP -lpthread -shared-intel -cxxlib" - -# 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}/lib/release -lmpi -L${MPI_ROOT}/lib -lmpifort -lrt $OPENMP -threads -lpthread -shared-intel -cxxlib" -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 cosim_begin.f" -if test "$MARC_INTEGER_SIZE" = "i8" ; then - LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" -fi - -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 dpsmsah.f tpsmsah.f cn_qsort4_11.f \ - prei11.f prei12.f prei31.f prei32.f prei41.f prei42.f prei61.f prei62.f \ - prei1n.f prei2n.f cgfullnts1.f cgfullnts2.f cg1n.f cg2n.f cg3n.f \ - cg4n.f cg5n.f cg6n.f cgnn.f sortab.f sortab1.f triann1.f preinv_nts.f \ - cn_sur_patchl.f cn_quad_3e.f" - - - -MAXNUM=1000000 diff --git a/install/MarcMentat/2020/Marc_tools/include_linux64.patch b/install/MarcMentat/2020/Marc_tools/include_linux64.patch new file mode 100644 index 000000000..c28b41b9e --- /dev/null +++ b/install/MarcMentat/2020/Marc_tools/include_linux64.patch @@ -0,0 +1,113 @@ +--- ++++ +@@ -95,6 +95,11 @@ + else + FCOMPROOT= + fi ++ ++# DAMASK uses the HDF5 compiler wrapper around the Intel compiler ++H5FC="$(h5fc -shlib -show)" ++HDF5_LIB=${H5FC//ifort/} ++FCOMP="$H5FC -DDAMASK_HDF5" + + # AEM + if test "$MARCDLLOUTDIR" = ""; then +@@ -390,8 +395,8 @@ + I8DEFINES= + I8CDEFINES= + else +- I8FFLAGS="-i8" +- I8DEFINES="-DI64" ++ I8FFLAGS="-i8 -integer-size 64" ++ I8DEFINES="-DI64 -DINT=8" + I8CDEFINES="-U_DOUBLE -D_SINGLE" + fi + +@@ -498,7 +503,7 @@ + PROFILE=" $PROFILE -pg" + fi + +-FORT_OPT="-c -assume byterecl -safe_cray_ptr -mp1 -WB -fp-model source" ++FORT_OPT="-c -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr -mp1 -WB -fp-model source" + if test "$MTHREAD" = "OPENMP" + then + FORT_OPT=" $FORT_OPT -qopenmp" +@@ -511,7 +516,7 @@ + FORT_OPT=" $FORT_OPT -save -zero" + fi + if test "$MARCHDF_HDF" = "HDF"; then +- FORT_OPT="$FORT_OPT -DMARCHDF_HDF=$MARCHDF_HDF $HDF_INCLUDE" ++ FORT_OPT="$FORT_OPT -DMARCHDF=$MARCHDF_HDF" + fi + + FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ +@@ -524,6 +529,30 @@ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" + # for compiling free form f90 files. high opt, integer(4) + FORTF90="$FCOMP -c -O3" ++ ++# determine DAMASK version ++if test -n "$DAMASK_USER"; then ++ DAMASKROOT=`dirname $DAMASK_USER`/.. ++ read DAMASKVERSION < $DAMASKROOT/VERSION ++ DAMASKVERSION="'"$DAMASKVERSION"'" ++else ++ DAMASKVERSION="'N/A'" ++fi ++ ++ ++# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3 ++DFORTLOWMP="$FCOMP -c -O0 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -qopenmp -qopenmp-threadprivate=compat\ ++ $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" ++DFORTRANMP="$FCOMP -c -O1 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -qopenmp -qopenmp-threadprivate=compat\ ++ $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" ++DFORTHIGHMP="$FCOMP -c -O3 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -qopenmp -qopenmp-threadprivate=compat\ ++ $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD" + + if test "$MARCDEBUG" = "ON" + then +@@ -697,16 +726,16 @@ + fi + + if test "$MARC_INTEGER_SIZE" = "i4" ; then +- MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a $MUMPSSOLVERLIBS2 -Wl,--end-group" +-else +- MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a $MUMPSSOLVERLIBS2 -Wl,--end-group" ++ MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a $MARC_MKL/libmkl_blacs_intelmpi_lp64.a $MUMPSSOLVERLIBS2 -Wl,--end-group" ++else ++ MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a $MUMPSSOLVERLIBS2 -Wl,--end-group" + fi + + SECLIBS="-L$MARC_LIB -llapi" + + SOLVERLIBS="${BCSSOLVERLIBS} ${VKISOLVERLIBS} ${CASISOLVERLIBS} ${MF2SOLVERLIBS} \ + $MKLLIB -L$MARC_MKL -liomp5 \ +- $MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a $KDTREE2_LIB/libkdtree2.a $HDF_LIBS $SOLVER2LIBS" ++ $MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a $KDTREE2_LIB/libkdtree2.a $HDF5_LIB $SOLVER2LIBS" + + SOLVERLIBS_DLL=${SOLVERLIBS} + if test "$AEM_DLL" -eq 1 +@@ -734,7 +763,7 @@ + OPENSSL=NONE + fi + +-SYSLIBS=" $OPENMP -lpthread -shared-intel -cxxlib" ++SYSLIBS=" $OPENMP -lpthread -cxxlib" + + # Uncomment the following lines to turn on the trace and comment out the next 4 lines + # if test $MPITYPE = intelmpi +@@ -744,7 +773,7 @@ + # fi + if test $MPITYPE = intelmpi + then +- SYSLIBS="-L${MPI_ROOT}/lib/release -lmpi -L${MPI_ROOT}/lib -lmpifort -lrt $OPENMP -threads -lpthread -shared-intel -cxxlib" ++ SYSLIBS="-L${MPI_ROOT}/lib/release -lmpi -L${MPI_ROOT}/lib -lmpifort -lrt $OPENMP -threads -lpthread -cxxlib" + fi + + diff --git a/install/MarcMentat/2020/Marc_tools/run_damask_hmp b/install/MarcMentat/2020/Marc_tools/run_damask_hmp deleted file mode 100644 index 2b7641304..000000000 --- a/install/MarcMentat/2020/Marc_tools/run_damask_hmp +++ /dev/null @@ -1,4130 +0,0 @@ -#!/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 # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo This option is deprecated. As of Marc 2015, only # -# the integer*8 version is available. # -# -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= -modeerror= -modeoption= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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 $1}}' $HOME/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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) - modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - modeoption=error - echo $modeerror - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i8" - echo " " - echo " use -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - echo - echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available - echo - 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 - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - 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" - - -# getting user subroutine file name -found=0 -for i in "$@"; do - if test $found = 1; then - DAMASK_USER=$i - found=0 - fi - case $i in - -u* | -U*) - found=1 - ;; - esac -done -# sourcing include_linux64 (needs DAMASK_USER to be set) -. $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 -export MESHERDIR -MSC_LICENSE_FINPROC=0 -export MSC_LICENSE_FINPROC -# -# 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:$SFMATDIR -if test -f "/etc/redhat-release"; then - ver=`cat /etc/redhat-release | sed 's/.* release \([0-9]\).\([0-9]\+\) .*/\1\2/'` - case "$ver" in - 6*) LD_LIBRARY_PATH="${MARC_LIB_SHARED}rh67:$LD_LIBRARY_PATH" ;; - esac -fi -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$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= -oversubscribe=false -gpuids= -nauto= -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -ddm_arc=0 -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 -iprintsimufact= -SRCLIB=$MARC_LIB/srclib.a -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_OTHER $MPI_DEFAULT" - 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="$MUMPSLIB_DIR/libmumps_$value.a" - 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 - case $value in - sfg | sfm | sim) - iprintsimufact=true - ;; - esac - ;; - -au* | -AU*) - nauto=$value - echo - echo warning: the option -au is no longer supported and will be ignored - echo - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -ddm | -DDM) - ddm_arc=$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="$MUMPSLIB_DIR/libmumps_$value.a" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.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 - -# oversubscribe case -if test $nprocd -gt $(/usr/bin/nproc); then - if test "$ALLOWMPIOVERSUBSCRIBE" != "true"; then - error="$error - The requested number of domains ($nprocd) is larger than the number - of processors ($(/usr/bin/nproc)). As such an oversubscription may result in - very poor performance, the analysis will not be started. - Running an analysis in case of oversubscription can be forced - by defining an environment variable \"ALLOWMPIOVERSUBSCRIBE\" - with the value \"true\"." - oversubscribe=true - 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 - -nsolverprint=$nsolver -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 "$iam" = sim ; then - SFLIB="-L$SFMATDIR -lMBA_Grain" -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 $MPI_DEFAULT)" - 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 "$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 - if test "$user" - then -# allow user sub without giving job id - qid=foreground - verify=no - else - error="$error -job id required" -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 - -############################################################################## -# 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 \ -" -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" > $jid.log -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log -fi -echo \ -"Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit" >> $jid.log -deletelog=no -fi -echo \ -" -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" -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" -fi -echo \ -"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" - - -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 "$modeoption" -then - error=$modeerror -fi - -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 -# Update print variable for -nsolver option - nsolverprint=$nsolver - if test $nsolver -eq 0 - then - nsolverprint= - fi - $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 "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) - if test "$deletelog" = no -a $oversubscribe = true - then - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - 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 - if test "$jid" - then - /bin/rm $jid.log 2>/dev/null - fi -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 -a "$jid" - -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 DAMASK options for linking - DAMASK="-lstdc++" - - 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. " - 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. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - 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 -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 $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 $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(" -host %s",$1); \ - printf(" -n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) printf(" -wdir %s ",$3); \ - 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 ) printf(" -wdir %s ",$3); \ - 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 - - -# -# check for external file to run using valgrind -# -if test -f $MARC_TOOLS/run_marc_valgrind -then - . $MARC_TOOLS/run_marc_valgrind -fi - - -############################################################################## -# 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 2>/dev/null -# done if no job id given -if test -z "$jid" -then - echo - echo only compilation requested - echo - exit -fi -# -# 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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 2>/dev/null -fi - - -fi -fi diff --git a/install/MarcMentat/2020/Marc_tools/run_damask_hmp.patch b/install/MarcMentat/2020/Marc_tools/run_damask_hmp.patch new file mode 100644 index 000000000..0d1be0c8a --- /dev/null +++ b/install/MarcMentat/2020/Marc_tools/run_damask_hmp.patch @@ -0,0 +1,662 @@ +--- ++++ +@@ -298,7 +298,23 @@ + + . "$DIR/getarch" + ++ ++# getting user subroutine file name ++found=0 ++for i in "$@"; do ++ if test $found = 1; then ++ DAMASK_USER=$i ++ found=0 ++ fi ++ case $i in ++ -u* | -U*) ++ found=1 ++ ;; ++ esac ++done ++# sourcing include_linux64 (needs DAMASK_USER to be set) + . $MARC_INCLUDE ++ + # + + # +@@ -399,7 +415,7 @@ + did= + vid= + user= +-usersubname= ++usernoext= + objs= + qid=background + cpu= +@@ -568,7 +584,7 @@ + justlist=yes + ;; + -fe* | -FE*) +- feature=$value ++ feature=$value + + ;; + -pr* | -PR*) +@@ -664,50 +680,19 @@ + esac + ;; + -u* | -U*) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname + ;; + esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ 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" +@@ -1188,12 +1173,12 @@ + fi + fi + fi +- if test "$usersubname" ++ if test "$user" + then +- if test ! -f $usersubname ++ if test ! -f $user + then + error="$error +-user subroutine file $usersubname not accessible" ++user subroutine file $user not accessible" + fi + fi + if test "$objs" +@@ -1367,7 +1352,7 @@ + else + error="$error + job id required" +- fi ++fi + fi + + case $qid in +@@ -1508,7 +1493,7 @@ + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1540,7 +1525,7 @@ + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1663,7 +1648,7 @@ + ;; + esac + fi +- $ECHO "User subroutine name ($usersubname)? $ECHOTXT" ++ $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then +@@ -1672,50 +1657,19 @@ + user= + ;; + *) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in +- \/*) +- ;; +- *) ++ \/*) ++ ;; ++ *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname +- ;; +- esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ ;; ++ 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 +@@ -2256,11 +2210,12 @@ + # + # user subroutine used + # ++# add DAMASK options for linking ++ DAMASK="-lstdc++" + + if test "$user" + then +-# program=$user.marc +- program=$DIRJOB/`$BASENAME $user .f`.marc ++ program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= +@@ -2373,7 +2328,7 @@ + fi + if test "$user" + then +- execpath=$DIRJOB/`$BASENAME $user .f`.marc ++ execpath=$usernoext.marc + usersub=1 + fi + export execpath +@@ -3256,44 +3211,27 @@ + echo + 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 +- ++ userobj=$usermoext.o + 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 || \ ++ $DFORTHIGHMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTHIGHMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi + + +@@ -3313,7 +3251,8 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ + $SECLIBS || \ +@@ -3326,6 +3265,8 @@ + prgsav=yes + fi + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + + # + # run marc +@@ -3372,7 +3313,7 @@ + fi + else + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes +@@ -3538,7 +3479,7 @@ + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3551,21 +3492,21 @@ + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $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.f on host $i" ++ 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.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3575,39 +3516,27 @@ + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" ++ echo "Compiling and linking user subroutine $user 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 ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTHIGHMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTHIGHMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + 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 + + +@@ -3627,7 +3556,8 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ + $SECLIBS || \ +@@ -3668,6 +3598,8 @@ + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + + # + # run marc +@@ -3726,42 +3658,42 @@ + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ 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 +- 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 ++ DIR1=$workdir + fi +- done +- 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 + fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then +@@ -3886,7 +3818,7 @@ + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3899,20 +3831,20 @@ + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $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.f on host $i" ++ 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.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3922,37 +3854,25 @@ + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" ++ echo "Compiling and linking user subroutine $user 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 ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTHIGHMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTHIGHMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi # if test $user + + +@@ -3972,6 +3892,7 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +@@ -4012,7 +3933,8 @@ + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null +- ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + # done if no job id given + if test -z "$jid" + then +@@ -4052,7 +3974,7 @@ + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " + fi + +-$RUN_JOB ++ $RUN_JOB + + if test $nprocd -gt 1 + then +@@ -4096,42 +4018,42 @@ + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ 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 +- 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 ++ DIR1=$workdir + fi +- done +- 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 + fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then diff --git a/install/MarcMentat/2020/Marc_tools/run_damask_lmp b/install/MarcMentat/2020/Marc_tools/run_damask_lmp deleted file mode 100644 index cc6181325..000000000 --- a/install/MarcMentat/2020/Marc_tools/run_damask_lmp +++ /dev/null @@ -1,4130 +0,0 @@ -#!/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 # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo This option is deprecated. As of Marc 2015, only # -# the integer*8 version is available. # -# -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= -modeerror= -modeoption= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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 $1}}' $HOME/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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) - modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - modeoption=error - echo $modeerror - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i8" - echo " " - echo " use -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - echo - echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available - echo - 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 - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - 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" - - -# getting user subroutine file name -found=0 -for i in "$@"; do - if test $found = 1; then - DAMASK_USER=$i - found=0 - fi - case $i in - -u* | -U*) - found=1 - ;; - esac -done -# sourcing include_linux64 (needs DAMASK_USER to be set) -. $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 -export MESHERDIR -MSC_LICENSE_FINPROC=0 -export MSC_LICENSE_FINPROC -# -# 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:$SFMATDIR -if test -f "/etc/redhat-release"; then - ver=`cat /etc/redhat-release | sed 's/.* release \([0-9]\).\([0-9]\+\) .*/\1\2/'` - case "$ver" in - 6*) LD_LIBRARY_PATH="${MARC_LIB_SHARED}rh67:$LD_LIBRARY_PATH" ;; - esac -fi -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$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= -oversubscribe=false -gpuids= -nauto= -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -ddm_arc=0 -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 -iprintsimufact= -SRCLIB=$MARC_LIB/srclib.a -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_OTHER $MPI_DEFAULT" - 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="$MUMPSLIB_DIR/libmumps_$value.a" - 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 - case $value in - sfg | sfm | sim) - iprintsimufact=true - ;; - esac - ;; - -au* | -AU*) - nauto=$value - echo - echo warning: the option -au is no longer supported and will be ignored - echo - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -ddm | -DDM) - ddm_arc=$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="$MUMPSLIB_DIR/libmumps_$value.a" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.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 - -# oversubscribe case -if test $nprocd -gt $(/usr/bin/nproc); then - if test "$ALLOWMPIOVERSUBSCRIBE" != "true"; then - error="$error - The requested number of domains ($nprocd) is larger than the number - of processors ($(/usr/bin/nproc)). As such an oversubscription may result in - very poor performance, the analysis will not be started. - Running an analysis in case of oversubscription can be forced - by defining an environment variable \"ALLOWMPIOVERSUBSCRIBE\" - with the value \"true\"." - oversubscribe=true - 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 - -nsolverprint=$nsolver -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 "$iam" = sim ; then - SFLIB="-L$SFMATDIR -lMBA_Grain" -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 $MPI_DEFAULT)" - 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 "$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 - if test "$user" - then -# allow user sub without giving job id - qid=foreground - verify=no - else - error="$error -job id required" -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 - -############################################################################## -# 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 \ -" -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" > $jid.log -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log -fi -echo \ -"Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit" >> $jid.log -deletelog=no -fi -echo \ -" -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" -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" -fi -echo \ -"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" - - -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 "$modeoption" -then - error=$modeerror -fi - -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 -# Update print variable for -nsolver option - nsolverprint=$nsolver - if test $nsolver -eq 0 - then - nsolverprint= - fi - $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 "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) - if test "$deletelog" = no -a $oversubscribe = true - then - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - 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 - if test "$jid" - then - /bin/rm $jid.log 2>/dev/null - fi -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 -a "$jid" - -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 DAMASK options for linking - DAMASK="-lstdc++" - - 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. " - 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. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - 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 -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 $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 $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(" -host %s",$1); \ - printf(" -n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) printf(" -wdir %s ",$3); \ - 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 ) printf(" -wdir %s ",$3); \ - 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 - - -# -# check for external file to run using valgrind -# -if test -f $MARC_TOOLS/run_marc_valgrind -then - . $MARC_TOOLS/run_marc_valgrind -fi - - -############################################################################## -# 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 2>/dev/null -# done if no job id given -if test -z "$jid" -then - echo - echo only compilation requested - echo - exit -fi -# -# 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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 2>/dev/null -fi - - -fi -fi diff --git a/install/MarcMentat/2020/Marc_tools/run_damask_lmp.patch b/install/MarcMentat/2020/Marc_tools/run_damask_lmp.patch new file mode 100644 index 000000000..0960673de --- /dev/null +++ b/install/MarcMentat/2020/Marc_tools/run_damask_lmp.patch @@ -0,0 +1,662 @@ +--- ++++ +@@ -298,7 +298,23 @@ + + . "$DIR/getarch" + ++ ++# getting user subroutine file name ++found=0 ++for i in "$@"; do ++ if test $found = 1; then ++ DAMASK_USER=$i ++ found=0 ++ fi ++ case $i in ++ -u* | -U*) ++ found=1 ++ ;; ++ esac ++done ++# sourcing include_linux64 (needs DAMASK_USER to be set) + . $MARC_INCLUDE ++ + # + + # +@@ -399,7 +415,7 @@ + did= + vid= + user= +-usersubname= ++usernoext= + objs= + qid=background + cpu= +@@ -568,7 +584,7 @@ + justlist=yes + ;; + -fe* | -FE*) +- feature=$value ++ feature=$value + + ;; + -pr* | -PR*) +@@ -664,50 +680,19 @@ + esac + ;; + -u* | -U*) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname + ;; + esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ 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" +@@ -1188,12 +1173,12 @@ + fi + fi + fi +- if test "$usersubname" ++ if test "$user" + then +- if test ! -f $usersubname ++ if test ! -f $user + then + error="$error +-user subroutine file $usersubname not accessible" ++user subroutine file $user not accessible" + fi + fi + if test "$objs" +@@ -1367,7 +1352,7 @@ + else + error="$error + job id required" +- fi ++fi + fi + + case $qid in +@@ -1508,7 +1493,7 @@ + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1540,7 +1525,7 @@ + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1663,7 +1648,7 @@ + ;; + esac + fi +- $ECHO "User subroutine name ($usersubname)? $ECHOTXT" ++ $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then +@@ -1672,50 +1657,19 @@ + user= + ;; + *) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in +- \/*) +- ;; +- *) ++ \/*) ++ ;; ++ *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname +- ;; +- esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ ;; ++ 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 +@@ -2256,11 +2210,12 @@ + # + # user subroutine used + # ++# add DAMASK options for linking ++ DAMASK="-lstdc++" + + if test "$user" + then +-# program=$user.marc +- program=$DIRJOB/`$BASENAME $user .f`.marc ++ program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= +@@ -2373,7 +2328,7 @@ + fi + if test "$user" + then +- execpath=$DIRJOB/`$BASENAME $user .f`.marc ++ execpath=$usernoext.marc + usersub=1 + fi + export execpath +@@ -3256,44 +3211,27 @@ + echo + 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 +- ++ userobj=$usermoext.o + 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 || \ ++ $DFORTLOWMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTLOWMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi + + +@@ -3313,7 +3251,8 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ + $SECLIBS || \ +@@ -3326,6 +3265,8 @@ + prgsav=yes + fi + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + + # + # run marc +@@ -3372,7 +3313,7 @@ + fi + else + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes +@@ -3538,7 +3479,7 @@ + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3551,21 +3492,21 @@ + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $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.f on host $i" ++ 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.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3575,39 +3516,27 @@ + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" ++ echo "Compiling and linking user subroutine $user 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 ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTLOWMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTLOWMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + 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 + + +@@ -3627,7 +3556,8 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ + $SECLIBS || \ +@@ -3668,6 +3598,8 @@ + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + + # + # run marc +@@ -3726,42 +3658,42 @@ + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ 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 +- 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 ++ DIR1=$workdir + fi +- done +- 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 + fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then +@@ -3886,7 +3818,7 @@ + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3899,20 +3831,20 @@ + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $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.f on host $i" ++ 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.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3922,37 +3854,25 @@ + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" ++ echo "Compiling and linking user subroutine $user 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 ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTLOWMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTLOWMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi # if test $user + + +@@ -3972,6 +3892,7 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +@@ -4012,7 +3933,8 @@ + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null +- ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + # done if no job id given + if test -z "$jid" + then +@@ -4052,7 +3974,7 @@ + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " + fi + +-$RUN_JOB ++ $RUN_JOB + + if test $nprocd -gt 1 + then +@@ -4096,42 +4018,42 @@ + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ 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 +- 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 ++ DIR1=$workdir + fi +- done +- 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 + fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then diff --git a/install/MarcMentat/2020/Marc_tools/run_damask_mp b/install/MarcMentat/2020/Marc_tools/run_damask_mp deleted file mode 100644 index 2944bfe96..000000000 --- a/install/MarcMentat/2020/Marc_tools/run_damask_mp +++ /dev/null @@ -1,4130 +0,0 @@ -#!/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 # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo This option is deprecated. As of Marc 2015, only # -# the integer*8 version is available. # -# -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= -modeerror= -modeoption= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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 $1}}' $HOME/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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) - modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - modeoption=error - echo $modeerror - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i8" - echo " " - echo " use -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - echo - echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available - echo - 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 - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - 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" - - -# getting user subroutine file name -found=0 -for i in "$@"; do - if test $found = 1; then - DAMASK_USER=$i - found=0 - fi - case $i in - -u* | -U*) - found=1 - ;; - esac -done -# sourcing include_linux64 (needs DAMASK_USER to be set) -. $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 -export MESHERDIR -MSC_LICENSE_FINPROC=0 -export MSC_LICENSE_FINPROC -# -# 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:$SFMATDIR -if test -f "/etc/redhat-release"; then - ver=`cat /etc/redhat-release | sed 's/.* release \([0-9]\).\([0-9]\+\) .*/\1\2/'` - case "$ver" in - 6*) LD_LIBRARY_PATH="${MARC_LIB_SHARED}rh67:$LD_LIBRARY_PATH" ;; - esac -fi -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$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= -oversubscribe=false -gpuids= -nauto= -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -ddm_arc=0 -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 -iprintsimufact= -SRCLIB=$MARC_LIB/srclib.a -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_OTHER $MPI_DEFAULT" - 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="$MUMPSLIB_DIR/libmumps_$value.a" - 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 - case $value in - sfg | sfm | sim) - iprintsimufact=true - ;; - esac - ;; - -au* | -AU*) - nauto=$value - echo - echo warning: the option -au is no longer supported and will be ignored - echo - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -ddm | -DDM) - ddm_arc=$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="$MUMPSLIB_DIR/libmumps_$value.a" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.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 - -# oversubscribe case -if test $nprocd -gt $(/usr/bin/nproc); then - if test "$ALLOWMPIOVERSUBSCRIBE" != "true"; then - error="$error - The requested number of domains ($nprocd) is larger than the number - of processors ($(/usr/bin/nproc)). As such an oversubscription may result in - very poor performance, the analysis will not be started. - Running an analysis in case of oversubscription can be forced - by defining an environment variable \"ALLOWMPIOVERSUBSCRIBE\" - with the value \"true\"." - oversubscribe=true - 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 - -nsolverprint=$nsolver -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 "$iam" = sim ; then - SFLIB="-L$SFMATDIR -lMBA_Grain" -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 $MPI_DEFAULT)" - 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 "$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 - if test "$user" - then -# allow user sub without giving job id - qid=foreground - verify=no - else - error="$error -job id required" -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 - -############################################################################## -# 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 \ -" -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" > $jid.log -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log -fi -echo \ -"Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit" >> $jid.log -deletelog=no -fi -echo \ -" -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" -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" -fi -echo \ -"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" - - -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 "$modeoption" -then - error=$modeerror -fi - -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 -# Update print variable for -nsolver option - nsolverprint=$nsolver - if test $nsolver -eq 0 - then - nsolverprint= - fi - $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 "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) - if test "$deletelog" = no -a $oversubscribe = true - then - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - 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 - if test "$jid" - then - /bin/rm $jid.log 2>/dev/null - fi -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 -a "$jid" - -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 DAMASK options for linking - DAMASK="-lstdc++" - - 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. " - 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. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - 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 -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 $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 $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(" -host %s",$1); \ - printf(" -n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) printf(" -wdir %s ",$3); \ - 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 ) printf(" -wdir %s ",$3); \ - 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 - - -# -# check for external file to run using valgrind -# -if test -f $MARC_TOOLS/run_marc_valgrind -then - . $MARC_TOOLS/run_marc_valgrind -fi - - -############################################################################## -# 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 2>/dev/null -# done if no job id given -if test -z "$jid" -then - echo - echo only compilation requested - echo - exit -fi -# -# 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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 2>/dev/null -fi - - -fi -fi diff --git a/install/MarcMentat/2020/Marc_tools/run_damask_mp.patch b/install/MarcMentat/2020/Marc_tools/run_damask_mp.patch new file mode 100644 index 000000000..f8ef8bfb0 --- /dev/null +++ b/install/MarcMentat/2020/Marc_tools/run_damask_mp.patch @@ -0,0 +1,662 @@ +--- ++++ +@@ -298,7 +298,23 @@ + + . "$DIR/getarch" + ++ ++# getting user subroutine file name ++found=0 ++for i in "$@"; do ++ if test $found = 1; then ++ DAMASK_USER=$i ++ found=0 ++ fi ++ case $i in ++ -u* | -U*) ++ found=1 ++ ;; ++ esac ++done ++# sourcing include_linux64 (needs DAMASK_USER to be set) + . $MARC_INCLUDE ++ + # + + # +@@ -399,7 +415,7 @@ + did= + vid= + user= +-usersubname= ++usernoext= + objs= + qid=background + cpu= +@@ -568,7 +584,7 @@ + justlist=yes + ;; + -fe* | -FE*) +- feature=$value ++ feature=$value + + ;; + -pr* | -PR*) +@@ -664,50 +680,19 @@ + esac + ;; + -u* | -U*) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname + ;; + esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ 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" +@@ -1188,12 +1173,12 @@ + fi + fi + fi +- if test "$usersubname" ++ if test "$user" + then +- if test ! -f $usersubname ++ if test ! -f $user + then + error="$error +-user subroutine file $usersubname not accessible" ++user subroutine file $user not accessible" + fi + fi + if test "$objs" +@@ -1367,7 +1352,7 @@ + else + error="$error + job id required" +- fi ++fi + fi + + case $qid in +@@ -1508,7 +1493,7 @@ + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1540,7 +1525,7 @@ + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1663,7 +1648,7 @@ + ;; + esac + fi +- $ECHO "User subroutine name ($usersubname)? $ECHOTXT" ++ $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then +@@ -1672,50 +1657,19 @@ + user= + ;; + *) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in +- \/*) +- ;; +- *) ++ \/*) ++ ;; ++ *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname +- ;; +- esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ ;; ++ 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 +@@ -2256,11 +2210,12 @@ + # + # user subroutine used + # ++# add DAMASK options for linking ++ DAMASK="-lstdc++" + + if test "$user" + then +-# program=$user.marc +- program=$DIRJOB/`$BASENAME $user .f`.marc ++ program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= +@@ -2373,7 +2328,7 @@ + fi + if test "$user" + then +- execpath=$DIRJOB/`$BASENAME $user .f`.marc ++ execpath=$usernoext.marc + usersub=1 + fi + export execpath +@@ -3256,44 +3211,27 @@ + echo + 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 +- ++ userobj=$usermoext.o + 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 || \ ++ $DFORTRANMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTRANMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi + + +@@ -3313,7 +3251,8 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ + $SECLIBS || \ +@@ -3326,6 +3265,8 @@ + prgsav=yes + fi + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + + # + # run marc +@@ -3372,7 +3313,7 @@ + fi + else + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes +@@ -3538,7 +3479,7 @@ + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3551,21 +3492,21 @@ + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $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.f on host $i" ++ 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.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3575,39 +3516,27 @@ + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" ++ echo "Compiling and linking user subroutine $user 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 ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTRANMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTRANMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + 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 + + +@@ -3627,7 +3556,8 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ + $SECLIBS || \ +@@ -3668,6 +3598,8 @@ + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + + # + # run marc +@@ -3726,42 +3658,42 @@ + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ 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 +- 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 ++ DIR1=$workdir + fi +- done +- 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 + fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then +@@ -3886,7 +3818,7 @@ + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3899,20 +3831,20 @@ + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $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.f on host $i" ++ 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.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3922,37 +3854,25 @@ + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" ++ echo "Compiling and linking user subroutine $user 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 ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTRANMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTRANMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi # if test $user + + +@@ -3972,6 +3892,7 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +@@ -4012,7 +3933,8 @@ + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null +- ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + # done if no job id given + if test -z "$jid" + then +@@ -4052,7 +3974,7 @@ + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " + fi + +-$RUN_JOB ++ $RUN_JOB + + if test $nprocd -gt 1 + then +@@ -4096,42 +4018,42 @@ + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ 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 +- 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 ++ DIR1=$workdir + fi +- done +- 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 + fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then diff --git a/install/MarcMentat/2020/Marc_tools/run_marc.original b/install/MarcMentat/2020/Marc_tools/run_marc.original deleted file mode 100644 index 7f3f94730..000000000 --- a/install/MarcMentat/2020/Marc_tools/run_marc.original +++ /dev/null @@ -1,4208 +0,0 @@ -#!/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 # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo This option is deprecated. As of Marc 2015, only # -# the integer*8 version is available. # -# -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= -modeerror= -modeoption= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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 $1}}' $HOME/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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) - modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - modeoption=error - echo $modeerror - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i8" - echo " " - echo " use -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - echo - echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available - echo - 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 - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - 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 -export MESHERDIR -MSC_LICENSE_FINPROC=0 -export MSC_LICENSE_FINPROC -# -# 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:$SFMATDIR -if test -f "/etc/redhat-release"; then - ver=`cat /etc/redhat-release | sed 's/.* release \([0-9]\).\([0-9]\+\) .*/\1\2/'` - case "$ver" in - 6*) LD_LIBRARY_PATH="${MARC_LIB_SHARED}rh67:$LD_LIBRARY_PATH" ;; - esac -fi -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$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= -oversubscribe=false -gpuids= -nauto= -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -ddm_arc=0 -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 -iprintsimufact= -SRCLIB=$MARC_LIB/srclib.a -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_OTHER $MPI_DEFAULT" - 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="$MUMPSLIB_DIR/libmumps_$value.a" - 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` - usersubname=$user - basefile=`$BASENAME $value` - if test ${basefile##*.} = f - then - user=`dirname $value`/`$BASENAME $value .f` - usersubname=$user.f - elif test ${basefile##*.} = F - then - user=`dirname $value`/`$BASENAME $value .F` - usersubname=$user.F - elif test ${basefile##*.} = f90 - then - user=`dirname $value`/`$BASENAME $value .f90` - usersubname=$user.f90 - elif test ${basefile##*.} = F90 - then - user=`dirname $value`/`$BASENAME $value .F90` - usersubname=$user.F90 - fi - case $user in - \/*) - ;; - *) - user=`pwd`/$user - usersubname=`pwd`/$usersubname - ;; - esac - if test ! -f $usersubname - then - if test -f $usersubname.f - then - usersubname=$usersubname.f - elif test -f $usersubname.F - then - usersubname=$usersubname.F - elif test -f $usersubname.f90 - then - usersubname=$usersubname.f90 - elif test -f $usersubname.F90 - then - usersubname=$usersubname.F90 - fi - 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 - case $value in - sfg | sfm | sim) - iprintsimufact=true - ;; - esac - ;; - -au* | -AU*) - nauto=$value - echo - echo warning: the option -au is no longer supported and will be ignored - echo - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -ddm | -DDM) - ddm_arc=$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="$MUMPSLIB_DIR/libmumps_$value.a" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.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 - -# oversubscribe case -if test $nprocd -gt $(/usr/bin/nproc); then - if test "$ALLOWMPIOVERSUBSCRIBE" != "true"; then - error="$error - The requested number of domains ($nprocd) is larger than the number - of processors ($(/usr/bin/nproc)). As such an oversubscription may result in - very poor performance, the analysis will not be started. - Running an analysis in case of oversubscription can be forced - by defining an environment variable \"ALLOWMPIOVERSUBSCRIBE\" - with the value \"true\"." - oversubscribe=true - 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 - -nsolverprint=$nsolver -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 "$iam" = sim ; then - SFLIB="-L$SFMATDIR -lMBA_Grain" -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 $MPI_DEFAULT)" - 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 "$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 - if test "$user" - then -# allow user sub without giving job id - qid=foreground - verify=no - else - error="$error -job id required" - 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 - -############################################################################## -# 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 \ -" -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" > $jid.log -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log -fi -echo \ -"Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit" >> $jid.log -deletelog=no -fi -echo \ -" -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" -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" -fi -echo \ -"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" - - -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 "$modeoption" -then - error=$modeerror -fi - -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 ($usersubname)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=`dirname $value`/`$BASENAME $value .f` - usersubname=$user - basefile=`$BASENAME $value` - if test ${basefile##*.} = f - then - user=`dirname $value`/`$BASENAME $value .f` - usersubname=$user.f - elif test ${basefile##*.} = F - then - user=`dirname $value`/`$BASENAME $value .F` - usersubname=$user.F - elif test ${basefile##*.} = f90 - then - user=`dirname $value`/`$BASENAME $value .f90` - usersubname=$user.f90 - elif test ${basefile##*.} = F90 - then - user=`dirname $value`/`$BASENAME $value .F90` - usersubname=$user.F90 - fi - case $user in - \/*) - ;; - *) - user=`pwd`/$user - usersubname=`pwd`/$usersubname - ;; - esac - if test ! -f $usersubname - then - if test -f $usersubname.f - then - usersubname=$usersubname.f - elif test -f $usersubname.F - then - usersubname=$usersubname.F - elif test -f $usersubname.f90 - then - usersubname=$usersubname.f90 - elif test -f $usersubname.F90 - then - usersubname=$usersubname.F90 - fi - 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 -# Update print variable for -nsolver option - nsolverprint=$nsolver - if test $nsolver -eq 0 - then - nsolverprint= - fi - $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 "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) - if test "$deletelog" = no -a $oversubscribe = true - then - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - 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 - if test "$jid" - then - /bin/rm $jid.log 2>/dev/null - fi -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 -a "$jid" - -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. " - 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. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - 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 -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 $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 $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(" -host %s",$1); \ - printf(" -n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) printf(" -wdir %s ",$3); \ - 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 ) printf(" -wdir %s ",$3); \ - 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 - - -# -# check for external file to run using valgrind -# -if test -f $MARC_TOOLS/run_marc_valgrind -then - . $MARC_TOOLS/run_marc_valgrind -fi - - -############################################################################## -# 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SFLIB \ - $OPENSSL_LIB \ - $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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SFLIB \ - $OPENSSL_LIB \ - $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 - -# done if no job id given -if test -z "$jid" -then - echo - echo only compilation requested - echo - exit -fi -# -# 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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 2>/dev/null -fi - - -fi -fi diff --git a/install/MarcMentat/2020/Mentat_bin/edit_window b/install/MarcMentat/2020/Mentat_bin/edit_window deleted file mode 100644 index b732a7694..000000000 --- a/install/MarcMentat/2020/Mentat_bin/edit_window +++ /dev/null @@ -1,5 +0,0 @@ -#!/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/install/MarcMentat/2020/Mentat_bin/edit_window.original b/install/MarcMentat/2020/Mentat_bin/edit_window.original deleted file mode 100644 index 64c0a68d0..000000000 --- a/install/MarcMentat/2020/Mentat_bin/edit_window.original +++ /dev/null @@ -1,18 +0,0 @@ -#!/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/install/MarcMentat/2020/Mentat_bin/edit_window.patch b/install/MarcMentat/2020/Mentat_bin/edit_window.patch new file mode 100644 index 000000000..b13f45608 --- /dev/null +++ b/install/MarcMentat/2020/Mentat_bin/edit_window.patch @@ -0,0 +1,24 @@ +--- ++++ +@@ -1,18 +1,5 @@ + #!/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. ++# This script opens a window running an editor. ++# The command to invoke the editor is specified during DAMASK installation + +-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 $* ++%EDITOR% $* \ No newline at end of file diff --git a/install/MarcMentat/2020/Mentat_bin/kill1.original b/install/MarcMentat/2020/Mentat_bin/kill1.original deleted file mode 100644 index 6d1ff84bf..000000000 --- a/install/MarcMentat/2020/Mentat_bin/kill1.original +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/install/MarcMentat/2020/Mentat_bin/kill4 b/install/MarcMentat/2020/Mentat_bin/kill4 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/install/MarcMentat/2020/Mentat_bin/kill4 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/install/MarcMentat/2020/Mentat_bin/kill4.patch b/install/MarcMentat/2020/Mentat_bin/kill4.patch new file mode 100644 index 000000000..e69de29bb diff --git a/install/MarcMentat/2020/Mentat_bin/kill5 b/install/MarcMentat/2020/Mentat_bin/kill5 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/install/MarcMentat/2020/Mentat_bin/kill5 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/install/MarcMentat/2020/Mentat_bin/kill5.patch b/install/MarcMentat/2020/Mentat_bin/kill5.patch new file mode 100644 index 000000000..e69de29bb diff --git a/install/MarcMentat/2020/Mentat_bin/kill6 b/install/MarcMentat/2020/Mentat_bin/kill6 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/install/MarcMentat/2020/Mentat_bin/kill6 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/install/MarcMentat/2020/Mentat_bin/kill6.patch b/install/MarcMentat/2020/Mentat_bin/kill6.patch new file mode 100644 index 000000000..e69de29bb diff --git a/install/MarcMentat/2020/Mentat_bin/submit1.original b/install/MarcMentat/2020/Mentat_bin/submit1.original deleted file mode 100644 index 9f59cba3b..000000000 --- a/install/MarcMentat/2020/Mentat_bin/submit1.original +++ /dev/null @@ -1,189 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=/tmp/msc/marc2020 -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 -SRCEXTC=.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 -copy_datfile="-ci $4" -copy_postfile="-cr $5" -scr_dir=$6 -dcoup=$7 -assem_recov_nthread=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then - slv="-iam sfm" -fi -if [ "$slv" == "marc" ]; then - slv="" -fi -if [ "$slv" == "datfit" ]; then - slv="-iam datfit" -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$//" | sed "s/$SRCEXTC$//"` - 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 \ - $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/install/MarcMentat/2020/Mentat_bin/submit4 b/install/MarcMentat/2020/Mentat_bin/submit4 deleted file mode 100644 index 09efd16bb..000000000 --- a/install/MarcMentat/2020/Mentat_bin/submit4 +++ /dev/null @@ -1,191 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc2020 - -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 -SRCEXTC=.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 -copy_datfile="-ci $4" -copy_postfile="-cr $5" -scr_dir=$6 -dcoup=$7 -assem_recov_nthread=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then - slv="-iam sfm" -fi -if [ "$slv" = "marc" ]; then - slv="" -fi -if [ "$slv" = "datfit" ]; then - slv="-iam datfit" -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$//" | sed "s/$SRCEXTC$//"` - 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 \ - $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/install/MarcMentat/2020/Mentat_bin/submit4.patch b/install/MarcMentat/2020/Mentat_bin/submit4.patch new file mode 100644 index 000000000..37069512e --- /dev/null +++ b/install/MarcMentat/2020/Mentat_bin/submit4.patch @@ -0,0 +1,42 @@ +--- ++++ +@@ -4,7 +4,8 @@ + # Normal exit status is 0. + # + +-DIR=/tmp/msc/marc2020 ++DIR=%INSTALLDIR%/marc2020 ++ + if test $MARCDIR1 + then + DIR=$MARCDIR1 +@@ -59,10 +60,10 @@ + if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then + slv="-iam sfm" + fi +-if [ "$slv" == "marc" ]; then ++if [ "$slv" = "marc" ]; then + slv="" + fi +-if [ "$slv" == "datfit" ]; then ++if [ "$slv" = "datfit" ]; then + slv="-iam datfit" + fi + +@@ -87,6 +88,7 @@ + srcfile="-u $srcfile -save y" + ;; + runsaved) ++ srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +@@ -181,7 +183,7 @@ + unset PYTHONHOME + unset PYTHONPATH + +-"${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd \ ++"${DIR}/tools/run_damask_hmp" $slv -j $job -v n -b y $nprocds $nprocd \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 diff --git a/install/MarcMentat/2020/Mentat_bin/submit5 b/install/MarcMentat/2020/Mentat_bin/submit5 deleted file mode 100644 index d7cf96c68..000000000 --- a/install/MarcMentat/2020/Mentat_bin/submit5 +++ /dev/null @@ -1,191 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc2020 - -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 -SRCEXTC=.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 -copy_datfile="-ci $4" -copy_postfile="-cr $5" -scr_dir=$6 -dcoup=$7 -assem_recov_nthread=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then - slv="-iam sfm" -fi -if [ "$slv" = "marc" ]; then - slv="" -fi -if [ "$slv" = "datfit" ]; then - slv="-iam datfit" -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$//" | sed "s/$SRCEXTC$//"` - 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 \ - $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/install/MarcMentat/2020/Mentat_bin/submit5.patch b/install/MarcMentat/2020/Mentat_bin/submit5.patch new file mode 100644 index 000000000..b13106394 --- /dev/null +++ b/install/MarcMentat/2020/Mentat_bin/submit5.patch @@ -0,0 +1,42 @@ +--- ++++ +@@ -4,7 +4,8 @@ + # Normal exit status is 0. + # + +-DIR=/tmp/msc/marc2020 ++DIR=%INSTALLDIR%/marc2020 ++ + if test $MARCDIR1 + then + DIR=$MARCDIR1 +@@ -59,10 +60,10 @@ + if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then + slv="-iam sfm" + fi +-if [ "$slv" == "marc" ]; then ++if [ "$slv" = "marc" ]; then + slv="" + fi +-if [ "$slv" == "datfit" ]; then ++if [ "$slv" = "datfit" ]; then + slv="-iam datfit" + fi + +@@ -87,6 +88,7 @@ + srcfile="-u $srcfile -save y" + ;; + runsaved) ++ srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +@@ -181,7 +183,7 @@ + unset PYTHONHOME + unset PYTHONPATH + +-"${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd \ ++"${DIR}/tools/run_damask_mp" $slv -j $job -v n -b y $nprocds $nprocd \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 diff --git a/install/MarcMentat/2020/Mentat_bin/submit6 b/install/MarcMentat/2020/Mentat_bin/submit6 deleted file mode 100644 index f672ea667..000000000 --- a/install/MarcMentat/2020/Mentat_bin/submit6 +++ /dev/null @@ -1,191 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc2020 - -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 -SRCEXTC=.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 -copy_datfile="-ci $4" -copy_postfile="-cr $5" -scr_dir=$6 -dcoup=$7 -assem_recov_nthread=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then - slv="-iam sfm" -fi -if [ "$slv" = "marc" ]; then - slv="" -fi -if [ "$slv" = "datfit" ]; then - slv="-iam datfit" -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$//" | sed "s/$SRCEXTC$//"` - 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 \ - $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/install/MarcMentat/2020/Mentat_bin/submit6.patch b/install/MarcMentat/2020/Mentat_bin/submit6.patch new file mode 100644 index 000000000..820822b34 --- /dev/null +++ b/install/MarcMentat/2020/Mentat_bin/submit6.patch @@ -0,0 +1,42 @@ +--- ++++ +@@ -4,7 +4,8 @@ + # Normal exit status is 0. + # + +-DIR=/tmp/msc/marc2020 ++DIR=%INSTALLDIR%/marc2020 ++ + if test $MARCDIR1 + then + DIR=$MARCDIR1 +@@ -59,10 +60,10 @@ + if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then + slv="-iam sfm" + fi +-if [ "$slv" == "marc" ]; then ++if [ "$slv" = "marc" ]; then + slv="" + fi +-if [ "$slv" == "datfit" ]; then ++if [ "$slv" = "datfit" ]; then + slv="-iam datfit" + fi + +@@ -87,6 +88,7 @@ + srcfile="-u $srcfile -save y" + ;; + runsaved) ++ srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +@@ -181,7 +183,7 @@ + unset PYTHONHOME + unset PYTHONPATH + +-"${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd \ ++"${DIR}/tools/run_damask_lmp" $slv -j $job -v n -b y $nprocds $nprocd \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 diff --git a/install/MarcMentat/2020/Mentat_menus/job_run.ms b/install/MarcMentat/2020/Mentat_menus/job_run.ms deleted file mode 100644 index 2429f1f3a..000000000 --- a/install/MarcMentat/2020/Mentat_menus/job_run.ms +++ /dev/null @@ -1,2973 +0,0 @@ -#ifndef AUTOFORGE -popmenu job_title_pm file jobs.ms -popdown job_title_ok file jobs.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 matrix_solver_gr file job_common.ms -popmenu ddm_options file job_common.ms - -browser edit_browser file file.ms -browser directory_browser file file.ms -screen domains file domain_decomposition.ms - -frame job_properties_subm_header_fr file job_common.ms -frame job_properties_subm_footer_fr file job_common.ms - - -browser usersub_file_browser { - text "$usersub_file_browser_label" ($usersub_file_browser_label) - filter "*.f *.F *.f90 *.F90" - select_files true - command "$usersub_file_browser_command" ($usersub_file_browser_command) -} - - - -browser host_file_browser { - text "$host_file_browser_label" ($host_file_browser_label) - filter "*" - select_files true - command "$host_file_browser_command" ($host_file_browser_command) -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_popmenu { - - text "RUN JOB" - - group { - - frame { - position 1 1 - size 60 4 - group { - label { - position 0 1 - size 15 4 - text "NAME" - help job_run - } - display { - position +12 = - size 45 4 - display "job_name" - } - label { - position 0 +4 - size 15 4 - text "TYPE" - help job_run - } - display { - position +12 = - size 45 4 - display job_class_label - } - } - } - - frame { - text "USER SUBROUTINES" - position 1 +4 - size 60 4 - group { - button { - position 0 0 - size 30 4 - text "FORTRAN SOURCE FILE" - help "job_run#User Subroutines" - browser usersub_file_browser - settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" - set $usersub_file_browser_command "*job_usersub_file" - } - toggle { - position +30 = - size 30 4 - text "SELECTED USER SUBS" - help "job_run#User Subroutines" - toggle job_usersubs - active job_usersubs - popmenu job_usersub_pm - } - display { - position 0 +4 - size 60 4 - display job_usersub_file - visible job_usersub_file - } - button { - position 0 +4 - size 15 4 - text "EDIT" - help "job_run#User Subroutines" - command "*job_edit_usersub_file" - visible job_usersub_file - } - button { - position +15 = - size 15 4 - text "CLEAR" - help "job_run#User Subroutines" - command "*job_clear_usersub_file" - visible job_usersub_file - } - roller { - position +15 = - size 30 4 - nvalues 3 - texts "COMPILE / NO SAVE" - "COMPILE AND SAVE" - "RUN SAVED EXECUTABLE" - help "job_run#User Subroutines" - roller "job_option user_source" - visible job_usersub_file - commands "*job_option user_source:compile_nosave" - "*job_option user_source:compile_save" - "*job_option user_source:run_saved" - } - } - } - - frame { - text "SOLVER/PARALLELIZATION" - position 1 +4 - size 60 4 - group { - button { - position 0 0 - size 30 4 - text "SETTINGS" - help "job_run#Solver/Parallelization" - popmenu job_run_parallelization_pm - set $popname2 "job_run_parallelization_pm" - } - display { - position 0 +4 - size 30 4 - display job_solver_solution - } - display { - position +30 = - size 30 4 - display job_ddm_domains - } - display { - position 0 +4 - size 30 4 - display job_solver_type - } - display { - position +30 = - size 30 4 - display job_assem_recov_nthreads - } - display { - position = +4 - size 30 4 - display job_solver_procs - visible solver_allows_multi_procs - } - display { - position = = - size 18 4 - display job_solver_threads - visible "and(solver_allows_multi_threads,\ - not(and(job_solver_mfront_sparse,\ - *job_option parallel:on)),\ - *job_option solver_use_gpu:off)" - } - display { - position +18 = - size 12 4 - display job_solver_gpu - visible "or(and(job_solver_mfront_sparse,job_nonsym_off), \ - and(job_solver_it_sparse,job_nonsym_off))" - } - } - } - - frame { - text "INPUT STYLE AND JOB TITLE" - position 1 +4 - size 60 4 - group { - -# see also job_common.ms -# see also the ADVANCED JOB SUBMISSION popmenu in this file - - label { - position 0 0 - size 8 4 - text "STYLE" - help "job_run#Input Style And Job Title" - border_width 1 - border_color black - } - roller { - position +8 = - size 22 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" - 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" - help "job_run#Input Style And Job Title" - } - button { - position +22 = - size 15 4 - text "TITLE" - help "job_run#Input Style And Job Title" - popmenu job_title_pm - command "*job_title" - } - button { - position +15 = - size 15 4 - text "SAVE MODEL" - help "job_run#Input Style And Job Title" - command "*save_model" - } - } - } - - frame { - text "JOB SUBMISSION AND CONTROL" - position 1 +4 - size 60 4 - group { - frame { - position 1 1 - size 50 4 - group { - button { - position 0 0 - size 25 4 - text "SUBMIT (1)" - help "job_run#Job Submission And Control" - command "*submit_job 1 *monitor_job" - } - button { - position +25 = - size 18 4 - text "ADVANCED JOB SUBMISSION" - help "job_run#Job Submission And Control" - popmenu job_submit_adv_pm - } - button { - position +18 = - size 7 4 - text "DAMASK" - help "damask_run#Job Submission And Control" - popmenu damask - } - button { - position 0 +4 - size 12 4 - text "UPDATE" - help "job_run#Job Submission And Control" - command "*update_job" - } - button { - position +12 = - size 13 4 - text "MONITOR" - help "job_run#Job Submission And Control" - command "*monitor_job" - } - button { - position +13 = - size 12 4 - text "RESET" - help "job_run#Job Submission And Control" - command "*job_submit_reset" - } - button { - position +12 = - size 13 4 - text "KILL" - help "job_run#Job Submission And Control" - command "*kill_job *monitor_job" - active "job_status_running" - } - } - } - - frame { - position 1 5 - size 50 4 - group { - label { - position 0 +4 - size 25 4 - text "STATUS" - help "job_run#Status" - border_width 1 - border_color black - } - display { - position +25 = - size 25 4 - display "job_status" - } - label { - position 0 +4 - size 25 4 - text "CURRENT INCREMENT (CYCLE)" - help "job_run#Current Increment" - border_width 1 - border_color black - } - display { - position +25 = - size 25 4 - display "job_increment" - } - label { - position 0 +4 - size 25 4 - text "SINGULARITY RATIO" - help "job_run#Singularity Ratio" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_singularity_ratio" - } - label { - position 0 +4 - size 25 4 - text "CONVERGENCE RATIO" - help "job_run#Convergence Ratio" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_convergence_ratio" - } - label { - position 0 +4 - size 25 4 - text "FRACTION OF INCREMENT (CONTACT)" - help "job_run#IPC" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_ipc_fraction" - } - label { - position 0 +4 - size 25 4 - text "ANALYSIS TIME" - help "job_run#Analysis Time" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_analysis_time" - } - } - } - - frame { - position 1 +4 - size 50 4 - group { - - frame { - position 0 0 - size 50 4 - text "ACCUMULATED ANALYSIS STATISTICS" - border_width 1 - border_color black - group { - label { - position 0 0 - size 12 4 - text "CYCLES" - help "job_run#Cycles" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_cycles" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "SEPARATIONS" - help "job_run#Separations" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_separations" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "WARNING MESSAGES" - help "job_run#Warnings" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "number_of_warning_messages" - border_width 1 - border_color black - } - label { - position +12 -8 - size 12 4 - text "CUT BACKS" - help "job_run#Cut Backs" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_cut_backs" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "REMESHES" - help "job_run#Remeshes" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_remeshes" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "WALL TIME" - help "job_run#Wall Time" - border_width 1 - border_color black - } - display { - position +12 = - size 12 4 - display "job_time" - } - } - } - - frame { - position 0 +4 - size 50 4 - text "JOB COMPLETION" - border_width 1 - border_color black - group { - label { - position 0 +4 - size 12 4 - text "EXIT NUMBER" - help "job_run#Exit Number" - border_width 1 - border_color black - } - integer { - position +12 = - size 13 4 - display "job_exit" - } - button { - position +13 = - size 25 4 - text "EXIT MESSAGE" - help "job_run#Exit Number" - popmenu job_exit_msg_pm - } - } - } - } - } - } - } - frame { - text "EDIT FILES" - position 1 +4 - size 60 4 - group { - frame { - position 1 1 - size 60 4 - group { - button { - position 0 +4 - size 15 4 - text "OUTPUT FILE" - help "job_run#Edit Files" - command "*job_edit_output" - } - button { - position +15 = - size 15 4 - text "LOG FILE" - help "job_run#Edit Files" - command "*job_edit_log_file" - } - button { - position +15 = - size 15 4 - text "STATUS FILE" - help "job_run#Edit Files" - command "*job_edit_status_file" - } - button { - position +15 = - size 15 4 - text "ANY FILE" - help "job_run#Edit Files" - settext $edit_browser_label "EDIT FILE" - set $edit_browser_command "*edit_file" - browser edit_browser - } - } - } - } - } - - frame { - position 1 +4 - size 60 4 - group { - layout hbox - spacer { - stretch 1 - } - popdown { - position 0 0 - size 60 4 - text "OPEN POST FILE" - help "job_run#Open Post File" - command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" - visible "not(*job_option write_cont_post_file:on)" - } - popdown { - position 0 0 - size 30 4 - text "OPEN POST FILE" - help "job_run#Open Post File" - command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" - visible "*job_option write_cont_post_file:on" - } - popdown { - position 0 0 - size 30 4 - text "OPEN EXPANDED BEAM POST FILE" - help "job_run#Open Expanded Beam Post File" - command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_con_default" - visible "*job_option write_cont_post_file:on" - } - spacer { - stretch 1 - } - } - } - - frame { - position 1 +5 - size 60 4 - group { - layout hbox - spacer { - stretch 1 - } - popdown { - size 12 4 - text "OK" - } - spacer { - stretch 1 - } - } - } - } - - window job_run_wi { - parent mentat - origin 35 1 - size 52 115 - background_color body - border_width 1 - border_color border - buffering single - } - - mode permanent -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_usersub_pm { - - text "CURRENTLY SELECTED USER SUBROUTINES" - - group { - - - 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 { - - text "ADVANCED JOB SUBMISSION" - - group { - - - 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 - } - - label { - position 1 9 - size 19 4 - text "INITIAL ALLOCATION" - border_width 1 - border_color black - } - label { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - } - 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" - } - - 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 29 - nvisible 29 - texts "DEFAULT" -#if 0 - "2020" -#endif - "2019.1" - "2019" - "2018.1" - "2018" - "2017.1" - "2017" - "2016" - "2015" - "2014.2" - "2014.1" - "2014" - "2013.1" - "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_2020" -#endif - "job_input_version_2019.1" - "job_input_version_2019" - "job_input_version_2018.1" - "job_input_version_2018" - "job_input_version_2017.1" - "job_input_version_2017" - "job_input_version_2016" - "job_input_version_2015" - "job_input_version_2014.2" - "job_input_version_2014.1" - "job_input_version_2014" - "job_input_version_2013.1" - "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" - commands "*job_option version:default" -#if 0 - "*job_option version:2020" -#endif - "*job_option version:2019.1" - "*job_option version:2019" - "*job_option version:2018.1" - "*job_option version:2018" - "*job_option version:2017.1" - "*job_option version:2017" - "*job_option version:2016" - "*job_option version:2015" - "*job_option version:2014.2" - "*job_option version:2014.1" - "*job_option version:2014" - "*job_option version:2013.1" - "*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_2020" -#endif - "job_allows_input_version_2019.1" - "job_allows_input_version_2019" - "job_allows_input_version_2018.1" - "job_allows_input_version_2018" - "job_allows_input_version_2017.1" - "job_allows_input_version_2017" - "job_allows_input_version_2016" - "job_allows_input_version_2015" - "job_allows_input_version_2014.2" - "job_allows_input_version_2014.1" - "job_allows_input_version_2014" - "job_allows_input_version_2013.1" - "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" - } - -# 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" - 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" - help job_option_input_style - } - - toggle { - position 0 +4 - size 24 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" - } - toggle { - position +24 = - size 24 4 - text "INCLUDE UNUSED TABLES" - toggle "*job_option input_file_tables:all" - true_command "*job_option input_file_tables:all" - false_command "*job_option input_file_tables:used" - } - } - } - - button { - position 1 +14 - size 24 4 - text "SCRATCH DIRECTORY" - settext $directory_browser_label "JOB SCRATCH DIRECTORY" - set $directory_browser_command "*job_scratch_directory" - browser directory_browser - 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 - } - - mode permanent -} - -#-------------------------------------------------------------------------------------------------- -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" - } - - 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 permanent -} - -#-------------------------------------------------------------------------------------------------- -popmenu job_exit_msg_pm { - - text "EXIT MESSAGE" - - group { - - - - text { - position 1 5 - size 84 74 - multiline - readonly - display "job_exit_msg" - } - - 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 -} - - - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_parallelization_pm { - - text "SOLVER/PARALLELIZATION" - - group { - layout vbox - frame { - position 0 0 - size 42 8 - group { - - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 36 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 36 4 - display job_class_label - } - } - } - frame { - position 0 8 - size 42 20 - group job_ddm_gr - text "DOMAIN DECOMPOSITION" - border_width 1 - border_color black - } - - frame { - position 0 +20 - size 42 13 - group job_assem_recov_gr - text "ASSEMBLY AND RECOVERY" - border_width 1 - border_color black - } - - frame { - position 0 +14 - size 42 31 - group job_parallel_matrix_solver_gr - text "MATRIX SOLVER" - border_width 1 - border_color black - } - - frame { - position 0 +32 - size 42 28 - group job_parallel_env_gr - text "PARALLELIZATION ENVIRONMENT" - border_width 1 - border_color black - visible "or(*job_option parallel:on, \ - solver_multi_procs)" - } - frame { - position 15 +30 - size 42 8 - group { - layout hbox - - spacer { - stretch 1 - } - popdown { - position 15 0 - size 12 8 - text "OK" - } - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - stretch 1 - } - } - - window { - parent mentat - origin 38 1 - size 60 119 - background_color body - border_width 1 - border_color border - buffering single - } - mode permanent -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_gr { - - toggle { - position 1 4 - size 42 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" - active "and(not(job_solver_it_ext),\ - not(job_solver_mixed_direct_iterative))" - } - - frame { - position = +5 - size 42 4 - group job_ddm_use_gr - visible "*job_option parallel:on" - } -} - -group job_ddm_use_gr { - layout vbox - frame{ - position 0 0 - size 30 4 - group { - layout hbox - label { - position 0 0 - size 12 4 - text "DECOMPOSITION IN" - help job_run_ddm_generator - } - oneonly{ - position +12 = - size 8 4 - text "MARC" - oneonly "*job_option ddm_generator:fea_solver" - command "*job_option ddm_generator:fea_solver" - help job_run_ddm_generator - } - oneonly{ - position +12 = - size 8 4 - text "MENTAT" - oneonly "*job_option ddm_generator:preprocessor" - command "*job_option ddm_generator:preprocessor" - 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" - } - - frame{ - position 0 +5 - size 40 4 - group{ - layout hbox - text { - position 0 0 - size 22 4 - text "Single Input File" - 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 - } - } - } -} - - - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_fea_solver_gr { - - label { - position 0 0 - size 10 4 - text "# DOMAINS" - help job_param - } - - text { - position +10 = - size 4 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position 0 +4 - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 18 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" - 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" - } - - button { - position +18 = - size 12 4 - text "ADV. SETTINGS" - popmenu job_ddm_fea_solver_pm - } -} - - - - -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_fea_solver_pm { - text "JOB PARALLELIZATION" - mode permanent - - group { - layout vbox - spacing 0 - - frame job_properties_subm_header_fr - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - frame { - text "ADVANCED DECOMPOSITION IN MARC" - - group { - layout vbox - spacing 0 - - frame { - - group { - layout hbox - spacing 0 - - label { - size 12 4 - text "# DOMAINS" - help job_param - } - - text { - size 14 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - size 8 4 - text "METHOD" - } - - roller { - size 32 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "RECURSIVE COORDINATE 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" - 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" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - visible "or(*job_option ddm_method:vector, \ - *job_option ddm_method:radial, \ - *job_option ddm_method:angular)" - - group { - layout hbox - spacing 0 - - frame { - group job_ddm_direction_gr - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - toggle { - size 24 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" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - size 8 4 - text "GRAPH" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } - - roller { - size 8 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)" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - size 20 4 - text "QUADRATIC ELEMENTS" - } - - roller { - size 12 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" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - position 0 +5 - size 24 4 - text "ELEMENT WEIGHT FACTOR" - help job_param - } - - text { - position +24 = - size 14 4 - display "job_param_value_ddm_elem_weight_factor" - command "*job_param ddm_elem_weight_factor" - help job_run_ddm_decomp_element_weight_factor - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - - group { - layout hbox - spacing 0 - - frame { - - group { - - toggle { - position 0 0 - size 16 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" - help job_run_ddm_decomp_detect_contact - } - - label { - position = +5 - size 28 4 - text "CONTACT TOLERANCE" - visible "*job_option ddm_detect_contact:on" - } - - text { - position +28 = - size 14 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 - } - - label { - position 0 +4 - size 28 4 - text "CONTACT CONSTRAINT FACTOR" - visible "*job_option ddm_detect_contact:on" - } - - text { - position +28 = - size 14 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 - } - } - } - - spacer { - stretch 1 - } - } - } - } - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame job_properties_subm_footer_fr - } -} # job_ddm_fea_solver_pm - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_direction_gr { - - button { - position 0 0 - size 21 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "model_anadim_3d" - } - - button { - position = = - size 21 4 - text "DIRECTION" - command "*job_vector_2d ddm_sort_direction_x" - visible "not(model_anadim_3d)" - } - - button { - position +21 = - size 21 4 - text "FROM / TO" - command "*job_vector_from_to ddm_sort_direction_x" - visible "model_anadim_3d" - } - - button { - position = = - size 21 4 - text "FROM / TO" - command "*job_vector_from_to_2d ddm_sort_direction_x" - visible "not(model_anadim_3d)" - } - - frame { - position 0 +4 - size 42 4 - - group { - layout hbox - spacing 0 - - text { - size 14 4 - command "*job_param ddm_sort_direction_x" - display "job_param_value_ddm_sort_direction_x" - help ddm_job_decomp_user_direction_x - } - - text { - size 14 4 - command "*job_param ddm_sort_direction_y" - display "job_param_value_ddm_sort_direction_y" - } - - text { - size 14 4 - command "*job_param ddm_sort_direction_z" - display "job_param_value_ddm_sort_direction_z" - visible "model_anadim_3d" - } - } - } - - frame { - position 0 +4 - size 42 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 16 4 - text "POINT ON AXIS" - } - - roller { - position +16 = - size 10 4 - nvalues 2 - texts "DEFAULT" - "USER" - roller "job_option ddm_sort_point" - commands "*job_option ddm_sort_point:default" - "*job_option ddm_sort_point:user" - } - - button { - position +20 = - size 6 4 - text "SET" - command "*job_position ddm_sort_point_x" - visible "and(*job_option ddm_sort_point:user, model_anadim_3d)" - } - - button { - position = = - size 6 4 - text "SET" - command "*job_position_2d ddm_sort_point_x" - visible "and(*job_option ddm_sort_point:user, not(model_anadim_3d))" - } - - frame { - position 0 +4 - size 42 4 - visible "*job_option ddm_sort_point:user" - - group { - layout hbox - spacing 0 - - text { - size 14 4 - command "*job_param ddm_sort_point_x" - display "job_param_value_ddm_sort_point_x" - } - - text { - size 14 4 - command "*job_param ddm_sort_point_y" - display "job_param_value_ddm_sort_point_y" - } - - text { - size 14 4 - command "*job_param ddm_sort_point_z" - display "job_param_value_ddm_sort_point_z" - visible "model_anadim_3d" - } - } - } -} - - - - -#-------------------------------------------------------------------------------------------------- -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 0 +4 - size 30 4 - text "USER DOMAINS" - popmenu domains_pm - help job_run_ddm_user_domains - } -} - - - - -#-------------------------------------------------------------------------------------------------- -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" - } - - label { - position = +4 - size 12 4 - text "# THREADS" - visible "*job_option assem_recov_multi_threading:on" - } - - 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 10 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)" - } - spacer{ - stretch 2 - } - -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_matrix_solver_gr { - layout vbox - frame { - position 1 0 - size 36 31 - group { - layout hbox - label { - position 3 4 - size 12 4 - text "SOLUTION" - border_width 1 - border_color black - } - oneonly { - position +12 = - size 12 4 - text "SYMMETRIC" - help "job_param_solver_method#symmetric" - oneonly "job_nonsym_off" - command "*job_option solver_nonsym:off" - } - oneonly { - position +12 = - size 12 4 - text "NONSYMMETRIC" - help "job_param_solver_method#symmetric" - oneonly "job_nonsym_on" - command "*job_option solver_nonsym:on" - } - spacer { - stretch 1 - } - } - } - - frame { - position 1 +5 - size 42 23 - group matrix_solver_gr - help job_param_solver - } - - frame { - position +1 = - size 42 4 - group job_run_solver_ddm_opts_gr - visible "*job_option parallel:on" - } - - frame { - position 1 +23 - size 42 8 - group job_solver_multi_procs_gr - visible solver_allows_multi_procs - } - - frame { - position = = - size 42 8 - group job_solver_multi_threads_gr - visible solver_allows_multi_threads - } - - frame { - position 1 +9 - size 42 8 - group job_solver_gpu_gr - visible "or(and(job_solver_mfront_sparse,job_nonsym_off), \ - and(job_solver_it_sparse,job_nonsym_off))" - } - -} - - -#-------------------------------------------------------------------------------------------------- -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))" - } - button { - position = = - size 14 4 - text "\{DDM} OPTIONS" - popmenu ddm_options_mumps - visible "job_solver_mumps" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_gr { - frame { - position 0 0 - size 42 8 - group job_solver_multi_procs_parallel_off_gr - visible "*job_option parallel:off" - } - - frame { - position = = - size 42 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_param_solver_method#mumps" - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option nsolver_procs_serial:on" - help job_param - } - - 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_param_solver_method#mumps" - toggle true - set $dummy dummy - } - - 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_param_solver_method#mumps" - 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 { - - label { - position 0 0 - size 8 4 - text "VALUE" - help job_param - } - - text { - position +8 = - size 8 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - } -} - -group job_solver_multi_threads_gr { - layout vbox - spacing 0 - - frame { - size 46 8 - group job_solver_multi_threads_it_sparse_parallel_off_gr - visible "and(job_solver_it_sparse,*job_option parallel:off)" - active "*job_option solver_use_gpu:off" - } - - frame { - size 46 8 - group job_solver_multi_threads_mfront_sparse_parallel_off_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:off)" - active "*job_option solver_use_gpu:off" - } - - frame { - size 46 8 - group job_solver_multi_threads_mfront_sparse_parallel_on_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:on)" - } - - frame { - size 46 8 - group job_solver_multi_threads_pardiso_parallel_off_gr - visible "and(job_solver_pardiso,*job_option parallel:off)" - } - - frame { - size 46 8 - group job_solver_multi_threads_pardiso_parallel_on_gr - visible "and(job_solver_pardiso,*job_option parallel:on)" - } - - frame { - size 46 8 - group job_solver_multi_threads_it_ext_off_gr - visible "and(job_solver_it_ext,*job_option parallel:off)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_it_sparse_parallel_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - toggle "*job_option it_sparse_multi_threading:on" - true_command "*job_option it_sparse_multi_threading:on" - false_command "*job_option it_sparse_multi_threading:off" - help "job_param_solver_method#iterative" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option it_sparse_multi_threading:on" - help "job_param_solver_method#iterative" - } - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option it_sparse_multi_threading:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_mfront_sparse_parallel_off_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_param_solver_method#multifrontal" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option mfront_sparse_multi_threading:on" - help "job_param_solver_method#multifrontal" - } - - 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_multi_threads_mfront_sparse_parallel_on_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - help "job_param_solver_method#multifrontal" - toggle true - set $dummy dummy - } - - label { - position +30 0 - size 12 4 - visible "and( not(*job_option ddm_precond:direct)\ - *job_option parallel:on)" - text "PER DOMAIN" - border_width 1 - border_color black - help "job_param_solver_method#multifrontal" - } - - display { - position +12 0 - size 4 4 - display "job_mfront_sparse_nthreads_dom" - visible "and( not(*job_option ddm_precond:direct)\ - *job_option parallel:on)" - } - - label { - position 0 +4 - size 14 4 - text "# THREADS" - border_color black - border_width 1 - help "job_param_solver_method#multifrontal" - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option mfront_sparse_multi_threading_ddm:automatic" - "*job_option mfront_sparse_multi_threading_ddm:user" - help "job_param_solver_method#multifrontal" - rollers "*job_option mfront_sparse_multi_threading_ddm:automatic" - "*job_option mfront_sparse_multi_threading_ddm:user" - visible "not(*job_option solver_use_gpu:on)" - } - - display { - position = = - size 14 4 - text "AUTOMATIC" - visible "*job_option solver_use_gpu:on" - } - - frame { - position +14 = - size 16 4 - group job_mfront_sparse_multi_threads_ddm_automatic_gr - visible "*job_option mfront_sparse_multi_threading_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_mfront_sparse_multi_threads_ddm_user_gr - visible "*job_option mfront_sparse_multi_threading_ddm:user" - } -} -#-------------------------------------------------------------------------------------------------- -group job_mfront_sparse_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_mfront_sparse_multi_threads_ddm_user_gr { - - label { - position 0 0 - size 8 4 - text "VALUE" - help "job_param_solver_method#multifrontal" - } - - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - - - -#-------------------------------------------------------------------------------------------------- -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 - } - frame{ - position 0 +4 - size 28 4 - group{ - layout hbox - - label { - position 0 0 - 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 12 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)" - } - spacer { - stretch 1 - } - } - } -} - -#-------------------------------------------------------------------------------------------------- -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_param_solver_method#pardiso" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option pardiso_multi_threading:on" - help "job_param_solver_method#pardiso" - } - - 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_param_solver_method#pardiso" - toggle true - set $dummy dummy - } - - label { - position = +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_param_solver_method#pardiso" - 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 { - - label { - position 0 0 - size 8 4 - text "VALUE" - help "job_param_solver_method#pardiso" - } - - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_it_ext_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - toggle "*job_option it_ext_multi_threading:on" - true_command "*job_option it_ext_multi_threading:on" - false_command "*job_option it_ext_multi_threading:off" - help "job_param_solver_method#casi" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option it_ext_multi_threading:on" - help "job_param_solver_method#casi" - } - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option it_ext_multi_threading:on" - } -} - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_gr { - - frame{ - position 0 +4 - size 40 4 - group{ - layout hbox - label{ - position 0 0 - size 8 4 - text "SETUP" - help job_run_ddm_setup - } - oneonly { - position +12 = - size 12 4 - text "SINGLE MACHINE" - oneonly "*job_option parallel_setup:single" - command "*job_option parallel_setup:single" - help job_run_ddm_setup - } - oneonly { - position +8 = - size 12 4 - text "NETWORK" - oneonly "*job_option parallel_setup:network" - command "*job_option parallel_setup:network" - help job_run_ddm_setup - } - - spacer { - stretch 1 - } - } - } - - - frame { - position +1 +5 - size 40 16 - 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" - browser host_file_browser - 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 - } -} - - -#endif - diff --git a/install/MarcMentat/2020/Mentat_menus/job_run.ms.original b/install/MarcMentat/2020/Mentat_menus/job_run.ms.original deleted file mode 100644 index e54a95086..000000000 --- a/install/MarcMentat/2020/Mentat_menus/job_run.ms.original +++ /dev/null @@ -1,2838 +0,0 @@ -#ifndef AUTOFORGE -popmenu job_title_pm file jobs.ms -popdown job_title_ok file jobs.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 matrix_solver_gr file job_common.ms -popmenu ddm_options file job_common.ms - -browser edit_browser file file.ms -browser directory_browser file file.ms -screen domains file domain_decomposition.ms - -frame job_properties_subm_header_fr file job_common.ms -frame job_properties_subm_footer_fr file job_common.ms - - -browser usersub_file_browser { - text "$usersub_file_browser_label" ($usersub_file_browser_label) - filter "*.f *.F *.f90 *.F90" - select_files true - command "$usersub_file_browser_command" ($usersub_file_browser_command) -} - - - -browser host_file_browser { - text "$host_file_browser_label" ($host_file_browser_label) - filter "*" - select_files true - command "$host_file_browser_command" ($host_file_browser_command) -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_popmenu { - - text "RUN JOB" - - group { - - frame { - position 1 1 - size 60 4 - group { - label { - position 0 1 - size 15 4 - text "NAME" - help job_run - } - display { - position +12 = - size 45 4 - display "job_name" - } - label { - position 0 +4 - size 15 4 - text "TYPE" - help job_run - } - display { - position +12 = - size 45 4 - display job_class_label - } - } - } - - frame { - text "USER SUBROUTINES" - position 1 +4 - size 60 4 - group { - button { - position 0 0 - size 30 4 - text "FORTRAN SOURCE FILE" - help "job_run#User Subroutines" - browser usersub_file_browser - settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" - set $usersub_file_browser_command "*job_usersub_file" - } - toggle { - position +30 = - size 30 4 - text "SELECTED USER SUBS" - help "job_run#User Subroutines" - toggle job_usersubs - active job_usersubs - popmenu job_usersub_pm - } - display { - position 0 +4 - size 60 4 - display job_usersub_file - visible job_usersub_file - } - button { - position 0 +4 - size 15 4 - text "EDIT" - help "job_run#User Subroutines" - command "*job_edit_usersub_file" - visible job_usersub_file - } - button { - position +15 = - size 15 4 - text "CLEAR" - help "job_run#User Subroutines" - command "*job_clear_usersub_file" - visible job_usersub_file - } - roller { - position +15 = - size 30 4 - nvalues 3 - texts "COMPILE / NO SAVE" - "COMPILE AND SAVE" - "RUN SAVED EXECUTABLE" - help "job_run#User Subroutines" - roller "job_option user_source" - visible job_usersub_file - commands "*job_option user_source:compile_nosave" - "*job_option user_source:compile_save" - "*job_option user_source:run_saved" - } - } - } - - frame { - text "SOLVER/PARALLELIZATION" - position 1 +4 - size 60 4 - group { - button { - position 0 0 - size 30 4 - text "SETTINGS" - help "job_run#Solver/Parallelization" - popmenu job_run_parallelization_pm - set $popname2 "job_run_parallelization_pm" - } - display { - position 0 +4 - size 30 4 - display job_solver_solution - } - display { - position +30 = - size 30 4 - display job_ddm_domains - } - display { - position 0 +4 - size 30 4 - display job_solver_type - } - display { - position +30 = - size 30 4 - display job_assem_recov_nthreads - } - display { - position = +4 - size 30 4 - display job_solver_procs - visible solver_allows_multi_procs - } - display { - position = = - size 18 4 - display job_solver_threads - visible "and(solver_allows_multi_threads,\ - not(and(job_solver_mfront_sparse,\ - *job_option parallel:on)),\ - *job_option solver_use_gpu:off)" - } - display { - position +18 = - size 12 4 - display job_solver_gpu - visible "or(and(job_solver_mfront_sparse,job_nonsym_off), \ - and(job_solver_it_sparse,job_nonsym_off))" - } - } - } - - frame { - text "INPUT STYLE AND JOB TITLE" - position 1 +4 - size 60 4 - group { - -# see also job_common.ms -# see also the ADVANCED JOB SUBMISSION popmenu in this file - - label { - position 0 0 - size 8 4 - text "STYLE" - help "job_run#Input Style And Job Title" - border_width 1 - border_color black - } - roller { - position +8 = - size 22 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" - 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" - help "job_run#Input Style And Job Title" - } - button { - position +22 = - size 15 4 - text "TITLE" - help "job_run#Input Style And Job Title" - popmenu job_title_pm - command "*job_title" - } - button { - position +15 = - size 15 4 - text "SAVE MODEL" - help "job_run#Input Style And Job Title" - command "*save_model" - } - } - } - - frame { - text "JOB SUBMISSION AND CONTROL" - position 1 +4 - size 60 4 - group { - frame { - position 1 1 - size 50 4 - group { - button { - position 0 0 - size 25 4 - text "SUBMIT (1)" - help "job_run#Job Submission And Control" - command "*submit_job 1 *monitor_job" - } - button { - position +25 = - size 25 4 - text "ADVANCED JOB SUBMISSION" - help "job_run#Job Submission And Control" - popmenu job_submit_adv_pm - } - button { - position 0 +4 - size 12 4 - text "UPDATE" - help "job_run#Job Submission And Control" - command "*update_job" - } - button { - position +12 = - size 13 4 - text "MONITOR" - help "job_run#Job Submission And Control" - command "*monitor_job" - } - button { - position +13 = - size 12 4 - text "RESET" - help "job_run#Job Submission And Control" - command "*job_submit_reset" - } - button { - position +12 = - size 13 4 - text "KILL" - help "job_run#Job Submission And Control" - command "*kill_job *monitor_job" - active "job_status_running" - } - } - } - - frame { - position 1 5 - size 50 4 - group { - label { - position 0 +4 - size 25 4 - text "STATUS" - help "job_run#Status" - border_width 1 - border_color black - } - display { - position +25 = - size 25 4 - display "job_status" - } - label { - position 0 +4 - size 25 4 - text "CURRENT INCREMENT (CYCLE)" - help "job_run#Current Increment" - border_width 1 - border_color black - } - display { - position +25 = - size 25 4 - display "job_increment" - } - label { - position 0 +4 - size 25 4 - text "SINGULARITY RATIO" - help "job_run#Singularity Ratio" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_singularity_ratio" - } - label { - position 0 +4 - size 25 4 - text "CONVERGENCE RATIO" - help "job_run#Convergence Ratio" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_convergence_ratio" - } - label { - position 0 +4 - size 25 4 - text "FRACTION OF INCREMENT (CONTACT)" - help "job_run#IPC" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_ipc_fraction" - } - label { - position 0 +4 - size 25 4 - text "ANALYSIS TIME" - help "job_run#Analysis Time" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_analysis_time" - } - } - } - - frame { - position 1 +4 - size 50 4 - group { - - frame { - position 0 0 - size 50 4 - text "ACCUMULATED ANALYSIS STATISTICS" - border_width 1 - border_color black - group { - label { - position 0 0 - size 12 4 - text "CYCLES" - help "job_run#Cycles" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_cycles" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "SEPARATIONS" - help "job_run#Separations" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_separations" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "WARNING MESSAGES" - help "job_run#Warnings" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "number_of_warning_messages" - border_width 1 - border_color black - } - label { - position +12 -8 - size 12 4 - text "CUT BACKS" - help "job_run#Cut Backs" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_cut_backs" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "REMESHES" - help "job_run#Remeshes" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_remeshes" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "WALL TIME" - help "job_run#Wall Time" - border_width 1 - border_color black - } - display { - position +12 = - size 12 4 - display "job_time" - } - } - } - - frame { - position 0 +4 - size 50 4 - text "JOB COMPLETION" - border_width 1 - border_color black - group { - label { - position 0 +4 - size 12 4 - text "EXIT NUMBER" - help "job_run#Exit Number" - border_width 1 - border_color black - } - integer { - position +12 = - size 13 4 - display "job_exit" - } - button { - position +13 = - size 25 4 - text "EXIT MESSAGE" - help "job_run#Exit Number" - popmenu job_exit_msg_pm - } - } - } - } - } - } - } - frame { - text "EDIT FILES" - position 1 +4 - size 60 4 - group { - frame { - position 1 1 - size 60 4 - group { - button { - position 0 +4 - size 15 4 - text "OUTPUT FILE" - help "job_run#Edit Files" - command "*job_edit_output" - } - button { - position +15 = - size 15 4 - text "LOG FILE" - help "job_run#Edit Files" - command "*job_edit_log_file" - } - button { - position +15 = - size 15 4 - text "STATUS FILE" - help "job_run#Edit Files" - command "*job_edit_status_file" - } - button { - position +15 = - size 15 4 - text "ANY FILE" - help "job_run#Edit Files" - settext $edit_browser_label "EDIT FILE" - set $edit_browser_command "*edit_file" - browser edit_browser - } - } - } - } - } - - frame { - position 1 +4 - size 60 4 - group { - layout hbox - spacer { - stretch 1 - } - popdown { - position 0 0 - size 60 4 - text "OPEN POST FILE" - help "job_run#Open Post File" - command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" - visible "not(*job_option write_cont_post_file:on)" - } - popdown { - position 0 0 - size 30 4 - text "OPEN POST FILE" - help "job_run#Open Post File" - command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" - visible "*job_option write_cont_post_file:on" - } - popdown { - position 0 0 - size 30 4 - text "OPEN EXPANDED BEAM POST FILE" - help "job_run#Open Expanded Beam Post File" - command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_con_default" - visible "*job_option write_cont_post_file:on" - } - spacer { - stretch 1 - } - } - } - - frame { - position 1 +5 - size 60 4 - group { - layout hbox - spacer { - stretch 1 - } - popdown { - size 12 4 - text "OK" - } - spacer { - stretch 1 - } - } - } - } - - window job_run_wi { - parent mentat - origin 35 1 - size 52 115 - background_color body - border_width 1 - border_color border - buffering single - } - - mode permanent -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_usersub_pm { - - text "CURRENTLY SELECTED USER SUBROUTINES" - - group { - - - 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 { - - text "ADVANCED JOB SUBMISSION" - - group { - - - 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 - } - - label { - position 1 9 - size 19 4 - text "INITIAL ALLOCATION" - border_width 1 - border_color black - } - label { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - } - 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" - } - - 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 29 - nvisible 29 - texts "DEFAULT" -#if 0 - "2020" -#endif - "2019.1" - "2019" - "2018.1" - "2018" - "2017.1" - "2017" - "2016" - "2015" - "2014.2" - "2014.1" - "2014" - "2013.1" - "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_2020" -#endif - "job_input_version_2019.1" - "job_input_version_2019" - "job_input_version_2018.1" - "job_input_version_2018" - "job_input_version_2017.1" - "job_input_version_2017" - "job_input_version_2016" - "job_input_version_2015" - "job_input_version_2014.2" - "job_input_version_2014.1" - "job_input_version_2014" - "job_input_version_2013.1" - "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" - commands "*job_option version:default" -#if 0 - "*job_option version:2020" -#endif - "*job_option version:2019.1" - "*job_option version:2019" - "*job_option version:2018.1" - "*job_option version:2018" - "*job_option version:2017.1" - "*job_option version:2017" - "*job_option version:2016" - "*job_option version:2015" - "*job_option version:2014.2" - "*job_option version:2014.1" - "*job_option version:2014" - "*job_option version:2013.1" - "*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_2020" -#endif - "job_allows_input_version_2019.1" - "job_allows_input_version_2019" - "job_allows_input_version_2018.1" - "job_allows_input_version_2018" - "job_allows_input_version_2017.1" - "job_allows_input_version_2017" - "job_allows_input_version_2016" - "job_allows_input_version_2015" - "job_allows_input_version_2014.2" - "job_allows_input_version_2014.1" - "job_allows_input_version_2014" - "job_allows_input_version_2013.1" - "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" - } - -# 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" - 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" - help job_option_input_style - } - - toggle { - position 0 +4 - size 24 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" - } - toggle { - position +24 = - size 24 4 - text "INCLUDE UNUSED TABLES" - toggle "*job_option input_file_tables:all" - true_command "*job_option input_file_tables:all" - false_command "*job_option input_file_tables:used" - } - } - } - - button { - position 1 +14 - size 24 4 - text "SCRATCH DIRECTORY" - settext $directory_browser_label "JOB SCRATCH DIRECTORY" - set $directory_browser_command "*job_scratch_directory" - browser directory_browser - 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 - } - - mode permanent -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_exit_msg_pm { - - text "EXIT MESSAGE" - - group { - - - - text { - position 1 5 - size 84 74 - multiline - readonly - display "job_exit_msg" - } - - 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 -} - - - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_parallelization_pm { - - text "SOLVER/PARALLELIZATION" - - group { - layout vbox - frame { - position 0 0 - size 42 8 - group { - - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 36 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 36 4 - display job_class_label - } - } - } - frame { - position 0 8 - size 42 20 - group job_ddm_gr - text "DOMAIN DECOMPOSITION" - border_width 1 - border_color black - } - - frame { - position 0 +20 - size 42 13 - group job_assem_recov_gr - text "ASSEMBLY AND RECOVERY" - border_width 1 - border_color black - } - - frame { - position 0 +14 - size 42 31 - group job_parallel_matrix_solver_gr - text "MATRIX SOLVER" - border_width 1 - border_color black - } - - frame { - position 0 +32 - size 42 28 - group job_parallel_env_gr - text "PARALLELIZATION ENVIRONMENT" - border_width 1 - border_color black - visible "or(*job_option parallel:on, \ - solver_multi_procs)" - } - frame { - position 15 +30 - size 42 8 - group { - layout hbox - - spacer { - stretch 1 - } - popdown { - position 15 0 - size 12 8 - text "OK" - } - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - stretch 1 - } - } - - window { - parent mentat - origin 38 1 - size 60 119 - background_color body - border_width 1 - border_color border - buffering single - } - mode permanent -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_gr { - - toggle { - position 1 4 - size 42 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" - active "and(not(job_solver_it_ext),\ - not(job_solver_mixed_direct_iterative))" - } - - frame { - position = +5 - size 42 4 - group job_ddm_use_gr - visible "*job_option parallel:on" - } -} - -group job_ddm_use_gr { - layout vbox - frame{ - position 0 0 - size 30 4 - group { - layout hbox - label { - position 0 0 - size 12 4 - text "DECOMPOSITION IN" - help job_run_ddm_generator - } - oneonly{ - position +12 = - size 8 4 - text "MARC" - oneonly "*job_option ddm_generator:fea_solver" - command "*job_option ddm_generator:fea_solver" - help job_run_ddm_generator - } - oneonly{ - position +12 = - size 8 4 - text "MENTAT" - oneonly "*job_option ddm_generator:preprocessor" - command "*job_option ddm_generator:preprocessor" - 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" - } - - frame{ - position 0 +5 - size 40 4 - group{ - layout hbox - text { - position 0 0 - size 22 4 - text "Single Input File" - 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 - } - } - } -} - - - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_fea_solver_gr { - - label { - position 0 0 - size 10 4 - text "# DOMAINS" - help job_param - } - - text { - position +10 = - size 4 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position 0 +4 - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 18 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" - 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" - } - - button { - position +18 = - size 12 4 - text "ADV. SETTINGS" - popmenu job_ddm_fea_solver_pm - } -} - - - - -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_fea_solver_pm { - text "JOB PARALLELIZATION" - mode permanent - - group { - layout vbox - spacing 0 - - frame job_properties_subm_header_fr - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - frame { - text "ADVANCED DECOMPOSITION IN MARC" - - group { - layout vbox - spacing 0 - - frame { - - group { - layout hbox - spacing 0 - - label { - size 12 4 - text "# DOMAINS" - help job_param - } - - text { - size 14 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - size 8 4 - text "METHOD" - } - - roller { - size 32 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "RECURSIVE COORDINATE 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" - 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" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - visible "or(*job_option ddm_method:vector, \ - *job_option ddm_method:radial, \ - *job_option ddm_method:angular)" - - group { - layout hbox - spacing 0 - - frame { - group job_ddm_direction_gr - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - toggle { - size 24 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" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - size 8 4 - text "GRAPH" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } - - roller { - size 8 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)" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - size 20 4 - text "QUADRATIC ELEMENTS" - } - - roller { - size 12 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" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - position 0 +5 - size 24 4 - text "ELEMENT WEIGHT FACTOR" - help job_param - } - - text { - position +24 = - size 14 4 - display "job_param_value_ddm_elem_weight_factor" - command "*job_param ddm_elem_weight_factor" - help job_run_ddm_decomp_element_weight_factor - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - - group { - layout hbox - spacing 0 - - frame { - - group { - - toggle { - position 0 0 - size 16 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" - help job_run_ddm_decomp_detect_contact - } - - label { - position = +5 - size 28 4 - text "CONTACT TOLERANCE" - visible "*job_option ddm_detect_contact:on" - } - - text { - position +28 = - size 14 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 - } - - label { - position 0 +4 - size 28 4 - text "CONTACT CONSTRAINT FACTOR" - visible "*job_option ddm_detect_contact:on" - } - - text { - position +28 = - size 14 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 - } - } - } - - spacer { - stretch 1 - } - } - } - } - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame job_properties_subm_footer_fr - } -} # job_ddm_fea_solver_pm - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_direction_gr { - - button { - position 0 0 - size 21 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "model_anadim_3d" - } - - button { - position = = - size 21 4 - text "DIRECTION" - command "*job_vector_2d ddm_sort_direction_x" - visible "not(model_anadim_3d)" - } - - button { - position +21 = - size 21 4 - text "FROM / TO" - command "*job_vector_from_to ddm_sort_direction_x" - visible "model_anadim_3d" - } - - button { - position = = - size 21 4 - text "FROM / TO" - command "*job_vector_from_to_2d ddm_sort_direction_x" - visible "not(model_anadim_3d)" - } - - frame { - position 0 +4 - size 42 4 - - group { - layout hbox - spacing 0 - - text { - size 14 4 - command "*job_param ddm_sort_direction_x" - display "job_param_value_ddm_sort_direction_x" - help ddm_job_decomp_user_direction_x - } - - text { - size 14 4 - command "*job_param ddm_sort_direction_y" - display "job_param_value_ddm_sort_direction_y" - } - - text { - size 14 4 - command "*job_param ddm_sort_direction_z" - display "job_param_value_ddm_sort_direction_z" - visible "model_anadim_3d" - } - } - } - - frame { - position 0 +4 - size 42 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 16 4 - text "POINT ON AXIS" - } - - roller { - position +16 = - size 10 4 - nvalues 2 - texts "DEFAULT" - "USER" - roller "job_option ddm_sort_point" - commands "*job_option ddm_sort_point:default" - "*job_option ddm_sort_point:user" - } - - button { - position +20 = - size 6 4 - text "SET" - command "*job_position ddm_sort_point_x" - visible "and(*job_option ddm_sort_point:user, model_anadim_3d)" - } - - button { - position = = - size 6 4 - text "SET" - command "*job_position_2d ddm_sort_point_x" - visible "and(*job_option ddm_sort_point:user, not(model_anadim_3d))" - } - - frame { - position 0 +4 - size 42 4 - visible "*job_option ddm_sort_point:user" - - group { - layout hbox - spacing 0 - - text { - size 14 4 - command "*job_param ddm_sort_point_x" - display "job_param_value_ddm_sort_point_x" - } - - text { - size 14 4 - command "*job_param ddm_sort_point_y" - display "job_param_value_ddm_sort_point_y" - } - - text { - size 14 4 - command "*job_param ddm_sort_point_z" - display "job_param_value_ddm_sort_point_z" - visible "model_anadim_3d" - } - } - } -} - - - - -#-------------------------------------------------------------------------------------------------- -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 0 +4 - size 30 4 - text "USER DOMAINS" - popmenu domains_pm - help job_run_ddm_user_domains - } -} - - - - -#-------------------------------------------------------------------------------------------------- -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" - } - - label { - position = +4 - size 12 4 - text "# THREADS" - visible "*job_option assem_recov_multi_threading:on" - } - - 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 10 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)" - } - spacer{ - stretch 2 - } - -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_matrix_solver_gr { - layout vbox - frame { - position 1 0 - size 36 31 - group { - layout hbox - label { - position 3 4 - size 12 4 - text "SOLUTION" - border_width 1 - border_color black - } - oneonly { - position +12 = - size 12 4 - text "SYMMETRIC" - help "job_param_solver_method#symmetric" - oneonly "job_nonsym_off" - command "*job_option solver_nonsym:off" - } - oneonly { - position +12 = - size 12 4 - text "NONSYMMETRIC" - help "job_param_solver_method#symmetric" - oneonly "job_nonsym_on" - command "*job_option solver_nonsym:on" - } - spacer { - stretch 1 - } - } - } - - frame { - position 1 +5 - size 42 23 - group matrix_solver_gr - help job_param_solver - } - - frame { - position +1 = - size 42 4 - group job_run_solver_ddm_opts_gr - visible "*job_option parallel:on" - } - - frame { - position 1 +23 - size 42 8 - group job_solver_multi_procs_gr - visible solver_allows_multi_procs - } - - frame { - position = = - size 42 8 - group job_solver_multi_threads_gr - visible solver_allows_multi_threads - } - - frame { - position 1 +9 - size 42 8 - group job_solver_gpu_gr - visible "or(and(job_solver_mfront_sparse,job_nonsym_off), \ - and(job_solver_it_sparse,job_nonsym_off))" - } - -} - - -#-------------------------------------------------------------------------------------------------- -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))" - } - button { - position = = - size 14 4 - text "\{DDM} OPTIONS" - popmenu ddm_options_mumps - visible "job_solver_mumps" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_gr { - frame { - position 0 0 - size 42 8 - group job_solver_multi_procs_parallel_off_gr - visible "*job_option parallel:off" - } - - frame { - position = = - size 42 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_param_solver_method#mumps" - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option nsolver_procs_serial:on" - help job_param - } - - 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_param_solver_method#mumps" - toggle true - set $dummy dummy - } - - 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_param_solver_method#mumps" - 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 { - - label { - position 0 0 - size 8 4 - text "VALUE" - help job_param - } - - text { - position +8 = - size 8 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - } -} - -group job_solver_multi_threads_gr { - layout vbox - spacing 0 - - frame { - size 46 8 - group job_solver_multi_threads_it_sparse_parallel_off_gr - visible "and(job_solver_it_sparse,*job_option parallel:off)" - active "*job_option solver_use_gpu:off" - } - - frame { - size 46 8 - group job_solver_multi_threads_mfront_sparse_parallel_off_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:off)" - active "*job_option solver_use_gpu:off" - } - - frame { - size 46 8 - group job_solver_multi_threads_mfront_sparse_parallel_on_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:on)" - } - - frame { - size 46 8 - group job_solver_multi_threads_pardiso_parallel_off_gr - visible "and(job_solver_pardiso,*job_option parallel:off)" - } - - frame { - size 46 8 - group job_solver_multi_threads_pardiso_parallel_on_gr - visible "and(job_solver_pardiso,*job_option parallel:on)" - } - - frame { - size 46 8 - group job_solver_multi_threads_it_ext_off_gr - visible "and(job_solver_it_ext,*job_option parallel:off)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_it_sparse_parallel_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - toggle "*job_option it_sparse_multi_threading:on" - true_command "*job_option it_sparse_multi_threading:on" - false_command "*job_option it_sparse_multi_threading:off" - help "job_param_solver_method#iterative" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option it_sparse_multi_threading:on" - help "job_param_solver_method#iterative" - } - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option it_sparse_multi_threading:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_mfront_sparse_parallel_off_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_param_solver_method#multifrontal" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option mfront_sparse_multi_threading:on" - help "job_param_solver_method#multifrontal" - } - - 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_multi_threads_mfront_sparse_parallel_on_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - help "job_param_solver_method#multifrontal" - toggle true - set $dummy dummy - } - - label { - position +30 0 - size 12 4 - visible "and( not(*job_option ddm_precond:direct)\ - *job_option parallel:on)" - text "PER DOMAIN" - border_width 1 - border_color black - help "job_param_solver_method#multifrontal" - } - - display { - position +12 0 - size 4 4 - display "job_mfront_sparse_nthreads_dom" - visible "and( not(*job_option ddm_precond:direct)\ - *job_option parallel:on)" - } - - label { - position 0 +4 - size 14 4 - text "# THREADS" - border_color black - border_width 1 - help "job_param_solver_method#multifrontal" - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option mfront_sparse_multi_threading_ddm:automatic" - "*job_option mfront_sparse_multi_threading_ddm:user" - help "job_param_solver_method#multifrontal" - rollers "*job_option mfront_sparse_multi_threading_ddm:automatic" - "*job_option mfront_sparse_multi_threading_ddm:user" - visible "not(*job_option solver_use_gpu:on)" - } - - display { - position = = - size 14 4 - text "AUTOMATIC" - visible "*job_option solver_use_gpu:on" - } - - frame { - position +14 = - size 16 4 - group job_mfront_sparse_multi_threads_ddm_automatic_gr - visible "*job_option mfront_sparse_multi_threading_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_mfront_sparse_multi_threads_ddm_user_gr - visible "*job_option mfront_sparse_multi_threading_ddm:user" - } -} -#-------------------------------------------------------------------------------------------------- -group job_mfront_sparse_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_mfront_sparse_multi_threads_ddm_user_gr { - - label { - position 0 0 - size 8 4 - text "VALUE" - help "job_param_solver_method#multifrontal" - } - - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - - - -#-------------------------------------------------------------------------------------------------- -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 - } - frame{ - position 0 +4 - size 28 4 - group{ - layout hbox - - label { - position 0 0 - 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 12 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)" - } - spacer { - stretch 1 - } - } - } -} - -#-------------------------------------------------------------------------------------------------- -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_param_solver_method#pardiso" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option pardiso_multi_threading:on" - help "job_param_solver_method#pardiso" - } - - 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_param_solver_method#pardiso" - toggle true - set $dummy dummy - } - - label { - position = +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_param_solver_method#pardiso" - 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 { - - label { - position 0 0 - size 8 4 - text "VALUE" - help "job_param_solver_method#pardiso" - } - - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_it_ext_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - toggle "*job_option it_ext_multi_threading:on" - true_command "*job_option it_ext_multi_threading:on" - false_command "*job_option it_ext_multi_threading:off" - help "job_param_solver_method#casi" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option it_ext_multi_threading:on" - help "job_param_solver_method#casi" - } - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option it_ext_multi_threading:on" - } -} - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_gr { - - frame{ - position 0 +4 - size 40 4 - group{ - layout hbox - label{ - position 0 0 - size 8 4 - text "SETUP" - help job_run_ddm_setup - } - oneonly { - position +12 = - size 12 4 - text "SINGLE MACHINE" - oneonly "*job_option parallel_setup:single" - command "*job_option parallel_setup:single" - help job_run_ddm_setup - } - oneonly { - position +8 = - size 12 4 - text "NETWORK" - oneonly "*job_option parallel_setup:network" - command "*job_option parallel_setup:network" - help job_run_ddm_setup - } - - spacer { - stretch 1 - } - } - } - - - frame { - position +1 +5 - size 40 16 - 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" - browser host_file_browser - 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 - } -} - - -#endif - diff --git a/install/MarcMentat/2020/Mentat_menus/job_run.ms.patch b/install/MarcMentat/2020/Mentat_menus/job_run.ms.patch new file mode 100644 index 000000000..e011e93e3 --- /dev/null +++ b/install/MarcMentat/2020/Mentat_menus/job_run.ms.patch @@ -0,0 +1,156 @@ +--- ++++ +@@ -260,10 +260,17 @@ + } + button { + position +25 = +- size 25 4 ++ size 18 4 + text "ADVANCED JOB SUBMISSION" + help "job_run#Job Submission And Control" + popmenu job_submit_adv_pm ++ } ++ button { ++ position +18 = ++ size 7 4 ++ text "DAMASK" ++ help "damask_run#Job Submission And Control" ++ popmenu damask + } + button { + position 0 +4 +@@ -1123,6 +1130,134 @@ + mode permanent + } + ++#-------------------------------------------------------------------------------------------------- ++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" ++ } ++ ++ 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 permanent ++} + + #-------------------------------------------------------------------------------------------------- + popmenu job_exit_msg_pm { diff --git a/install/MarcMentat/2021.2/Marc_tools/comp_damask_hmp b/install/MarcMentat/2021.2/Marc_tools/comp_damask_hmp deleted file mode 100644 index de6fce745..000000000 --- a/install/MarcMentat/2021.2/Marc_tools/comp_damask_hmp +++ /dev/null @@ -1,53 +0,0 @@ -#!/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 - /bin/rm $DIRJOB/*.smod diff --git a/install/MarcMentat/2021.2/Marc_tools/comp_damask_hmp.patch b/install/MarcMentat/2021.2/Marc_tools/comp_damask_hmp.patch new file mode 100644 index 000000000..9c20f61d4 --- /dev/null +++ b/install/MarcMentat/2021.2/Marc_tools/comp_damask_hmp.patch @@ -0,0 +1,48 @@ +--- ++++ +@@ -6,18 +6,27 @@ + 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.f on host `hostname`" ++echo "Compiling and linking user subroutine $user on host `hostname`" + echo "program: $program" +- $FORTRAN $user.f || \ ++ $DFORTHIGHMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null +- userobj=$user.o ++ userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ +@@ -33,9 +42,12 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $BLAS \ + $SYSLIBS || \ + { +- echo "$0: link failed for $user.o on host `hostname`" ++ echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj ++ /bin/rm $DIRJOB/*.mod ++ /bin/rm $DIRJOB/*.smod diff --git a/install/MarcMentat/2021.2/Marc_tools/comp_damask_lmp b/install/MarcMentat/2021.2/Marc_tools/comp_damask_lmp deleted file mode 100644 index 6d063adf3..000000000 --- a/install/MarcMentat/2021.2/Marc_tools/comp_damask_lmp +++ /dev/null @@ -1,53 +0,0 @@ -#!/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 - /bin/rm $DIRJOB/*.smod diff --git a/install/MarcMentat/2021.2/Marc_tools/comp_damask_lmp.patch b/install/MarcMentat/2021.2/Marc_tools/comp_damask_lmp.patch new file mode 100644 index 000000000..d92110f13 --- /dev/null +++ b/install/MarcMentat/2021.2/Marc_tools/comp_damask_lmp.patch @@ -0,0 +1,48 @@ +--- ++++ +@@ -6,18 +6,27 @@ + 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.f on host `hostname`" ++echo "Compiling and linking user subroutine $user on host `hostname`" + echo "program: $program" +- $FORTRAN $user.f || \ ++ $DFORTRANLOWMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null +- userobj=$user.o ++ userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ +@@ -33,9 +42,12 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $BLAS \ + $SYSLIBS || \ + { +- echo "$0: link failed for $user.o on host `hostname`" ++ echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj ++ /bin/rm $DIRJOB/*.mod ++ /bin/rm $DIRJOB/*.smod diff --git a/install/MarcMentat/2021.2/Marc_tools/comp_damask_mp b/install/MarcMentat/2021.2/Marc_tools/comp_damask_mp deleted file mode 100644 index 871b8a449..000000000 --- a/install/MarcMentat/2021.2/Marc_tools/comp_damask_mp +++ /dev/null @@ -1,53 +0,0 @@ -#!/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 - /bin/rm $DIRJOB/*.smod diff --git a/install/MarcMentat/2021.2/Marc_tools/comp_damask_mp.patch b/install/MarcMentat/2021.2/Marc_tools/comp_damask_mp.patch new file mode 100644 index 000000000..d9ff8d660 --- /dev/null +++ b/install/MarcMentat/2021.2/Marc_tools/comp_damask_mp.patch @@ -0,0 +1,48 @@ +--- ++++ +@@ -6,18 +6,27 @@ + 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.f on host `hostname`" ++echo "Compiling and linking user subroutine $user on host `hostname`" + echo "program: $program" +- $FORTRAN $user.f || \ ++ $DFORTRANMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null +- userobj=$user.o ++ userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ +@@ -33,9 +42,12 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $BLAS \ + $SYSLIBS || \ + { +- echo "$0: link failed for $user.o on host `hostname`" ++ echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj ++ /bin/rm $DIRJOB/*.mod ++ /bin/rm $DIRJOB/*.smod diff --git a/install/MarcMentat/2021.2/Marc_tools/comp_user.original b/install/MarcMentat/2021.2/Marc_tools/comp_user.original deleted file mode 100644 index 8679bb041..000000000 --- a/install/MarcMentat/2021.2/Marc_tools/comp_user.original +++ /dev/null @@ -1,41 +0,0 @@ -#!/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/install/MarcMentat/2021.2/Marc_tools/include_linux64 b/install/MarcMentat/2021.2/Marc_tools/include_linux64 deleted file mode 100644 index 3b9c0d180..000000000 --- a/install/MarcMentat/2021.2/Marc_tools/include_linux64 +++ /dev/null @@ -1,846 +0,0 @@ -# -# General definitions for the Marc 2021.1 version -# -# EM64T -# -# Linux RedHat 7.7 / SuSE 12 SP4 -# -# 64 bit MPI version -# -# Intel(R) Fortran Intel(R) 64 Compiler XE for applications -# running on Intel(R) 64, Version 19.0.4.243 Build 20190416 -# -# Intel(R) C Intel(R) 64 Compiler XE for applications -# running on Intel(R) 64, Version 19.0.4.243 Build 20190416 -# -# To check the O/S level, type: -# uname -a -# -# Distributed parallel MPI libraries: -# Intel MPI 2019 Update 10 -# To check the mpi version, type: -# mpiexec.hydra -version -# -# 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 program. 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 -# -# Flag for performance improvement -# -if ! grep -i -q Intel /proc/cpuinfo ; then - export MKL_DEBUG_CPU_TYPE=5 -fi -# integer size -if test "$MARC_INTEGER_SIZE" = "" ; then - INTEGER_PATH= -else - INTEGER_PATH=/$MARC_INTEGER_SIZE -fi - -FCOMP=ifort -INTELPATH="/opt/intel/compilers_and_libraries_2019/linux" -if test -z "$MARC_INTELMPI"; then - INTELMPIPATH="$INTELPATH/mpi/intel64" -else - INTELMPIPATH="$MARC_INTELMPI/bin" -fi -if test -d /opt/intel/compilers_and_libraries_2018.1.163 ; then - INTELMPIPATH="/opt/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64" -fi - -# find the root directory of the compiler installation: -# - if ifort is found in $PATH, then the root directory is derived -# from the path to ifort -# - if ifort is not found in $PATH, the root directory is assumed -# to be $INTELPATH and the directory in which ifort is found is -# added to $PATH -FCOMPPATH=`which "$FCOMP" 2>/dev/null` -if test -n "$FCOMPPATH"; then - # derive the root directory from $FCOMPPATH - FCOMPROOT="${FCOMPPATH%/bin/intel64/$FCOMP}" - if test "$FCOMPROOT" = "$FCOMPPATH"; then - FCOMPROOT="${FCOMPPATH%/bin/$FCOMP}" - fi - if test "$FCOMPROOT" = "$FCOMPPATH"; then - FCOMPROOT= - fi -elif test -d "$INTELPATH"; then - # check for compiler in $INTELPATH - if test -d "$INTELPATH/bin/intel64" -a \ - -x "$INTELPATH/bin/intel64/$FCOMP" ; then - FCOMPROOT="$INTELPATH" - PATH="$INTELPATH/bin/intel64:$PATH" - elif test -d "$INTELPATH/bin" -a \ - -x "$INTELPATH/bin/$FCOMP"; then - FCOMPROOT="$INTELPATH" - PATH="$INTELPATH/bin:$PATH" - else - FCOMPROOT= - fi -else - FCOMPROOT= -fi - -# Cosim Adapter -if test "$MSCCOSIM_HOME" = ""; then - MARC_COSIM_LIB= -else - MARC_COSIM_LIB="$MSCCOSIM_HOME/CoSim2021/Dcosim2021/lib" -fi -if test "$MSCCOSIM_VERSION" = ""; then - MSCCOSIM_VERSION="2020" -fi - -# DAMASK uses the HDF5 compiler wrapper around the Intel compiler -H5FC="$(h5fc -shlib -show)" -HDF5_LIB=${H5FC//ifort/} -FCOMP="$H5FC -DDAMASK_HDF5" - -# AEM -if test "$MARCDLLOUTDIR" = ""; then - DLLOUTDIR="$MARC_LIB" -else - DLLOUTDIR="$MARCDLLOUTDIR" -fi - -# settings for MKL -if test "$IMKLDIR" = ""; then - MARC_MKL="$FCOMPROOT/mkl/lib/intel64" -else - MARC_MKL=$IMKLDIR/lib/intel64 -fi - -# check for oneAPI -if test "$FCOMPPATH" = "" ; then - if test -d /opt/intel/oneapi; then - PATH="/opt/intel/oneapi/compiler/latest/linux/bin/intel64:$PATH" - MARC_MKL=/opt/intel/oneapi/mkl/latest/lib/intel64 - LD_LIBRARY_PATH=$MARC_MKL:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - FCOMPROOT=/opt/intel/oneapi/compiler/latest/linux/bin/intel64 - fi -fi - -# -# settings for Metis -# -METIS="-I$METIS_SOURCE/include" -METISLIBS="$METISLIB_DIR/libmarcddm.a $METISLIB_DIR/libmarcmetis.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= - -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 - -# Edit following lines to build solver 2 with GPU support -SOLVER2GPU=GPU -#SOLVER2GPU=NONE - -# Edit following lines to set the openssl library -if test "$OPENSSL" != "NONE" -then - OPENSSL_LIB="$MARC_LIB/libcrypto.a" -fi -OPENSSL_INCLUDE=-I"$MARC_OPENSSL/include/" - -MARCHDF_HDF=HDF -#MARCHDF_HDF=NONE - -# activate contact component build if flagged -AEM_DLL=0 -if test "$AEM_BUILD" = "ON" ; then - AEM_DLL=1 - LINK_MARC_DLL="-shared -fPIC" - EXT_DLL="so" - MPITYPE=none - MPI_OTHER= - MARCHDF_HDF=NONE - BCSGPUSOLVER=NONE - SOLVER2GPU=NONE - MUMPSSOLVER=NONE - CASISOLVER=NONE -fi - -if test "$MARCHDF_HDF" = "HDF"; then - HDF_INCLUDE="-I$MARC_HDF/include" - HDF_LIBS="$MARC_LIB/libhdf5_fortran.so.100 $MARC_LIB/libhdf5.so.103" -fi - -SOLVERFLAGS= -if test "$BCSGPUSOLVER" = BCSGPU -then - SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" - BCS_DIR=bcsgpusolver -else - BCS_DIR=bcssolver -fi -# -# settings for MPI -# -DDM= -if test $MPITYPE != none -then - if test $MPITYPE = intelmpi - then - INTELMPI_VERSION=HYDRA - FCOMPMPI=mpiifort - if test -n "$MARC_INTELMPI" ; then - MPI_ROOT=$MARC_INTELMPI - else - MPI_ROOT=$INTELMPIPATH - MARC_INTELMPI=$MPI_ROOT - fi - DDM="-I${MPI_ROOT}/include -DDDM" - PATH=$MPI_ROOT/bin:$PATH - export PATH - LD_LIBRARY_PATH=$MPI_ROOT/lib:$MPI_ROOT/lib/release:$MPI_ROOT/libfabric/lib:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - if test $INTELMPI_VERSION = HYDRA - then - RUN_JOB1="${MPI_ROOT}/bin/mpiexec.hydra -genvall -n " - RUN_JOB2="${MPI_ROOT}/bin/mpiexec.hydra -genvall" - else - RUN_JOB1="${MPI_ROOT}/bin/mpiexec -n " - RUN_JOB2="${MPI_ROOT}/bin/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 - FI_PROVIDER_PATH=$MPI_ROOT/libfabric/lib/prov - export FI_PROVIDER_PATH - if test -f "/etc/SuSE-release"; then - FI_PROVIDER=sockets - export FI_PROVIDER - fi - I_MPI_WAIT_MODE=1 - export I_MPI_WAIT_MODE - 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 -if test "$MARC_CASISOLVER" = "NONE" ; then - CASISOLVER=NONE -fi -#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 - -# Edit following lines to enable zlib support -ZLIB=ZLIB -if test "$MARC_ZLIB" = "NONE"; then - ZLIB=NONE -fi -#ZLIB=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 - SOLVER2GPU=NONE - MARC_DLL=NONE - ZLIB=NONE -fi -if test "$AEM_DLL" -eq 1 -then - VKISOLVER=NONE - CASISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - MUMPSSOLVER=NONE - BCSGPUSOLVER=NONE - SOLVER2GPU=NONE - ZLIB=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 - -if test "$SOLVER2GPU" = GPU -then - SOLVERFLAGS="$SOLVERFLAGS -DSOLVER2GPU" -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" - -MARCCODEPROF= -#MARCCODEPROF="ON" - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - I8FFLAGS= - I8DEFINES= - I8CDEFINES= -else - I8FFLAGS="-i8 -integer-size 64" - I8DEFINES="-DI64 -DINT=8" - I8CDEFINES="-U_DOUBLE -D_SINGLE" -fi - -MTHREAD=OPENMP -if test "$MARC_OPENMP" = "NONE" ; then - MTHREAD=NONE -fi -#MTHREAD=NONE -if test "$_OEM_NASTRAN" -ne 0 -then -MTHREAD=NONE -fi -if test "$AEM_DLL" -eq 1 -then - MTHREAD=NONE - CASISOLVER=NONE - VKISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - BCSGPUSOLVER=NONE - SOLVER2GPU=NONE - OPENSSL_LIB= - MARC_DLL=NONE - METISLIBS= -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" - -if test "$AEM_DLL" -eq 1 -then - FDEFINES="$FDEFINES -D_AEMNL -DAAA" - CDEFINES="$CDEFINES -D_AEMNL -DAAA" -fi - -CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS -I$LAPI_IMPORTS/common/include" -if test "$_OEM_NASTRAN" -ne 0 -then - CINCL="$CINCL -I../../include" -fi - -CC_OPT= -if test "$MTHREAD" = "OPENMP" -then - CC_OPT=" $CC_OPT -qopenmp" -fi - -if test "$ZLIB" = "ZLIB"; then - FDEFINES="$FDEFINES -DENABLE_ZLIB" - CDEFINES="$CDEFINES -DENABLE_ZLIB" - CINCL="$CINCL -I$ZLIB_INCLUDE" -fi - -CC="icc -c $CC_OPT -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " -CCLOW="icc -c $CC_OPT -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " -CCHIGH="icc -c $CC_OPT -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " - -CC_TETMESH="icpc -c -O2 -I$TETMESHDIR/include -qopenmp -ansi-alias -m64 -pipe -fPIC -falign-functions=16 -fstrict-aliasing -fno-jump-tables -MMD -DLINUX -D_CRT_SECURE_NO_WARNINGS -DX64 -DMESHINGAPI_LIB -DNDEBUG" -CC_CAEFATIGUE="icpc -c -O2 -I$CAEFATIGUEDIR/linux64/include -qopenmp -ansi-alias -m64 -pipe -fPIC -falign-functions=16 -fstrict-aliasing -fno-jump-tables -MMD -DLINUX -D_CRT_SECURE_NO_WARNINGS -DX64 -DNDEBUG" - -if test "$MARCDEBUG" = "ON" -then - CC="icc -c $CC_OPT -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " - CCLOW="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " - CCHIGH="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " -fi - -LOAD_CC="icc $CC_OPT -O1 -DLinux -DLINUX -DLinux_intel" -CCT="$CC" -CCTLOW="$CCLOW" -CCTHIGH="$CCHIGH" - -#PROFILE="-Mprof=func" -#PROFILE="-Mprof=lines" -#PROFILE="-Mprof=func,mpi" -PROFILE= -#PROFILE="-init=snan,arrays -CB -traceback -fpe0 -fp-stack-check -check all -check uninit -ftrapuv" -if test "$MARCCODECOV" = "ON" -then -PROFILE="-prof-gen=srcpos" -fi -if test "$MARCCODEPROF" = "ON" -then -PROFILE=" $PROFILE -pg" -fi - -FORT_OPT="-c -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr -mp1 -WB -fp-model source" -if test "$MTHREAD" = "OPENMP" -then - FORT_OPT=" $FORT_OPT -qopenmp" - if test "$OMP_COMPAT" = "YES" - then - FORT_OPT=" $FORT_OPT -qopenmp-threadprivate=compat" - fi -else -# FORT_OPT=" $FORT_OPT -auto " - FORT_OPT=" $FORT_OPT -save -zero" -fi -if test "$MARCHDF_HDF" = "HDF"; then - FORT_OPT="$FORT_OPT -DMARCHDF=$MARCHDF_HDF" -fi - -FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" -FORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" -FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" -FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" -# for compiling free form f90 files. high opt, integer(4) -FORTF90="$FCOMP -c -O3" - -# determine DAMASK version -if test -n "$DAMASK_USER"; then - DAMASKROOT=`dirname $DAMASK_USER`/.. - read DAMASKVERSION < $DAMASKROOT/VERSION - DAMASKVERSION="'"$DAMASKVERSION"'" -else - DAMASKVERSION="'N/A'" -fi - - -# DAMASK compiler calls -DFORTLOWMP="$FCOMP -c -O0 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ - -qopenmp -qopenmp-threadprivate=compat\ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" -DFORTRANMP="$FCOMP -c -O1 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ - -qopenmp -qopenmp-threadprivate=compat\ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" -DFORTHIGHMP="$FCOMP -c -O3 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ - -qopenmp -qopenmp-threadprivate=compat\ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" - -if test "$MARCDEBUG" = "ON" -then - FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" - FORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" - FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" - FORTNA="$FCOMP $FORT_OPT -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_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" - -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/include -I$VT_ROOT/include" -# LOAD="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# LOADT="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# fi - if test $MPITYPE = intelmpi - then - LOAD="ifort $PROFILE $LINK_OPT -o " - LOADT="ifort $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" - 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 - -if test "$AEM_DLL" -eq 1 -then - FORTLOW="$FORTLOW -fpp -fPIC" - FORTRAN="$FORTRAN -fpp -fPIC" - FORTHIGH="$FORTHIGH -fpp -fPIC" - FORTRANMNF="$FORTRANMNF -fpp -fPIC" - CC="$CC -fPIC" - CCMNF="$CCMNF -fPIC" - LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide" - 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="$CASILIB_DIR/libmarccasi.a $CASILIB_DIR/libcasi.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 "$MUMPSSOLVER" = MUMPS -then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps.a" - if test $MPITYPE = intelmpi - then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.a" - fi -else - MUMPSSOLVERLIBS= -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 -else - BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " -fi - -SOLVER2LIBS= -if test "$SOLVER2GPU" = GPU -then - SOLVER2LIBS="-L$MARC_LIB/cuda_dummy -lsolver2gpu" -fi - -if test "$AEM_DLL" -eq 1 -then - BCSSOLVERLIBS= -fi - - -SECLIBS="-L$MARC_LIB -llapi" - -SOLVERLIBS="${BCSSOLVERLIBS} ${VKISOLVERLIBS} ${CASISOLVERLIBS} ${MF2SOLVERLIBS} \ - -L$MARC_MKL \ - $MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a $KDTREE2_LIB/libkdtree2.a $MARC_LIB/libtetmeshinterface.a $MARC_LIB/libcaefatigueinterface.a -L$MARC_LIB -lmkl_blacs_intelmpi_ilp64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -ltetmesh -lmeshgems -lmg-tetra -lmeshgems_stubs $HDF5_LIB $SOLVER2LIBS" - -SOLVERLIBS_DLL=${SOLVERLIBS} -if test "$AEM_DLL" -eq 1 -then -SOLVERLIBS_DLL="-L$MARC_MKL -lmkl_blacs_intelmpi_ilp64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 $MARC_LIB/blas_src.a" -fi -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" -SFLIB="-L$SFMATDIR -lMBA_Grain" -OPENMP="-qopenmp" - -if test "$AEM_DLL" -eq 1 -then - LOAD_DLL=$LOAD - OPENMP= - LIBMNF= - OPENSSL=NONE -fi - -SYSLIBS=" $OPENMP -lpthread -cxxlib" - -# 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}/lib/release -lmpi -L${MPI_ROOT}/lib -lmpifort -lrt $OPENMP -threads -lpthread -cxxlib" -fi - -if test "$ZLIB" = "ZLIB"; then - SYSLIBS="$SYSLIBS $ZLIB_LIB/libz.a" -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 cosim_begin.f" -if test "$MARC_INTEGER_SIZE" = "i8" ; then - LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" -fi - -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 dpsmsah.f tpsmsah.f cn_qsort4_11.f \ - prei11.f prei12.f prei31.f prei32.f prei41.f prei42.f prei61.f prei62.f \ - prei1n.f prei2n.f cgfullnts1.f cgfullnts2.f cg1n.f cg2n.f cg3n.f \ - cg4n.f cg5n.f cg6n.f cgnn.f sortab.f sortab1.f triann1.f preinv_nts.f \ - cn_sur_patchl.f cn_quad_3e.f" - - - -MAXNUM=1000000 diff --git a/install/MarcMentat/2021.2/Marc_tools/include_linux64.original b/install/MarcMentat/2021.2/Marc_tools/include_linux64.original deleted file mode 100644 index bf34f5f50..000000000 --- a/install/MarcMentat/2021.2/Marc_tools/include_linux64.original +++ /dev/null @@ -1,817 +0,0 @@ -# -# General definitions for the Marc 2021.1 version -# -# EM64T -# -# Linux RedHat 7.7 / SuSE 12 SP4 -# -# 64 bit MPI version -# -# Intel(R) Fortran Intel(R) 64 Compiler XE for applications -# running on Intel(R) 64, Version 19.0.4.243 Build 20190416 -# -# Intel(R) C Intel(R) 64 Compiler XE for applications -# running on Intel(R) 64, Version 19.0.4.243 Build 20190416 -# -# To check the O/S level, type: -# uname -a -# -# Distributed parallel MPI libraries: -# Intel MPI 2019 Update 10 -# To check the mpi version, type: -# mpiexec.hydra -version -# -# 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 program. 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 -# -# Flag for performance improvement -# -if ! grep -i -q Intel /proc/cpuinfo ; then - export MKL_DEBUG_CPU_TYPE=5 -fi -# integer size -if test "$MARC_INTEGER_SIZE" = "" ; then - INTEGER_PATH= -else - INTEGER_PATH=/$MARC_INTEGER_SIZE -fi - -FCOMP=ifort -INTELPATH="/opt/intel/compilers_and_libraries_2019/linux" -if test -z "$MARC_INTELMPI"; then - INTELMPIPATH="$INTELPATH/mpi/intel64" -else - INTELMPIPATH="$MARC_INTELMPI/bin" -fi -if test -d /opt/intel/compilers_and_libraries_2018.1.163 ; then - INTELMPIPATH="/opt/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64" -fi - -# find the root directory of the compiler installation: -# - if ifort is found in $PATH, then the root directory is derived -# from the path to ifort -# - if ifort is not found in $PATH, the root directory is assumed -# to be $INTELPATH and the directory in which ifort is found is -# added to $PATH -FCOMPPATH=`which "$FCOMP" 2>/dev/null` -if test -n "$FCOMPPATH"; then - # derive the root directory from $FCOMPPATH - FCOMPROOT="${FCOMPPATH%/bin/intel64/$FCOMP}" - if test "$FCOMPROOT" = "$FCOMPPATH"; then - FCOMPROOT="${FCOMPPATH%/bin/$FCOMP}" - fi - if test "$FCOMPROOT" = "$FCOMPPATH"; then - FCOMPROOT= - fi -elif test -d "$INTELPATH"; then - # check for compiler in $INTELPATH - if test -d "$INTELPATH/bin/intel64" -a \ - -x "$INTELPATH/bin/intel64/$FCOMP" ; then - FCOMPROOT="$INTELPATH" - PATH="$INTELPATH/bin/intel64:$PATH" - elif test -d "$INTELPATH/bin" -a \ - -x "$INTELPATH/bin/$FCOMP"; then - FCOMPROOT="$INTELPATH" - PATH="$INTELPATH/bin:$PATH" - else - FCOMPROOT= - fi -else - FCOMPROOT= -fi - -# Cosim Adapter -if test "$MSCCOSIM_HOME" = ""; then - MARC_COSIM_LIB= -else - MARC_COSIM_LIB="$MSCCOSIM_HOME/CoSim2021/Dcosim2021/lib" -fi -if test "$MSCCOSIM_VERSION" = ""; then - MSCCOSIM_VERSION="2020" -fi - -# AEM -if test "$MARCDLLOUTDIR" = ""; then - DLLOUTDIR="$MARC_LIB" -else - DLLOUTDIR="$MARCDLLOUTDIR" -fi - -# settings for MKL -if test "$IMKLDIR" = ""; then - MARC_MKL="$FCOMPROOT/mkl/lib/intel64" -else - MARC_MKL=$IMKLDIR/lib/intel64 -fi - -# check for oneAPI -if test "$FCOMPPATH" = "" ; then - if test -d /opt/intel/oneapi; then - PATH="/opt/intel/oneapi/compiler/latest/linux/bin/intel64:$PATH" - MARC_MKL=/opt/intel/oneapi/mkl/latest/lib/intel64 - LD_LIBRARY_PATH=$MARC_MKL:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - FCOMPROOT=/opt/intel/oneapi/compiler/latest/linux/bin/intel64 - fi -fi - -# -# settings for Metis -# -METIS="-I$METIS_SOURCE/include" -METISLIBS="$METISLIB_DIR/libmarcddm.a $METISLIB_DIR/libmarcmetis.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= - -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 - -# Edit following lines to build solver 2 with GPU support -SOLVER2GPU=GPU -#SOLVER2GPU=NONE - -# Edit following lines to set the openssl library -if test "$OPENSSL" != "NONE" -then - OPENSSL_LIB="$MARC_LIB/libcrypto.a" -fi -OPENSSL_INCLUDE=-I"$MARC_OPENSSL/include/" - -MARCHDF_HDF=HDF -#MARCHDF_HDF=NONE - -# activate contact component build if flagged -AEM_DLL=0 -if test "$AEM_BUILD" = "ON" ; then - AEM_DLL=1 - LINK_MARC_DLL="-shared -fPIC" - EXT_DLL="so" - MPITYPE=none - MPI_OTHER= - MARCHDF_HDF=NONE - BCSGPUSOLVER=NONE - SOLVER2GPU=NONE - MUMPSSOLVER=NONE - CASISOLVER=NONE -fi - -if test "$MARCHDF_HDF" = "HDF"; then - HDF_INCLUDE="-I$MARC_HDF/include" - HDF_LIBS="$MARC_LIB/libhdf5_fortran.so.100 $MARC_LIB/libhdf5.so.103" -fi - -SOLVERFLAGS= -if test "$BCSGPUSOLVER" = BCSGPU -then - SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" - BCS_DIR=bcsgpusolver -else - BCS_DIR=bcssolver -fi -# -# settings for MPI -# -DDM= -if test $MPITYPE != none -then - if test $MPITYPE = intelmpi - then - INTELMPI_VERSION=HYDRA - FCOMPMPI=mpiifort - if test -n "$MARC_INTELMPI" ; then - MPI_ROOT=$MARC_INTELMPI - else - MPI_ROOT=$INTELMPIPATH - MARC_INTELMPI=$MPI_ROOT - fi - DDM="-I${MPI_ROOT}/include -DDDM" - PATH=$MPI_ROOT/bin:$PATH - export PATH - LD_LIBRARY_PATH=$MPI_ROOT/lib:$MPI_ROOT/lib/release:$MPI_ROOT/libfabric/lib:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - if test $INTELMPI_VERSION = HYDRA - then - RUN_JOB1="${MPI_ROOT}/bin/mpiexec.hydra -genvall -n " - RUN_JOB2="${MPI_ROOT}/bin/mpiexec.hydra -genvall" - else - RUN_JOB1="${MPI_ROOT}/bin/mpiexec -n " - RUN_JOB2="${MPI_ROOT}/bin/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 - FI_PROVIDER_PATH=$MPI_ROOT/libfabric/lib/prov - export FI_PROVIDER_PATH - if test -f "/etc/SuSE-release"; then - FI_PROVIDER=sockets - export FI_PROVIDER - fi - I_MPI_WAIT_MODE=1 - export I_MPI_WAIT_MODE - 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 -if test "$MARC_CASISOLVER" = "NONE" ; then - CASISOLVER=NONE -fi -#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 - -# Edit following lines to enable zlib support -ZLIB=ZLIB -if test "$MARC_ZLIB" = "NONE"; then - ZLIB=NONE -fi -#ZLIB=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 - SOLVER2GPU=NONE - MARC_DLL=NONE - ZLIB=NONE -fi -if test "$AEM_DLL" -eq 1 -then - VKISOLVER=NONE - CASISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - MUMPSSOLVER=NONE - BCSGPUSOLVER=NONE - SOLVER2GPU=NONE - ZLIB=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 - -if test "$SOLVER2GPU" = GPU -then - SOLVERFLAGS="$SOLVERFLAGS -DSOLVER2GPU" -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" - -MARCCODEPROF= -#MARCCODEPROF="ON" - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - I8FFLAGS= - I8DEFINES= - I8CDEFINES= -else - I8FFLAGS="-i8" - I8DEFINES="-DI64" - I8CDEFINES="-U_DOUBLE -D_SINGLE" -fi - -MTHREAD=OPENMP -if test "$MARC_OPENMP" = "NONE" ; then - MTHREAD=NONE -fi -#MTHREAD=NONE -if test "$_OEM_NASTRAN" -ne 0 -then -MTHREAD=NONE -fi -if test "$AEM_DLL" -eq 1 -then - MTHREAD=NONE - CASISOLVER=NONE - VKISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - BCSGPUSOLVER=NONE - SOLVER2GPU=NONE - OPENSSL_LIB= - MARC_DLL=NONE - METISLIBS= -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" - -if test "$AEM_DLL" -eq 1 -then - FDEFINES="$FDEFINES -D_AEMNL -DAAA" - CDEFINES="$CDEFINES -D_AEMNL -DAAA" -fi - -CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS -I$LAPI_IMPORTS/common/include" -if test "$_OEM_NASTRAN" -ne 0 -then - CINCL="$CINCL -I../../include" -fi - -CC_OPT= -if test "$MTHREAD" = "OPENMP" -then - CC_OPT=" $CC_OPT -qopenmp" -fi - -if test "$ZLIB" = "ZLIB"; then - FDEFINES="$FDEFINES -DENABLE_ZLIB" - CDEFINES="$CDEFINES -DENABLE_ZLIB" - CINCL="$CINCL -I$ZLIB_INCLUDE" -fi - -CC="icc -c $CC_OPT -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " -CCLOW="icc -c $CC_OPT -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " -CCHIGH="icc -c $CC_OPT -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " - -CC_TETMESH="icpc -c -O2 -I$TETMESHDIR/include -qopenmp -ansi-alias -m64 -pipe -fPIC -falign-functions=16 -fstrict-aliasing -fno-jump-tables -MMD -DLINUX -D_CRT_SECURE_NO_WARNINGS -DX64 -DMESHINGAPI_LIB -DNDEBUG" -CC_CAEFATIGUE="icpc -c -O2 -I$CAEFATIGUEDIR/linux64/include -qopenmp -ansi-alias -m64 -pipe -fPIC -falign-functions=16 -fstrict-aliasing -fno-jump-tables -MMD -DLINUX -D_CRT_SECURE_NO_WARNINGS -DX64 -DNDEBUG" - -if test "$MARCDEBUG" = "ON" -then - CC="icc -c $CC_OPT -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " - CCLOW="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " - CCHIGH="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE " -fi - -LOAD_CC="icc $CC_OPT -O1 -DLinux -DLINUX -DLinux_intel" -CCT="$CC" -CCTLOW="$CCLOW" -CCTHIGH="$CCHIGH" - -#PROFILE="-Mprof=func" -#PROFILE="-Mprof=lines" -#PROFILE="-Mprof=func,mpi" -PROFILE= -#PROFILE="-init=snan,arrays -CB -traceback -fpe0 -fp-stack-check -check all -check uninit -ftrapuv" -if test "$MARCCODECOV" = "ON" -then -PROFILE="-prof-gen=srcpos" -fi -if test "$MARCCODEPROF" = "ON" -then -PROFILE=" $PROFILE -pg" -fi - -FORT_OPT="-c -assume byterecl -safe_cray_ptr -mp1 -WB -fp-model source" -if test "$MTHREAD" = "OPENMP" -then - FORT_OPT=" $FORT_OPT -qopenmp" - if test "$OMP_COMPAT" = "YES" - then - FORT_OPT=" $FORT_OPT -qopenmp-threadprivate=compat" - fi -else -# FORT_OPT=" $FORT_OPT -auto " - FORT_OPT=" $FORT_OPT -save -zero" -fi -if test "$MARCHDF_HDF" = "HDF"; then - FORT_OPT="$FORT_OPT -DMARCHDF_HDF=$MARCHDF_HDF $HDF_INCLUDE" -fi - -FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" -FORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" -FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" -FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" -# for compiling free form f90 files. high opt, integer(4) -FORTF90="$FCOMP -c -O3" - -if test "$MARCDEBUG" = "ON" -then - FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" - FORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" - FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" - FORTNA="$FCOMP $FORT_OPT -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - $MUMPS_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" - -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/include -I$VT_ROOT/include" -# LOAD="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# LOADT="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# fi - if test $MPITYPE = intelmpi - then - LOAD="ifort $PROFILE $LINK_OPT -o " - LOADT="ifort $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" - 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 - -if test "$AEM_DLL" -eq 1 -then - FORTLOW="$FORTLOW -fpp -fPIC" - FORTRAN="$FORTRAN -fpp -fPIC" - FORTHIGH="$FORTHIGH -fpp -fPIC" - FORTRANMNF="$FORTRANMNF -fpp -fPIC" - CC="$CC -fPIC" - CCMNF="$CCMNF -fPIC" - LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide" - 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="$CASILIB_DIR/libmarccasi.a $CASILIB_DIR/libcasi.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 "$MUMPSSOLVER" = MUMPS -then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps.a" - if test $MPITYPE = intelmpi - then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.a" - fi -else - MUMPSSOLVERLIBS= -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 -else - BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " -fi - -SOLVER2LIBS= -if test "$SOLVER2GPU" = GPU -then - SOLVER2LIBS="-L$MARC_LIB/cuda_dummy -lsolver2gpu" -fi - -if test "$AEM_DLL" -eq 1 -then - BCSSOLVERLIBS= -fi - - -SECLIBS="-L$MARC_LIB -llapi" - -SOLVERLIBS="${BCSSOLVERLIBS} ${VKISOLVERLIBS} ${CASISOLVERLIBS} ${MF2SOLVERLIBS} \ - -L$MARC_MKL \ - $MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a $KDTREE2_LIB/libkdtree2.a $MARC_LIB/libtetmeshinterface.a $MARC_LIB/libcaefatigueinterface.a -L$MARC_LIB -lmkl_blacs_intelmpi_ilp64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -ltetmesh -lmeshgems -lmg-tetra -lmeshgems_stubs $HDF_LIBS $SOLVER2LIBS" - -SOLVERLIBS_DLL=${SOLVERLIBS} -if test "$AEM_DLL" -eq 1 -then -SOLVERLIBS_DLL="-L$MARC_MKL -lmkl_blacs_intelmpi_ilp64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 $MARC_LIB/blas_src.a" -fi -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" -SFLIB="-L$SFMATDIR -lMBA_Grain" -OPENMP="-qopenmp" - -if test "$AEM_DLL" -eq 1 -then - LOAD_DLL=$LOAD - OPENMP= - LIBMNF= - OPENSSL=NONE -fi - -SYSLIBS=" $OPENMP -lpthread -shared-intel -cxxlib" - -# 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}/lib/release -lmpi -L${MPI_ROOT}/lib -lmpifort -lrt $OPENMP -threads -lpthread -shared-intel -cxxlib" -fi - -if test "$ZLIB" = "ZLIB"; then - SYSLIBS="$SYSLIBS $ZLIB_LIB/libz.a" -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 cosim_begin.f" -if test "$MARC_INTEGER_SIZE" = "i8" ; then - LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" -fi - -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 dpsmsah.f tpsmsah.f cn_qsort4_11.f \ - prei11.f prei12.f prei31.f prei32.f prei41.f prei42.f prei61.f prei62.f \ - prei1n.f prei2n.f cgfullnts1.f cgfullnts2.f cg1n.f cg2n.f cg3n.f \ - cg4n.f cg5n.f cg6n.f cgnn.f sortab.f sortab1.f triann1.f preinv_nts.f \ - cn_sur_patchl.f cn_quad_3e.f" - - - -MAXNUM=1000000 diff --git a/install/MarcMentat/2021.2/Marc_tools/include_linux64.patch b/install/MarcMentat/2021.2/Marc_tools/include_linux64.patch new file mode 100644 index 000000000..430d5bc61 --- /dev/null +++ b/install/MarcMentat/2021.2/Marc_tools/include_linux64.patch @@ -0,0 +1,101 @@ +--- ++++ +@@ -118,6 +118,11 @@ + if test "$MSCCOSIM_VERSION" = ""; then + MSCCOSIM_VERSION="2020" + fi ++ ++# DAMASK uses the HDF5 compiler wrapper around the Intel compiler ++H5FC="$(h5fc -shlib -show)" ++HDF5_LIB=${H5FC//ifort/} ++FCOMP="$H5FC -DDAMASK_HDF5" + + # AEM + if test "$MARCDLLOUTDIR" = ""; then +@@ -439,8 +444,8 @@ + I8DEFINES= + I8CDEFINES= + else +- I8FFLAGS="-i8" +- I8DEFINES="-DI64" ++ I8FFLAGS="-i8 -integer-size 64" ++ I8DEFINES="-DI64 -DINT=8" + I8CDEFINES="-U_DOUBLE -D_SINGLE" + fi + +@@ -556,7 +561,7 @@ + PROFILE=" $PROFILE -pg" + fi + +-FORT_OPT="-c -assume byterecl -safe_cray_ptr -mp1 -WB -fp-model source" ++FORT_OPT="-c -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr -mp1 -WB -fp-model source" + if test "$MTHREAD" = "OPENMP" + then + FORT_OPT=" $FORT_OPT -qopenmp" +@@ -569,7 +574,7 @@ + FORT_OPT=" $FORT_OPT -save -zero" + fi + if test "$MARCHDF_HDF" = "HDF"; then +- FORT_OPT="$FORT_OPT -DMARCHDF_HDF=$MARCHDF_HDF $HDF_INCLUDE" ++ FORT_OPT="$FORT_OPT -DMARCHDF=$MARCHDF_HDF" + fi + + FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ +@@ -582,6 +587,30 @@ + $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" + # for compiling free form f90 files. high opt, integer(4) + FORTF90="$FCOMP -c -O3" ++ ++# determine DAMASK version ++if test -n "$DAMASK_USER"; then ++ DAMASKROOT=`dirname $DAMASK_USER`/.. ++ read DAMASKVERSION < $DAMASKROOT/VERSION ++ DAMASKVERSION="'"$DAMASKVERSION"'" ++else ++ DAMASKVERSION="'N/A'" ++fi ++ ++ ++# DAMASK compiler calls ++DFORTLOWMP="$FCOMP -c -O0 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -qopenmp -qopenmp-threadprivate=compat\ ++ $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" ++DFORTRANMP="$FCOMP -c -O1 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -qopenmp -qopenmp-threadprivate=compat\ ++ $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" ++DFORTHIGHMP="$FCOMP -c -O3 -qno-offload -implicitnone -stand f18 -standard-semantics -assume nostd_mod_proc_name -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=2020 -DDAMASKVERSION=$DAMASKVERSION \ ++ -qopenmp -qopenmp-threadprivate=compat\ ++ $MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD -I$MARC_MOD" + + if test "$MARCDEBUG" = "ON" + then +@@ -739,7 +768,7 @@ + + SOLVERLIBS="${BCSSOLVERLIBS} ${VKISOLVERLIBS} ${CASISOLVERLIBS} ${MF2SOLVERLIBS} \ + -L$MARC_MKL \ +- $MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a $KDTREE2_LIB/libkdtree2.a $MARC_LIB/libtetmeshinterface.a $MARC_LIB/libcaefatigueinterface.a -L$MARC_LIB -lmkl_blacs_intelmpi_ilp64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -ltetmesh -lmeshgems -lmg-tetra -lmeshgems_stubs $HDF_LIBS $SOLVER2LIBS" ++ $MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a $KDTREE2_LIB/libkdtree2.a $MARC_LIB/libtetmeshinterface.a $MARC_LIB/libcaefatigueinterface.a -L$MARC_LIB -lmkl_blacs_intelmpi_ilp64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -ltetmesh -lmeshgems -lmg-tetra -lmeshgems_stubs $HDF5_LIB $SOLVER2LIBS" + + SOLVERLIBS_DLL=${SOLVERLIBS} + if test "$AEM_DLL" -eq 1 +@@ -762,7 +791,7 @@ + OPENSSL=NONE + fi + +-SYSLIBS=" $OPENMP -lpthread -shared-intel -cxxlib" ++SYSLIBS=" $OPENMP -lpthread -cxxlib" + + # Uncomment the following lines to turn on the trace and comment out the next 4 lines + # if test $MPITYPE = intelmpi +@@ -772,7 +801,7 @@ + # fi + if test $MPITYPE = intelmpi + then +- SYSLIBS="-L${MPI_ROOT}/lib/release -lmpi -L${MPI_ROOT}/lib -lmpifort -lrt $OPENMP -threads -lpthread -shared-intel -cxxlib" ++ SYSLIBS="-L${MPI_ROOT}/lib/release -lmpi -L${MPI_ROOT}/lib -lmpifort -lrt $OPENMP -threads -lpthread -cxxlib" + fi + + if test "$ZLIB" = "ZLIB"; then diff --git a/install/MarcMentat/2021.2/Marc_tools/run_damask_hmp b/install/MarcMentat/2021.2/Marc_tools/run_damask_hmp deleted file mode 100644 index 524bac7c1..000000000 --- a/install/MarcMentat/2021.2/Marc_tools/run_damask_hmp +++ /dev/null @@ -1,4129 +0,0 @@ -#!/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 # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo This option is deprecated. As of Marc 2015, only # -# the integer*8 version is available. # -# -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. # -# -dl y|n delete log file, if "yes" an old exisitng log file is # -# deleted, no new log is created. If "no" a new log file # -# is created. For job running in the background, the log # -# file is always created. Default is "yes" # -############################################################################## -# 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= -modeerror= -modeoption= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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 $1}}' $HOME/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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) - modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - modeoption=error - echo $modeerror - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i8" - echo " " - echo " use -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - echo - echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available - echo - 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 - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - 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" - - -# getting user subroutine file name -found=0 -for i in "$@"; do - if test $found = 1; then - DAMASK_USER=$i - found=0 - fi - case $i in - -u* | -U*) - found=1 - ;; - esac -done -# sourcing include_linux64 (needs DAMASK_USER to be set) -. $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 -export MESHERDIR -MSC_LICENSE_FINPROC=0 -export MSC_LICENSE_FINPROC -# -# 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_COSIM_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH:$SFMATDIR -if test -f "/etc/redhat-release"; then - ver=`cat /etc/redhat-release | sed 's/.* release \([0-9]\).\([0-9]\+\) .*/\1\2/'` - case "$ver" in - 6*) LD_LIBRARY_PATH="${MARC_LIB_SHARED}rh67:$LD_LIBRARY_PATH" ;; - esac -fi -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$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= -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -ddm_arc=0 -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 -iprintsimufact= -SRCLIB=$MARC_LIB/srclib.a -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_OTHER $MPI_DEFAULT" - 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="$MUMPSLIB_DIR/libmumps_$value.a" - 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 # -############################################################################## -deletelog=yes -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 - ;; - -dl | -DL) - case $value in - y* | Y*) - deletelog=yes - ;; - n* | N*) - deletelog=no - ;; - *) - ;; - 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 - case $value in - sfg | sfm | sim) - iprintsimufact=true - ;; - esac - ;; - -au* | -AU*) - nauto=$value - echo - echo warning: the option -au is no longer supported and will be ignored - echo - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -ddm | -DDM) - ddm_arc=$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="$MUMPSLIB_DIR/libmumps_$value.a" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.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 - -nsolverprint=$nsolver -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 "$iam" = sim ; then - SFLIB="-L$SFMATDIR -lMBA_Grain" -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 $MPI_DEFAULT)" - 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 "$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 - if test "$user" - then -# allow user sub without giving job id - qid=foreground - verify=no - else - error="$error -job id required" -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 - -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -if test $qid = background -a $verify = no -then - deletelog=no -fi - -if test "$deletelog" = no -then -echo \ -" -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid$extra_job_info -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" > $jid.log -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log -fi -echo \ -"Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit" >> $jid.log -fi -echo \ -" -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid$extra_job_info -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" -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" -fi -echo \ -"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" - - -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 "$modeoption" -then - error=$modeerror -fi - -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 -# Update print variable for -nsolver option - nsolverprint=$nsolver - if test $nsolver -eq 0 - then - nsolverprint= - fi - $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 "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 - if test "$jid" - then - /bin/rm $jid.log 2>/dev/null - fi -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 -a "$jid" - -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 DAMASK options for linking - DAMASK="-lstdc++" - - 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. " - 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. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - 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 -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 $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 $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(" -host %s",$1); \ - printf(" -n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) printf(" -wdir %s ",$3); \ - 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 ) printf(" -wdir %s ",$3); \ - 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 - - -# -# check for external file to run using valgrind -# -if test -f $MARC_TOOLS/run_marc_valgrind -then - . $MARC_TOOLS/run_marc_valgrind -fi - - -############################################################################## -# 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 2>/dev/null -# done if no job id given -if test -z "$jid" -then - echo - echo only compilation requested - echo - exit -fi -# -# 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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 2>/dev/null -fi - - -fi -fi diff --git a/install/MarcMentat/2021.2/Marc_tools/run_damask_hmp.patch b/install/MarcMentat/2021.2/Marc_tools/run_damask_hmp.patch new file mode 100644 index 000000000..8842a1fda --- /dev/null +++ b/install/MarcMentat/2021.2/Marc_tools/run_damask_hmp.patch @@ -0,0 +1,708 @@ +--- ++++ +@@ -302,7 +302,23 @@ + + . "$DIR/getarch" + ++ ++# getting user subroutine file name ++found=0 ++for i in "$@"; do ++ if test $found = 1; then ++ DAMASK_USER=$i ++ found=0 ++ fi ++ case $i in ++ -u* | -U*) ++ found=1 ++ ;; ++ esac ++done ++# sourcing include_linux64 (needs DAMASK_USER to be set) + . $MARC_INCLUDE ++ + # + + # +@@ -403,7 +419,7 @@ + did= + vid= + user= +-usersubname= ++usernoext= + objs= + qid=background + cpu= +@@ -571,7 +587,7 @@ + justlist=yes + ;; + -fe* | -FE*) +- feature=$value ++ feature=$value + + ;; + -pr* | -PR*) +@@ -667,50 +683,19 @@ + esac + ;; + -u* | -U*) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname + ;; + esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ 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" +@@ -730,19 +715,19 @@ + ;; + esac + ;; +- -dl | -DL) +- case $value in +- y* | Y*) +- deletelog=yes +- ;; +- n* | N*) +- deletelog=no +- ;; +- *) +- ;; +- esac +- +- ;; ++ -dl | -DL) ++ case $value in ++ y* | Y*) ++ deletelog=yes ++ ;; ++ n* | N*) ++ deletelog=no ++ ;; ++ *) ++ ;; ++ esac ++ ++ ;; + -at | -AT) + att=$value + ;; +@@ -1190,12 +1175,12 @@ + fi + fi + fi +- if test "$usersubname" ++ if test "$user" + then +- if test ! -f $usersubname ++ if test ! -f $user + then + error="$error +-user subroutine file $usersubname not accessible" ++user subroutine file $user not accessible" + fi + fi + if test "$objs" +@@ -1369,7 +1354,7 @@ + else + error="$error + job id required" +- fi ++fi + fi + + case $qid in +@@ -1514,7 +1499,7 @@ + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid$extra_job_info +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1545,7 +1530,7 @@ + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid$extra_job_info +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1668,7 +1653,7 @@ + ;; + esac + fi +- $ECHO "User subroutine name ($usersubname)? $ECHOTXT" ++ $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then +@@ -1677,50 +1662,19 @@ + user= + ;; + *) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in +- \/*) +- ;; +- *) ++ \/*) ++ ;; ++ *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname +- ;; +- esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ ;; ++ 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 +@@ -2255,11 +2209,12 @@ + # + # user subroutine used + # ++# add DAMASK options for linking ++ DAMASK="-lstdc++" + + if test "$user" + then +-# program=$user.marc +- program=$DIRJOB/`$BASENAME $user .f`.marc ++ program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= +@@ -2372,7 +2327,7 @@ + fi + if test "$user" + then +- execpath=$DIRJOB/`$BASENAME $user .f`.marc ++ execpath=$usernoext.marc + usersub=1 + fi + export execpath +@@ -3255,44 +3210,27 @@ + echo + 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 +- ++ userobj=$usermoext.o + 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 || \ ++ $DFORTHIGHMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTHIGHMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi + + +@@ -3312,10 +3250,11 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 +@@ -3325,6 +3264,8 @@ + prgsav=yes + fi + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + + # + # run marc +@@ -3371,7 +3312,7 @@ + fi + else + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes +@@ -3537,7 +3478,7 @@ + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3550,21 +3491,21 @@ + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $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.f on host $i" ++ 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.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3574,39 +3515,27 @@ + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" ++ echo "Compiling and linking user subroutine $user 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 ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTHIGHMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTHIGHMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + 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 + + +@@ -3626,10 +3555,11 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" +@@ -3667,6 +3597,8 @@ + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + + # + # run marc +@@ -3725,42 +3657,42 @@ + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ 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 +- 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 ++ DIR1=$workdir + fi +- done +- 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 + fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then +@@ -3885,7 +3817,7 @@ + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3898,20 +3830,20 @@ + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $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.f on host $i" ++ 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.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3921,37 +3853,25 @@ + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" ++ echo "Compiling and linking user subroutine $user 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 ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTHIGHMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTHIGHMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi # if test $user + + +@@ -3971,10 +3891,11 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 +@@ -4011,7 +3932,8 @@ + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null +- ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + # done if no job id given + if test -z "$jid" + then +@@ -4051,7 +3973,7 @@ + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " + fi + +-$RUN_JOB ++ $RUN_JOB + + if test $nprocd -gt 1 + then +@@ -4095,42 +4017,42 @@ + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ 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 +- 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 ++ DIR1=$workdir + fi +- done +- 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 + fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then diff --git a/install/MarcMentat/2021.2/Marc_tools/run_damask_lmp b/install/MarcMentat/2021.2/Marc_tools/run_damask_lmp deleted file mode 100644 index 951bd3aab..000000000 --- a/install/MarcMentat/2021.2/Marc_tools/run_damask_lmp +++ /dev/null @@ -1,4129 +0,0 @@ -#!/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 # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo This option is deprecated. As of Marc 2015, only # -# the integer*8 version is available. # -# -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. # -# -dl y|n delete log file, if "yes" an old exisitng log file is # -# deleted, no new log is created. If "no" a new log file # -# is created. For job running in the background, the log # -# file is always created. Default is "yes" # -############################################################################## -# 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= -modeerror= -modeoption= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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 $1}}' $HOME/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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) - modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - modeoption=error - echo $modeerror - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i8" - echo " " - echo " use -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - echo - echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available - echo - 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 - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - 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" - - -# getting user subroutine file name -found=0 -for i in "$@"; do - if test $found = 1; then - DAMASK_USER=$i - found=0 - fi - case $i in - -u* | -U*) - found=1 - ;; - esac -done -# sourcing include_linux64 (needs DAMASK_USER to be set) -. $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 -export MESHERDIR -MSC_LICENSE_FINPROC=0 -export MSC_LICENSE_FINPROC -# -# 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_COSIM_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH:$SFMATDIR -if test -f "/etc/redhat-release"; then - ver=`cat /etc/redhat-release | sed 's/.* release \([0-9]\).\([0-9]\+\) .*/\1\2/'` - case "$ver" in - 6*) LD_LIBRARY_PATH="${MARC_LIB_SHARED}rh67:$LD_LIBRARY_PATH" ;; - esac -fi -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$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= -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -ddm_arc=0 -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 -iprintsimufact= -SRCLIB=$MARC_LIB/srclib.a -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_OTHER $MPI_DEFAULT" - 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="$MUMPSLIB_DIR/libmumps_$value.a" - 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 # -############################################################################## -deletelog=yes -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 - ;; - -dl | -DL) - case $value in - y* | Y*) - deletelog=yes - ;; - n* | N*) - deletelog=no - ;; - *) - ;; - 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 - case $value in - sfg | sfm | sim) - iprintsimufact=true - ;; - esac - ;; - -au* | -AU*) - nauto=$value - echo - echo warning: the option -au is no longer supported and will be ignored - echo - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -ddm | -DDM) - ddm_arc=$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="$MUMPSLIB_DIR/libmumps_$value.a" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.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 - -nsolverprint=$nsolver -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 "$iam" = sim ; then - SFLIB="-L$SFMATDIR -lMBA_Grain" -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 $MPI_DEFAULT)" - 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 "$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 - if test "$user" - then -# allow user sub without giving job id - qid=foreground - verify=no - else - error="$error -job id required" -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 - -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -if test $qid = background -a $verify = no -then - deletelog=no -fi - -if test "$deletelog" = no -then -echo \ -" -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid$extra_job_info -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" > $jid.log -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log -fi -echo \ -"Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit" >> $jid.log -fi -echo \ -" -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid$extra_job_info -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" -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" -fi -echo \ -"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" - - -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 "$modeoption" -then - error=$modeerror -fi - -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 -# Update print variable for -nsolver option - nsolverprint=$nsolver - if test $nsolver -eq 0 - then - nsolverprint= - fi - $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 "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 - if test "$jid" - then - /bin/rm $jid.log 2>/dev/null - fi -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 -a "$jid" - -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 DAMASK options for linking - DAMASK="-lstdc++" - - 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. " - 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. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - 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 -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 $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 $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(" -host %s",$1); \ - printf(" -n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) printf(" -wdir %s ",$3); \ - 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 ) printf(" -wdir %s ",$3); \ - 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 - - -# -# check for external file to run using valgrind -# -if test -f $MARC_TOOLS/run_marc_valgrind -then - . $MARC_TOOLS/run_marc_valgrind -fi - - -############################################################################## -# 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 2>/dev/null -# done if no job id given -if test -z "$jid" -then - echo - echo only compilation requested - echo - exit -fi -# -# 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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 2>/dev/null -fi - - -fi -fi diff --git a/install/MarcMentat/2021.2/Marc_tools/run_damask_lmp.patch b/install/MarcMentat/2021.2/Marc_tools/run_damask_lmp.patch new file mode 100644 index 000000000..02642e7b4 --- /dev/null +++ b/install/MarcMentat/2021.2/Marc_tools/run_damask_lmp.patch @@ -0,0 +1,708 @@ +--- ++++ +@@ -302,7 +302,23 @@ + + . "$DIR/getarch" + ++ ++# getting user subroutine file name ++found=0 ++for i in "$@"; do ++ if test $found = 1; then ++ DAMASK_USER=$i ++ found=0 ++ fi ++ case $i in ++ -u* | -U*) ++ found=1 ++ ;; ++ esac ++done ++# sourcing include_linux64 (needs DAMASK_USER to be set) + . $MARC_INCLUDE ++ + # + + # +@@ -403,7 +419,7 @@ + did= + vid= + user= +-usersubname= ++usernoext= + objs= + qid=background + cpu= +@@ -571,7 +587,7 @@ + justlist=yes + ;; + -fe* | -FE*) +- feature=$value ++ feature=$value + + ;; + -pr* | -PR*) +@@ -667,50 +683,19 @@ + esac + ;; + -u* | -U*) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname + ;; + esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ 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" +@@ -730,19 +715,19 @@ + ;; + esac + ;; +- -dl | -DL) +- case $value in +- y* | Y*) +- deletelog=yes +- ;; +- n* | N*) +- deletelog=no +- ;; +- *) +- ;; +- esac +- +- ;; ++ -dl | -DL) ++ case $value in ++ y* | Y*) ++ deletelog=yes ++ ;; ++ n* | N*) ++ deletelog=no ++ ;; ++ *) ++ ;; ++ esac ++ ++ ;; + -at | -AT) + att=$value + ;; +@@ -1190,12 +1175,12 @@ + fi + fi + fi +- if test "$usersubname" ++ if test "$user" + then +- if test ! -f $usersubname ++ if test ! -f $user + then + error="$error +-user subroutine file $usersubname not accessible" ++user subroutine file $user not accessible" + fi + fi + if test "$objs" +@@ -1369,7 +1354,7 @@ + else + error="$error + job id required" +- fi ++fi + fi + + case $qid in +@@ -1514,7 +1499,7 @@ + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid$extra_job_info +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1545,7 +1530,7 @@ + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid$extra_job_info +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1668,7 +1653,7 @@ + ;; + esac + fi +- $ECHO "User subroutine name ($usersubname)? $ECHOTXT" ++ $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then +@@ -1677,50 +1662,19 @@ + user= + ;; + *) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in +- \/*) +- ;; +- *) ++ \/*) ++ ;; ++ *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname +- ;; +- esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ ;; ++ 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 +@@ -2255,11 +2209,12 @@ + # + # user subroutine used + # ++# add DAMASK options for linking ++ DAMASK="-lstdc++" + + if test "$user" + then +-# program=$user.marc +- program=$DIRJOB/`$BASENAME $user .f`.marc ++ program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= +@@ -2372,7 +2327,7 @@ + fi + if test "$user" + then +- execpath=$DIRJOB/`$BASENAME $user .f`.marc ++ execpath=$usernoext.marc + usersub=1 + fi + export execpath +@@ -3255,44 +3210,27 @@ + echo + 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 +- ++ userobj=$usermoext.o + 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 || \ ++ $DFORTLOWMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTLOWMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi + + +@@ -3312,10 +3250,11 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 +@@ -3325,6 +3264,8 @@ + prgsav=yes + fi + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + + # + # run marc +@@ -3371,7 +3312,7 @@ + fi + else + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes +@@ -3537,7 +3478,7 @@ + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3550,21 +3491,21 @@ + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $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.f on host $i" ++ 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.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3574,39 +3515,27 @@ + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" ++ echo "Compiling and linking user subroutine $user 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 ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTLOWMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTLOWMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + 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 + + +@@ -3626,10 +3555,11 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" +@@ -3667,6 +3597,8 @@ + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + + # + # run marc +@@ -3725,42 +3657,42 @@ + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ 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 +- 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 ++ DIR1=$workdir + fi +- done +- 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 + fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then +@@ -3885,7 +3817,7 @@ + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3898,20 +3830,20 @@ + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $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.f on host $i" ++ 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.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3921,37 +3853,25 @@ + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" ++ echo "Compiling and linking user subroutine $user 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 ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTLOWMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTLOWMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi # if test $user + + +@@ -3971,10 +3891,11 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 +@@ -4011,7 +3932,8 @@ + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null +- ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + # done if no job id given + if test -z "$jid" + then +@@ -4051,7 +3973,7 @@ + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " + fi + +-$RUN_JOB ++ $RUN_JOB + + if test $nprocd -gt 1 + then +@@ -4095,42 +4017,42 @@ + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ 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 +- 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 ++ DIR1=$workdir + fi +- done +- 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 + fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then diff --git a/install/MarcMentat/2021.2/Marc_tools/run_damask_mp b/install/MarcMentat/2021.2/Marc_tools/run_damask_mp deleted file mode 100644 index d912b9622..000000000 --- a/install/MarcMentat/2021.2/Marc_tools/run_damask_mp +++ /dev/null @@ -1,4129 +0,0 @@ -#!/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 # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo This option is deprecated. As of Marc 2015, only # -# the integer*8 version is available. # -# -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. # -# -dl y|n delete log file, if "yes" an old exisitng log file is # -# deleted, no new log is created. If "no" a new log file # -# is created. For job running in the background, the log # -# file is always created. Default is "yes" # -############################################################################## -# 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= -modeerror= -modeoption= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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 $1}}' $HOME/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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) - modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - modeoption=error - echo $modeerror - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i8" - echo " " - echo " use -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - echo - echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available - echo - 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 - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - 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" - - -# getting user subroutine file name -found=0 -for i in "$@"; do - if test $found = 1; then - DAMASK_USER=$i - found=0 - fi - case $i in - -u* | -U*) - found=1 - ;; - esac -done -# sourcing include_linux64 (needs DAMASK_USER to be set) -. $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 -export MESHERDIR -MSC_LICENSE_FINPROC=0 -export MSC_LICENSE_FINPROC -# -# 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_COSIM_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH:$SFMATDIR -if test -f "/etc/redhat-release"; then - ver=`cat /etc/redhat-release | sed 's/.* release \([0-9]\).\([0-9]\+\) .*/\1\2/'` - case "$ver" in - 6*) LD_LIBRARY_PATH="${MARC_LIB_SHARED}rh67:$LD_LIBRARY_PATH" ;; - esac -fi -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$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= -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -ddm_arc=0 -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 -iprintsimufact= -SRCLIB=$MARC_LIB/srclib.a -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_OTHER $MPI_DEFAULT" - 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="$MUMPSLIB_DIR/libmumps_$value.a" - 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 # -############################################################################## -deletelog=yes -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 - ;; - -dl | -DL) - case $value in - y* | Y*) - deletelog=yes - ;; - n* | N*) - deletelog=no - ;; - *) - ;; - 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 - case $value in - sfg | sfm | sim) - iprintsimufact=true - ;; - esac - ;; - -au* | -AU*) - nauto=$value - echo - echo warning: the option -au is no longer supported and will be ignored - echo - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -ddm | -DDM) - ddm_arc=$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="$MUMPSLIB_DIR/libmumps_$value.a" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.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 - -nsolverprint=$nsolver -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 "$iam" = sim ; then - SFLIB="-L$SFMATDIR -lMBA_Grain" -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 $MPI_DEFAULT)" - 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 "$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 - if test "$user" - then -# allow user sub without giving job id - qid=foreground - verify=no - else - error="$error -job id required" -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 - -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -if test $qid = background -a $verify = no -then - deletelog=no -fi - -if test "$deletelog" = no -then -echo \ -" -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid$extra_job_info -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" > $jid.log -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log -fi -echo \ -"Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit" >> $jid.log -fi -echo \ -" -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid$extra_job_info -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" -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" -fi -echo \ -"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" - - -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 "$modeoption" -then - error=$modeerror -fi - -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 -# Update print variable for -nsolver option - nsolverprint=$nsolver - if test $nsolver -eq 0 - then - nsolverprint= - fi - $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 "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 - if test "$jid" - then - /bin/rm $jid.log 2>/dev/null - fi -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 -a "$jid" - -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 DAMASK options for linking - DAMASK="-lstdc++" - - 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. " - 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. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - 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 -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 $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 $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(" -host %s",$1); \ - printf(" -n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) printf(" -wdir %s ",$3); \ - 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 ) printf(" -wdir %s ",$3); \ - 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 - - -# -# check for external file to run using valgrind -# -if test -f $MARC_TOOLS/run_marc_valgrind -then - . $MARC_TOOLS/run_marc_valgrind -fi - - -############################################################################## -# 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -/bin/rm $DIRJOB/*.smod 2>/dev/null -# done if no job id given -if test -z "$jid" -then - echo - echo only compilation requested - echo - exit -fi -# -# 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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 2>/dev/null -fi - - -fi -fi diff --git a/install/MarcMentat/2021.2/Marc_tools/run_damask_mp.patch b/install/MarcMentat/2021.2/Marc_tools/run_damask_mp.patch new file mode 100644 index 000000000..c22bcb5c7 --- /dev/null +++ b/install/MarcMentat/2021.2/Marc_tools/run_damask_mp.patch @@ -0,0 +1,708 @@ +--- ++++ +@@ -302,7 +302,23 @@ + + . "$DIR/getarch" + ++ ++# getting user subroutine file name ++found=0 ++for i in "$@"; do ++ if test $found = 1; then ++ DAMASK_USER=$i ++ found=0 ++ fi ++ case $i in ++ -u* | -U*) ++ found=1 ++ ;; ++ esac ++done ++# sourcing include_linux64 (needs DAMASK_USER to be set) + . $MARC_INCLUDE ++ + # + + # +@@ -403,7 +419,7 @@ + did= + vid= + user= +-usersubname= ++usernoext= + objs= + qid=background + cpu= +@@ -571,7 +587,7 @@ + justlist=yes + ;; + -fe* | -FE*) +- feature=$value ++ feature=$value + + ;; + -pr* | -PR*) +@@ -667,50 +683,19 @@ + esac + ;; + -u* | -U*) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname + ;; + esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ 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" +@@ -730,19 +715,19 @@ + ;; + esac + ;; +- -dl | -DL) +- case $value in +- y* | Y*) +- deletelog=yes +- ;; +- n* | N*) +- deletelog=no +- ;; +- *) +- ;; +- esac +- +- ;; ++ -dl | -DL) ++ case $value in ++ y* | Y*) ++ deletelog=yes ++ ;; ++ n* | N*) ++ deletelog=no ++ ;; ++ *) ++ ;; ++ esac ++ ++ ;; + -at | -AT) + att=$value + ;; +@@ -1190,12 +1175,12 @@ + fi + fi + fi +- if test "$usersubname" ++ if test "$user" + then +- if test ! -f $usersubname ++ if test ! -f $user + then + error="$error +-user subroutine file $usersubname not accessible" ++user subroutine file $user not accessible" + fi + fi + if test "$objs" +@@ -1369,7 +1354,7 @@ + else + error="$error + job id required" +- fi ++fi + fi + + case $qid in +@@ -1514,7 +1499,7 @@ + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid$extra_job_info +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1545,7 +1530,7 @@ + Marc shared lib : $progdll + Version type : $mode + Job ID : $DIRJID/$jid$extra_job_info +-User subroutine name : $usersubname ++User subroutine name : $user + User objects/libs : $objs + Restart file job ID : $rid + Substructure file ID : $sid +@@ -1668,7 +1653,7 @@ + ;; + esac + fi +- $ECHO "User subroutine name ($usersubname)? $ECHOTXT" ++ $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then +@@ -1677,50 +1662,19 @@ + user= + ;; + *) +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user +- basefile=`$BASENAME $value` +- if test ${basefile##*.} = f +- then +- user=`dirname $value`/`$BASENAME $value .f` +- usersubname=$user.f +- elif test ${basefile##*.} = F +- then +- user=`dirname $value`/`$BASENAME $value .F` +- usersubname=$user.F +- elif test ${basefile##*.} = f90 +- then +- user=`dirname $value`/`$BASENAME $value .f90` +- usersubname=$user.f90 +- elif test ${basefile##*.} = F90 +- then +- user=`dirname $value`/`$BASENAME $value .F90` +- usersubname=$user.F90 +- fi ++ user=$value + case $user in +- \/*) +- ;; +- *) ++ \/*) ++ ;; ++ *) + user=`pwd`/$user +- usersubname=`pwd`/$usersubname +- ;; +- esac +- if test ! -f $usersubname +- then +- if test -f $usersubname.f +- then +- usersubname=$usersubname.f +- elif test -f $usersubname.F +- then +- usersubname=$usersubname.F +- elif test -f $usersubname.f90 +- then +- usersubname=$usersubname.f90 +- elif test -f $usersubname.F90 +- then +- usersubname=$usersubname.F90 +- fi +- fi ++ ;; ++ 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 +@@ -2255,11 +2209,12 @@ + # + # user subroutine used + # ++# add DAMASK options for linking ++ DAMASK="-lstdc++" + + if test "$user" + then +-# program=$user.marc +- program=$DIRJOB/`$BASENAME $user .f`.marc ++ program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= +@@ -2372,7 +2327,7 @@ + fi + if test "$user" + then +- execpath=$DIRJOB/`$BASENAME $user .f`.marc ++ execpath=$usernoext.marc + usersub=1 + fi + export execpath +@@ -3255,44 +3210,27 @@ + echo + 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 +- ++ userobj=$usermoext.o + 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 || \ ++ $DFORTRANMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTRANMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi + + +@@ -3312,10 +3250,11 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 +@@ -3325,6 +3264,8 @@ + prgsav=yes + fi + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + + # + # run marc +@@ -3371,7 +3312,7 @@ + fi + else + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes +@@ -3537,7 +3478,7 @@ + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3550,21 +3491,21 @@ + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $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.f on host $i" ++ 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.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3574,39 +3515,27 @@ + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" ++ echo "Compiling and linking user subroutine $user 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 ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTRANMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTRANMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + 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 + + +@@ -3626,10 +3555,11 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ +- $SFLIB \ ++ $DAMASK \ ++ $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" +@@ -3667,6 +3597,8 @@ + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + + # + # run marc +@@ -3725,42 +3657,42 @@ + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ 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 +- 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 ++ DIR1=$workdir + fi +- done +- 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 + fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then +@@ -3885,7 +3817,7 @@ + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then +- $RCP $user.f $i:$DIR1/ ++ $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" +@@ -3898,20 +3830,20 @@ + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo +- $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog ++ $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.f on host $i" ++ 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.f 2> /dev/null ++ $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi +@@ -3921,37 +3853,25 @@ + if test "$userhost" + then + echo +- echo "Compiling and linking user subroutine $user.f on host `hostname`" ++ echo "Compiling and linking user subroutine $user 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 ++ userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then +- $FORTRAN $usersub || \ ++ $DFORTRANMP $user || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else +- $FORTRAN $usersub -o $userobj || \ ++ $DFORTRANMP $user -o $userobj || \ + { +- echo "$0: compile failed for $user.f" ++ echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi +- if test ${basefile##*.} = f +- then +- /bin/rm -f "$usersub" +- fi + fi # if test $user + + +@@ -3971,10 +3891,11 @@ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ ++ $DAMASK \ + $SFLIB \ + $OPENSSL_LIB \ + $SYSLIBS \ +- $SECLIBS || \ ++ $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 +@@ -4011,7 +3932,8 @@ + prgsav=yes + fi # if test $link + /bin/rm $userobj 2>/dev/null +- ++/bin/rm $DIRJOB/*.mod 2>/dev/null ++/bin/rm $DIRJOB/*.smod 2>/dev/null + # done if no job id given + if test -z "$jid" + then +@@ -4051,7 +3973,7 @@ + RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " + fi + +-$RUN_JOB ++ $RUN_JOB + + if test $nprocd -gt 1 + then +@@ -4095,42 +4017,42 @@ + counter=0 + if test -f "$host_filt" + then +- for i in `$AWK -v n=$numfield '{print $n}' $host_filt` +- do +- ibase=${i%%.*} +- if test $ibase != $thishost ++ 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 +- 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 ++ DIR1=$workdir + fi +- done +- 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 + fi + else + #dllrun >0 + if test $cpdll = yes; then +- filename=`basename $usersubname .f` ++ filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then diff --git a/install/MarcMentat/2021.2/Marc_tools/run_marc.original b/install/MarcMentat/2021.2/Marc_tools/run_marc.original deleted file mode 100644 index 23e9e0d9c..000000000 --- a/install/MarcMentat/2021.2/Marc_tools/run_marc.original +++ /dev/null @@ -1,4207 +0,0 @@ -#!/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 # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo This option is deprecated. As of Marc 2015, only # -# the integer*8 version is available. # -# -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. # -# -dl y|n delete log file, if "yes" an old exisitng log file is # -# deleted, no new log is created. If "no" a new log file # -# is created. For job running in the background, the log # -# file is always created. Default is "yes" # -############################################################################## -# 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= -modeerror= -modeoption= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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 $1}}' $HOME/run_marc_defaults` - if test "$line" = "MARC_MODE"; then - echo - echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available - echo - line= - fi - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" - modeoption=error - echo $modeerror - 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) - modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - modeoption=error - echo $modeerror - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i8" - echo " " - echo " use -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - echo - echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available - echo - 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 - modeerror="bad value for mode option; only i8 is supported." - modeoption=error - echo - echo $modeerror - echo - 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 -export MESHERDIR -MSC_LICENSE_FINPROC=0 -export MSC_LICENSE_FINPROC -# -# 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_COSIM_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH:$SFMATDIR -if test -f "/etc/redhat-release"; then - ver=`cat /etc/redhat-release | sed 's/.* release \([0-9]\).\([0-9]\+\) .*/\1\2/'` - case "$ver" in - 6*) LD_LIBRARY_PATH="${MARC_LIB_SHARED}rh67:$LD_LIBRARY_PATH" ;; - esac -fi -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$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= -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -ddm_arc=0 -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 -iprintsimufact= -SRCLIB=$MARC_LIB/srclib.a -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_OTHER $MPI_DEFAULT" - 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="$MUMPSLIB_DIR/libmumps_$value.a" - 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 # -############################################################################## -deletelog=yes -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` - usersubname=$user - basefile=`$BASENAME $value` - if test ${basefile##*.} = f - then - user=`dirname $value`/`$BASENAME $value .f` - usersubname=$user.f - elif test ${basefile##*.} = F - then - user=`dirname $value`/`$BASENAME $value .F` - usersubname=$user.F - elif test ${basefile##*.} = f90 - then - user=`dirname $value`/`$BASENAME $value .f90` - usersubname=$user.f90 - elif test ${basefile##*.} = F90 - then - user=`dirname $value`/`$BASENAME $value .F90` - usersubname=$user.F90 - fi - case $user in - \/*) - ;; - *) - user=`pwd`/$user - usersubname=`pwd`/$usersubname - ;; - esac - if test ! -f $usersubname - then - if test -f $usersubname.f - then - usersubname=$usersubname.f - elif test -f $usersubname.F - then - usersubname=$usersubname.F - elif test -f $usersubname.f90 - then - usersubname=$usersubname.f90 - elif test -f $usersubname.F90 - then - usersubname=$usersubname.F90 - fi - fi - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -dl | -DL) - case $value in - y* | Y*) - deletelog=yes - ;; - n* | N*) - deletelog=no - ;; - *) - ;; - 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 - case $value in - sfg | sfm | sim) - iprintsimufact=true - ;; - esac - ;; - -au* | -AU*) - nauto=$value - echo - echo warning: the option -au is no longer supported and will be ignored - echo - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -ddm | -DDM) - ddm_arc=$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="$MUMPSLIB_DIR/libmumps_$value.a" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.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 - -nsolverprint=$nsolver -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 "$iam" = sim ; then - SFLIB="-L$SFMATDIR -lMBA_Grain" -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 $MPI_DEFAULT)" - 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 "$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 - if test "$user" - then -# allow user sub without giving job id - qid=foreground - verify=no - else - error="$error -job id required" - 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 - -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -if test $qid = background -a $verify = no -then - deletelog=no -fi - -if test "$deletelog" = no -then -echo \ -" -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid$extra_job_info -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" > $jid.log -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log -fi -echo \ -"Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit" >> $jid.log -fi -echo \ -" -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid$extra_job_info -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" -if test "$iprintsimufact" = true ; then - echo "DDM with ARC Mapper : $ddm_arc" -fi -echo \ -"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" - - -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 "$modeoption" -then - error=$modeerror -fi - -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 ($usersubname)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=`dirname $value`/`$BASENAME $value .f` - usersubname=$user - basefile=`$BASENAME $value` - if test ${basefile##*.} = f - then - user=`dirname $value`/`$BASENAME $value .f` - usersubname=$user.f - elif test ${basefile##*.} = F - then - user=`dirname $value`/`$BASENAME $value .F` - usersubname=$user.F - elif test ${basefile##*.} = f90 - then - user=`dirname $value`/`$BASENAME $value .f90` - usersubname=$user.f90 - elif test ${basefile##*.} = F90 - then - user=`dirname $value`/`$BASENAME $value .F90` - usersubname=$user.F90 - fi - case $user in - \/*) - ;; - *) - user=`pwd`/$user - usersubname=`pwd`/$usersubname - ;; - esac - if test ! -f $usersubname - then - if test -f $usersubname.f - then - usersubname=$usersubname.f - elif test -f $usersubname.F - then - usersubname=$usersubname.F - elif test -f $usersubname.f90 - then - usersubname=$usersubname.f90 - elif test -f $usersubname.F90 - then - usersubname=$usersubname.F90 - fi - 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 -# Update print variable for -nsolver option - nsolverprint=$nsolver - if test $nsolver -eq 0 - then - nsolverprint= - fi - $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 "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 - if test "$jid" - then - /bin/rm $jid.log 2>/dev/null - fi -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 -a "$jid" - -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. " - 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. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - 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 -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 $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 $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(" -host %s",$1); \ - printf(" -n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) printf(" -wdir %s ",$3); \ - 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 ) printf(" -wdir %s ",$3); \ - 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 - - -# -# check for external file to run using valgrind -# -if test -f $MARC_TOOLS/run_marc_valgrind -then - . $MARC_TOOLS/run_marc_valgrind -fi - - -############################################################################## -# 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SFLIB \ - $OPENSSL_LIB \ - $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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SFLIB \ - $OPENSSL_LIB \ - $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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 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 -z "$FCOMPROOT"; then - echo "$0: No compiler available" - echo - echo " $PRODUCT Exit number 3" - exit 1 - fi - echo - echo "Using compiler from: $FCOMPROOT" - echo - 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 \ - $SRCLIB \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SFLIB \ - $OPENSSL_LIB \ - $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 - -# done if no job id given -if test -z "$jid" -then - echo - echo only compilation requested - echo - exit -fi -# -# 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 - -# for DDM with ARC support - -if test $ddm_arc -gt 0; then - RUN_JOB="$BINDIR/exeddm $RUN_JOB -ddm $ddm_arc " -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 - if test -f "$host_filt" - then - 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 -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 - /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.sin 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 - /bin/rm $DIRJOB/$jid.sle 2>/dev/null - /bin/rm $DIRJOB/$jid.sin 2>/dev/null -fi - - -fi -fi diff --git a/install/MarcMentat/2021.2/Mentat_bin/edit_window b/install/MarcMentat/2021.2/Mentat_bin/edit_window deleted file mode 100644 index b732a7694..000000000 --- a/install/MarcMentat/2021.2/Mentat_bin/edit_window +++ /dev/null @@ -1,5 +0,0 @@ -#!/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/install/MarcMentat/2021.2/Mentat_bin/edit_window.original b/install/MarcMentat/2021.2/Mentat_bin/edit_window.original deleted file mode 100644 index 64c0a68d0..000000000 --- a/install/MarcMentat/2021.2/Mentat_bin/edit_window.original +++ /dev/null @@ -1,18 +0,0 @@ -#!/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/install/MarcMentat/2021.2/Mentat_bin/edit_window.patch b/install/MarcMentat/2021.2/Mentat_bin/edit_window.patch new file mode 100644 index 000000000..b13f45608 --- /dev/null +++ b/install/MarcMentat/2021.2/Mentat_bin/edit_window.patch @@ -0,0 +1,24 @@ +--- ++++ +@@ -1,18 +1,5 @@ + #!/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. ++# This script opens a window running an editor. ++# The command to invoke the editor is specified during DAMASK installation + +-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 $* ++%EDITOR% $* \ No newline at end of file diff --git a/install/MarcMentat/2021.2/Mentat_bin/kill1.original b/install/MarcMentat/2021.2/Mentat_bin/kill1.original deleted file mode 100644 index 6d1ff84bf..000000000 --- a/install/MarcMentat/2021.2/Mentat_bin/kill1.original +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/install/MarcMentat/2021.2/Mentat_bin/kill4 b/install/MarcMentat/2021.2/Mentat_bin/kill4 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/install/MarcMentat/2021.2/Mentat_bin/kill4 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/install/MarcMentat/2021.2/Mentat_bin/kill4.patch b/install/MarcMentat/2021.2/Mentat_bin/kill4.patch new file mode 100644 index 000000000..e69de29bb diff --git a/install/MarcMentat/2021.2/Mentat_bin/kill5 b/install/MarcMentat/2021.2/Mentat_bin/kill5 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/install/MarcMentat/2021.2/Mentat_bin/kill5 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/install/MarcMentat/2021.2/Mentat_bin/kill5.patch b/install/MarcMentat/2021.2/Mentat_bin/kill5.patch new file mode 100644 index 000000000..e69de29bb diff --git a/install/MarcMentat/2021.2/Mentat_bin/kill6 b/install/MarcMentat/2021.2/Mentat_bin/kill6 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/install/MarcMentat/2021.2/Mentat_bin/kill6 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/install/MarcMentat/2021.2/Mentat_bin/kill6.patch b/install/MarcMentat/2021.2/Mentat_bin/kill6.patch new file mode 100644 index 000000000..e69de29bb diff --git a/install/MarcMentat/2021.2/Mentat_bin/submit1.original b/install/MarcMentat/2021.2/Mentat_bin/submit1.original deleted file mode 100644 index 5eb7dc1b2..000000000 --- a/install/MarcMentat/2021.2/Mentat_bin/submit1.original +++ /dev/null @@ -1,189 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=/nethome/f.roters/temp/msc/Marc2021.2/marc2021.2 -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 -SRCEXTC=.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 -copy_datfile="-ci $4" -copy_postfile="-cr $5" -scr_dir=$6 -dcoup=$7 -assem_recov_nthread=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then - slv="-iam sfm" -fi -if [ "$slv" == "marc" ]; then - slv="" -fi -if [ "$slv" == "datfit" ]; then - slv="-iam datfit" -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$//" | sed "s/$SRCEXTC$//"` - 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 \ - $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/install/MarcMentat/2021.2/Mentat_bin/submit4 b/install/MarcMentat/2021.2/Mentat_bin/submit4 deleted file mode 100644 index eea3495da..000000000 --- a/install/MarcMentat/2021.2/Mentat_bin/submit4 +++ /dev/null @@ -1,191 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc2021.2 - -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 -SRCEXTC=.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 -copy_datfile="-ci $4" -copy_postfile="-cr $5" -scr_dir=$6 -dcoup=$7 -assem_recov_nthread=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then - slv="-iam sfm" -fi -if [ "$slv" = "marc" ]; then - slv="" -fi -if [ "$slv" = "datfit" ]; then - slv="-iam datfit" -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$//" | sed "s/$SRCEXTC$//"` - 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 \ - $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/install/MarcMentat/2021.2/Mentat_bin/submit4.patch b/install/MarcMentat/2021.2/Mentat_bin/submit4.patch new file mode 100644 index 000000000..874df90d5 --- /dev/null +++ b/install/MarcMentat/2021.2/Mentat_bin/submit4.patch @@ -0,0 +1,42 @@ +--- ++++ +@@ -4,7 +4,8 @@ + # Normal exit status is 0. + # + +-DIR=/nethome/f.roters/temp/msc/Marc2021.2/marc2021.2 ++DIR=%INSTALLDIR%/marc2021.2 ++ + if test $MARCDIR1 + then + DIR=$MARCDIR1 +@@ -59,10 +60,10 @@ + if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then + slv="-iam sfm" + fi +-if [ "$slv" == "marc" ]; then ++if [ "$slv" = "marc" ]; then + slv="" + fi +-if [ "$slv" == "datfit" ]; then ++if [ "$slv" = "datfit" ]; then + slv="-iam datfit" + fi + +@@ -87,6 +88,7 @@ + srcfile="-u $srcfile -save y" + ;; + runsaved) ++ srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +@@ -181,7 +183,7 @@ + unset PYTHONHOME + unset PYTHONPATH + +-"${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd \ ++"${DIR}/tools/run_damask_hmp" $slv -j $job -v n -b y $nprocds $nprocd \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 diff --git a/install/MarcMentat/2021.2/Mentat_bin/submit5 b/install/MarcMentat/2021.2/Mentat_bin/submit5 deleted file mode 100644 index 8fc6d326c..000000000 --- a/install/MarcMentat/2021.2/Mentat_bin/submit5 +++ /dev/null @@ -1,191 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc2021.2 - -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 -SRCEXTC=.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 -copy_datfile="-ci $4" -copy_postfile="-cr $5" -scr_dir=$6 -dcoup=$7 -assem_recov_nthread=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then - slv="-iam sfm" -fi -if [ "$slv" = "marc" ]; then - slv="" -fi -if [ "$slv" = "datfit" ]; then - slv="-iam datfit" -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$//" | sed "s/$SRCEXTC$//"` - 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 \ - $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/install/MarcMentat/2021.2/Mentat_bin/submit5.patch b/install/MarcMentat/2021.2/Mentat_bin/submit5.patch new file mode 100644 index 000000000..c43a02469 --- /dev/null +++ b/install/MarcMentat/2021.2/Mentat_bin/submit5.patch @@ -0,0 +1,42 @@ +--- ++++ +@@ -4,7 +4,8 @@ + # Normal exit status is 0. + # + +-DIR=/nethome/f.roters/temp/msc/Marc2021.2/marc2021.2 ++DIR=%INSTALLDIR%/marc2021.2 ++ + if test $MARCDIR1 + then + DIR=$MARCDIR1 +@@ -59,10 +60,10 @@ + if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then + slv="-iam sfm" + fi +-if [ "$slv" == "marc" ]; then ++if [ "$slv" = "marc" ]; then + slv="" + fi +-if [ "$slv" == "datfit" ]; then ++if [ "$slv" = "datfit" ]; then + slv="-iam datfit" + fi + +@@ -87,6 +88,7 @@ + srcfile="-u $srcfile -save y" + ;; + runsaved) ++ srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +@@ -181,7 +183,7 @@ + unset PYTHONHOME + unset PYTHONPATH + +-"${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd \ ++"${DIR}/tools/run_damask_mp" $slv -j $job -v n -b y $nprocds $nprocd \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 diff --git a/install/MarcMentat/2021.2/Mentat_bin/submit6 b/install/MarcMentat/2021.2/Mentat_bin/submit6 deleted file mode 100644 index 08007dc87..000000000 --- a/install/MarcMentat/2021.2/Mentat_bin/submit6 +++ /dev/null @@ -1,191 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc2021.2 - -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 -SRCEXTC=.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 -copy_datfile="-ci $4" -copy_postfile="-cr $5" -scr_dir=$6 -dcoup=$7 -assem_recov_nthread=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then - slv="-iam sfm" -fi -if [ "$slv" = "marc" ]; then - slv="" -fi -if [ "$slv" = "datfit" ]; then - slv="-iam datfit" -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$//" | sed "s/$SRCEXTC$//"` - 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 \ - $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/install/MarcMentat/2021.2/Mentat_bin/submit6.patch b/install/MarcMentat/2021.2/Mentat_bin/submit6.patch new file mode 100644 index 000000000..e12e27f8b --- /dev/null +++ b/install/MarcMentat/2021.2/Mentat_bin/submit6.patch @@ -0,0 +1,42 @@ +--- ++++ +@@ -4,7 +4,8 @@ + # Normal exit status is 0. + # + +-DIR=/nethome/f.roters/temp/msc/Marc2021.2/marc2021.2 ++DIR=%INSTALLDIR%/marc2021.2 ++ + if test $MARCDIR1 + then + DIR=$MARCDIR1 +@@ -59,10 +60,10 @@ + if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then + slv="-iam sfm" + fi +-if [ "$slv" == "marc" ]; then ++if [ "$slv" = "marc" ]; then + slv="" + fi +-if [ "$slv" == "datfit" ]; then ++if [ "$slv" = "datfit" ]; then + slv="-iam datfit" + fi + +@@ -87,6 +88,7 @@ + srcfile="-u $srcfile -save y" + ;; + runsaved) ++ srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +@@ -181,7 +183,7 @@ + unset PYTHONHOME + unset PYTHONPATH + +-"${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd \ ++"${DIR}/tools/run_damask_lmp" $slv -j $job -v n -b y $nprocds $nprocd \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 diff --git a/install/MarcMentat/2021.2/Mentat_menus/job_run.ms b/install/MarcMentat/2021.2/Mentat_menus/job_run.ms deleted file mode 100644 index 59d4cc90b..000000000 --- a/install/MarcMentat/2021.2/Mentat_menus/job_run.ms +++ /dev/null @@ -1,3109 +0,0 @@ -#ifndef AUTOFORGE -popmenu job_title_pm file jobs.ms -popdown job_title_ok file jobs.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 matrix_solver_gr file job_common.ms -popmenu ddm_options file job_common.ms - -browser edit_browser file file.ms -browser directory_browser file file.ms -screen domains file domain_decomposition.ms - -frame job_properties_subm_header_fr file job_common.ms -frame job_properties_subm_footer_fr file job_common.ms - - -browser usersub_file_browser { - text "$usersub_file_browser_label" ($usersub_file_browser_label) - filter "*.f *.F *.f90 *.F90" - select_files true - command "$usersub_file_browser_command" ($usersub_file_browser_command) -} - - - -browser host_file_browser { - text "$host_file_browser_label" ($host_file_browser_label) - filter "*" - select_files true - command "$host_file_browser_command" ($host_file_browser_command) -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_popmenu { - - text "RUN JOB" - - group { - - frame { - position 1 1 - size 60 4 - group { - label { - position 0 1 - size 15 4 - text "NAME" - help job_run - } - display { - position +12 = - size 45 4 - display "job_name" - } - label { - position 0 +4 - size 15 4 - text "TYPE" - help job_run - } - display { - position +12 = - size 45 4 - display job_class_label - } - } - } - - frame { - text "USER SUBROUTINES" - position 1 +4 - size 60 4 - group { - button { - position 0 0 - size 30 4 - text "FORTRAN SOURCE FILE" - help "job_run#User Subroutines" - browser usersub_file_browser - settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" - set $usersub_file_browser_command "*job_usersub_file" - } - toggle { - position +30 = - size 30 4 - text "SELECTED USER SUBS" - help "job_run#User Subroutines" - toggle job_usersubs - active job_usersubs - popmenu job_usersub_pm - } - display { - position 0 +4 - size 60 4 - display job_usersub_file - visible job_usersub_file - } - button { - position 0 +4 - size 15 4 - text "EDIT" - help "job_run#User Subroutines" - command "*job_edit_usersub_file" - visible job_usersub_file - } - button { - position +15 = - size 15 4 - text "CLEAR" - help "job_run#User Subroutines" - command "*job_clear_usersub_file" - visible job_usersub_file - } - roller { - position +15 = - size 30 4 - nvalues 3 - texts "COMPILE / NO SAVE" - "COMPILE AND SAVE" - "RUN SAVED EXECUTABLE" - help "job_run#User Subroutines" - roller "job_option user_source" - visible job_usersub_file - commands "*job_option user_source:compile_nosave" - "*job_option user_source:compile_save" - "*job_option user_source:run_saved" - } - } - } - - frame { - text "SOLVER/PARALLELIZATION" - position 1 +4 - size 60 4 - group { - button { - position 0 0 - size 30 4 - text "SETTINGS" - help "job_run#Solver/Parallelization" - popmenu job_run_parallelization_pm - set $popname2 "job_run_parallelization_pm" - } - display { - position 0 +4 - size 30 4 - display job_solver_solution - } - display { - position +30 = - size 30 4 - display job_ddm_domains - } - display { - position 0 +4 - size 30 4 - display job_solver_type - } - display { - position +30 = - size 30 4 - display job_assem_recov_nthreads - } - display { - position = +4 - size 30 4 - display job_solver_procs - visible solver_allows_multi_procs - } - display { - position = = - size 18 4 - display job_solver_threads - visible "and(solver_allows_multi_threads,\ - not(and(job_solver_mfront_sparse,\ - *job_option parallel:on)),\ - *job_option solver_use_gpu:off)" - } - display { - position +18 = - size 12 4 - display job_solver_gpu - visible "or(and(job_solver_mfront_sparse,job_nonsym_off), \ - and(job_solver_it_sparse,job_nonsym_off))" - } - } - } - - frame { - text "INPUT STYLE AND JOB TITLE" - position 1 +4 - size 60 4 - group { - -# see also job_common.ms -# see also the ADVANCED JOB SUBMISSION popmenu in this file - - label { - position 0 0 - size 8 4 - text "STYLE" - help "job_run#Input Style And Job Title" - border_width 1 - border_color black - } - roller { - position +8 = - size 22 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" - 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" - help "job_run#Input Style And Job Title" - } - button { - position +22 = - size 15 4 - text "TITLE" - help "job_run#Input Style And Job Title" - popmenu job_title_pm - command "*job_title" - } - button { - position +15 = - size 15 4 - text "SAVE MODEL" - help "job_run#Input Style And Job Title" - command "*save_model" - } - } - } - - frame { - text "JOB SUBMISSION AND CONTROL" - position 1 +4 - size 60 4 - group { - frame { - position 1 1 - size 50 4 - group { - button { - position 0 0 - size 25 4 - text "SUBMIT (1)" - help "job_run#Job Submission And Control" - command "*submit_job 1 *monitor_job" - } - button { - position +25 = - size 18 4 - text "ADVANCED JOB SUBMISSION" - help "job_run#Job Submission And Control" - popmenu job_submit_adv_pm - } - button { - position +18 = - size 7 4 - text "DAMASK" - help "damask_run#Job Submission And Control" - popmenu damask - } - button { - position 0 +4 - size 12 4 - text "UPDATE" - help "job_run#Job Submission And Control" - command "*update_job" - } - button { - position +12 = - size 13 4 - text "MONITOR" - help "job_run#Job Submission And Control" - command "*monitor_job" - } - button { - position +13 = - size 12 4 - text "RESET" - help "job_run#Job Submission And Control" - command "*job_submit_reset" - } - button { - position +12 = - size 13 4 - text "KILL" - help "job_run#Job Submission And Control" - command "*kill_job *monitor_job" - active "job_status_running" - } - } - } - - frame { - position 1 5 - size 50 4 - group { - label { - position 0 +4 - size 25 4 - text "STATUS" - help "job_run#Status" - border_width 1 - border_color black - } - display { - position +25 = - size 25 4 - display "job_status" - } - label { - position 0 +4 - size 25 4 - text "CURRENT INCREMENT (CYCLE)" - help "job_run#Current Increment" - border_width 1 - border_color black - } - display { - position +25 = - size 25 4 - display "job_increment" - } - label { - position 0 +4 - size 25 4 - text "SINGULARITY RATIO" - help "job_run#Singularity Ratio" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_singularity_ratio" - } - label { - position 0 +4 - size 25 4 - text "CONVERGENCE RATIO" - help "job_run#Convergence Ratio" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_convergence_ratio" - } - label { - position 0 +4 - size 25 4 - text "FRACTION OF INCREMENT (CONTACT)" - help "job_run#IPC" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_ipc_fraction" - } - label { - position 0 +4 - size 25 4 - text "ANALYSIS TIME" - help "job_run#Analysis Time" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_analysis_time" - } - } - } - - frame { - position 1 +4 - size 50 4 - group { - - frame { - position 0 0 - size 50 4 - text "ACCUMULATED ANALYSIS STATISTICS" - border_width 1 - border_color black - group { - label { - position 0 0 - size 12 4 - text "CYCLES" - help "job_run#Cycles" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_cycles" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "SEPARATIONS" - help "job_run#Separations" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_separations" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "WARNING MESSAGES" - help "job_run#Warnings" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "number_of_warning_messages" - border_width 1 - border_color black - } - label { - position +12 -8 - size 12 4 - text "CUT BACKS" - help "job_run#Cut Backs" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_cut_backs" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "REMESHES" - help "job_run#Remeshes" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_remeshes" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "WALL TIME" - help "job_run#Wall Time" - border_width 1 - border_color black - } - display { - position +12 = - size 12 4 - display "job_time" - } - } - } - - frame { - position 0 +4 - size 50 4 - text "JOB COMPLETION" - border_width 1 - border_color black - group { - label { - position 0 +4 - size 12 4 - text "EXIT NUMBER" - help "job_run#Exit Number" - border_width 1 - border_color black - } - integer { - position +12 = - size 13 4 - display "job_exit" - } - button { - position +13 = - size 25 4 - text "EXIT MESSAGE" - help "job_run#Exit Number" - popmenu job_exit_msg_pm - } - } - } - } - } - } - } - frame { - text "EDIT FILES" - position 1 +4 - size 60 4 - group { - frame { - position 1 1 - size 60 4 - group { - button { - position 0 +4 - size 15 4 - text "OUTPUT FILE" - help "job_run#Edit Files" - command "*job_edit_output" - } - button { - position +15 = - size 15 4 - text "LOG FILE" - help "job_run#Edit Files" - command "*job_edit_log_file" - } - button { - position +15 = - size 15 4 - text "STATUS FILE" - help "job_run#Edit Files" - command "*job_edit_status_file" - } - button { - position +15 = - size 15 4 - text "ANY FILE" - help "job_run#Edit Files" - settext $edit_browser_label "EDIT FILE" - set $edit_browser_command "*edit_file" - browser edit_browser - } - } - } - } - } - - frame { - position 1 +4 - size 60 4 - group { - layout hbox - spacer { - stretch 1 - } - popdown { - position 0 0 - size 60 4 - text "OPEN POST FILE" - help "job_run#Open Post File" - command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" - visible "not(*job_option write_cont_post_file:on)" - } - popdown { - position 0 0 - size 30 4 - text "OPEN POST FILE" - help "job_run#Open Post File" - command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" - visible "*job_option write_cont_post_file:on" - } - popdown { - position 0 0 - size 30 4 - text "OPEN EXPANDED BEAM POST FILE" - help "job_run#Open Expanded Beam Post File" - command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_con_default" - visible "*job_option write_cont_post_file:on" - } - spacer { - stretch 1 - } - } - } - - frame { - position 1 +5 - size 60 4 - group { - layout hbox - spacer { - stretch 1 - } - popdown { - size 12 4 - text "OK" - } - spacer { - stretch 1 - } - } - } - } - - window job_run_wi { - parent mentat - origin 35 1 - size 52 115 - background_color body - border_width 1 - border_color border - buffering single - } - - mode permanent -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_usersub_pm { - - text "CURRENTLY SELECTED USER SUBROUTINES" - - group { - - - 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 { - - text "ADVANCED JOB SUBMISSION" - - group { - - - 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 - } - - label { - position 1 9 - size 19 4 - text "INITIAL ALLOCATION" - border_width 1 - border_color black - } - label { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - } - text { - position +15 = - size 14 4 - display "job_param_value_general_init_allocation" - command "*job_param general_init_allocation" - help job_param_general_init_allocation - } - - 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" - } - - 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 32 - nvisible 32 - texts "DEFAULT" -#if 0 - "2021.2" -#endif - "2021.1" - "2020.1" - "2020" - "2019.1" - "2019" - "2018.1" - "2018" - "2017.1" - "2017" - "2016" - "2015" - "2014.2" - "2014.1" - "2014" - "2013.1" - "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_2021.2" -#endif - "job_input_version_2021.1" - "job_input_version_2020.1" - "job_input_version_2020" - "job_input_version_2019.1" - "job_input_version_2019" - "job_input_version_2018.1" - "job_input_version_2018" - "job_input_version_2017.1" - "job_input_version_2017" - "job_input_version_2016" - "job_input_version_2015" - "job_input_version_2014.2" - "job_input_version_2014.1" - "job_input_version_2014" - "job_input_version_2013.1" - "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" - commands "*job_option version:default" -#if 0 - "*job_option version:2021.2" -#endif - "*job_option version:2021.1" - "*job_option version:2020.1" - "*job_option version:2020" - "*job_option version:2019.1" - "*job_option version:2019" - "*job_option version:2018.1" - "*job_option version:2018" - "*job_option version:2017.1" - "*job_option version:2017" - "*job_option version:2016" - "*job_option version:2015" - "*job_option version:2014.2" - "*job_option version:2014.1" - "*job_option version:2014" - "*job_option version:2013.1" - "*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_2021.2" -#endif - "job_allows_input_version_2021.1" - "job_allows_input_version_2020.1" - "job_allows_input_version_2020" - "job_allows_input_version_2019.1" - "job_allows_input_version_2019" - "job_allows_input_version_2018.1" - "job_allows_input_version_2018" - "job_allows_input_version_2017.1" - "job_allows_input_version_2017" - "job_allows_input_version_2016" - "job_allows_input_version_2015" - "job_allows_input_version_2014.2" - "job_allows_input_version_2014.1" - "job_allows_input_version_2014" - "job_allows_input_version_2013.1" - "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" - } - -# 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" - 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" - help job_option_input_style - } - - toggle { - position 0 +4 - size 24 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" - } - toggle { - position +24 = - size 24 4 - text "INCLUDE UNUSED TABLES" - toggle "*job_option input_file_tables:all" - true_command "*job_option input_file_tables:all" - false_command "*job_option input_file_tables:used" - } - } - } - - button { - position 1 +14 - size 24 4 - text "SCRATCH DIRECTORY" - settext $directory_browser_label "JOB SCRATCH DIRECTORY" - set $directory_browser_command "*job_scratch_directory" - browser directory_browser - 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 - } - - mode permanent -} - - -#-------------------------------------------------------------------------------------------------- -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" - } - - 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 permanent -} - -#-------------------------------------------------------------------------------------------------- -popmenu job_exit_msg_pm { - - text "EXIT MESSAGE" - - group { - - - - text { - position 1 5 - size 84 74 - multiline - readonly - display "job_exit_msg" - } - - 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 -} - - - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_parallelization_pm { - - text "SOLVER/PARALLELIZATION" - - group { - layout vbox - frame { - position 0 0 - size 42 8 - group { - - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 36 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 36 4 - display job_class_label - } - } - } - frame { - position 0 8 - size 42 20 - group job_ddm_gr - text "DOMAIN DECOMPOSITION" - border_width 1 - border_color black - } - - frame { - position 0 +20 - size 42 13 - group job_assem_recov_gr - text "ASSEMBLY AND RECOVERY" - border_width 1 - border_color black - } - - frame { - position 0 +14 - size 42 31 - group job_parallel_matrix_solver_gr - text "MATRIX SOLVER" - border_width 1 - border_color black - } - - frame { - position 0 +32 - size 42 28 - group job_parallel_env_gr - text "PARALLELIZATION ENVIRONMENT" - border_width 1 - border_color black - visible "or(*job_option parallel:on, \ - solver_multi_procs)" - } - frame { - position 15 +30 - size 42 8 - group { - layout hbox - - spacer { - stretch 1 - } - popdown { - position 15 0 - size 12 8 - text "OK" - } - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - stretch 1 - } - } - - window { - parent mentat - origin 38 1 - size 60 119 - background_color body - border_width 1 - border_color border - buffering single - } - mode permanent -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_gr { - - toggle { - position 1 4 - size 42 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" - active "and(not(job_solver_it_ext),\ - not(job_solver_mixed_direct_iterative))" - } - - frame { - position = +5 - size 42 4 - group job_ddm_use_gr - visible "*job_option parallel:on" - } -} - -group job_ddm_use_gr { - layout vbox - frame{ - position 0 0 - size 30 4 - group { - layout hbox - label { - position 0 0 - size 12 4 - text "DECOMPOSITION IN" - help job_run_ddm_generator - } - oneonly{ - position +12 = - size 8 4 - text "MARC" - oneonly "*job_option ddm_generator:fea_solver" - command "*job_option ddm_generator:fea_solver" - help job_run_ddm_generator - } - oneonly{ - position +12 = - size 8 4 - text "MENTAT" - oneonly "*job_option ddm_generator:preprocessor" - command "*job_option ddm_generator:preprocessor" - 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" - } - - frame{ - position 0 +5 - size 40 4 - group{ - layout hbox - text { - position 0 0 - size 22 4 - text "Single Input File" - 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 - } - } - } -} - - - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_fea_solver_gr { - - label { - position 0 0 - size 10 4 - text "# DOMAINS" - help job_param - } - - text { - position +10 = - size 4 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position 0 +4 - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 18 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" - 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" - } - - button { - position +18 = - size 12 4 - text "ADV. SETTINGS" - popmenu job_ddm_fea_solver_pm - } -} - - - - -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_fea_solver_pm { - text "JOB PARALLELIZATION" - mode permanent - - group { - layout vbox - spacing 0 - - frame job_properties_subm_header_fr - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - frame { - text "ADVANCED DECOMPOSITION IN MARC" - - group { - layout vbox - spacing 0 - - frame { - - group { - layout hbox - spacing 0 - - label { - size 12 4 - text "# DOMAINS" - help job_param - } - - text { - size 14 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - size 8 4 - text "METHOD" - } - - roller { - size 32 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "RECURSIVE COORDINATE 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" - 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" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - visible "or(*job_option ddm_method:vector, \ - *job_option ddm_method:radial, \ - *job_option ddm_method:angular)" - - group { - layout hbox - spacing 0 - - frame { - group job_ddm_direction_gr - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - toggle { - size 24 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" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - size 8 4 - text "GRAPH" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } - - roller { - size 8 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)" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - size 20 4 - text "QUADRATIC ELEMENTS" - } - - roller { - size 12 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" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - position 0 +5 - size 24 4 - text "ELEMENT WEIGHT FACTOR" - help job_param - } - - text { - position +24 = - size 14 4 - display "job_param_value_ddm_elem_weight_factor" - command "*job_param ddm_elem_weight_factor" - help job_run_ddm_decomp_element_weight_factor - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - - group { - layout hbox - spacing 0 - - frame { - - group { - - toggle { - position 0 0 - size 16 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" - help job_run_ddm_decomp_detect_contact - } - - label { - position = +5 - size 28 4 - text "CONTACT TOLERANCE" - visible "*job_option ddm_detect_contact:on" - } - - text { - position +28 = - size 14 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 - } - - label { - position 0 +4 - size 28 4 - text "CONTACT CONSTRAINT FACTOR" - visible "*job_option ddm_detect_contact:on" - } - - text { - position +28 = - size 14 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 - } - } - } - - spacer { - stretch 1 - } - } - } - } - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame job_properties_subm_footer_fr - } -} # job_ddm_fea_solver_pm - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_direction_gr { - - button { - position 0 0 - size 21 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "model_anadim_3d" - } - - button { - position = = - size 21 4 - text "DIRECTION" - command "*job_vector_2d ddm_sort_direction_x" - visible "not(model_anadim_3d)" - } - - button { - position +21 = - size 21 4 - text "FROM / TO" - command "*job_vector_from_to ddm_sort_direction_x" - visible "model_anadim_3d" - } - - button { - position = = - size 21 4 - text "FROM / TO" - command "*job_vector_from_to_2d ddm_sort_direction_x" - visible "not(model_anadim_3d)" - } - - frame { - position 0 +4 - size 42 4 - - group { - layout hbox - spacing 0 - - text { - size 14 4 - command "*job_param ddm_sort_direction_x" - display "job_param_value_ddm_sort_direction_x" - help ddm_job_decomp_user_direction_x - } - - text { - size 14 4 - command "*job_param ddm_sort_direction_y" - display "job_param_value_ddm_sort_direction_y" - } - - text { - size 14 4 - command "*job_param ddm_sort_direction_z" - display "job_param_value_ddm_sort_direction_z" - visible "model_anadim_3d" - } - } - } - - frame { - position 0 +4 - size 42 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 16 4 - text "POINT ON AXIS" - } - - roller { - position +16 = - size 10 4 - nvalues 2 - texts "DEFAULT" - "USER" - roller "job_option ddm_sort_point" - commands "*job_option ddm_sort_point:default" - "*job_option ddm_sort_point:user" - } - - button { - position +20 = - size 6 4 - text "SET" - command "*job_position ddm_sort_point_x" - visible "and(*job_option ddm_sort_point:user, model_anadim_3d)" - } - - button { - position = = - size 6 4 - text "SET" - command "*job_position_2d ddm_sort_point_x" - visible "and(*job_option ddm_sort_point:user, not(model_anadim_3d))" - } - - frame { - position 0 +4 - size 42 4 - visible "*job_option ddm_sort_point:user" - - group { - layout hbox - spacing 0 - - text { - size 14 4 - command "*job_param ddm_sort_point_x" - display "job_param_value_ddm_sort_point_x" - } - - text { - size 14 4 - command "*job_param ddm_sort_point_y" - display "job_param_value_ddm_sort_point_y" - } - - text { - size 14 4 - command "*job_param ddm_sort_point_z" - display "job_param_value_ddm_sort_point_z" - visible "model_anadim_3d" - } - } - } -} - - - - -#-------------------------------------------------------------------------------------------------- -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 0 +4 - size 30 4 - text "USER DOMAINS" - popmenu domains_pm - help job_run_ddm_user_domains - } -} - - - - -#-------------------------------------------------------------------------------------------------- -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" - } - - label { - position = +4 - size 12 4 - text "# THREADS" - visible "*job_option assem_recov_multi_threading:on" - } - - 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 10 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)" - } - spacer{ - stretch 2 - } - -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_matrix_solver_gr { - layout vbox - frame { - position 1 0 - size 36 31 - group { - layout hbox - label { - position 3 4 - size 12 4 - text "SOLUTION" - border_width 1 - border_color black - } - oneonly { - position +12 = - size 12 4 - text "SYMMETRIC" - help "job_param_solver_method#symmetric" - oneonly "job_nonsym_off" - command "*job_option solver_nonsym:off" - } - oneonly { - position +12 = - size 12 4 - text "NONSYMMETRIC" - help "job_param_solver_method#symmetric" - oneonly "job_nonsym_on" - command "*job_option solver_nonsym:on" - } - spacer { - stretch 1 - } - } - } - - frame { - position 1 +5 - size 42 23 - group matrix_solver_gr - help job_param_solver - } - - frame { - position +1 = - size 42 4 - group job_run_solver_ddm_opts_gr - visible "*job_option parallel:on" - } - - frame { - position 1 +23 - size 42 8 - group job_solver_multi_procs_gr - visible solver_allows_multi_procs - } - - frame { - position = = - size 42 8 - group job_solver_multi_threads_gr - visible solver_allows_multi_threads - } - - frame { - position 1 +9 - size 42 8 - group job_solver_gpu_gr - visible "or(and(job_solver_mfront_sparse,job_nonsym_off), \ - and(job_solver_it_sparse,job_nonsym_off))" - } - -} - - -#-------------------------------------------------------------------------------------------------- -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))" - } - button { - position = = - size 14 4 - text "\{DDM} OPTIONS" - popmenu ddm_options_mumps - visible "job_solver_mumps" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_gr { - frame { - position 0 0 - size 42 8 - group job_solver_multi_procs_parallel_off_gr - visible "*job_option parallel:off" - } - - frame { - position = = - size 42 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_param_solver_method#mumps" - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option nsolver_procs_serial:on" - help job_param - } - - 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_param_solver_method#mumps" - toggle true - set $dummy dummy - } - - 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_param_solver_method#mumps" - 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 { - - label { - position 0 0 - size 8 4 - text "VALUE" - help job_param - } - - text { - position +8 = - size 8 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - } -} - -group job_solver_multi_threads_gr { - layout vbox - spacing 0 - - frame { - size 46 8 - group job_solver_multi_threads_it_sparse_parallel_off_gr - visible "and(job_solver_it_sparse,*job_option parallel:off)" - active "*job_option solver_use_gpu:off" - } - - frame { - size 46 8 - group job_solver_multi_threads_mfront_sparse_parallel_off_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:off)" - active "*job_option solver_use_gpu:off" - } - - frame { - size 46 8 - group job_solver_multi_threads_mfront_sparse_parallel_on_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:on)" - } - - frame { - size 46 8 - group job_solver_multi_threads_pardiso_parallel_off_gr - visible "and(job_solver_pardiso,*job_option parallel:off)" - } - - frame { - size 46 8 - group job_solver_multi_threads_pardiso_parallel_on_gr - visible "and(job_solver_pardiso,*job_option parallel:on)" - } - - frame { - size 46 8 - group job_solver_multi_threads_it_ext_off_gr - visible "and(job_solver_it_ext,*job_option parallel:off)" - } - - frame { - size 46 8 - group job_solver_multi_threads_mumps_parallel_off_gr - visible "and(job_solver_mumps,*job_option parallel:off)" - } - - frame { - size 46 8 - group job_solver_multi_threads_mumps_parallel_on_gr - visible "and(job_solver_mumps,*job_option parallel:on)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_it_sparse_parallel_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - toggle "*job_option it_sparse_multi_threading:on" - true_command "*job_option it_sparse_multi_threading:on" - false_command "*job_option it_sparse_multi_threading:off" - help "job_param_solver_method#iterative" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option it_sparse_multi_threading:on" - help "job_param_solver_method#iterative" - } - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option it_sparse_multi_threading:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_mfront_sparse_parallel_off_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_param_solver_method#multifrontal" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option mfront_sparse_multi_threading:on" - help "job_param_solver_method#multifrontal" - } - - 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_multi_threads_mfront_sparse_parallel_on_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - help "job_param_solver_method#multifrontal" - toggle true - set $dummy dummy - } - - label { - position +30 0 - size 12 4 - visible "and( not(*job_option ddm_precond:direct)\ - *job_option parallel:on)" - text "PER DOMAIN" - border_width 1 - border_color black - help "job_param_solver_method#multifrontal" - } - - display { - position +12 0 - size 4 4 - display "job_mfront_sparse_nthreads_dom" - visible "and( not(*job_option ddm_precond:direct)\ - *job_option parallel:on)" - } - - label { - position 0 +4 - size 14 4 - text "# THREADS" - border_color black - border_width 1 - help "job_param_solver_method#multifrontal" - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option mfront_sparse_multi_threading_ddm:automatic" - "*job_option mfront_sparse_multi_threading_ddm:user" - help "job_param_solver_method#multifrontal" - rollers "*job_option mfront_sparse_multi_threading_ddm:automatic" - "*job_option mfront_sparse_multi_threading_ddm:user" - visible "not(*job_option solver_use_gpu:on)" - } - - display { - position = = - size 14 4 - text "AUTOMATIC" - visible "*job_option solver_use_gpu:on" - } - - frame { - position +14 = - size 16 4 - group job_mfront_sparse_multi_threads_ddm_automatic_gr - visible "*job_option mfront_sparse_multi_threading_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_mfront_sparse_multi_threads_ddm_user_gr - visible "*job_option mfront_sparse_multi_threading_ddm:user" - } -} -#-------------------------------------------------------------------------------------------------- -group job_mfront_sparse_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_mfront_sparse_multi_threads_ddm_user_gr { - - label { - position 0 0 - size 8 4 - text "VALUE" - help "job_param_solver_method#multifrontal" - } - - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - - - -#-------------------------------------------------------------------------------------------------- -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 - } - frame{ - position 0 +4 - size 28 4 - group{ - layout hbox - - label { - position 0 0 - 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 12 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)" - } - spacer { - stretch 1 - } - } - } -} - -#-------------------------------------------------------------------------------------------------- -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_param_solver_method#pardiso" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option pardiso_multi_threading:on" - help "job_param_solver_method#pardiso" - } - - 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_param_solver_method#pardiso" - toggle true - set $dummy dummy - } - - label { - position = +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_param_solver_method#pardiso" - 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 { - - label { - position 0 0 - size 8 4 - text "VALUE" - help "job_param_solver_method#pardiso" - } - - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_mumps_parallel_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - toggle "*job_option nsolver_procs_serial:on" - true_command "*job_option nsolver_procs_serial:on" - false_command "*job_option nsolver_procs_serial:off" - help "job_param_solver_method#mumps" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option nsolver_procs_serial:on" - help "job_param_solver_method#mumps" - } - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option nsolver_procs_serial:on" - } -} -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_mumps_parallel_on_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - help "job_param_solver_method#mumps" - toggle true - set $dummy dummy - } - - label { - position = +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 nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - help "job_param_solver_method#mumps" - rollers "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_mumps_multi_threads_ddm_automatic_gr - visible "*job_option nsolver_procs_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_mumps_multi_threads_ddm_user_gr - visible "*job_option nsolver_procs_ddm:user" - } -} -#-------------------------------------------------------------------------------------------------- -group job_mumps_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_mumps_multi_threads_ddm_user_gr { - - label { - position 0 0 - size 8 4 - text "VALUE" - help "job_param_solver_method#mumps" - } - - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_it_ext_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - toggle "*job_option it_ext_multi_threading:on" - true_command "*job_option it_ext_multi_threading:on" - false_command "*job_option it_ext_multi_threading:off" - help "job_param_solver_method#casi" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option it_ext_multi_threading:on" - help "job_param_solver_method#casi" - } - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option it_ext_multi_threading:on" - } -} - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_gr { - - frame{ - position 0 +4 - size 40 4 - group{ - layout hbox - label{ - position 0 0 - size 8 4 - text "SETUP" - help job_run_ddm_setup - } - oneonly { - position +12 = - size 12 4 - text "SINGLE MACHINE" - oneonly "*job_option parallel_setup:single" - command "*job_option parallel_setup:single" - help job_run_ddm_setup - } - oneonly { - position +8 = - size 12 4 - text "NETWORK" - oneonly "*job_option parallel_setup:network" - command "*job_option parallel_setup:network" - help job_run_ddm_setup - } - - spacer { - stretch 1 - } - } - } - - - frame { - position +1 +5 - size 40 16 - 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" - browser host_file_browser - 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 - } -} - - -#endif - diff --git a/install/MarcMentat/2021.2/Mentat_menus/job_run.ms.original b/install/MarcMentat/2021.2/Mentat_menus/job_run.ms.original deleted file mode 100644 index 6560c0601..000000000 --- a/install/MarcMentat/2021.2/Mentat_menus/job_run.ms.original +++ /dev/null @@ -1,2973 +0,0 @@ -#ifndef AUTOFORGE -popmenu job_title_pm file jobs.ms -popdown job_title_ok file jobs.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 matrix_solver_gr file job_common.ms -popmenu ddm_options file job_common.ms - -browser edit_browser file file.ms -browser directory_browser file file.ms -screen domains file domain_decomposition.ms - -frame job_properties_subm_header_fr file job_common.ms -frame job_properties_subm_footer_fr file job_common.ms - - -browser usersub_file_browser { - text "$usersub_file_browser_label" ($usersub_file_browser_label) - filter "*.f *.F *.f90 *.F90" - select_files true - command "$usersub_file_browser_command" ($usersub_file_browser_command) -} - - - -browser host_file_browser { - text "$host_file_browser_label" ($host_file_browser_label) - filter "*" - select_files true - command "$host_file_browser_command" ($host_file_browser_command) -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_popmenu { - - text "RUN JOB" - - group { - - frame { - position 1 1 - size 60 4 - group { - label { - position 0 1 - size 15 4 - text "NAME" - help job_run - } - display { - position +12 = - size 45 4 - display "job_name" - } - label { - position 0 +4 - size 15 4 - text "TYPE" - help job_run - } - display { - position +12 = - size 45 4 - display job_class_label - } - } - } - - frame { - text "USER SUBROUTINES" - position 1 +4 - size 60 4 - group { - button { - position 0 0 - size 30 4 - text "FORTRAN SOURCE FILE" - help "job_run#User Subroutines" - browser usersub_file_browser - settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" - set $usersub_file_browser_command "*job_usersub_file" - } - toggle { - position +30 = - size 30 4 - text "SELECTED USER SUBS" - help "job_run#User Subroutines" - toggle job_usersubs - active job_usersubs - popmenu job_usersub_pm - } - display { - position 0 +4 - size 60 4 - display job_usersub_file - visible job_usersub_file - } - button { - position 0 +4 - size 15 4 - text "EDIT" - help "job_run#User Subroutines" - command "*job_edit_usersub_file" - visible job_usersub_file - } - button { - position +15 = - size 15 4 - text "CLEAR" - help "job_run#User Subroutines" - command "*job_clear_usersub_file" - visible job_usersub_file - } - roller { - position +15 = - size 30 4 - nvalues 3 - texts "COMPILE / NO SAVE" - "COMPILE AND SAVE" - "RUN SAVED EXECUTABLE" - help "job_run#User Subroutines" - roller "job_option user_source" - visible job_usersub_file - commands "*job_option user_source:compile_nosave" - "*job_option user_source:compile_save" - "*job_option user_source:run_saved" - } - } - } - - frame { - text "SOLVER/PARALLELIZATION" - position 1 +4 - size 60 4 - group { - button { - position 0 0 - size 30 4 - text "SETTINGS" - help "job_run#Solver/Parallelization" - popmenu job_run_parallelization_pm - set $popname2 "job_run_parallelization_pm" - } - display { - position 0 +4 - size 30 4 - display job_solver_solution - } - display { - position +30 = - size 30 4 - display job_ddm_domains - } - display { - position 0 +4 - size 30 4 - display job_solver_type - } - display { - position +30 = - size 30 4 - display job_assem_recov_nthreads - } - display { - position = +4 - size 30 4 - display job_solver_procs - visible solver_allows_multi_procs - } - display { - position = = - size 18 4 - display job_solver_threads - visible "and(solver_allows_multi_threads,\ - not(and(job_solver_mfront_sparse,\ - *job_option parallel:on)),\ - *job_option solver_use_gpu:off)" - } - display { - position +18 = - size 12 4 - display job_solver_gpu - visible "or(and(job_solver_mfront_sparse,job_nonsym_off), \ - and(job_solver_it_sparse,job_nonsym_off))" - } - } - } - - frame { - text "INPUT STYLE AND JOB TITLE" - position 1 +4 - size 60 4 - group { - -# see also job_common.ms -# see also the ADVANCED JOB SUBMISSION popmenu in this file - - label { - position 0 0 - size 8 4 - text "STYLE" - help "job_run#Input Style And Job Title" - border_width 1 - border_color black - } - roller { - position +8 = - size 22 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" - 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" - help "job_run#Input Style And Job Title" - } - button { - position +22 = - size 15 4 - text "TITLE" - help "job_run#Input Style And Job Title" - popmenu job_title_pm - command "*job_title" - } - button { - position +15 = - size 15 4 - text "SAVE MODEL" - help "job_run#Input Style And Job Title" - command "*save_model" - } - } - } - - frame { - text "JOB SUBMISSION AND CONTROL" - position 1 +4 - size 60 4 - group { - frame { - position 1 1 - size 50 4 - group { - button { - position 0 0 - size 25 4 - text "SUBMIT (1)" - help "job_run#Job Submission And Control" - command "*submit_job 1 *monitor_job" - } - button { - position +25 = - size 25 4 - text "ADVANCED JOB SUBMISSION" - help "job_run#Job Submission And Control" - popmenu job_submit_adv_pm - } - button { - position 0 +4 - size 12 4 - text "UPDATE" - help "job_run#Job Submission And Control" - command "*update_job" - } - button { - position +12 = - size 13 4 - text "MONITOR" - help "job_run#Job Submission And Control" - command "*monitor_job" - } - button { - position +13 = - size 12 4 - text "RESET" - help "job_run#Job Submission And Control" - command "*job_submit_reset" - } - button { - position +12 = - size 13 4 - text "KILL" - help "job_run#Job Submission And Control" - command "*kill_job *monitor_job" - active "job_status_running" - } - } - } - - frame { - position 1 5 - size 50 4 - group { - label { - position 0 +4 - size 25 4 - text "STATUS" - help "job_run#Status" - border_width 1 - border_color black - } - display { - position +25 = - size 25 4 - display "job_status" - } - label { - position 0 +4 - size 25 4 - text "CURRENT INCREMENT (CYCLE)" - help "job_run#Current Increment" - border_width 1 - border_color black - } - display { - position +25 = - size 25 4 - display "job_increment" - } - label { - position 0 +4 - size 25 4 - text "SINGULARITY RATIO" - help "job_run#Singularity Ratio" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_singularity_ratio" - } - label { - position 0 +4 - size 25 4 - text "CONVERGENCE RATIO" - help "job_run#Convergence Ratio" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_convergence_ratio" - } - label { - position 0 +4 - size 25 4 - text "FRACTION OF INCREMENT (CONTACT)" - help "job_run#IPC" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_ipc_fraction" - } - label { - position 0 +4 - size 25 4 - text "ANALYSIS TIME" - help "job_run#Analysis Time" - border_width 1 - border_color black - } - float { - position +25 = - size 25 4 - display "job_analysis_time" - } - } - } - - frame { - position 1 +4 - size 50 4 - group { - - frame { - position 0 0 - size 50 4 - text "ACCUMULATED ANALYSIS STATISTICS" - border_width 1 - border_color black - group { - label { - position 0 0 - size 12 4 - text "CYCLES" - help "job_run#Cycles" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_cycles" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "SEPARATIONS" - help "job_run#Separations" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_separations" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "WARNING MESSAGES" - help "job_run#Warnings" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "number_of_warning_messages" - border_width 1 - border_color black - } - label { - position +12 -8 - size 12 4 - text "CUT BACKS" - help "job_run#Cut Backs" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_cut_backs" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "REMESHES" - help "job_run#Remeshes" - border_width 1 - border_color black - } - integer { - position +12 = - size 12 4 - display "acc_job_remeshes" - border_width 1 - border_color black - } - label { - position -12 +4 - size 12 4 - text "WALL TIME" - help "job_run#Wall Time" - border_width 1 - border_color black - } - display { - position +12 = - size 12 4 - display "job_time" - } - } - } - - frame { - position 0 +4 - size 50 4 - text "JOB COMPLETION" - border_width 1 - border_color black - group { - label { - position 0 +4 - size 12 4 - text "EXIT NUMBER" - help "job_run#Exit Number" - border_width 1 - border_color black - } - integer { - position +12 = - size 13 4 - display "job_exit" - } - button { - position +13 = - size 25 4 - text "EXIT MESSAGE" - help "job_run#Exit Number" - popmenu job_exit_msg_pm - } - } - } - } - } - } - } - frame { - text "EDIT FILES" - position 1 +4 - size 60 4 - group { - frame { - position 1 1 - size 60 4 - group { - button { - position 0 +4 - size 15 4 - text "OUTPUT FILE" - help "job_run#Edit Files" - command "*job_edit_output" - } - button { - position +15 = - size 15 4 - text "LOG FILE" - help "job_run#Edit Files" - command "*job_edit_log_file" - } - button { - position +15 = - size 15 4 - text "STATUS FILE" - help "job_run#Edit Files" - command "*job_edit_status_file" - } - button { - position +15 = - size 15 4 - text "ANY FILE" - help "job_run#Edit Files" - settext $edit_browser_label "EDIT FILE" - set $edit_browser_command "*edit_file" - browser edit_browser - } - } - } - } - } - - frame { - position 1 +4 - size 60 4 - group { - layout hbox - spacer { - stretch 1 - } - popdown { - position 0 0 - size 60 4 - text "OPEN POST FILE" - help "job_run#Open Post File" - command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" - visible "not(*job_option write_cont_post_file:on)" - } - popdown { - position 0 0 - size 30 4 - text "OPEN POST FILE" - help "job_run#Open Post File" - command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" - visible "*job_option write_cont_post_file:on" - } - popdown { - position 0 0 - size 30 4 - text "OPEN EXPANDED BEAM POST FILE" - help "job_run#Open Expanded Beam Post File" - command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_con_default" - visible "*job_option write_cont_post_file:on" - } - spacer { - stretch 1 - } - } - } - - frame { - position 1 +5 - size 60 4 - group { - layout hbox - spacer { - stretch 1 - } - popdown { - size 12 4 - text "OK" - } - spacer { - stretch 1 - } - } - } - } - - window job_run_wi { - parent mentat - origin 35 1 - size 52 115 - background_color body - border_width 1 - border_color border - buffering single - } - - mode permanent -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_usersub_pm { - - text "CURRENTLY SELECTED USER SUBROUTINES" - - group { - - - 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 { - - text "ADVANCED JOB SUBMISSION" - - group { - - - 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 - } - - label { - position 1 9 - size 19 4 - text "INITIAL ALLOCATION" - border_width 1 - border_color black - } - label { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - } - text { - position +15 = - size 14 4 - display "job_param_value_general_init_allocation" - command "*job_param general_init_allocation" - help job_param_general_init_allocation - } - - 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" - } - - 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 32 - nvisible 32 - texts "DEFAULT" -#if 0 - "2021.2" -#endif - "2021.1" - "2020.1" - "2020" - "2019.1" - "2019" - "2018.1" - "2018" - "2017.1" - "2017" - "2016" - "2015" - "2014.2" - "2014.1" - "2014" - "2013.1" - "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_2021.2" -#endif - "job_input_version_2021.1" - "job_input_version_2020.1" - "job_input_version_2020" - "job_input_version_2019.1" - "job_input_version_2019" - "job_input_version_2018.1" - "job_input_version_2018" - "job_input_version_2017.1" - "job_input_version_2017" - "job_input_version_2016" - "job_input_version_2015" - "job_input_version_2014.2" - "job_input_version_2014.1" - "job_input_version_2014" - "job_input_version_2013.1" - "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" - commands "*job_option version:default" -#if 0 - "*job_option version:2021.2" -#endif - "*job_option version:2021.1" - "*job_option version:2020.1" - "*job_option version:2020" - "*job_option version:2019.1" - "*job_option version:2019" - "*job_option version:2018.1" - "*job_option version:2018" - "*job_option version:2017.1" - "*job_option version:2017" - "*job_option version:2016" - "*job_option version:2015" - "*job_option version:2014.2" - "*job_option version:2014.1" - "*job_option version:2014" - "*job_option version:2013.1" - "*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_2021.2" -#endif - "job_allows_input_version_2021.1" - "job_allows_input_version_2020.1" - "job_allows_input_version_2020" - "job_allows_input_version_2019.1" - "job_allows_input_version_2019" - "job_allows_input_version_2018.1" - "job_allows_input_version_2018" - "job_allows_input_version_2017.1" - "job_allows_input_version_2017" - "job_allows_input_version_2016" - "job_allows_input_version_2015" - "job_allows_input_version_2014.2" - "job_allows_input_version_2014.1" - "job_allows_input_version_2014" - "job_allows_input_version_2013.1" - "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" - } - -# 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" - 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" - help job_option_input_style - } - - toggle { - position 0 +4 - size 24 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" - } - toggle { - position +24 = - size 24 4 - text "INCLUDE UNUSED TABLES" - toggle "*job_option input_file_tables:all" - true_command "*job_option input_file_tables:all" - false_command "*job_option input_file_tables:used" - } - } - } - - button { - position 1 +14 - size 24 4 - text "SCRATCH DIRECTORY" - settext $directory_browser_label "JOB SCRATCH DIRECTORY" - set $directory_browser_command "*job_scratch_directory" - browser directory_browser - 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 - } - - mode permanent -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_exit_msg_pm { - - text "EXIT MESSAGE" - - group { - - - - text { - position 1 5 - size 84 74 - multiline - readonly - display "job_exit_msg" - } - - 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 -} - - - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_parallelization_pm { - - text "SOLVER/PARALLELIZATION" - - group { - layout vbox - frame { - position 0 0 - size 42 8 - group { - - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 36 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 36 4 - display job_class_label - } - } - } - frame { - position 0 8 - size 42 20 - group job_ddm_gr - text "DOMAIN DECOMPOSITION" - border_width 1 - border_color black - } - - frame { - position 0 +20 - size 42 13 - group job_assem_recov_gr - text "ASSEMBLY AND RECOVERY" - border_width 1 - border_color black - } - - frame { - position 0 +14 - size 42 31 - group job_parallel_matrix_solver_gr - text "MATRIX SOLVER" - border_width 1 - border_color black - } - - frame { - position 0 +32 - size 42 28 - group job_parallel_env_gr - text "PARALLELIZATION ENVIRONMENT" - border_width 1 - border_color black - visible "or(*job_option parallel:on, \ - solver_multi_procs)" - } - frame { - position 15 +30 - size 42 8 - group { - layout hbox - - spacer { - stretch 1 - } - popdown { - position 15 0 - size 12 8 - text "OK" - } - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - stretch 1 - } - } - - window { - parent mentat - origin 38 1 - size 60 119 - background_color body - border_width 1 - border_color border - buffering single - } - mode permanent -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_gr { - - toggle { - position 1 4 - size 42 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" - active "and(not(job_solver_it_ext),\ - not(job_solver_mixed_direct_iterative))" - } - - frame { - position = +5 - size 42 4 - group job_ddm_use_gr - visible "*job_option parallel:on" - } -} - -group job_ddm_use_gr { - layout vbox - frame{ - position 0 0 - size 30 4 - group { - layout hbox - label { - position 0 0 - size 12 4 - text "DECOMPOSITION IN" - help job_run_ddm_generator - } - oneonly{ - position +12 = - size 8 4 - text "MARC" - oneonly "*job_option ddm_generator:fea_solver" - command "*job_option ddm_generator:fea_solver" - help job_run_ddm_generator - } - oneonly{ - position +12 = - size 8 4 - text "MENTAT" - oneonly "*job_option ddm_generator:preprocessor" - command "*job_option ddm_generator:preprocessor" - 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" - } - - frame{ - position 0 +5 - size 40 4 - group{ - layout hbox - text { - position 0 0 - size 22 4 - text "Single Input File" - 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 - } - } - } -} - - - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_fea_solver_gr { - - label { - position 0 0 - size 10 4 - text "# DOMAINS" - help job_param - } - - text { - position +10 = - size 4 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position 0 +4 - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 18 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" - 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" - } - - button { - position +18 = - size 12 4 - text "ADV. SETTINGS" - popmenu job_ddm_fea_solver_pm - } -} - - - - -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_fea_solver_pm { - text "JOB PARALLELIZATION" - mode permanent - - group { - layout vbox - spacing 0 - - frame job_properties_subm_header_fr - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - frame { - text "ADVANCED DECOMPOSITION IN MARC" - - group { - layout vbox - spacing 0 - - frame { - - group { - layout hbox - spacing 0 - - label { - size 12 4 - text "# DOMAINS" - help job_param - } - - text { - size 14 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - size 8 4 - text "METHOD" - } - - roller { - size 32 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "RECURSIVE COORDINATE 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" - 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" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - visible "or(*job_option ddm_method:vector, \ - *job_option ddm_method:radial, \ - *job_option ddm_method:angular)" - - group { - layout hbox - spacing 0 - - frame { - group job_ddm_direction_gr - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - toggle { - size 24 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" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - size 8 4 - text "GRAPH" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } - - roller { - size 8 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)" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - size 20 4 - text "QUADRATIC ELEMENTS" - } - - roller { - size 12 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" - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - - group { - layout hbox - spacing 0 - - label { - position 0 +5 - size 24 4 - text "ELEMENT WEIGHT FACTOR" - help job_param - } - - text { - position +24 = - size 14 4 - display "job_param_value_ddm_elem_weight_factor" - command "*job_param ddm_elem_weight_factor" - help job_run_ddm_decomp_element_weight_factor - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame { - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - - group { - layout hbox - spacing 0 - - frame { - - group { - - toggle { - position 0 0 - size 16 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" - help job_run_ddm_decomp_detect_contact - } - - label { - position = +5 - size 28 4 - text "CONTACT TOLERANCE" - visible "*job_option ddm_detect_contact:on" - } - - text { - position +28 = - size 14 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 - } - - label { - position 0 +4 - size 28 4 - text "CONTACT CONSTRAINT FACTOR" - visible "*job_option ddm_detect_contact:on" - } - - text { - position +28 = - size 14 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 - } - } - } - - spacer { - stretch 1 - } - } - } - } - } - - spacer { - stretch 1 - } - } - } - - spacer { - spacing 2 - } - - frame job_properties_subm_footer_fr - } -} # job_ddm_fea_solver_pm - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_direction_gr { - - button { - position 0 0 - size 21 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "model_anadim_3d" - } - - button { - position = = - size 21 4 - text "DIRECTION" - command "*job_vector_2d ddm_sort_direction_x" - visible "not(model_anadim_3d)" - } - - button { - position +21 = - size 21 4 - text "FROM / TO" - command "*job_vector_from_to ddm_sort_direction_x" - visible "model_anadim_3d" - } - - button { - position = = - size 21 4 - text "FROM / TO" - command "*job_vector_from_to_2d ddm_sort_direction_x" - visible "not(model_anadim_3d)" - } - - frame { - position 0 +4 - size 42 4 - - group { - layout hbox - spacing 0 - - text { - size 14 4 - command "*job_param ddm_sort_direction_x" - display "job_param_value_ddm_sort_direction_x" - help ddm_job_decomp_user_direction_x - } - - text { - size 14 4 - command "*job_param ddm_sort_direction_y" - display "job_param_value_ddm_sort_direction_y" - } - - text { - size 14 4 - command "*job_param ddm_sort_direction_z" - display "job_param_value_ddm_sort_direction_z" - visible "model_anadim_3d" - } - } - } - - frame { - position 0 +4 - size 42 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 16 4 - text "POINT ON AXIS" - } - - roller { - position +16 = - size 10 4 - nvalues 2 - texts "DEFAULT" - "USER" - roller "job_option ddm_sort_point" - commands "*job_option ddm_sort_point:default" - "*job_option ddm_sort_point:user" - } - - button { - position +20 = - size 6 4 - text "SET" - command "*job_position ddm_sort_point_x" - visible "and(*job_option ddm_sort_point:user, model_anadim_3d)" - } - - button { - position = = - size 6 4 - text "SET" - command "*job_position_2d ddm_sort_point_x" - visible "and(*job_option ddm_sort_point:user, not(model_anadim_3d))" - } - - frame { - position 0 +4 - size 42 4 - visible "*job_option ddm_sort_point:user" - - group { - layout hbox - spacing 0 - - text { - size 14 4 - command "*job_param ddm_sort_point_x" - display "job_param_value_ddm_sort_point_x" - } - - text { - size 14 4 - command "*job_param ddm_sort_point_y" - display "job_param_value_ddm_sort_point_y" - } - - text { - size 14 4 - command "*job_param ddm_sort_point_z" - display "job_param_value_ddm_sort_point_z" - visible "model_anadim_3d" - } - } - } -} - - - - -#-------------------------------------------------------------------------------------------------- -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 0 +4 - size 30 4 - text "USER DOMAINS" - popmenu domains_pm - help job_run_ddm_user_domains - } -} - - - - -#-------------------------------------------------------------------------------------------------- -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" - } - - label { - position = +4 - size 12 4 - text "# THREADS" - visible "*job_option assem_recov_multi_threading:on" - } - - 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 10 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)" - } - spacer{ - stretch 2 - } - -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_matrix_solver_gr { - layout vbox - frame { - position 1 0 - size 36 31 - group { - layout hbox - label { - position 3 4 - size 12 4 - text "SOLUTION" - border_width 1 - border_color black - } - oneonly { - position +12 = - size 12 4 - text "SYMMETRIC" - help "job_param_solver_method#symmetric" - oneonly "job_nonsym_off" - command "*job_option solver_nonsym:off" - } - oneonly { - position +12 = - size 12 4 - text "NONSYMMETRIC" - help "job_param_solver_method#symmetric" - oneonly "job_nonsym_on" - command "*job_option solver_nonsym:on" - } - spacer { - stretch 1 - } - } - } - - frame { - position 1 +5 - size 42 23 - group matrix_solver_gr - help job_param_solver - } - - frame { - position +1 = - size 42 4 - group job_run_solver_ddm_opts_gr - visible "*job_option parallel:on" - } - - frame { - position 1 +23 - size 42 8 - group job_solver_multi_procs_gr - visible solver_allows_multi_procs - } - - frame { - position = = - size 42 8 - group job_solver_multi_threads_gr - visible solver_allows_multi_threads - } - - frame { - position 1 +9 - size 42 8 - group job_solver_gpu_gr - visible "or(and(job_solver_mfront_sparse,job_nonsym_off), \ - and(job_solver_it_sparse,job_nonsym_off))" - } - -} - - -#-------------------------------------------------------------------------------------------------- -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))" - } - button { - position = = - size 14 4 - text "\{DDM} OPTIONS" - popmenu ddm_options_mumps - visible "job_solver_mumps" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_gr { - frame { - position 0 0 - size 42 8 - group job_solver_multi_procs_parallel_off_gr - visible "*job_option parallel:off" - } - - frame { - position = = - size 42 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_param_solver_method#mumps" - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option nsolver_procs_serial:on" - help job_param - } - - 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_param_solver_method#mumps" - toggle true - set $dummy dummy - } - - 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_param_solver_method#mumps" - 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 { - - label { - position 0 0 - size 8 4 - text "VALUE" - help job_param - } - - text { - position +8 = - size 8 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - } -} - -group job_solver_multi_threads_gr { - layout vbox - spacing 0 - - frame { - size 46 8 - group job_solver_multi_threads_it_sparse_parallel_off_gr - visible "and(job_solver_it_sparse,*job_option parallel:off)" - active "*job_option solver_use_gpu:off" - } - - frame { - size 46 8 - group job_solver_multi_threads_mfront_sparse_parallel_off_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:off)" - active "*job_option solver_use_gpu:off" - } - - frame { - size 46 8 - group job_solver_multi_threads_mfront_sparse_parallel_on_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:on)" - } - - frame { - size 46 8 - group job_solver_multi_threads_pardiso_parallel_off_gr - visible "and(job_solver_pardiso,*job_option parallel:off)" - } - - frame { - size 46 8 - group job_solver_multi_threads_pardiso_parallel_on_gr - visible "and(job_solver_pardiso,*job_option parallel:on)" - } - - frame { - size 46 8 - group job_solver_multi_threads_it_ext_off_gr - visible "and(job_solver_it_ext,*job_option parallel:off)" - } - - frame { - size 46 8 - group job_solver_multi_threads_mumps_parallel_off_gr - visible "and(job_solver_mumps,*job_option parallel:off)" - } - - frame { - size 46 8 - group job_solver_multi_threads_mumps_parallel_on_gr - visible "and(job_solver_mumps,*job_option parallel:on)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_it_sparse_parallel_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - toggle "*job_option it_sparse_multi_threading:on" - true_command "*job_option it_sparse_multi_threading:on" - false_command "*job_option it_sparse_multi_threading:off" - help "job_param_solver_method#iterative" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option it_sparse_multi_threading:on" - help "job_param_solver_method#iterative" - } - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option it_sparse_multi_threading:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_mfront_sparse_parallel_off_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_param_solver_method#multifrontal" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option mfront_sparse_multi_threading:on" - help "job_param_solver_method#multifrontal" - } - - 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_multi_threads_mfront_sparse_parallel_on_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - help "job_param_solver_method#multifrontal" - toggle true - set $dummy dummy - } - - label { - position +30 0 - size 12 4 - visible "and( not(*job_option ddm_precond:direct)\ - *job_option parallel:on)" - text "PER DOMAIN" - border_width 1 - border_color black - help "job_param_solver_method#multifrontal" - } - - display { - position +12 0 - size 4 4 - display "job_mfront_sparse_nthreads_dom" - visible "and( not(*job_option ddm_precond:direct)\ - *job_option parallel:on)" - } - - label { - position 0 +4 - size 14 4 - text "# THREADS" - border_color black - border_width 1 - help "job_param_solver_method#multifrontal" - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option mfront_sparse_multi_threading_ddm:automatic" - "*job_option mfront_sparse_multi_threading_ddm:user" - help "job_param_solver_method#multifrontal" - rollers "*job_option mfront_sparse_multi_threading_ddm:automatic" - "*job_option mfront_sparse_multi_threading_ddm:user" - visible "not(*job_option solver_use_gpu:on)" - } - - display { - position = = - size 14 4 - text "AUTOMATIC" - visible "*job_option solver_use_gpu:on" - } - - frame { - position +14 = - size 16 4 - group job_mfront_sparse_multi_threads_ddm_automatic_gr - visible "*job_option mfront_sparse_multi_threading_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_mfront_sparse_multi_threads_ddm_user_gr - visible "*job_option mfront_sparse_multi_threading_ddm:user" - } -} -#-------------------------------------------------------------------------------------------------- -group job_mfront_sparse_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_mfront_sparse_multi_threads_ddm_user_gr { - - label { - position 0 0 - size 8 4 - text "VALUE" - help "job_param_solver_method#multifrontal" - } - - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - - - -#-------------------------------------------------------------------------------------------------- -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 - } - frame{ - position 0 +4 - size 28 4 - group{ - layout hbox - - label { - position 0 0 - 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 12 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)" - } - spacer { - stretch 1 - } - } - } -} - -#-------------------------------------------------------------------------------------------------- -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_param_solver_method#pardiso" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option pardiso_multi_threading:on" - help "job_param_solver_method#pardiso" - } - - 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_param_solver_method#pardiso" - toggle true - set $dummy dummy - } - - label { - position = +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_param_solver_method#pardiso" - 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 { - - label { - position 0 0 - size 8 4 - text "VALUE" - help "job_param_solver_method#pardiso" - } - - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_mumps_parallel_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - toggle "*job_option nsolver_procs_serial:on" - true_command "*job_option nsolver_procs_serial:on" - false_command "*job_option nsolver_procs_serial:off" - help "job_param_solver_method#mumps" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option nsolver_procs_serial:on" - help "job_param_solver_method#mumps" - } - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option nsolver_procs_serial:on" - } -} -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_mumps_parallel_on_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - help "job_param_solver_method#mumps" - toggle true - set $dummy dummy - } - - label { - position = +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 nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - help "job_param_solver_method#mumps" - rollers "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_mumps_multi_threads_ddm_automatic_gr - visible "*job_option nsolver_procs_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_mumps_multi_threads_ddm_user_gr - visible "*job_option nsolver_procs_ddm:user" - } -} -#-------------------------------------------------------------------------------------------------- -group job_mumps_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_mumps_multi_threads_ddm_user_gr { - - label { - position 0 0 - size 8 4 - text "VALUE" - help "job_param_solver_method#mumps" - } - - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_it_ext_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - toggle "*job_option it_ext_multi_threading:on" - true_command "*job_option it_ext_multi_threading:on" - false_command "*job_option it_ext_multi_threading:off" - help "job_param_solver_method#casi" - } - - label { - position = +4 - size 14 4 - text "# THREADS" - visible "*job_option it_ext_multi_threading:on" - help "job_param_solver_method#casi" - } - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option it_ext_multi_threading:on" - } -} - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_gr { - - frame{ - position 0 +4 - size 40 4 - group{ - layout hbox - label{ - position 0 0 - size 8 4 - text "SETUP" - help job_run_ddm_setup - } - oneonly { - position +12 = - size 12 4 - text "SINGLE MACHINE" - oneonly "*job_option parallel_setup:single" - command "*job_option parallel_setup:single" - help job_run_ddm_setup - } - oneonly { - position +8 = - size 12 4 - text "NETWORK" - oneonly "*job_option parallel_setup:network" - command "*job_option parallel_setup:network" - help job_run_ddm_setup - } - - spacer { - stretch 1 - } - } - } - - - frame { - position +1 +5 - size 40 16 - 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" - browser host_file_browser - 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 - } -} - - -#endif - diff --git a/install/MarcMentat/2021.2/Mentat_menus/job_run.ms.patch b/install/MarcMentat/2021.2/Mentat_menus/job_run.ms.patch new file mode 100644 index 000000000..55f64ecf5 --- /dev/null +++ b/install/MarcMentat/2021.2/Mentat_menus/job_run.ms.patch @@ -0,0 +1,157 @@ +--- ++++ +@@ -260,10 +260,17 @@ + } + button { + position +25 = +- size 25 4 ++ size 18 4 + text "ADVANCED JOB SUBMISSION" + help "job_run#Job Submission And Control" + popmenu job_submit_adv_pm ++ } ++ button { ++ position +18 = ++ size 7 4 ++ text "DAMASK" ++ help "damask_run#Job Submission And Control" ++ popmenu damask + } + button { + position 0 +4 +@@ -1129,6 +1136,135 @@ + + + #-------------------------------------------------------------------------------------------------- ++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" ++ } ++ ++ 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 permanent ++} ++ ++#-------------------------------------------------------------------------------------------------- + popmenu job_exit_msg_pm { + + text "EXIT MESSAGE" diff --git a/install/MarcMentat/apply_DAMASK_modifications.py b/install/MarcMentat/apply_DAMASK_modifications.py index c3a5a18f3..d66c38227 100755 --- a/install/MarcMentat/apply_DAMASK_modifications.py +++ b/install/MarcMentat/apply_DAMASK_modifications.py @@ -10,7 +10,7 @@ import damask def copy_and_replace(patch,orig,msc_root,editor): try: - shutil.copyfile(orig,orig.parent/patch.stem) + shutil.copyfile(orig,orig.parent/patch.stem) except shutil.SameFileError: pass damask.execute(f'patch {orig.parent/patch.stem} {patch} -b}') From 9cb2ce39817f521ad497ffffb71ccf609d2d2622 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 14 Jul 2021 18:20:43 +0200 Subject: [PATCH 09/36] file rights are inherited from the original file --- install/MarcMentat/apply_DAMASK_modifications.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/install/MarcMentat/apply_DAMASK_modifications.py b/install/MarcMentat/apply_DAMASK_modifications.py index d66c38227..d35c4328a 100755 --- a/install/MarcMentat/apply_DAMASK_modifications.py +++ b/install/MarcMentat/apply_DAMASK_modifications.py @@ -8,7 +8,7 @@ from pathlib import Path import damask -def copy_and_replace(patch,orig,msc_root,editor): +def copy_and_patch(patch,orig,msc_root,editor): try: shutil.copyfile(orig,orig.parent/patch.stem) except shutil.SameFileError: @@ -56,19 +56,10 @@ for directory in glob.glob(str(damask_root/f'install/MarcMentat/{msc_version}/*' dirs = (msc_root/Path(directory)).name.lower().split('_') orig = msc_root/f'{dirs[0]}{msc_version}/{dirs[1]}/{orig}' for patch in glob.glob(f'{directory}/{mods}.patch'): - copy_and_replace(Path(patch),orig,msc_root,editor) + copy_and_patch(Path(patch),orig,msc_root,editor) print('compiling Mentat menu binaries...') executable = msc_root/f'mentat{msc_version}/bin/mentat' menu_file = msc_root/f'mentat{msc_version}/menus/linux64/main.msb' os.system(f'xvfb-run -a {executable} -compile {menu_file}') - - -print('setting file access rights...\n') - -for pattern in [msc_root/f'marc{msc_version}/tools/*damask*', - msc_root/f'mentat{msc_version}/bin/submit?', - msc_root/f'mentat{msc_version}/bin/kill?']: - for f in glob.glob(str(pattern)): - os.chmod(f,0o755) From 5720a19bed3aee4b949c84a8997929dc18129a56 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 14 Jul 2021 18:21:11 +0200 Subject: [PATCH 10/36] documented in code --- install/MarcMentat/installation.txt | 32 ++--------------------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/install/MarcMentat/installation.txt b/install/MarcMentat/installation.txt index d527af558..2ef682d65 100644 --- a/install/MarcMentat/installation.txt +++ b/install/MarcMentat/installation.txt @@ -5,38 +5,10 @@ Refer to http://damask.mpie.de for complete installation instructions. Usually you will need to be root for this to work! -See Marc and Mentat Release Guide for List of Build and Supported Platforms! +See Marc and Mentat Release Guide for List of Build and Supported Platforms. The Intel Fortran compiler needs to be installed. 1) Install Marc, Mentat and Documentation as usual - Run the test example including subroutines to confirm that the installation of both Marc/Mentat and the Intel Fortran Compiler is ok! + Run the test example including subroutines to confirm that the installation of both Marc/Mentat and the Intel Fortran Compiler is ok. 2) Run the apply_DAMASK_modifications.py script from this directory. - - -APPENDIX: - -The structure of this directory should be (VERSION = 20XX or 20XX.Y) - -./VERSION/Marc_tools/comp_user.original original file from installation -./VERSION/Marc_tools/comp_damask_mp modified version using -O1 optimization and OpenMP -./VERSION/Marc_tools/comp_damask_lmp modified version using -O0 optimization and OpenMP -./VERSION/Marc_tools/comp_damask_hmp modified version using -O2 optimization and OpenMP -./VERSION/Marc_tools/run_marc.original original file from installation -./VERSION/Marc_tools/run_damask_mp modified version using -O1 optimization and OpenMP -./VERSION/Marc_tools/run_damask_lmp modified version using -O0 optimization and OpenMP -./VERSION/Marc_tools/run_damask_hmp modified version using -O2 optimization and OpenMP -./VERSION/Marc_tools/include_linux64.original original file from installation -./VERSION/Marc_tools/include_linux64 modified version defining DAMASK compiler calls -./VERSION/Mentat_bin/edit_window.original original file from installation -./VERSION/Mentat_bin/edit_window modified version calling editor of your chcoice -./VERSION/Mentat_bin/submit1.original original file from installation -./VERSION/Mentat_bin/submit4 modified version of original calling run_h_marc -./VERSION/Mentat_bin/submit5 modified version of original calling run_marc -./VERSION/Mentat_bin/submit6 modified version of original calling run_l_marc -./VERSION/Mentat_bin/kill1.original original file from installation -./VERSION/Mentat_bin/kill4 kill file for submit4, identical to original kill1 -./VERSION/Mentat_bin/kill5 kill file for submit5, identical to original kill1 -./VERSION/Mentat_bin/kill6 kill file for submit6, identical to original kill1 -./VERSION/Mentat_menus/job_run.ms.original original file from installation -./VERSION/Mentat_menus/job_run.ms modified version adding DAMASK menu to run menu From 6d1ec392c092460d36b198dc593b0d1c00078d18 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 14 Jul 2021 18:35:38 +0200 Subject: [PATCH 11/36] polishing/fixing --- .../MarcMentat/apply_DAMASK_modifications.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/install/MarcMentat/apply_DAMASK_modifications.py b/install/MarcMentat/apply_DAMASK_modifications.py index d35c4328a..43bdce26e 100755 --- a/install/MarcMentat/apply_DAMASK_modifications.py +++ b/install/MarcMentat/apply_DAMASK_modifications.py @@ -13,9 +13,11 @@ def copy_and_patch(patch,orig,msc_root,editor): shutil.copyfile(orig,orig.parent/patch.stem) except shutil.SameFileError: pass - damask.execute(f'patch {orig.parent/patch.stem} {patch} -b}') - with open(orig.parent/patch.stem) as f_in, open(orig.parent/patch.stem,'w') as f_out: - f_out.write(f_in.read().replace('%INSTALLDIR%',msc_root).replace('%EDITOR%',editor)) + damask.execute(f'patch {orig.parent/patch.stem} {patch} -b') + with open(orig.parent/patch.stem) as f_in: + content = f_in.read() + with open(orig.parent/patch.stem,'w') as f_out: + f_out.write(content.replace('%INSTALLDIR%',msc_root).replace('%EDITOR%',editor)) parser = argparse.ArgumentParser( @@ -38,7 +40,8 @@ parser.add_argument('--damask-root', dest='damask_root', metavar = 'string', args = parser.parse_args() msc_root = Path(args.msc_root).expanduser() damask_root = Path(args.damask_root).expanduser() -msc_version = int(args.msc_version) if str(args.msc_version).split('.')[1] == '0' else args.msc_version +msc_version = int(args.msc_version) if str(args.msc_version).split('.')[1] == '0' else \ + args.msc_version matches = {'Marc_tools': [['comp_user','comp_damask_*mp'], ['run_marc','run_damask_*mp'], @@ -53,10 +56,10 @@ print('patching files...\n') for directory in glob.glob(str(damask_root/f'install/MarcMentat/{msc_version}/*')): for orig, mods in matches[Path(directory).name]: - dirs = (msc_root/Path(directory)).name.lower().split('_') - orig = msc_root/f'{dirs[0]}{msc_version}/{dirs[1]}/{orig}' + product,subfolder = (msc_root/Path(directory)).name.split('_') + orig = msc_root/f'{product.lower()}{msc_version}/{subfolder}/{orig}' for patch in glob.glob(f'{directory}/{mods}.patch'): - copy_and_patch(Path(patch),orig,msc_root,editor) + copy_and_patch(Path(patch),orig,msc_root,args.editor) print('compiling Mentat menu binaries...') From 899727138a6a2b4a67c1a88a9bc2960a75506ce6 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 15 Jul 2021 12:19:42 +0200 Subject: [PATCH 12/36] [skip ci] updated version information after successful test of v3.0.0-alpha4-72-g11fa1160e --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index a0034a82e..6cfef66bb 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha4-65-gae3d844e4 +v3.0.0-alpha4-72-g11fa1160e From 0f6fbe60b00312d050777d5385377073d20644a1 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 15 Jul 2021 15:16:49 +0200 Subject: [PATCH 13/36] [skip ci] updated version information after successful test of v3.0.0-alpha4-87-gac4dcd195 --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 6cfef66bb..1848845dd 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha4-72-g11fa1160e +v3.0.0-alpha4-87-gac4dcd195 From cc857c11169182083e528e40a41020802ccbe83b Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Thu, 15 Jul 2021 15:29:21 +0200 Subject: [PATCH 14/36] new GitLab server name --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8adb67db9..0f313bae4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -83,7 +83,7 @@ checkout: - mkdir -p $DAMASKROOT - mkdir -p $TESTROOT - cd $DAMASKROOT - - git clone -q git@magit1.mpie.de:damask/DAMASK.git . + - git clone -q git@git.damask.mpie.de:damask/DAMASK.git . - git checkout $CI_COMMIT_SHA - git submodule update --init - source env/DAMASK.sh From 41fd7c9768c86f11312f6f9205ff1fbec72ed0f8 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 15 Jul 2021 17:08:49 +0200 Subject: [PATCH 15/36] [skip ci] updated version information after successful test of v3.0.0-alpha4-89-gcc857c111 --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 1848845dd..20700824e 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha4-87-gac4dcd195 +v3.0.0-alpha4-89-gcc857c111 From f11e7742e5867ab39a33899c6d32951e524d403a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 16 Jul 2021 10:21:06 +0200 Subject: [PATCH 16/36] better document make damask.mpie.de colorful ;) --- python/damask/_grid.py | 26 ++++++++++++++++- python/damask/_result.py | 16 ++++++++++ python/damask/_rotation.py | 55 +++++++++++++++++++++++++++++++++++ python/damask/grid_filters.py | 2 +- 4 files changed, 97 insertions(+), 2 deletions(-) diff --git a/python/damask/_grid.py b/python/damask/_grid.py index 4eb978427..1338ad1d5 100644 --- a/python/damask/_grid.py +++ b/python/damask/_grid.py @@ -525,7 +525,7 @@ class Grid: periods : integer, optional. Number of periods per unit cell. Defaults to 1. materials : (int, int), optional - Material IDs. Defaults to (1,2). + Material IDs. Defaults to (0,1). Returns ------- @@ -559,6 +559,30 @@ class Grid: M.-T. Hsieh and L. Valdevit, Software Impacts 6:100026, 2020 https://doi.org/10.1016/j.simpa.2020.100026 + Examples + -------- + Minimal surface of 'Gyroid' type. + + >>> import numpy as np + >>> import damask + >>> damask.Grid.from_minimal_surface(np.array([64]*3,int),np.ones(3), + ... 'Gyroid') + cells a b c: 64 x 64 x 64 + size x y z: 1.0 x 1.0 x 1.0 + origin x y z: 0.0 0.0 0.0 + # materials: 2 + + Minimal surface of 'Neovius' type. non-default material IDs. + + >>> import numpy as np + >>> import damask + >>> damask.Grid.from_minimal_surface(np.array([80]*3,int),np.ones(3), + ... 'Neovius',materials=(1,5)) + cells a b c: 80 x 80 x 80 + size x y z: 1.0 x 1.0 x 1.0 + origin x y z: 0.0 0.0 0.0 + # materials: 2 (min: 1, max: 5) + """ x,y,z = np.meshgrid(periods*2.0*np.pi*(np.arange(cells[0])+0.5)/cells[0], periods*2.0*np.pi*(np.arange(cells[1])+0.5)/cells[1], diff --git a/python/damask/_result.py b/python/damask/_result.py index 88bf4184a..1fa376f63 100644 --- a/python/damask/_result.py +++ b/python/damask/_result.py @@ -704,6 +704,14 @@ class Result: T : str Name of tensor dataset. + Examples + -------- + Add the deviatoric part of Cauchy stress 'sigma': + + >>> import damask + >>> r = damask.Result('my_file.hdf5') + >>> r.add_deviator('sigma') + """ self._add_generic_pointwise(self._add_deviator,{'T':T}) @@ -737,6 +745,14 @@ class Result: eigenvalue : {'max', 'mid', 'min'} Eigenvalue. Defaults to 'max'. + Examples + -------- + Add the minimum eigenvalue of Cauchy stress 'sigma': + + >>> import damask + >>> r = damask.Result('my_file.hdf5') + >>> r.add_eigenvalue('sigma','min') + """ self._add_generic_pointwise(self._add_eigenvalue,{'T_sym':T_sym},{'eigenvalue':eigenvalue}) diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index c76f95c8e..b68e25d49 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -502,6 +502,15 @@ class Rotation: Bunge-Euler angles: (φ_1, ϕ, φ_2), φ_1 ∈ [0,2π], ϕ ∈ [0,π], φ_2 ∈ [0,2π] unless degrees == True: φ_1 ∈ [0,360], ϕ ∈ [0,180], φ_2 ∈ [0,360] + Examples + -------- + Cube orientation as Bunge-Euler angles. + + >>> import damask + >>> import numpy as np + >>> damask.Rotation(np.array([1,0,0,0])).as_Euler_angles() + array([0., 0., 0.]) + """ eu = Rotation._qu2eu(self.quaternion) if degrees: eu = np.degrees(eu) @@ -527,6 +536,15 @@ class Rotation: Axis angle pair: (n_1, n_2, n_3, ω), ǀnǀ = 1 and ω ∈ [0,π] unless degrees = True: ω ∈ [0,180]. + Examples + -------- + Cube orientation as axis angle pair. + + >>> import damask + >>> import numpy as np + >>> damask.Rotation(np.array([1,0,0,0])).as_axis_angle() + array([0., 0., 1., 0.]) + """ ax = Rotation._qu2ax(self.quaternion) if degrees: ax[...,3] = np.degrees(ax[...,3]) @@ -541,6 +559,16 @@ class Rotation: R : numpy.ndarray of shape (...,3,3) Rotation matrix R, det(R) = 1, R.T∙R=I. + Examples + -------- + Cube orientation as rotation matrix. + + >>> import damask + >>> import numpy as np + >>> damask.Rotation(np.array([1,0,0,0])).as_matrix() + array([[1., 0., 0.], + [0., 1., 0.], + [0., 0., 1.]]) """ return Rotation._qu2om(self.quaternion) @@ -563,6 +591,15 @@ class Rotation: numpy.ndarray of shape (...,3) containing tan(ω/2) [n_1, n_2, n_3], ω ∈ [0,π]. + Examples + -------- + Cube orientation as 'real' Rodrigues-Frank vector. + + >>> import damask + >>> import numpy as np + >>> damask.Rotation(np.array([1,0,0,0])).as_Rodrigues_vector(compact=True) + array([ 0., 0., 0.]) + """ ro = Rotation._qu2ro(self.quaternion) if compact: @@ -580,6 +617,15 @@ class Rotation: h : numpy.ndarray of shape (...,3) Homochoric vector: (h_1, h_2, h_3), ǀhǀ < (3/4*π)^(1/3). + Examples + -------- + Cube orientation as homochoric vector. + + >>> import damask + >>> import numpy as np + >>> damask.Rotation(np.array([1,0,0,0])).as_homochoric() + array([0., 0., 0.]) + """ return Rotation._qu2ho(self.quaternion) @@ -592,6 +638,15 @@ class Rotation: x : numpy.ndarray of shape (...,3) Cubochoric vector: (x_1, x_2, x_3), max(x_i) < 1/2*π^(2/3). + Examples + -------- + Cube orientation as cubochoric vector. + + >>> import damask + >>> import numpy as np + >>> damask.Rotation(np.array([1,0,0,0])).as_cubochoric() + array([0., 0., 0.]) + """ return Rotation._qu2cu(self.quaternion) diff --git a/python/damask/grid_filters.py b/python/damask/grid_filters.py index 7d0bdab64..816c727cd 100644 --- a/python/damask/grid_filters.py +++ b/python/damask/grid_filters.py @@ -2,7 +2,7 @@ Filters for operations on regular grids. The grids are defined as (x,y,z,...) where x is fastest and z is slowest. -This convention is consistent with the layout in grid vtr files. +This convention is consistent with the layout in grid vti files. When converting to/from a plain list (e.g. storage in ASCII table), the following operations are required for tensorial data: From 2f1fa8292bb0f4f3b9f1c41315e8badf4a7d48cc Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 16 Jul 2021 10:30:45 +0200 Subject: [PATCH 17/36] unify style to majority of occurences --- src/YAML_parse.f90 | 8 ++++---- src/YAML_types.f90 | 8 ++++---- src/grid/discretization_grid.f90 | 2 +- src/grid/spectral_utilities.f90 | 2 +- src/mesh/discretization_mesh.f90 | 2 +- src/mesh/mesh_mech_FEM.f90 | 2 +- src/rotations.f90 | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/YAML_parse.f90 b/src/YAML_parse.f90 index 971fc208c..d7cfa016f 100644 --- a/src/YAML_parse.f90 +++ b/src/YAML_parse.f90 @@ -79,7 +79,7 @@ recursive function parse_flow(YAML_flow) result(node) class is (tDict) call node%set(key,myVal) end select - end do + enddo elseif (flow_string(1:1) == '[') then ! start of a list e = 1 allocate(tList::node) @@ -92,7 +92,7 @@ recursive function parse_flow(YAML_flow) result(node) class is (tList) call node%append(myVal) end select - end do + enddo else ! scalar value allocate(tScalar::node) select type (node) @@ -533,7 +533,7 @@ recursive subroutine lst(blck,flow,s_blck,s_flow,offset) s_flow = s_flow + 2 endif - end do + enddo s_flow = s_flow - 1 if (flow(s_flow-1:s_flow-1) == ',') s_flow = s_flow - 1 @@ -620,7 +620,7 @@ recursive subroutine dct(blck,flow,s_blck,s_flow,offset) flow(s_flow:s_flow) = ' ' s_flow = s_flow + 1 offset = 0 - end do + enddo s_flow = s_flow - 1 if (flow(s_flow-1:s_flow-1) == ',') s_flow = s_flow - 1 diff --git a/src/YAML_types.f90 b/src/YAML_types.f90 index 2a6bd64f9..45907fbae 100644 --- a/src/YAML_types.f90 +++ b/src/YAML_types.f90 @@ -1082,7 +1082,7 @@ recursive function tList_asFormattedString(self,indent) result(str) if (i /= 1) str = str//repeat(' ',indent_) str = str//'- '//item%node%asFormattedString(indent_+2) item => item%next - end do + enddo end function tList_asFormattedString @@ -1116,7 +1116,7 @@ recursive function tDict_asFormattedString(self,indent) result(str) str = str//trim(item%key)//':'//IO_EOL//repeat(' ',indent_+2)//item%node%asFormattedString(indent_+2) endselect item => item%next - end do + enddo end function tDict_asFormattedString @@ -1316,7 +1316,7 @@ subroutine tList_append(self,node) item => self%first do while (associated(item%next)) item => item%next - end do + enddo allocate(item%next) item => item%next end if @@ -1347,7 +1347,7 @@ subroutine tDict_set(self,key,node) searchExisting: do while (associated(item%next)) if (item%key == key) exit item => item%next - end do searchExisting + enddo searchExisting if (item%key /= key) then allocate(item%next) item => item%next diff --git a/src/grid/discretization_grid.f90 b/src/grid/discretization_grid.f90 index 8d1d38503..049b3b60d 100644 --- a/src/grid/discretization_grid.f90 +++ b/src/grid/discretization_grid.f90 @@ -239,7 +239,7 @@ subroutine readVTI(grid,geomSize,origin,material) if (gotCellData) exit startPos = endPos + 2_pI64 - end do + enddo if(.not. allocated(material)) call IO_error(error_ID = 844, ext_msg='material data not found') if(size(material) /= product(grid)) call IO_error(error_ID = 844, ext_msg='size(material)') diff --git a/src/grid/spectral_utilities.f90 b/src/grid/spectral_utilities.f90 index aa7c2f4a7..061cc9d74 100644 --- a/src/grid/spectral_utilities.f90 +++ b/src/grid/spectral_utilities.f90 @@ -840,7 +840,7 @@ subroutine utilities_constitutiveResponse(P,P_av,C_volAvg,C_minmaxAvg,& dPdF_min = homogenization_dPdF(1:3,1:3,1:3,1:3,i) dPdF_norm_min = sum(homogenization_dPdF(1:3,1:3,1:3,1:3,i)**2.0_pReal) endif - end do + enddo valueAndRank = [dPdF_norm_max,real(worldrank,pReal)] call MPI_Allreduce(MPI_IN_PLACE,valueAndRank,1, MPI_2DOUBLE_PRECISION, MPI_MAXLOC, MPI_COMM_WORLD, ierr) diff --git a/src/mesh/discretization_mesh.f90 b/src/mesh/discretization_mesh.f90 index 88a19ade9..49eaf0e18 100644 --- a/src/mesh/discretization_mesh.f90 +++ b/src/mesh/discretization_mesh.f90 @@ -161,7 +161,7 @@ subroutine discretization_mesh_init(restart) do j = 1, mesh_NcpElems call DMGetLabelValue(geomMesh,'Cell Sets',j-1,materialAt(j),ierr) CHKERRQ(ierr) - end do + enddo materialAt = materialAt + 1 if (debug_element < 1 .or. debug_element > mesh_NcpElems) call IO_error(602,ext_msg='element') diff --git a/src/mesh/mesh_mech_FEM.f90 b/src/mesh/mesh_mech_FEM.f90 index 6fa2f668b..761b398fc 100644 --- a/src/mesh/mesh_mech_FEM.f90 +++ b/src/mesh/mesh_mech_FEM.f90 @@ -696,7 +696,7 @@ subroutine FEM_mechanical_updateCoords() do p=pStart, pEnd-1 call DMPlexGetPointLocal(dm_local, p, s, e, ierr); CHKERRQ(ierr) nodeCoords(1:dimPlex,p)=nodeCoords_linear(s+1:e) - end do + enddo call discretization_setNodeCoords(nodeCoords) call VecRestoreArrayF90(x_local,nodeCoords_linear,ierr); CHKERRQ(ierr) diff --git a/src/rotations.f90 b/src/rotations.f90 index 8d7b842fc..c64169cab 100644 --- a/src/rotations.f90 +++ b/src/rotations.f90 @@ -1131,7 +1131,7 @@ pure function ho2ax(ho) result(ax) do i=3,16 hm = hm*hmag_squared s = s + tfit(i) * hm - end do + enddo ax = [ho/sqrt(hmag_squared), 2.0_pReal*acos(s)] end if From 013c4c0a92d95e96e1cf43514de11a11a3be27f1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 16 Jul 2021 10:31:40 +0200 Subject: [PATCH 18/36] common variable names --- src/math.f90 | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/math.f90 b/src/math.f90 index 5b2cedacb..191791ee2 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -646,9 +646,8 @@ pure function math_33to9(m33) integer :: i - do i = 1, 9 - math_33to9(i) = m33(MAPPLAIN(1,i),MAPPLAIN(2,i)) - enddo + + math_33to9 = [(m33(MAPPLAIN(1,i),MAPPLAIN(2,i)),i=1,9)] end function math_33to9 @@ -663,6 +662,7 @@ pure function math_9to33(v9) integer :: i + do i = 1, 9 math_9to33(MAPPLAIN(1,i),MAPPLAIN(2,i)) = v9(i) enddo @@ -685,15 +685,14 @@ pure function math_sym33to6(m33,weighted) real(pReal), dimension(6) :: w integer :: i + if(present(weighted)) then w = merge(NRMMANDEL,1.0_pReal,weighted) else w = NRMMANDEL endif - do i = 1, 6 - math_sym33to6(i) = w(i)*m33(MAPNYE(1,i),MAPNYE(2,i)) - enddo + math_sym33to6 = [(w(i)*m33(MAPNYE(1,i),MAPNYE(2,i)),i=1,6)] end function math_sym33to6 @@ -842,18 +841,18 @@ end function math_Voigt66to3333 !-------------------------------------------------------------------------------------------------- !> @brief draw a random sample from Gauss variable !-------------------------------------------------------------------------------------------------- -real(pReal) function math_sampleGaussVar(meanvalue, stddev, width) +real(pReal) function math_sampleGaussVar(mu, sigma, width) - real(pReal), intent(in) :: meanvalue, & !< meanvalue of gauss distribution - stddev !< standard deviation of gauss distribution - real(pReal), intent(in), optional :: width !< width of considered values as multiples of standard deviation + real(pReal), intent(in) :: mu, & !< mean + sigma !< standard deviation + real(pReal), intent(in), optional :: width !< cut off as multiples of standard deviation real(pReal), dimension(2) :: rnd ! random numbers - real(pReal) :: scatter, & ! normalized scatter around meanvalue + real(pReal) :: scatter, & ! normalized scatter around mean width_ - if (abs(stddev) < tol_math_check) then - math_sampleGaussVar = meanvalue + if (abs(sigma) < tol_math_check) then + math_sampleGaussVar = mu else if (present(width)) then width_ = width @@ -867,7 +866,7 @@ real(pReal) function math_sampleGaussVar(meanvalue, stddev, width) if (rnd(2) <= exp(-0.5_pReal * scatter ** 2.0_pReal)) exit ! test if scattered value is drawn enddo - math_sampleGaussVar = scatter * stddev + math_sampleGaussVar = scatter * sigma endif end function math_sampleGaussVar From 63fee141b94cb42658a4cbf39d099190704bb5f6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 16 Jul 2021 10:34:56 +0200 Subject: [PATCH 19/36] rubbish neper offers advanced seeding/meshing methods --- processing/legacy/seeds_fromDistribution.py | 268 -------------------- python/damask/_rotation.py | 1 + 2 files changed, 1 insertion(+), 268 deletions(-) delete mode 100755 processing/legacy/seeds_fromDistribution.py diff --git a/processing/legacy/seeds_fromDistribution.py b/processing/legacy/seeds_fromDistribution.py deleted file mode 100755 index 59d9f0213..000000000 --- a/processing/legacy/seeds_fromDistribution.py +++ /dev/null @@ -1,268 +0,0 @@ -#!/usr/bin/env python3 - -import threading -import time -import os -import sys -import random -from optparse import OptionParser -from io import StringIO - -import numpy as np - -import damask - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName,damask.version]) - -mismatch = None -currentSeedsName = None - -#--------------------------------------------------------------------------------------------------- -class myThread (threading.Thread): - """Perturb seed in seed file, performes Voronoi tessellation, evaluates, and updates best match.""" - - def __init__(self, threadID): - """Threading class with thread ID.""" - threading.Thread.__init__(self) - self.threadID = threadID - - def run(self): - global bestSeedsUpdate - global bestSeedsVFile - global nMaterials - global delta - global points - global target - global match - global baseFile - global maxSeeds - - s.acquire() - bestMatch = match - s.release() - - random.seed(options.randomSeed+self.threadID) # initializes to given seeds - knownSeedsUpdate = bestSeedsUpdate -1.0 # trigger update of local best seeds - randReset = True # aquire new direction - - myBestSeedsVFile = StringIO() # store local copy of best seeds file - perturbedSeedsVFile = StringIO() # perturbed best seeds file - -#--- still not matching desired bin class ---------------------------------------------------------- - while bestMatch < options.threshold: - s.acquire() # ensure only one thread acces global data - if bestSeedsUpdate > knownSeedsUpdate: # write best fit to virtual file - knownSeedsUpdate = bestSeedsUpdate - bestSeedsVFile.seek(0) - myBestSeedsVFile.close() - myBestSeedsVFile = StringIO() - i=0 - myBestSeedsVFile.writelines(bestSeedsVFile.readlines()) - s.release() - - if randReset: # new direction because current one led to worse fit - - randReset = False - - NmoveGrains = random.randrange(1,maxSeeds) - selectedMs = [] - direction = [] - for i in range(NmoveGrains): - selectedMs.append(random.randrange(1,nMaterials)) - - direction.append((np.random.random()-0.5)*delta) - - perturbedSeedsVFile.close() # reset virtual file - perturbedSeedsVFile = StringIO() - myBestSeedsVFile.seek(0) - - perturbedSeedsTable = damask.Table.load(myBestSeedsVFile) - coords = perturbedSeedsTable.get('pos') - i = 0 - for ms,coord in enumerate(coords): - if ms in selectedMs: - newCoords=coord+direction[i] - newCoords=np.where(newCoords>=1.0,newCoords-1.0,newCoords) # ensure that the seeds remain in the box - newCoords=np.where(newCoords <0.0,newCoords+1.0,newCoords) - coords[i]=newCoords - direction[i]*=2. - i+= 1 - perturbedSeedsTable.set('pos',coords).save(perturbedSeedsVFile,legacy=True) - -#--- do tesselation with perturbed seed file ------------------------------------------------------ - perturbedGeom = damask.Grid.from_Voronoi_tessellation(options.grid,np.ones(3),coords) - - -#--- evaluate current seeds file ------------------------------------------------------------------ - myNmaterials = len(np.unique(perturbedGeom.material)) - currentData = np.bincount(perturbedGeom.material.ravel())[1:]/points - currentError=[] - currentHist=[] - for i in range(nMaterials): # calculate the deviation in all bins per histogram - currentHist.append(np.histogram(currentData,bins=target[i]['bins'])[0]) - currentError.append(np.sqrt(np.square(np.array(target[i]['histogram']-currentHist[i])).sum())) - -# as long as not all grains are within the range of the target, use the deviation to left and right as error - if currentError[0]>0.0: - currentError[0] *=((target[0]['bins'][0]-np.min(currentData))**2.0+ - (target[0]['bins'][1]-np.max(currentData))**2.0)**0.5 # norm of deviations by number of usual bin deviation - s.acquire() # do the evaluation serially - bestMatch = match -#--- count bin classes with no mismatch ---------------------------------------------------------------------- - myMatch=0 - for i in range(nMaterials): - if currentError[i] > 0.0: break - myMatch = i+1 - - if myNmaterials == nMaterials: - for i in range(min(nMaterials,myMatch+options.bins)): - if currentError[i] > target[i]['error']: # worse fitting, next try - randReset = True - break - elif currentError[i] < target[i]['error']: # better fit - bestSeedsUpdate = time.time() # save time of better fit - damask.util.croak('Thread {:d}: Better match ({:d} bins, {:6.4f} --> {:6.4f})'\ - .format(self.threadID,i+1,target[i]['error'],currentError[i])) - damask.util.croak(' target: '+np.array_str(target[i]['histogram'])) - damask.util.croak(' best: '+np.array_str(currentHist[i])) - currentSeedsName = baseFile+'_'+str(bestSeedsUpdate).replace('.','-') # name of new seed file (use time as unique identifier) - perturbedSeedsVFile.seek(0) - bestSeedsVFile.close() - bestSeedsVFile = StringIO() - sys.stdout.flush() - with open(currentSeedsName+'.seeds','w') as currentSeedsFile: # write to new file - for line in perturbedSeedsVFile: - currentSeedsFile.write(line) - bestSeedsVFile.write(line) - for j in range(nMaterials): # save new errors for all bins - target[j]['error'] = currentError[j] - if myMatch > match: # one or more new bins have no deviation - damask.util.croak( 'Stage {:d} cleared'.format(myMatch)) - match=myMatch - sys.stdout.flush() - break - if i == min(nMaterials,myMatch+options.bins)-1: # same quality as before: take it to keep on moving - bestSeedsUpdate = time.time() - perturbedSeedsVFile.seek(0) - bestSeedsVFile.close() - bestSeedsVFile = StringIO() - bestSeedsVFile.writelines(perturbedSeedsVFile.readlines()) - for j in range(nMaterials): - target[j]['error'] = currentError[j] - randReset = True - else: #--- not all grains are tessellated - damask.util.croak('Thread {:d}: Material mismatch ({:d} material indices mapped)'\ - .format(self.threadID,myNmaterials)) - randReset = True - - - s.release() - - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- - -parser = OptionParser(usage='%prog options [file[s]]', description = """ -Monte Carlo simulation to produce seed file that gives same size distribution like given geometry file. - -""", version = scriptID) - -parser.add_option('-s','--seeds', dest='seedFile', metavar='string', - help='name of the intial seed file. If not found, a new one is created [%default]') -parser.add_option('-g','--grid', dest='grid', type='int', nargs=3, metavar='int int int', - help='a,b,c grid of hexahedral box [%default]') -parser.add_option('-t','--threads', dest='threads', type='int', metavar='int', - help='number of parallel executions [%default]') -parser.add_option('-r', '--rnd', dest='randomSeed', type='int', metavar='int', - help='seed of random number generator [%default]') -parser.add_option('--target', dest='target', metavar='string', - help='name of the geom file with target distribution [%default]') -parser.add_option('--tolerance', dest='threshold', type='int', metavar='int', - help='stopping criterion (bin number) [%default]') -parser.add_option('--scale', dest='scale',type='float', metavar='float', - help='maximum moving distance of perturbed seed in pixel [%default]') -parser.add_option('--bins', dest='bins', type='int', metavar='int', - help='bins to sort beyond current best fit [%default]') -parser.add_option('--maxseeds', dest='maxseeds', type='int', metavar='int', - help='maximum number of seeds to move simulateneously [number of seeds]') - -parser.set_defaults(seedFile = 'seeds', - grid = (64,64,64), - threads = 2, - randomSeed = None, - target = 'geom', - threshold = 20, - bins = 15, - scale = 1.0, - maxseeds = 0) - -options = parser.parse_args()[0] - -damask.util.report(scriptName,options.seedFile) - -if options.randomSeed is None: - options.randomSeed = int(os.urandom(4).hex(),16) -damask.util.croak(options.randomSeed) -delta = options.scale/np.array(options.grid) -baseFile = os.path.splitext(os.path.basename(options.seedFile))[0] -points = np.array(options.grid).prod().astype('float') - -# ----------- calculate target distribution and bin edges -targetGeom = damask.Grid.load_ASCII(os.path.splitext(os.path.basename(options.target))[0]+'.geom') -nMaterials = len(np.unique(targetGeom.material)) -targetVolFrac = np.bincount(targetGeom.material.flatten())/targetGeom.cells.prod().astype(np.float) -target = [] -for i in range(1,nMaterials+1): - targetHist,targetBins = np.histogram(targetVolFrac,bins=i) #bin boundaries - target.append({'histogram':targetHist,'bins':targetBins}) - -# ----------- create initial seed file or open existing one -bestSeedsVFile = StringIO() -if os.path.isfile(os.path.splitext(options.seedFile)[0]+'.seeds'): - initial_seeds = damask.Table.load(os.path.splitext(options.seedFile)[0]+'.seeds').get('pos') -else: - initial_seeds = damask.seeds.from_random(np.ones(3),nMaterials,options.grid,options.randomSeed) - -bestSeedsUpdate = time.time() - -# ----------- tessellate initial seed file to get and evaluate geom file -bestSeedsVFile.seek(0) -initialGeom = damask.Grid.from_Voronoi_tessellation(options.grid,np.ones(3),initial_seeds) - -if len(np.unique(targetGeom.material)) != nMaterials: - damask.util.croak('error. Material count mismatch') - -initialData = np.bincount(initialGeom.material.flatten())/points -for i in range(nMaterials): - initialHist = np.histogram(initialData,bins=target[i]['bins'])[0] - target[i]['error']=np.sqrt(np.square(np.array(target[i]['histogram']-initialHist)).sum()) - -# as long as not all grain sizes are within the range, the error is the deviation to left and right -if target[0]['error'] > 0.0: - target[0]['error'] *=((target[0]['bins'][0]-np.min(initialData))**2.0+ - (target[0]['bins'][1]-np.max(initialData))**2.0)**0.5 -match=0 -for i in range(nMaterials): - if target[i]['error'] > 0.0: break - match = i+1 - - -if options.maxseeds < 1: - maxSeeds = len(np.unique(initialGeom.material)) -else: - maxSeeds = options.maxseeds - -if match >0: damask.util.croak('Stage {:d} cleared'.format(match)) -sys.stdout.flush() - -# start mulithreaded monte carlo simulation -threads = [] -s = threading.Semaphore(1) - -for i in range(options.threads): - threads.append(myThread(i)) - threads[i].start() -for i in range(options.threads): - threads[i].join() diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index b68e25d49..4eb52eb87 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -569,6 +569,7 @@ class Rotation: array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]) + """ return Rotation._qu2om(self.quaternion) From e2b8145dc68c47b03784864cdc75277a305c14d8 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 16 Jul 2021 16:52:41 +0200 Subject: [PATCH 20/36] [skip ci] updated version information after successful test of v3.0.0-alpha4-94-g63fee141b --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 20700824e..862500995 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha4-89-gcc857c111 +v3.0.0-alpha4-94-g63fee141b From 3f0eafd640ddd60c5009137522ee2a89ef14b164 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 16 Jul 2021 17:53:11 +0200 Subject: [PATCH 21/36] first step towards separating of mechanics, thermal, and damage --- src/CPFEM.f90 | 5 ++-- src/grid/spectral_utilities.f90 | 1 + src/homogenization.f90 | 40 ++++++++++++++++++++++-------- src/mesh/FEM_utilities.f90 | 44 ++++++++++++++++----------------- 4 files changed, 56 insertions(+), 34 deletions(-) diff --git a/src/CPFEM.f90 b/src/CPFEM.f90 index 213b56a54..3a1340764 100644 --- a/src/CPFEM.f90 +++ b/src/CPFEM.f90 @@ -189,9 +189,10 @@ subroutine CPFEM_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyS CPFEM_dcsde(1:6,1:6,ip,elCP) = ODD_JACOBIAN * math_eye(6) else validCalculation - if (debugCPFEM%extensive) & - print'(a,i8,1x,i2)', '<< CPFEM >> calculation for elFE ip ',elFE,ip + if (debugCPFEM%extensive) print'(a,i8,1x,i2)', '<< CPFEM >> calculation for elFE ip ',elFE,ip call materialpoint_stressAndItsTangent(dt,[ip,ip],[elCP,elCP]) + call materialpoint_stressAndItsTangent2(dt,[ip,ip],[elCP,elCP]) + terminalIllness: if (terminallyIll) then diff --git a/src/grid/spectral_utilities.f90 b/src/grid/spectral_utilities.f90 index 061cc9d74..c143f480f 100644 --- a/src/grid/spectral_utilities.f90 +++ b/src/grid/spectral_utilities.f90 @@ -816,6 +816,7 @@ subroutine utilities_constitutiveResponse(P,P_av,C_volAvg,C_minmaxAvg,& homogenization_F = reshape(F,[3,3,product(grid(1:2))*grid3]) ! set materialpoint target F to estimated field call materialpoint_stressAndItsTangent(timeinc,[1,1],[1,product(grid(1:2))*grid3]) ! calculate P field + call materialpoint_stressAndItsTangent2(timeinc,[1,1],[1,product(grid(1:2))*grid3]) P = reshape(homogenization_P, [3,3,grid(1),grid(2),grid3]) P_av = sum(sum(sum(P,dim=5),dim=4),dim=3) * wgt ! average of P diff --git a/src/homogenization.f90 b/src/homogenization.f90 index f34834272..07218e50a 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -179,6 +179,7 @@ module homogenization public :: & homogenization_init, & materialpoint_stressAndItsTangent, & + materialpoint_stressAndItsTangent2, & homogenization_mu_T, & homogenization_K_T, & homogenization_f_T, & @@ -227,7 +228,7 @@ end subroutine homogenization_init !-------------------------------------------------------------------------------------------------- -!> @brief parallelized calculation of stress and corresponding tangent at material points +!> @brief !-------------------------------------------------------------------------------------------------- subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execElem) @@ -243,8 +244,8 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE logical, dimension(2) :: & doneAndHappy - !$OMP PARALLEL - !$OMP DO PRIVATE(ce,en,ho,NiterationMPstate,converged,doneAndHappy) + + !$OMP PARALLEL DO PRIVATE(ce,en,ho,NiterationMPstate,converged,doneAndHappy) do el = FEsolving_execElem(1),FEsolving_execElem(2) do ip = FEsolving_execIP(1),FEsolving_execIP(2) @@ -285,10 +286,30 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE endif enddo enddo - !$OMP END DO + !$OMP END PARALLEL DO + +end subroutine materialpoint_stressAndItsTangent + + +!-------------------------------------------------------------------------------------------------- +!> @brief +!-------------------------------------------------------------------------------------------------- +subroutine materialpoint_stressAndItsTangent2(dt,FEsolving_execIP,FEsolving_execElem) + + real(pReal), intent(in) :: dt !< time increment + integer, dimension(2), intent(in) :: FEsolving_execElem, FEsolving_execIP + integer :: & + NiterationMPstate, & + ip, & !< integration point number + el, & !< element number + co, ce, ho, en, ph + logical :: & + converged + logical, dimension(2) :: & + doneAndHappy if (.not. terminallyIll) then - !$OMP DO PRIVATE(ho,ph,ce) + !$OMP PARALLEL DO PRIVATE(ho,ph,ce) do el = FEsolving_execElem(1),FEsolving_execElem(2) if (terminallyIll) continue do ip = FEsolving_execIP(1),FEsolving_execIP(2) @@ -305,9 +326,9 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE enddo enddo enddo - !$OMP END DO + !$OMP END PARALLEL DO - !$OMP DO PRIVATE(ho,ce) + !$OMP PARALLEL DO PRIVATE(ho,ce) elementLooping3: do el = FEsolving_execElem(1),FEsolving_execElem(2) IpLooping3: do ip = FEsolving_execIP(1),FEsolving_execIP(2) ce = (el-1)*discretization_nIPs + ip @@ -318,13 +339,12 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE call mechanical_homogenize(dt,ce) enddo IpLooping3 enddo elementLooping3 - !$OMP END DO + !$OMP END PARALLEL DO else print'(/,a,/)', ' << HOMOG >> Material Point terminally ill' endif - !$OMP END PARALLEL -end subroutine materialpoint_stressAndItsTangent +end subroutine materialpoint_stressAndItsTangent2 !-------------------------------------------------------------------------------------------------- diff --git a/src/mesh/FEM_utilities.f90 b/src/mesh/FEM_utilities.f90 index 6765d3d0d..b388bc95b 100644 --- a/src/mesh/FEM_utilities.f90 +++ b/src/mesh/FEM_utilities.f90 @@ -27,17 +27,17 @@ module FEM_utilities logical, public :: cutBack = .false. !< cut back of BVP solver in case convergence is not achieved or a material point is terminally ill integer, public, parameter :: maxFields = 6 integer, public :: nActiveFields = 0 - + !-------------------------------------------------------------------------------------------------- ! grid related information information real(pReal), public :: wgt !< weighting factor 1/Nelems - + !-------------------------------------------------------------------------------------------------- ! field labels information character(len=*), parameter, public :: & FIELD_MECH_label = 'mechanical' - + enum, bind(c); enumerator :: & FIELD_UNDEFINED_ID, & FIELD_MECH_ID @@ -48,7 +48,7 @@ module FEM_utilities COMPONENT_MECH_Y_ID, & COMPONENT_MECH_Z_ID end enum - + !-------------------------------------------------------------------------------------------------- ! variables controlling debugging logical :: & @@ -57,23 +57,23 @@ module FEM_utilities !-------------------------------------------------------------------------------------------------- ! derived types type, public :: tSolutionState !< return type of solution from FEM solver variants - logical :: converged = .true. - logical :: stagConverged = .true. + logical :: converged = .true. + logical :: stagConverged = .true. integer :: iterationsNeeded = 0 end type tSolutionState - + type, public :: tComponentBC integer(kind(COMPONENT_UNDEFINED_ID)) :: ID real(pReal), allocatable, dimension(:) :: Value - logical, allocatable, dimension(:) :: Mask + logical, allocatable, dimension(:) :: Mask end type tComponentBC - + type, public :: tFieldBC integer(kind(FIELD_UNDEFINED_ID)) :: ID integer :: nComponents = 0 type(tComponentBC), allocatable :: componentBC(:) end type tFieldBC - + type, public :: tLoadCase real(pReal) :: time = 0.0_pReal !< length of increment integer :: incs = 0, & !< number of increments @@ -83,7 +83,7 @@ module FEM_utilities integer, allocatable, dimension(:) :: faceID type(tFieldBC), allocatable, dimension(:) :: fieldBC end type tLoadCase - + public :: & FEM_utilities_init, & utilities_constitutiveResponse, & @@ -94,14 +94,14 @@ module FEM_utilities COMPONENT_MECH_Y_ID, & COMPONENT_MECH_Z_ID -contains +contains !ToDo: use functions in variable call !-------------------------------------------------------------------------------------------------- !> @brief allocates all neccessary fields, sets debug flags !-------------------------------------------------------------------------------------------------- subroutine FEM_utilities_init - + character(len=pStringLen) :: petsc_optionsOrder class(tNode), pointer :: & num_mesh, & @@ -113,7 +113,7 @@ subroutine FEM_utilities_init PetscErrorCode :: ierr print'(/,a)', ' <<<+- FEM_utilities init -+>>>' - + num_mesh => config_numerics%get('mesh',defaultVal=emptyDict) structOrder = num_mesh%get_asInt('structOrder', defaultVal = 2) @@ -141,7 +141,7 @@ subroutine FEM_utilities_init write(petsc_optionsOrder,'(a,i0)') '-mechFE_petscspace_degree ', structOrder call PetscOptionsInsertString(PETSC_NULL_OPTIONS,trim(petsc_optionsOrder),ierr) CHKERRQ(ierr) - + wgt = 1.0/real(mesh_maxNips*mesh_NcpElemsGlobal,pReal) @@ -152,20 +152,20 @@ end subroutine FEM_utilities_init !> @brief calculates constitutive response !-------------------------------------------------------------------------------------------------- subroutine utilities_constitutiveResponse(timeinc,P_av,forwardData) - + real(pReal), intent(in) :: timeinc !< loading time logical, intent(in) :: forwardData !< age results - + real(pReal),intent(out), dimension(3,3) :: P_av !< average PK stress - + PetscErrorCode :: ierr print'(/,a)', ' ... evaluating constitutive response ......................................' call materialpoint_stressAndItsTangent(timeinc,[1,mesh_maxNips],[1,mesh_NcpElems]) ! calculate P field - + call materialpoint_stressAndItsTangent2(timeinc,[1,mesh_maxNips],[1,mesh_NcpElems]) cutBack = .false. ! reset cutBack status - + P_av = sum(homogenization_P,dim=3) * wgt call MPI_Allreduce(MPI_IN_PLACE,P_av,9,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD,ierr) @@ -198,12 +198,12 @@ subroutine utilities_projectBCValues(localVec,section,field,comp,bcPointsIS,BCVa do dof = offset+comp+1, offset+numDof, numComp localArray(dof) = localArray(dof) + BCValue + BCDotValue*timeinc enddo - enddo + enddo call VecRestoreArrayF90(localVec,localArray,ierr); CHKERRQ(ierr) call VecAssemblyBegin(localVec, ierr); CHKERRQ(ierr) call VecAssemblyEnd (localVec, ierr); CHKERRQ(ierr) if (nBcPoints > 0) call ISRestoreIndicesF90(bcPointsIS,bcPoints,ierr) - + end subroutine utilities_projectBCValues end module FEM_utilities From 5f78f1753c7d0e7d138d895c704c3a32577c0df8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 16 Jul 2021 18:03:38 +0200 Subject: [PATCH 22/36] split up thermal only for grid at the moment --- src/grid/spectral_utilities.f90 | 1 + src/homogenization.f90 | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/grid/spectral_utilities.f90 b/src/grid/spectral_utilities.f90 index c143f480f..d164c33a2 100644 --- a/src/grid/spectral_utilities.f90 +++ b/src/grid/spectral_utilities.f90 @@ -816,6 +816,7 @@ subroutine utilities_constitutiveResponse(P,P_av,C_volAvg,C_minmaxAvg,& homogenization_F = reshape(F,[3,3,product(grid(1:2))*grid3]) ! set materialpoint target F to estimated field call materialpoint_stressAndItsTangent(timeinc,[1,1],[1,product(grid(1:2))*grid3]) ! calculate P field + call materialpoint_stressAndItsTangent3(timeinc,[1,1],[1,product(grid(1:2))*grid3]) call materialpoint_stressAndItsTangent2(timeinc,[1,1],[1,product(grid(1:2))*grid3]) P = reshape(homogenization_P, [3,3,grid(1),grid(2),grid3]) diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 07218e50a..9e80c6dda 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -180,6 +180,7 @@ module homogenization homogenization_init, & materialpoint_stressAndItsTangent, & materialpoint_stressAndItsTangent2, & + materialpoint_stressAndItsTangent3, & homogenization_mu_T, & homogenization_K_T, & homogenization_f_T, & @@ -294,7 +295,7 @@ end subroutine materialpoint_stressAndItsTangent !-------------------------------------------------------------------------------------------------- !> @brief !-------------------------------------------------------------------------------------------------- -subroutine materialpoint_stressAndItsTangent2(dt,FEsolving_execIP,FEsolving_execElem) +subroutine materialpoint_stressAndItsTangent3(dt,FEsolving_execIP,FEsolving_execElem) real(pReal), intent(in) :: dt !< time increment integer, dimension(2), intent(in) :: FEsolving_execElem, FEsolving_execIP @@ -327,7 +328,30 @@ subroutine materialpoint_stressAndItsTangent2(dt,FEsolving_execIP,FEsolving_exec enddo enddo !$OMP END PARALLEL DO + else + print'(/,a,/)', ' << HOMOG >> Material Point terminally ill' + endif +end subroutine materialpoint_stressAndItsTangent3 +!-------------------------------------------------------------------------------------------------- +!> @brief +!-------------------------------------------------------------------------------------------------- +subroutine materialpoint_stressAndItsTangent2(dt,FEsolving_execIP,FEsolving_execElem) + + real(pReal), intent(in) :: dt !< time increment + integer, dimension(2), intent(in) :: FEsolving_execElem, FEsolving_execIP + integer :: & + NiterationMPstate, & + ip, & !< integration point number + el, & !< element number + co, ce, ho, en, ph + logical :: & + converged + logical, dimension(2) :: & + doneAndHappy + + + if (.not. terminallyIll) then !$OMP PARALLEL DO PRIVATE(ho,ce) elementLooping3: do el = FEsolving_execElem(1),FEsolving_execElem(2) IpLooping3: do ip = FEsolving_execIP(1),FEsolving_execIP(2) From 2a84aa7ae4a612e81d701025e0f55946c24a032c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 16 Jul 2021 20:32:21 +0200 Subject: [PATCH 23/36] obvious, no need for comment --- src/grid/grid_mech_FEM.f90 | 6 ++---- src/grid/grid_mech_spectral_basic.f90 | 6 ++---- src/grid/grid_mech_spectral_polarisation.f90 | 16 +++++++--------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/grid/grid_mech_FEM.f90 b/src/grid/grid_mech_FEM.f90 index 77678137d..d2fd89b2b 100644 --- a/src/grid/grid_mech_FEM.f90 +++ b/src/grid/grid_mech_FEM.f90 @@ -490,8 +490,8 @@ subroutine converged(snes_local,PETScIter,devNull1,devNull2,fnorm,reason,dummy,i BCTol err_div = fnorm*sqrt(wgt)*geomSize(1)/scaledGeomSize(1)/detJ - divTol = max(maxval(abs(P_av))*num%eps_div_rtol ,num%eps_div_atol) - BCTol = max(maxval(abs(P_av))*num%eps_stress_rtol,num%eps_stress_atol) + divTol = max(maxval(abs(P_av))*num%eps_div_rtol, num%eps_div_atol) + BCTol = max(maxval(abs(P_av))*num%eps_stress_rtol, num%eps_stress_atol) if ((totalIter >= num%itmin .and. all([err_div/divTol, err_BC/BCTol] < 1.0_pReal)) & .or. terminallyIll) then @@ -502,8 +502,6 @@ subroutine converged(snes_local,PETScIter,devNull1,devNull2,fnorm,reason,dummy,i reason = 0 endif -!-------------------------------------------------------------------------------------------------- -! report print'(1/,a)', ' ... reporting .............................................................' print'(1/,a,f12.2,a,es8.2,a,es9.2,a)', ' error divergence = ', & err_div/divTol, ' (',err_div,' / m, tol = ',divTol,')' diff --git a/src/grid/grid_mech_spectral_basic.f90 b/src/grid/grid_mech_spectral_basic.f90 index 83b961023..3ec14d00e 100644 --- a/src/grid/grid_mech_spectral_basic.f90 +++ b/src/grid/grid_mech_spectral_basic.f90 @@ -429,8 +429,8 @@ subroutine converged(snes_local,PETScIter,devNull1,devNull2,devNull3,reason,dumm divTol, & BCTol - divTol = max(maxval(abs(P_av))*num%eps_div_rtol ,num%eps_div_atol) - BCTol = max(maxval(abs(P_av))*num%eps_stress_rtol,num%eps_stress_atol) + divTol = max(maxval(abs(P_av))*num%eps_div_rtol, num%eps_div_atol) + BCTol = max(maxval(abs(P_av))*num%eps_stress_rtol, num%eps_stress_atol) if ((totalIter >= num%itmin .and. all([err_div/divTol, err_BC/BCTol] < 1.0_pReal)) & .or. terminallyIll) then @@ -441,8 +441,6 @@ subroutine converged(snes_local,PETScIter,devNull1,devNull2,devNull3,reason,dumm reason = 0 endif -!-------------------------------------------------------------------------------------------------- -! report print'(1/,a)', ' ... reporting .............................................................' print'(1/,a,f12.2,a,es8.2,a,es9.2,a)', ' error divergence = ', & err_div/divTol, ' (',err_div,' / m, tol = ',divTol,')' diff --git a/src/grid/grid_mech_spectral_polarisation.f90 b/src/grid/grid_mech_spectral_polarisation.f90 index 07edc84b5..7c9c85199 100644 --- a/src/grid/grid_mech_spectral_polarisation.f90 +++ b/src/grid/grid_mech_spectral_polarisation.f90 @@ -487,9 +487,9 @@ subroutine converged(snes_local,PETScIter,devNull1,devNull2,devNull3,reason,dumm divTol, & BCTol - curlTol = max(maxval(abs(F_aim-math_I3))*num%eps_curl_rtol ,num%eps_curl_atol) - divTol = max(maxval(abs(P_av)) *num%eps_div_rtol ,num%eps_div_atol) - BCTol = max(maxval(abs(P_av)) *num%eps_stress_rtol,num%eps_stress_atol) + curlTol = max(maxval(abs(F_aim-math_I3))*num%eps_curl_rtol, num%eps_curl_atol) + divTol = max(maxval(abs(P_av))*num%eps_div_rtol, num%eps_div_atol) + BCTol = max(maxval(abs(P_av))*num%eps_stress_rtol, num%eps_stress_atol) if ((totalIter >= num%itmin .and. all([err_div/divTol, err_curl/curlTol, err_BC/BCTol] < 1.0_pReal)) & .or. terminallyIll) then @@ -500,8 +500,6 @@ subroutine converged(snes_local,PETScIter,devNull1,devNull2,devNull3,reason,dumm reason = 0 endif -!-------------------------------------------------------------------------------------------------- -! report print'(1/,a)', ' ... reporting .............................................................' print'(1/,a,f12.2,a,es8.2,a,es9.2,a)', ' error divergence = ', & err_div/divTol, ' (',err_div, ' / m, tol = ',divTol,')' @@ -542,13 +540,13 @@ subroutine formResidual(in, FandF_tau, & !--------------------------------------------------------------------------------------------------- F => FandF_tau(1:3,1:3,1,& - XG_RANGE,YG_RANGE,ZG_RANGE) + XG_RANGE,YG_RANGE,ZG_RANGE) F_tau => FandF_tau(1:3,1:3,2,& - XG_RANGE,YG_RANGE,ZG_RANGE) + XG_RANGE,YG_RANGE,ZG_RANGE) residual_F => residuum(1:3,1:3,1,& - X_RANGE, Y_RANGE, Z_RANGE) + X_RANGE, Y_RANGE, Z_RANGE) residual_F_tau => residuum(1:3,1:3,2,& - X_RANGE, Y_RANGE, Z_RANGE) + X_RANGE, Y_RANGE, Z_RANGE) F_av = sum(sum(sum(F,dim=5),dim=4),dim=3) * wgt call MPI_Allreduce(MPI_IN_PLACE,F_av,9,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD,ierr) From ed6b1be35210087d7da5eaac4b81da22aca69477 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 16 Jul 2021 20:43:08 +0200 Subject: [PATCH 24/36] solver handles terminally ill --- src/CPFEM.f90 | 3 +- src/grid/spectral_utilities.f90 | 8 ++-- src/homogenization.f90 | 67 +++++++++++++++------------------ src/mesh/FEM_utilities.f90 | 5 ++- 4 files changed, 41 insertions(+), 42 deletions(-) diff --git a/src/CPFEM.f90 b/src/CPFEM.f90 index 3a1340764..06d1ca6a8 100644 --- a/src/CPFEM.f90 +++ b/src/CPFEM.f90 @@ -191,7 +191,8 @@ subroutine CPFEM_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyS else validCalculation if (debugCPFEM%extensive) print'(a,i8,1x,i2)', '<< CPFEM >> calculation for elFE ip ',elFE,ip call materialpoint_stressAndItsTangent(dt,[ip,ip],[elCP,elCP]) - call materialpoint_stressAndItsTangent2(dt,[ip,ip],[elCP,elCP]) + if (.not. terminallyIll) & + call materialpoint_stressAndItsTangent2(dt,[ip,ip],[elCP,elCP]) terminalIllness: if (terminallyIll) then diff --git a/src/grid/spectral_utilities.f90 b/src/grid/spectral_utilities.f90 index d164c33a2..607928c1b 100644 --- a/src/grid/spectral_utilities.f90 +++ b/src/grid/spectral_utilities.f90 @@ -816,11 +816,13 @@ subroutine utilities_constitutiveResponse(P,P_av,C_volAvg,C_minmaxAvg,& homogenization_F = reshape(F,[3,3,product(grid(1:2))*grid3]) ! set materialpoint target F to estimated field call materialpoint_stressAndItsTangent(timeinc,[1,1],[1,product(grid(1:2))*grid3]) ! calculate P field - call materialpoint_stressAndItsTangent3(timeinc,[1,1],[1,product(grid(1:2))*grid3]) - call materialpoint_stressAndItsTangent2(timeinc,[1,1],[1,product(grid(1:2))*grid3]) + if (.not. terminallyIll) & + call materialpoint_stressAndItsTangent3(timeinc,[1,1],[1,product(grid(1:2))*grid3]) + if (.not. terminallyIll) & + call materialpoint_stressAndItsTangent2(timeinc,[1,1],[1,product(grid(1:2))*grid3]) P = reshape(homogenization_P, [3,3,grid(1),grid(2),grid3]) - P_av = sum(sum(sum(P,dim=5),dim=4),dim=3) * wgt ! average of P + P_av = sum(sum(sum(P,dim=5),dim=4),dim=3) * wgt call MPI_Allreduce(MPI_IN_PLACE,P_av,9,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD,ierr) if (debugRotation) print'(/,a,/,2(3(2x,f12.4,1x)/),3(2x,f12.4,1x))', & ' Piola--Kirchhoff stress (lab) / MPa =', transpose(P_av)*1.e-6_pReal diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 9e80c6dda..f4f701d7c 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -309,30 +309,28 @@ subroutine materialpoint_stressAndItsTangent3(dt,FEsolving_execIP,FEsolving_exec logical, dimension(2) :: & doneAndHappy - if (.not. terminallyIll) then - !$OMP PARALLEL DO PRIVATE(ho,ph,ce) - do el = FEsolving_execElem(1),FEsolving_execElem(2) - if (terminallyIll) continue - do ip = FEsolving_execIP(1),FEsolving_execIP(2) - ce = (el-1)*discretization_nIPs + ip - ho = material_homogenizationID(ce) - call thermal_partition(ce) - do co = 1, homogenization_Nconstituents(ho) - ph = material_phaseID(co,ce) - if (.not. thermal_stress(dt,ph,material_phaseMemberAt(co,ip,el))) then - if (.not. terminallyIll) & ! so first signals terminally ill... - print*, ' Integration point ', ip,' at element ', el, ' terminally ill' - terminallyIll = .true. ! ...and kills all others - endif - enddo + !$OMP PARALLEL DO PRIVATE(ho,ph,ce) + do el = FEsolving_execElem(1),FEsolving_execElem(2) + if (terminallyIll) continue + do ip = FEsolving_execIP(1),FEsolving_execIP(2) + ce = (el-1)*discretization_nIPs + ip + ho = material_homogenizationID(ce) + call thermal_partition(ce) + do co = 1, homogenization_Nconstituents(ho) + ph = material_phaseID(co,ce) + if (.not. thermal_stress(dt,ph,material_phaseMemberAt(co,ip,el))) then + if (.not. terminallyIll) & ! so first signals terminally ill... + print*, ' Integration point ', ip,' at element ', el, ' terminally ill' + terminallyIll = .true. ! ...and kills all others + endif enddo enddo - !$OMP END PARALLEL DO - else - print'(/,a,/)', ' << HOMOG >> Material Point terminally ill' - endif + enddo + !$OMP END PARALLEL DO + end subroutine materialpoint_stressAndItsTangent3 + !-------------------------------------------------------------------------------------------------- !> @brief !-------------------------------------------------------------------------------------------------- @@ -351,22 +349,19 @@ subroutine materialpoint_stressAndItsTangent2(dt,FEsolving_execIP,FEsolving_exec doneAndHappy - if (.not. terminallyIll) then - !$OMP PARALLEL DO PRIVATE(ho,ce) - elementLooping3: do el = FEsolving_execElem(1),FEsolving_execElem(2) - IpLooping3: do ip = FEsolving_execIP(1),FEsolving_execIP(2) - ce = (el-1)*discretization_nIPs + ip - ho = material_homogenizationID(ce) - do co = 1, homogenization_Nconstituents(ho) - call crystallite_orientations(co,ip,el) - enddo - call mechanical_homogenize(dt,ce) - enddo IpLooping3 - enddo elementLooping3 - !$OMP END PARALLEL DO - else - print'(/,a,/)', ' << HOMOG >> Material Point terminally ill' - endif + !$OMP PARALLEL DO PRIVATE(ho,ce) + elementLooping3: do el = FEsolving_execElem(1),FEsolving_execElem(2) + IpLooping3: do ip = FEsolving_execIP(1),FEsolving_execIP(2) + ce = (el-1)*discretization_nIPs + ip + ho = material_homogenizationID(ce) + do co = 1, homogenization_Nconstituents(ho) + call crystallite_orientations(co,ip,el) + enddo + call mechanical_homogenize(dt,ce) + enddo IpLooping3 + enddo elementLooping3 + !$OMP END PARALLEL DO + end subroutine materialpoint_stressAndItsTangent2 diff --git a/src/mesh/FEM_utilities.f90 b/src/mesh/FEM_utilities.f90 index b388bc95b..402c6ddf7 100644 --- a/src/mesh/FEM_utilities.f90 +++ b/src/mesh/FEM_utilities.f90 @@ -163,8 +163,9 @@ subroutine utilities_constitutiveResponse(timeinc,P_av,forwardData) print'(/,a)', ' ... evaluating constitutive response ......................................' call materialpoint_stressAndItsTangent(timeinc,[1,mesh_maxNips],[1,mesh_NcpElems]) ! calculate P field - call materialpoint_stressAndItsTangent2(timeinc,[1,mesh_maxNips],[1,mesh_NcpElems]) - cutBack = .false. ! reset cutBack status + if (.not. terminallyIll) & + call materialpoint_stressAndItsTangent2(timeinc,[1,mesh_maxNips],[1,mesh_NcpElems]) + cutBack = .false. P_av = sum(homogenization_P,dim=3) * wgt call MPI_Allreduce(MPI_IN_PLACE,P_av,9,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD,ierr) From 2b24224c7ee29b04159040e96644a33c9c7a1e28 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 16 Jul 2021 20:50:08 +0200 Subject: [PATCH 25/36] more meaningful name --- src/homogenization.f90 | 4 ++-- src/phase.f90 | 12 ++++++------ src/phase_mechanical.f90 | 4 ++-- src/phase_thermal.f90 | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/homogenization.f90 b/src/homogenization.f90 index f4f701d7c..57b3dae4b 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -270,7 +270,7 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE call mechanical_partition(homogenization_F(1:3,1:3,ce),ce) converged = .true. do co = 1, homogenization_Nconstituents(ho) - converged = converged .and. crystallite_stress(dt,co,ip,el) + converged = converged .and. phase_mechanical_constitutive(dt,co,ip,el) enddo if (converged) then @@ -318,7 +318,7 @@ subroutine materialpoint_stressAndItsTangent3(dt,FEsolving_execIP,FEsolving_exec call thermal_partition(ce) do co = 1, homogenization_Nconstituents(ho) ph = material_phaseID(co,ce) - if (.not. thermal_stress(dt,ph,material_phaseMemberAt(co,ip,el))) then + if (.not. phase_thermal_constitutive(dt,ph,material_phaseMemberAt(co,ip,el))) then if (.not. terminallyIll) & ! so first signals terminally ill... print*, ' Integration point ', ip,' at element ', el, ' terminally ill' terminallyIll = .true. ! ...and kills all others diff --git a/src/phase.f90 b/src/phase.f90 index e396e5661..a96145995 100644 --- a/src/phase.f90 +++ b/src/phase.f90 @@ -209,13 +209,13 @@ module phase ! == cleaned:end =================================================================================== - module function thermal_stress(Delta_t,ph,en) result(converged_) + module function phase_thermal_constitutive(Delta_t,ph,en) result(converged_) real(pReal), intent(in) :: Delta_t integer, intent(in) :: ph, en logical :: converged_ - end function thermal_stress + end function phase_thermal_constitutive module function integrateDamageState(dt,co,ce) result(broken) real(pReal), intent(in) :: dt @@ -225,11 +225,11 @@ module phase logical :: broken end function integrateDamageState - module function crystallite_stress(dt,co,ip,el) result(converged_) + module function phase_mechanical_constitutive(dt,co,ip,el) result(converged_) real(pReal), intent(in) :: dt integer, intent(in) :: co, ip, el logical :: converged_ - end function crystallite_stress + end function phase_mechanical_constitutive !ToDo: Try to merge the all stiffness functions module function phase_homogenizedC(ph,en) result(C) @@ -315,8 +315,8 @@ module phase plastic_nonlocal_updateCompatibility, & converged, & crystallite_init, & - crystallite_stress, & - thermal_stress, & + phase_mechanical_constitutive, & + phase_thermal_constitutive, & phase_mechanical_dPdF, & crystallite_orientations, & crystallite_push33ToRef, & diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index 7562c055f..c176de069 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -977,7 +977,7 @@ end subroutine mechanical_forward !-------------------------------------------------------------------------------------------------- !> @brief calculate stress (P) !-------------------------------------------------------------------------------------------------- -module function crystallite_stress(dt,co,ip,el) result(converged_) +module function phase_mechanical_constitutive(dt,co,ip,el) result(converged_) real(pReal), intent(in) :: dt integer, intent(in) :: & @@ -1071,7 +1071,7 @@ module function crystallite_stress(dt,co,ip,el) result(converged_) enddo cutbackLooping -end function crystallite_stress +end function phase_mechanical_constitutive !-------------------------------------------------------------------------------------------------- diff --git a/src/phase_thermal.f90 b/src/phase_thermal.f90 index 8d2915ef7..895246dfa 100644 --- a/src/phase_thermal.f90 +++ b/src/phase_thermal.f90 @@ -216,7 +216,7 @@ module function phase_K_T(co,ce) result(K) end function phase_K_T -module function thermal_stress(Delta_t,ph,en) result(converged_) ! ?? why is this called "stress" when it seems closer to "updateState" ?? +module function phase_thermal_constitutive(Delta_t,ph,en) result(converged_) real(pReal), intent(in) :: Delta_t integer, intent(in) :: ph, en @@ -225,7 +225,7 @@ module function thermal_stress(Delta_t,ph,en) result(converged_) ! ?? converged_ = .not. integrateThermalState(Delta_t,ph,en) -end function thermal_stress +end function phase_thermal_constitutive !-------------------------------------------------------------------------------------------------- From 594ad2c310f15fd0676cd5c15d72ec786da07b78 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 16 Jul 2021 22:22:41 +0200 Subject: [PATCH 26/36] semi-separate handling of damage --- src/phase_mechanical.f90 | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index c176de069..2a693c690 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -1009,17 +1009,13 @@ module function phase_mechanical_constitutive(dt,co,ip,el) result(converged_) subLi0 = phase_mechanical_Li0(ph)%data(1:3,1:3,en) subLp0 = phase_mechanical_Lp0(ph)%data(1:3,1:3,en) subState0 = plasticState(ph)%State0(:,en) - - if (damageState(ph)%sizeState > 0) & - damageState(ph)%subState0(:,en) = damageState(ph)%state0(:,en) - subFp0 = phase_mechanical_Fp0(ph)%data(1:3,1:3,en) subFi0 = phase_mechanical_Fi0(ph)%data(1:3,1:3,en) subF0 = phase_mechanical_F0(ph)%data(1:3,1:3,en) subFrac = 0.0_pReal - subStep = 1.0_pReal/num%subStepSizeCryst todo = .true. - converged_ = .false. ! pretend failed step of 1/subStepSizeCryst + subStep = 1.0_pReal/num%subStepSizeCryst + converged_ = .false. ! pretend failed step of 1/subStepSizeCryst todo = .true. cutbackLooping: do while (todo) @@ -1038,9 +1034,6 @@ module function phase_mechanical_constitutive(dt,co,ip,el) result(converged_) subFp0 = phase_mechanical_Fp(ph)%data(1:3,1:3,en) subFi0 = phase_mechanical_Fi(ph)%data(1:3,1:3,en) subState0 = plasticState(ph)%state(:,en) - if (damageState(ph)%sizeState > 0) & - damageState(ph)%subState0(:,en) = damageState(ph)%state(:,en) - endif !-------------------------------------------------------------------------------------------------- ! cut back (reduced time and restore) @@ -1048,16 +1041,13 @@ module function phase_mechanical_constitutive(dt,co,ip,el) result(converged_) subStep = num%subStepSizeCryst * subStep phase_mechanical_Fp(ph)%data(1:3,1:3,en) = subFp0 phase_mechanical_Fi(ph)%data(1:3,1:3,en) = subFi0 - phase_mechanical_S(ph)%data(1:3,1:3,en) = phase_mechanical_S0(ph)%data(1:3,1:3,en) ! why no subS0 ? is S0 of any use? + phase_mechanical_S(ph)%data(1:3,1:3,en) = phase_mechanical_S0(ph)%data(1:3,1:3,en) ! why no subS0 ? is S0 of any use? if (subStep < 1.0_pReal) then ! actual (not initial) cutback phase_mechanical_Lp(ph)%data(1:3,1:3,en) = subLp0 phase_mechanical_Li(ph)%data(1:3,1:3,en) = subLi0 endif plasticState(ph)%state(:,en) = subState0 - if (damageState(ph)%sizeState > 0) & - damageState(ph)%state(:,en) = damageState(ph)%subState0(:,en) - - todo = subStep > num%subStepMinCryst ! still on track or already done (beyond repair) + todo = subStep > num%subStepMinCryst ! still on track or already done (beyond repair) endif !-------------------------------------------------------------------------------------------------- @@ -1066,11 +1056,13 @@ module function phase_mechanical_constitutive(dt,co,ip,el) result(converged_) subF = subF0 & + subStep * (phase_mechanical_F(ph)%data(1:3,1:3,en) - phase_mechanical_F0(ph)%data(1:3,1:3,en)) converged_ = .not. integrateState(subF0,subF,subFp0,subFi0,subState0(1:sizeDotState),subStep * dt,co,ip,el) - converged_ = converged_ .and. .not. integrateDamageState(subStep * dt,co,(el-1)*discretization_nIPs + ip) endif enddo cutbackLooping + if (damageState(ph)%sizeState > 0) damageState(ph)%subState0(:,en) = damageState(ph)%state0(:,en) + converged_ = converged_ .and. .not. integrateDamageState(dt,co,(el-1)*discretization_nIPs + ip) + end function phase_mechanical_constitutive From 777620b800d9de33d4651555b919182496dd43d6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 16 Jul 2021 22:41:38 +0200 Subject: [PATCH 27/36] polishing --- src/phase_damage_anisobrittle.f90 | 14 ++++++-------- src/phase_damage_isobrittle.f90 | 18 ++++++++---------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/phase_damage_anisobrittle.f90 b/src/phase_damage_anisobrittle.f90 index 9984e5514..e71c6d3cc 100644 --- a/src/phase_damage_anisobrittle.f90 +++ b/src/phase_damage_anisobrittle.f90 @@ -58,10 +58,10 @@ module function anisobrittle_init() result(mySources) do p = 1, phases%length if(mySources(p)) then - phase => phases%get(p) - sources => phase%get('damage') + phase => phases%get(p) + sources => phase%get('damage') - associate(prm => param(p)) + associate(prm => param(p)) src => sources%get(1) N_cl = src%get_as1dInt('N_cl',defaultVal=emptyIntArray) @@ -97,12 +97,10 @@ module function anisobrittle_init() result(mySources) damageState(p)%atol = src%get_asFloat('atol_phi',defaultVal=1.0e-9_pReal) if(any(damageState(p)%atol < 0.0_pReal)) extmsg = trim(extmsg)//' atol_phi' - end associate + end associate -!-------------------------------------------------------------------------------------------------- -! exit if any parameter is out of range - if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'(damage_anisoBrittle)') - endif + if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'(damage_anisoBrittle)') + endif enddo diff --git a/src/phase_damage_isobrittle.f90 b/src/phase_damage_isobrittle.f90 index aed6a91e9..aad03daa9 100644 --- a/src/phase_damage_isobrittle.f90 +++ b/src/phase_damage_isobrittle.f90 @@ -47,10 +47,10 @@ module function isobrittle_init() result(mySources) do ph = 1, phases%length if(mySources(ph)) then - phase => phases%get(ph) - sources => phase%get('damage') + phase => phases%get(ph) + sources => phase%get('damage') - associate(prm => param(ph)) + associate(prm => param(ph)) src => sources%get(1) prm%W_crit = src%get_asFloat('W_crit') @@ -69,12 +69,11 @@ module function isobrittle_init() result(mySources) damageState(ph)%atol = src%get_asFloat('atol_phi',defaultVal=1.0e-9_pReal) if(any(damageState(ph)%atol < 0.0_pReal)) extmsg = trim(extmsg)//' atol_phi' - end associate + end associate -!-------------------------------------------------------------------------------------------------- -! exit if any parameter is out of range - if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'(damage_isobrittle)') - endif + + if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'(damage_isobrittle)') + endif enddo @@ -102,8 +101,7 @@ module subroutine isobrittle_deltaState(C, Fe, ph,me) strain = 0.5_pReal*math_sym33to6(matmul(transpose(Fe),Fe)-math_I3) associate(prm => param(ph)) - strainenergy = 2.0_pReal*sum(strain*matmul(C,strain))/prm%W_crit - ! ToDo: check strainenergy = 2.0_pReal*dot_product(strain,matmul(C,strain))/prm%W_crit + strainenergy = 2.0_pReal*dot_product(strain,matmul(C,strain))/prm%W_crit damageState(ph)%deltaState(1,me) = merge(strainenergy - damageState(ph)%state(1,me), & damageState(ph)%subState0(1,me) - damageState(ph)%state(1,me), & From fc735d639190ca09a6cd2413484eff77c54ec5c7 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 16 Jul 2021 23:19:48 +0200 Subject: [PATCH 28/36] substate0 only needed for staggered state-stress integration --- src/phase.f90 | 4 ---- src/phase_damage.f90 | 10 +++++----- src/phase_damage_isobrittle.f90 | 5 ++--- src/phase_mechanical.f90 | 4 +--- src/prec.f90 | 17 ++++++----------- 5 files changed, 14 insertions(+), 26 deletions(-) diff --git a/src/phase.f90 b/src/phase.f90 index a96145995..311e32a1e 100644 --- a/src/phase.f90 +++ b/src/phase.f90 @@ -545,10 +545,6 @@ subroutine crystallite_init() phases => config_material%get('phase') - do ph = 1, phases%length - if (damageState(ph)%sizeState > 0) allocate(damageState(ph)%subState0,source=damageState(ph)%state0) ! ToDo: hack - enddo - print'(a42,1x,i10)', ' # of elements: ', eMax print'(a42,1x,i10)', ' # of integration points/element: ', iMax print'(a42,1x,i10)', 'max # of constituents/integration point: ', cMax diff --git a/src/phase_damage.f90 b/src/phase_damage.f90 index d8ac5046a..4cc361637 100644 --- a/src/phase_damage.f90 +++ b/src/phase_damage.f90 @@ -212,8 +212,8 @@ module function integrateDamageState(dt,co,ce) result(broken) if(broken) return size_so = damageState(ph)%sizeDotState - damageState(ph)%state(1:size_so,me) = damageState(ph)%subState0(1:size_so,me) & - + damageState(ph)%dotState (1:size_so,me) * dt + damageState(ph)%state(1:size_so,me) = damageState(ph)%state0 (1:size_so,me) & + + damageState(ph)%dotState(1:size_so,me) * dt source_dotState(1:size_so,2) = 0.0_pReal iteration: do NiterationState = 1, num%nState @@ -228,9 +228,9 @@ module function integrateDamageState(dt,co,ce) result(broken) zeta = damper(damageState(ph)%dotState(:,me),source_dotState(1:size_so,1),source_dotState(1:size_so,2)) damageState(ph)%dotState(:,me) = damageState(ph)%dotState(:,me) * zeta & + source_dotState(1:size_so,1)* (1.0_pReal - zeta) - r(1:size_so) = damageState(ph)%state (1:size_so,me) & - - damageState(ph)%subState0(1:size_so,me) & - - damageState(ph)%dotState (1:size_so,me) * dt + r(1:size_so) = damageState(ph)%state (1:size_so,me) & + - damageState(ph)%State0 (1:size_so,me) & + - damageState(ph)%dotState(1:size_so,me) * dt damageState(ph)%state(1:size_so,me) = damageState(ph)%state(1:size_so,me) - r(1:size_so) converged_ = converged_ .and. converged(r(1:size_so), & damageState(ph)%state(1:size_so,me), & diff --git a/src/phase_damage_isobrittle.f90 b/src/phase_damage_isobrittle.f90 index aad03daa9..6480c3c99 100644 --- a/src/phase_damage_isobrittle.f90 +++ b/src/phase_damage_isobrittle.f90 @@ -103,9 +103,8 @@ module subroutine isobrittle_deltaState(C, Fe, ph,me) associate(prm => param(ph)) strainenergy = 2.0_pReal*dot_product(strain,matmul(C,strain))/prm%W_crit - damageState(ph)%deltaState(1,me) = merge(strainenergy - damageState(ph)%state(1,me), & - damageState(ph)%subState0(1,me) - damageState(ph)%state(1,me), & - strainenergy > damageState(ph)%subState0(1,me)) + damageState(ph)%deltaState(1,me) = merge(strainenergy - damageState(ph)%state(1,me), 0.0_pReal, & + strainenergy > damageState(ph)%state(1,me)) end associate end subroutine isobrittle_deltaState diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index 2a693c690..65dd2ceac 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -197,8 +197,7 @@ module subroutine mechanical_init(materials,phases) Nmembers class(tNode), pointer :: & num_crystallite, & - material, & - constituents, & + phase, & mech @@ -1060,7 +1059,6 @@ module function phase_mechanical_constitutive(dt,co,ip,el) result(converged_) enddo cutbackLooping - if (damageState(ph)%sizeState > 0) damageState(ph)%subState0(:,en) = damageState(ph)%state0(:,en) converged_ = converged_ .and. .not. integrateDamageState(dt,co,(el-1)*discretization_nIPs + ip) end function phase_mechanical_constitutive diff --git a/src/prec.f90 b/src/prec.f90 index 7613cfe46..620647b82 100644 --- a/src/prec.f90 +++ b/src/prec.f90 @@ -38,16 +38,14 @@ module prec sizeDotState = 0, & !< size of dot state, i.e. state(1:sizeDot) follows time evolution by dotState rates offsetDeltaState = 0, & !< index offset of delta state sizeDeltaState = 0 !< size of delta state, i.e. state(offset+1:offset+sizeDelta) follows time evolution by deltaState increments - ! http://stackoverflow.com/questions/3948210 - real(pReal), pointer, dimension(:), contiguous :: & + real(pReal), allocatable, dimension(:) :: & atol - real(pReal), pointer, dimension(:,:), contiguous :: & ! a pointer is needed here because we might point to state/doState. However, they will never point to something, but are rather allocated and, hence, contiguous + ! http://stackoverflow.com/questions/3948210 + real(pReal), pointer, dimension(:,:), contiguous :: & !< is basically an allocatable+target, but in a type needs to be pointer state0, & state, & !< state dotState, & !< rate of state change deltaState !< increment of state change - real(pReal), allocatable, dimension(:,:) :: & - subState0 end type type, extends(tState) :: tPlasticState @@ -61,12 +59,9 @@ module prec real(pReal), private, parameter :: PREAL_EPSILON = epsilon(0.0_pReal) !< minimum positive number such that 1.0 + EPSILON /= 1.0. real(pReal), private, parameter :: PREAL_MIN = tiny(0.0_pReal) !< smallest normalized floating point number - integer, dimension(0), parameter :: & - emptyIntArray = [integer::] - real(pReal), dimension(0), parameter :: & - emptyRealArray = [real(pReal)::] - character(len=pStringLen), dimension(0), parameter :: & - emptyStringArray = [character(len=pStringLen)::] + integer, dimension(0), parameter :: emptyIntArray = [integer::] + real(pReal), dimension(0), parameter :: emptyRealArray = [real(pReal)::] + character(len=pStringLen), dimension(0), parameter :: emptyStringArray = [character(len=pStringLen)::] private :: & selfTest From e6d25294d3b1a12e6deef39e8fb7098de0576afd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 16 Jul 2021 23:32:08 +0200 Subject: [PATCH 29/36] separating functionality --- src/phase.f90 | 14 +++++--------- src/phase_damage.f90 | 21 ++++++++++++++++++++- src/phase_damage_isobrittle.f90 | 5 ++--- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/phase.f90 b/src/phase.f90 index 311e32a1e..9324225a2 100644 --- a/src/phase.f90 +++ b/src/phase.f90 @@ -108,6 +108,10 @@ module phase logical, intent(in) :: includeL end subroutine mechanical_restore + module subroutine damage_restore(ce) + integer, intent(in) :: ce + end subroutine damage_restore + module function phase_mechanical_dPdF(dt,co,ce) result(dPdF) real(pReal), intent(in) :: dt @@ -435,17 +439,9 @@ subroutine phase_restore(ce,includeL) logical, intent(in) :: includeL integer, intent(in) :: ce - integer :: & - co - - - do co = 1,homogenization_Nconstituents(material_homogenizationID(ce)) - if (damageState(material_phaseID(co,ce))%sizeState > 0) & - damageState(material_phaseID(co,ce))%state( :,material_phaseEntry(co,ce)) = & - damageState(material_phaseID(co,ce))%state0(:,material_phaseEntry(co,ce)) - enddo call mechanical_restore(ce,includeL) + call damage_restore(ce) end subroutine phase_restore diff --git a/src/phase_damage.f90 b/src/phase_damage.f90 index 4cc361637..700bb2142 100644 --- a/src/phase_damage.f90 +++ b/src/phase_damage.f90 @@ -144,6 +144,26 @@ module function phase_damage_C(C_homogenized,ph,en) result(C) end function phase_damage_C +!-------------------------------------------------------------------------------------------------- +!> @brief Restore data after homog cutback. +!-------------------------------------------------------------------------------------------------- +module subroutine damage_restore(ce) + + integer, intent(in) :: ce + + integer :: & + co + + + do co = 1,homogenization_Nconstituents(material_homogenizationID(ce)) + if (damageState(material_phaseID(co,ce))%sizeState > 0) & + damageState(material_phaseID(co,ce))%state( :,material_phaseEntry(co,ce)) = & + damageState(material_phaseID(co,ce))%state0(:,material_phaseEntry(co,ce)) + enddo + +end subroutine damage_restore + + !---------------------------------------------------------------------------------------------- !< @brief returns local part of nonlocal damage driving force !---------------------------------------------------------------------------------------------- @@ -173,7 +193,6 @@ module function phase_f_phi(phi,co,ce) result(f) end function phase_f_phi - !-------------------------------------------------------------------------------------------------- !> @brief integrate stress, state with adaptive 1st order explicit Euler method !> using Fixed Point Iteration to adapt the stepsize diff --git a/src/phase_damage_isobrittle.f90 b/src/phase_damage_isobrittle.f90 index 6480c3c99..a73fe4fb3 100644 --- a/src/phase_damage_isobrittle.f90 +++ b/src/phase_damage_isobrittle.f90 @@ -121,12 +121,11 @@ module subroutine isobrittle_results(phase,group) integer :: o - associate(prm => param(phase), & - stt => damageState(phase)%state) + associate(prm => param(phase), stt => damageState(phase)%state) outputsLoop: do o = 1,size(prm%output) select case(trim(prm%output(o))) case ('f_phi') - call results_writeDataset(stt,group,trim(prm%output(o)),'driving force','J/m³') + call results_writeDataset(stt,group,trim(prm%output(o)),'driving force','J/m³') ! Wrong, this is dimensionless end select enddo outputsLoop end associate From f9edeb40a5a3e3fb2a15584365ab16c90022c91f Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 17 Jul 2021 11:50:21 +0200 Subject: [PATCH 30/36] descriptive names --- src/CPFEM.f90 | 4 +- src/grid/grid_mech_FEM.f90 | 2 +- src/grid/grid_mech_spectral_basic.f90 | 2 +- src/grid/grid_mech_spectral_polarisation.f90 | 2 +- src/grid/spectral_utilities.f90 | 6 +- src/homogenization.f90 | 74 ++++++++------------ src/homogenization_mechanical.f90 | 8 +-- src/mesh/FEM_utilities.f90 | 4 +- src/phase.f90 | 14 ++-- src/phase_damage.f90 | 14 ++-- src/phase_damage_anisobrittle.f90 | 18 ++--- src/phase_mechanical.f90 | 27 +++---- src/phase_mechanical_eigen.f90 | 4 +- 13 files changed, 83 insertions(+), 96 deletions(-) diff --git a/src/CPFEM.f90 b/src/CPFEM.f90 index 06d1ca6a8..aa532859a 100644 --- a/src/CPFEM.f90 +++ b/src/CPFEM.f90 @@ -190,9 +190,9 @@ subroutine CPFEM_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyS else validCalculation if (debugCPFEM%extensive) print'(a,i8,1x,i2)', '<< CPFEM >> calculation for elFE ip ',elFE,ip - call materialpoint_stressAndItsTangent(dt,[ip,ip],[elCP,elCP]) + call homogenization_mechanical_response(dt,[ip,ip],[elCP,elCP]) if (.not. terminallyIll) & - call materialpoint_stressAndItsTangent2(dt,[ip,ip],[elCP,elCP]) + call homogenization_mechanical_response2(dt,[ip,ip],[elCP,elCP]) terminalIllness: if (terminallyIll) then diff --git a/src/grid/grid_mech_FEM.f90 b/src/grid/grid_mech_FEM.f90 index d2fd89b2b..111e9fece 100644 --- a/src/grid/grid_mech_FEM.f90 +++ b/src/grid/grid_mech_FEM.f90 @@ -261,7 +261,7 @@ subroutine grid_mechanical_FEM_init F = spread(spread(spread(math_I3,3,grid(1)),4,grid(2)),5,grid3) endif restartRead - homogenization_F0 = reshape(F_lastInc, [3,3,product(grid(1:2))*grid3]) ! set starting condition for materialpoint_stressAndItsTangent + homogenization_F0 = reshape(F_lastInc, [3,3,product(grid(1:2))*grid3]) ! set starting condition for homogenization_mechanical_response call utilities_updateCoords(F) call utilities_constitutiveResponse(P_current,P_av,C_volAvg,devNull, & ! stress field, stress avg, global average of stiffness and (min+max)/2 F, & ! target F diff --git a/src/grid/grid_mech_spectral_basic.f90 b/src/grid/grid_mech_spectral_basic.f90 index 3ec14d00e..c4fce61a7 100644 --- a/src/grid/grid_mech_spectral_basic.f90 +++ b/src/grid/grid_mech_spectral_basic.f90 @@ -211,7 +211,7 @@ subroutine grid_mechanical_spectral_basic_init F = reshape(F_lastInc,[9,grid(1),grid(2),grid3]) endif restartRead - homogenization_F0 = reshape(F_lastInc, [3,3,product(grid(1:2))*grid3]) ! set starting condition for materialpoint_stressAndItsTangent + homogenization_F0 = reshape(F_lastInc, [3,3,product(grid(1:2))*grid3]) ! set starting condition for homogenization_mechanical_response call utilities_updateCoords(reshape(F,shape(F_lastInc))) call utilities_constitutiveResponse(P,P_av,C_volAvg,C_minMaxAvg, & ! stress field, stress avg, global average of stiffness and (min+max)/2 reshape(F,shape(F_lastInc)), & ! target F diff --git a/src/grid/grid_mech_spectral_polarisation.f90 b/src/grid/grid_mech_spectral_polarisation.f90 index 7c9c85199..a52554e3c 100644 --- a/src/grid/grid_mech_spectral_polarisation.f90 +++ b/src/grid/grid_mech_spectral_polarisation.f90 @@ -237,7 +237,7 @@ subroutine grid_mechanical_spectral_polarisation_init F_tau_lastInc = 2.0_pReal*F_lastInc endif restartRead - homogenization_F0 = reshape(F_lastInc, [3,3,product(grid(1:2))*grid3]) ! set starting condition for materialpoint_stressAndItsTangent + homogenization_F0 = reshape(F_lastInc, [3,3,product(grid(1:2))*grid3]) ! set starting condition for homogenization_mechanical_response call utilities_updateCoords(reshape(F,shape(F_lastInc))) call utilities_constitutiveResponse(P,P_av,C_volAvg,C_minMaxAvg, & ! stress field, stress avg, global average of stiffness and (min+max)/2 reshape(F,shape(F_lastInc)), & ! target F diff --git a/src/grid/spectral_utilities.f90 b/src/grid/spectral_utilities.f90 index 607928c1b..bd37e2654 100644 --- a/src/grid/spectral_utilities.f90 +++ b/src/grid/spectral_utilities.f90 @@ -815,11 +815,11 @@ subroutine utilities_constitutiveResponse(P,P_av,C_volAvg,C_minmaxAvg,& homogenization_F = reshape(F,[3,3,product(grid(1:2))*grid3]) ! set materialpoint target F to estimated field - call materialpoint_stressAndItsTangent(timeinc,[1,1],[1,product(grid(1:2))*grid3]) ! calculate P field + call homogenization_mechanical_response(timeinc,[1,1],[1,product(grid(1:2))*grid3]) ! calculate P field if (.not. terminallyIll) & - call materialpoint_stressAndItsTangent3(timeinc,[1,1],[1,product(grid(1:2))*grid3]) + call homogenization_thermal_response(timeinc,[1,1],[1,product(grid(1:2))*grid3]) if (.not. terminallyIll) & - call materialpoint_stressAndItsTangent2(timeinc,[1,1],[1,product(grid(1:2))*grid3]) + call homogenization_mechanical_response2(timeinc,[1,1],[1,product(grid(1:2))*grid3]) P = reshape(homogenization_P, [3,3,grid(1),grid(2),grid3]) P_av = sum(sum(sum(P,dim=5),dim=4),dim=3) * wgt diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 57b3dae4b..03a7c620d 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -101,8 +101,8 @@ module homogenization integer, intent(in) :: ce end subroutine damage_partition - module subroutine mechanical_homogenize(dt,ce) - real(pReal), intent(in) :: dt + module subroutine mechanical_homogenize(Delta_t,ce) + real(pReal), intent(in) :: Delta_t integer, intent(in) :: & ce !< cell end subroutine mechanical_homogenize @@ -178,9 +178,9 @@ module homogenization public :: & homogenization_init, & - materialpoint_stressAndItsTangent, & - materialpoint_stressAndItsTangent2, & - materialpoint_stressAndItsTangent3, & + homogenization_mechanical_response, & + homogenization_mechanical_response2, & + homogenization_thermal_response, & homogenization_mu_T, & homogenization_K_T, & homogenization_f_T, & @@ -231,15 +231,15 @@ end subroutine homogenization_init !-------------------------------------------------------------------------------------------------- !> @brief !-------------------------------------------------------------------------------------------------- -subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execElem) +subroutine homogenization_mechanical_response(Delta_t,FEsolving_execIP,FEsolving_execElem) - real(pReal), intent(in) :: dt !< time increment + real(pReal), intent(in) :: Delta_t !< time increment integer, dimension(2), intent(in) :: FEsolving_execElem, FEsolving_execIP integer :: & NiterationMPstate, & ip, & !< integration point number el, & !< element number - co, ce, ho, en, ph + co, ce, ho, en logical :: & converged logical, dimension(2) :: & @@ -268,13 +268,10 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE NiterationMPstate = NiterationMPstate + 1 call mechanical_partition(homogenization_F(1:3,1:3,ce),ce) - converged = .true. - do co = 1, homogenization_Nconstituents(ho) - converged = converged .and. phase_mechanical_constitutive(dt,co,ip,el) - enddo + converged = all([(phase_mechanical_constitutive(Delta_t,co,ip,el),co=1,homogenization_Nconstituents(ho))]) if (converged) then - doneAndHappy = mechanical_updateState(dt,homogenization_F(1:3,1:3,ce),ce) + doneAndHappy = mechanical_updateState(Delta_t,homogenization_F(1:3,1:3,ce),ce) converged = all(doneAndHappy) else doneAndHappy = [.true.,.false.] @@ -282,34 +279,30 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE enddo convergenceLooping if (.not. converged) then - if (.not. terminallyIll) print*, ' Integration point ', ip,' at element ', el, ' terminally ill' + if (.not. terminallyIll) print*, ' Cell ', ce, ' terminally ill' terminallyIll = .true. endif enddo enddo !$OMP END PARALLEL DO -end subroutine materialpoint_stressAndItsTangent +end subroutine homogenization_mechanical_response !-------------------------------------------------------------------------------------------------- !> @brief !-------------------------------------------------------------------------------------------------- -subroutine materialpoint_stressAndItsTangent3(dt,FEsolving_execIP,FEsolving_execElem) +subroutine homogenization_thermal_response(Delta_t,FEsolving_execIP,FEsolving_execElem) - real(pReal), intent(in) :: dt !< time increment + real(pReal), intent(in) :: Delta_t !< time increment integer, dimension(2), intent(in) :: FEsolving_execElem, FEsolving_execIP integer :: & - NiterationMPstate, & - ip, & !< integration point number - el, & !< element number - co, ce, ho, en, ph - logical :: & - converged - logical, dimension(2) :: & - doneAndHappy + ip, & !< integration point number + el, & !< element number + co, ce, ho - !$OMP PARALLEL DO PRIVATE(ho,ph,ce) + + !$OMP PARALLEL DO PRIVATE(ho,ce) do el = FEsolving_execElem(1),FEsolving_execElem(2) if (terminallyIll) continue do ip = FEsolving_execIP(1),FEsolving_execIP(2) @@ -317,36 +310,29 @@ subroutine materialpoint_stressAndItsTangent3(dt,FEsolving_execIP,FEsolving_exec ho = material_homogenizationID(ce) call thermal_partition(ce) do co = 1, homogenization_Nconstituents(ho) - ph = material_phaseID(co,ce) - if (.not. phase_thermal_constitutive(dt,ph,material_phaseMemberAt(co,ip,el))) then - if (.not. terminallyIll) & ! so first signals terminally ill... - print*, ' Integration point ', ip,' at element ', el, ' terminally ill' - terminallyIll = .true. ! ...and kills all others + if (.not. phase_thermal_constitutive(Delta_t,material_phaseID(co,ce),material_phaseEntry(co,ce))) then + if (.not. terminallyIll) print*, ' Cell ', ce, ' terminally ill' + terminallyIll = .true. endif enddo enddo enddo !$OMP END PARALLEL DO -end subroutine materialpoint_stressAndItsTangent3 +end subroutine homogenization_thermal_response !-------------------------------------------------------------------------------------------------- !> @brief !-------------------------------------------------------------------------------------------------- -subroutine materialpoint_stressAndItsTangent2(dt,FEsolving_execIP,FEsolving_execElem) +subroutine homogenization_mechanical_response2(Delta_t,FEsolving_execIP,FEsolving_execElem) - real(pReal), intent(in) :: dt !< time increment + real(pReal), intent(in) :: Delta_t !< time increment integer, dimension(2), intent(in) :: FEsolving_execElem, FEsolving_execIP integer :: & - NiterationMPstate, & - ip, & !< integration point number - el, & !< element number - co, ce, ho, en, ph - logical :: & - converged - logical, dimension(2) :: & - doneAndHappy + ip, & !< integration point number + el, & !< element number + co, ce, ho !$OMP PARALLEL DO PRIVATE(ho,ce) @@ -357,13 +343,13 @@ subroutine materialpoint_stressAndItsTangent2(dt,FEsolving_execIP,FEsolving_exec do co = 1, homogenization_Nconstituents(ho) call crystallite_orientations(co,ip,el) enddo - call mechanical_homogenize(dt,ce) + call mechanical_homogenize(Delta_t,ce) enddo IpLooping3 enddo elementLooping3 !$OMP END PARALLEL DO -end subroutine materialpoint_stressAndItsTangent2 +end subroutine homogenization_mechanical_response2 !-------------------------------------------------------------------------------------------------- diff --git a/src/homogenization_mechanical.f90 b/src/homogenization_mechanical.f90 index 7ea1f74e9..0138d2468 100644 --- a/src/homogenization_mechanical.f90 +++ b/src/homogenization_mechanical.f90 @@ -123,21 +123,21 @@ end subroutine mechanical_partition !-------------------------------------------------------------------------------------------------- !> @brief Average P and dPdF from the individual constituents. !-------------------------------------------------------------------------------------------------- -module subroutine mechanical_homogenize(dt,ce) +module subroutine mechanical_homogenize(Delta_t,ce) - real(pReal), intent(in) :: dt + real(pReal), intent(in) :: Delta_t integer, intent(in) :: ce integer :: co homogenization_P(1:3,1:3,ce) = phase_P(1,ce) - homogenization_dPdF(1:3,1:3,1:3,1:3,ce) = phase_mechanical_dPdF(dt,1,ce) + homogenization_dPdF(1:3,1:3,1:3,1:3,ce) = phase_mechanical_dPdF(Delta_t,1,ce) do co = 2, homogenization_Nconstituents(material_homogenizationID(ce)) homogenization_P(1:3,1:3,ce) = homogenization_P(1:3,1:3,ce) & + phase_P(co,ce) homogenization_dPdF(1:3,1:3,1:3,1:3,ce) = homogenization_dPdF(1:3,1:3,1:3,1:3,ce) & - + phase_mechanical_dPdF(dt,co,ce) + + phase_mechanical_dPdF(Delta_t,co,ce) enddo homogenization_P(1:3,1:3,ce) = homogenization_P(1:3,1:3,ce) & diff --git a/src/mesh/FEM_utilities.f90 b/src/mesh/FEM_utilities.f90 index 402c6ddf7..5bb6d5f44 100644 --- a/src/mesh/FEM_utilities.f90 +++ b/src/mesh/FEM_utilities.f90 @@ -162,9 +162,9 @@ subroutine utilities_constitutiveResponse(timeinc,P_av,forwardData) print'(/,a)', ' ... evaluating constitutive response ......................................' - call materialpoint_stressAndItsTangent(timeinc,[1,mesh_maxNips],[1,mesh_NcpElems]) ! calculate P field + call homogenization_mechanical_response(timeinc,[1,mesh_maxNips],[1,mesh_NcpElems]) ! calculate P field if (.not. terminallyIll) & - call materialpoint_stressAndItsTangent2(timeinc,[1,mesh_maxNips],[1,mesh_NcpElems]) + call homogenization_mechanical_response2(timeinc,[1,mesh_maxNips],[1,mesh_NcpElems]) cutBack = .false. P_av = sum(homogenization_P,dim=3) * wgt diff --git a/src/phase.f90 b/src/phase.f90 index 9324225a2..b551c4170 100644 --- a/src/phase.f90 +++ b/src/phase.f90 @@ -113,8 +113,8 @@ module phase end subroutine damage_restore - module function phase_mechanical_dPdF(dt,co,ce) result(dPdF) - real(pReal), intent(in) :: dt + module function phase_mechanical_dPdF(Delta_t,co,ce) result(dPdF) + real(pReal), intent(in) :: Delta_t integer, intent(in) :: & co, & !< counter in constituent loop ce @@ -221,21 +221,21 @@ module phase end function phase_thermal_constitutive - module function integrateDamageState(dt,co,ce) result(broken) - real(pReal), intent(in) :: dt + module function integrateDamageState(Delta_t,co,ce) result(broken) + real(pReal), intent(in) :: Delta_t integer, intent(in) :: & ce, & co logical :: broken end function integrateDamageState - module function phase_mechanical_constitutive(dt,co,ip,el) result(converged_) - real(pReal), intent(in) :: dt + module function phase_mechanical_constitutive(Delta_t,co,ip,el) result(converged_) + real(pReal), intent(in) :: Delta_t integer, intent(in) :: co, ip, el logical :: converged_ end function phase_mechanical_constitutive - !ToDo: Try to merge the all stiffness functions + !ToDo: Merge all the stiffness functions module function phase_homogenizedC(ph,en) result(C) integer, intent(in) :: ph, en real(pReal), dimension(6,6) :: C diff --git a/src/phase_damage.f90 b/src/phase_damage.f90 index 700bb2142..89d3b1653 100644 --- a/src/phase_damage.f90 +++ b/src/phase_damage.f90 @@ -197,9 +197,9 @@ end function phase_f_phi !> @brief integrate stress, state with adaptive 1st order explicit Euler method !> using Fixed Point Iteration to adapt the stepsize !-------------------------------------------------------------------------------------------------- -module function integrateDamageState(dt,co,ce) result(broken) +module function integrateDamageState(Delta_t,co,ce) result(broken) - real(pReal), intent(in) :: dt + real(pReal), intent(in) :: Delta_t integer, intent(in) :: & ce, & co @@ -230,10 +230,10 @@ module function integrateDamageState(dt,co,ce) result(broken) broken = phase_damage_collectDotState(ph,me) if(broken) return - size_so = damageState(ph)%sizeDotState - damageState(ph)%state(1:size_so,me) = damageState(ph)%state0 (1:size_so,me) & - + damageState(ph)%dotState(1:size_so,me) * dt - source_dotState(1:size_so,2) = 0.0_pReal + size_so = damageState(ph)%sizeDotState + damageState(ph)%state(1:size_so,me) = damageState(ph)%state0 (1:size_so,me) & + + damageState(ph)%dotState(1:size_so,me) * Delta_t + source_dotState(1:size_so,2) = 0.0_pReal iteration: do NiterationState = 1, num%nState @@ -249,7 +249,7 @@ module function integrateDamageState(dt,co,ce) result(broken) + source_dotState(1:size_so,1)* (1.0_pReal - zeta) r(1:size_so) = damageState(ph)%state (1:size_so,me) & - damageState(ph)%State0 (1:size_so,me) & - - damageState(ph)%dotState(1:size_so,me) * dt + - damageState(ph)%dotState(1:size_so,me) * Delta_t damageState(ph)%state(1:size_so,me) = damageState(ph)%state(1:size_so,me) - r(1:size_so) converged_ = converged_ .and. converged(r(1:size_so), & damageState(ph)%state(1:size_so,me), & diff --git a/src/phase_damage_anisobrittle.f90 b/src/phase_damage_anisobrittle.f90 index e71c6d3cc..cc3628323 100644 --- a/src/phase_damage_anisobrittle.f90 +++ b/src/phase_damage_anisobrittle.f90 @@ -40,7 +40,7 @@ module function anisobrittle_init() result(mySources) phase, & sources, & src - integer :: Nmembers,p + integer :: Nmembers,ph integer, dimension(:), allocatable :: N_cl character(len=pStringLen) :: extmsg = '' @@ -56,12 +56,12 @@ module function anisobrittle_init() result(mySources) allocate(param(phases%length)) - do p = 1, phases%length - if(mySources(p)) then - phase => phases%get(p) + do ph = 1, phases%length + if(mySources(ph)) then + phase => phases%get(ph) sources => phase%get('damage') - associate(prm => param(p)) + associate(prm => param(ph)) src => sources%get(1) N_cl = src%get_as1dInt('N_cl',defaultVal=emptyIntArray) @@ -92,10 +92,10 @@ module function anisobrittle_init() result(mySources) if (any(prm%g_crit < 0.0_pReal)) extmsg = trim(extmsg)//' g_crit' if (any(prm%s_crit < 0.0_pReal)) extmsg = trim(extmsg)//' s_crit' - Nmembers = count(material_phaseID==p) - call phase_allocateState(damageState(p),Nmembers,1,1,0) - damageState(p)%atol = src%get_asFloat('atol_phi',defaultVal=1.0e-9_pReal) - if(any(damageState(p)%atol < 0.0_pReal)) extmsg = trim(extmsg)//' atol_phi' + Nmembers = count(material_phaseID==ph) + call phase_allocateState(damageState(ph),Nmembers,1,1,0) + damageState(ph)%atol = src%get_asFloat('atol_phi',defaultVal=1.0e-9_pReal) + if(any(damageState(ph)%atol < 0.0_pReal)) extmsg = trim(extmsg)//' atol_phi' end associate diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index 65dd2ceac..e03998989 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -44,9 +44,9 @@ submodule(phase) mechanical interface - module subroutine eigendeformation_init(phases) + module subroutine eigen_init(phases) class(tNode), pointer :: phases - end subroutine eigendeformation_init + end subroutine eigen_init module subroutine elastic_init(phases) class(tNode), pointer :: phases @@ -302,7 +302,7 @@ module subroutine mechanical_init(materials,phases) end select - call eigendeformation_init(phases) + call eigen_init(phases) end subroutine mechanical_init @@ -976,9 +976,9 @@ end subroutine mechanical_forward !-------------------------------------------------------------------------------------------------- !> @brief calculate stress (P) !-------------------------------------------------------------------------------------------------- -module function phase_mechanical_constitutive(dt,co,ip,el) result(converged_) +module function phase_mechanical_constitutive(Delta_t,co,ip,el) result(converged_) - real(pReal), intent(in) :: dt + real(pReal), intent(in) :: Delta_t integer, intent(in) :: & co, & ip, & @@ -1054,12 +1054,12 @@ module function phase_mechanical_constitutive(dt,co,ip,el) result(converged_) if (todo) then subF = subF0 & + subStep * (phase_mechanical_F(ph)%data(1:3,1:3,en) - phase_mechanical_F0(ph)%data(1:3,1:3,en)) - converged_ = .not. integrateState(subF0,subF,subFp0,subFi0,subState0(1:sizeDotState),subStep * dt,co,ip,el) + converged_ = .not. integrateState(subF0,subF,subFp0,subFi0,subState0(1:sizeDotState),subStep * Delta_t,co,ip,el) endif enddo cutbackLooping - converged_ = converged_ .and. .not. integrateDamageState(dt,co,(el-1)*discretization_nIPs + ip) + converged_ = converged_ .and. .not. integrateDamageState(Delta_t,co,(el-1)*discretization_nIPs + ip) end function phase_mechanical_constitutive @@ -1094,12 +1094,13 @@ module subroutine mechanical_restore(ce,includeL) end subroutine mechanical_restore + !-------------------------------------------------------------------------------------------------- !> @brief Calculate tangent (dPdF). !-------------------------------------------------------------------------------------------------- -module function phase_mechanical_dPdF(dt,co,ce) result(dPdF) +module function phase_mechanical_dPdF(Delta_t,co,ce) result(dPdF) - real(pReal), intent(in) :: dt + real(pReal), intent(in) :: Delta_t integer, intent(in) :: & co, & !< counter in constituent loop ce @@ -1149,11 +1150,11 @@ module function phase_mechanical_dPdF(dt,co,ce) result(dPdF) lhs_3333 = 0.0_pReal; rhs_3333 = 0.0_pReal do o=1,3; do p=1,3 lhs_3333(1:3,1:3,o,p) = lhs_3333(1:3,1:3,o,p) & - + matmul(invSubFi0,dLidFi(1:3,1:3,o,p)) * dt + + matmul(invSubFi0,dLidFi(1:3,1:3,o,p)) * Delta_t lhs_3333(1:3,o,1:3,p) = lhs_3333(1:3,o,1:3,p) & + invFi*invFi(p,o) rhs_3333(1:3,1:3,o,p) = rhs_3333(1:3,1:3,o,p) & - - matmul(invSubFi0,dLidS(1:3,1:3,o,p)) * dt + - matmul(invSubFi0,dLidS(1:3,1:3,o,p)) * Delta_t enddo; enddo call math_invert(temp_99,error,math_3333to99(lhs_3333)) if (error) then @@ -1182,7 +1183,7 @@ module function phase_mechanical_dPdF(dt,co,ce) result(dPdF) temp_3333(1:3,1:3,p,o) = matmul(matmul(temp_33_2,dLpdS(1:3,1:3,p,o)), invFi) & + matmul(temp_33_3,dLidS(1:3,1:3,p,o)) enddo; enddo - lhs_3333 = math_mul3333xx3333(dSdFe,temp_3333) * dt & + lhs_3333 = math_mul3333xx3333(dSdFe,temp_3333) * Delta_t & + math_mul3333xx3333(dSdFi,dFidS) call math_invert(temp_99,error,math_eye(9)+math_3333to99(lhs_3333)) @@ -1198,7 +1199,7 @@ module function phase_mechanical_dPdF(dt,co,ce) result(dPdF) ! calculate dFpinvdF temp_3333 = math_mul3333xx3333(dLpdS,dSdF) do o=1,3; do p=1,3 - dFpinvdF(1:3,1:3,p,o) = - matmul(invSubFp0, matmul(temp_3333(1:3,1:3,p,o),invFi)) * dt + dFpinvdF(1:3,1:3,p,o) = - matmul(invSubFp0, matmul(temp_3333(1:3,1:3,p,o),invFi)) * Delta_t enddo; enddo !-------------------------------------------------------------------------------------------------- diff --git a/src/phase_mechanical_eigen.f90 b/src/phase_mechanical_eigen.f90 index 019838689..14d86661b 100644 --- a/src/phase_mechanical_eigen.f90 +++ b/src/phase_mechanical_eigen.f90 @@ -32,7 +32,7 @@ submodule(phase:mechanical) eigen contains -module subroutine eigendeformation_init(phases) +module subroutine eigen_init(phases) class(tNode), pointer :: & phases @@ -68,7 +68,7 @@ module subroutine eigendeformation_init(phases) where(damage_anisobrittle_init()) model_damage = KINEMATICS_cleavage_opening_ID -end subroutine eigendeformation_init +end subroutine eigen_init !-------------------------------------------------------------------------------------------------- From c109d5a37b349e937c92c09901264471ef4f28db Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 17 Jul 2021 14:06:48 +0200 Subject: [PATCH 31/36] better have different physics separated --- src/homogenization.f90 | 4 ++-- src/phase.f90 | 12 +++++------- src/phase_damage.f90 | 23 ++++++++++++++++++++++- src/phase_mechanical.f90 | 2 -- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 03a7c620d..12d192025 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -233,7 +233,7 @@ end subroutine homogenization_init !-------------------------------------------------------------------------------------------------- subroutine homogenization_mechanical_response(Delta_t,FEsolving_execIP,FEsolving_execElem) - real(pReal), intent(in) :: Delta_t !< time increment + real(pReal), intent(in) :: Delta_t !< time increment integer, dimension(2), intent(in) :: FEsolving_execElem, FEsolving_execIP integer :: & NiterationMPstate, & @@ -269,7 +269,7 @@ subroutine homogenization_mechanical_response(Delta_t,FEsolving_execIP,FEsolving call mechanical_partition(homogenization_F(1:3,1:3,ce),ce) converged = all([(phase_mechanical_constitutive(Delta_t,co,ip,el),co=1,homogenization_Nconstituents(ho))]) - + converged = converged .and. all([(phase_damage_constitutive(Delta_t,co,ip,el),co=1,homogenization_Nconstituents(ho))]) if (converged) then doneAndHappy = mechanical_updateState(Delta_t,homogenization_F(1:3,1:3,ce),ce) converged = all(doneAndHappy) diff --git a/src/phase.f90 b/src/phase.f90 index b551c4170..49f1adc16 100644 --- a/src/phase.f90 +++ b/src/phase.f90 @@ -221,13 +221,11 @@ module phase end function phase_thermal_constitutive - module function integrateDamageState(Delta_t,co,ce) result(broken) + module function phase_damage_constitutive(Delta_t,co,ip,el) result(converged_) real(pReal), intent(in) :: Delta_t - integer, intent(in) :: & - ce, & - co - logical :: broken - end function integrateDamageState + integer, intent(in) :: co, ip, el + logical :: converged_ + end function phase_damage_constitutive module function phase_mechanical_constitutive(Delta_t,co,ip,el) result(converged_) real(pReal), intent(in) :: Delta_t @@ -321,12 +319,12 @@ module phase crystallite_init, & phase_mechanical_constitutive, & phase_thermal_constitutive, & + phase_damage_constitutive, & phase_mechanical_dPdF, & crystallite_orientations, & crystallite_push33ToRef, & phase_restartWrite, & phase_restartRead, & - integrateDamageState, & phase_thermal_setField, & phase_set_phi, & phase_P, & diff --git a/src/phase_damage.f90 b/src/phase_damage.f90 index 89d3b1653..4164854fe 100644 --- a/src/phase_damage.f90 +++ b/src/phase_damage.f90 @@ -125,6 +125,27 @@ module subroutine damage_init end subroutine damage_init +!-------------------------------------------------------------------------------------------------- +!> @brief calculate stress (P) +!-------------------------------------------------------------------------------------------------- +module function phase_damage_constitutive(Delta_t,co,ip,el) result(converged_) + + real(pReal), intent(in) :: Delta_t + integer, intent(in) :: & + co, & + ip, & + el + logical :: converged_ + + integer :: & + ph, en + + + converged_ = .not. integrateDamageState(Delta_t,co,(el-1)*discretization_nIPs + ip) + +end function phase_damage_constitutive + + !-------------------------------------------------------------------------------------------------- !> @brief returns the degraded/modified elasticity matrix !-------------------------------------------------------------------------------------------------- @@ -197,7 +218,7 @@ end function phase_f_phi !> @brief integrate stress, state with adaptive 1st order explicit Euler method !> using Fixed Point Iteration to adapt the stepsize !-------------------------------------------------------------------------------------------------- -module function integrateDamageState(Delta_t,co,ce) result(broken) +function integrateDamageState(Delta_t,co,ce) result(broken) real(pReal), intent(in) :: Delta_t integer, intent(in) :: & diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index e03998989..8b04a0009 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -1059,8 +1059,6 @@ module function phase_mechanical_constitutive(Delta_t,co,ip,el) result(converged enddo cutbackLooping - converged_ = converged_ .and. .not. integrateDamageState(Delta_t,co,(el-1)*discretization_nIPs + ip) - end function phase_mechanical_constitutive From d068f45aa097d6e0be83a25641d57686a356613b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 17 Jul 2021 15:25:00 +0200 Subject: [PATCH 32/36] avoid superflouos damage calculations --- src/homogenization.f90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 12d192025..fc5dd7bda 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -269,15 +269,16 @@ subroutine homogenization_mechanical_response(Delta_t,FEsolving_execIP,FEsolving call mechanical_partition(homogenization_F(1:3,1:3,ce),ce) converged = all([(phase_mechanical_constitutive(Delta_t,co,ip,el),co=1,homogenization_Nconstituents(ho))]) - converged = converged .and. all([(phase_damage_constitutive(Delta_t,co,ip,el),co=1,homogenization_Nconstituents(ho))]) if (converged) then doneAndHappy = mechanical_updateState(Delta_t,homogenization_F(1:3,1:3,ce),ce) converged = all(doneAndHappy) else doneAndHappy = [.true.,.false.] endif - enddo convergenceLooping + + converged = converged .and. all([(phase_damage_constitutive(Delta_t,co,ip,el),co=1,homogenization_Nconstituents(ho))]) + if (.not. converged) then if (.not. terminallyIll) print*, ' Cell ', ce, ' terminally ill' terminallyIll = .true. From 50fccb0a2ea7e0fe893650ac9d92ae7c84797ea8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 17 Jul 2021 22:53:58 +0200 Subject: [PATCH 33/36] not needed --- examples/config/phase/damage/isobrittle_generic.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/config/phase/damage/isobrittle_generic.yaml b/examples/config/phase/damage/isobrittle_generic.yaml index 98c9b9763..a7c30ff1e 100644 --- a/examples/config/phase/damage/isobrittle_generic.yaml +++ b/examples/config/phase/damage/isobrittle_generic.yaml @@ -1,7 +1,5 @@ type: isobrittle W_crit: 1400000.0 -m: 1.0 -isoBrittle_atol: 0.01 output: [f_phi] From 57ad308a7f46cfd91360bc3f67bdff706064822b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 18 Jul 2021 09:10:33 +0200 Subject: [PATCH 34/36] readable --- src/phase_damage_isobrittle.f90 | 35 +++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/phase_damage_isobrittle.f90 b/src/phase_damage_isobrittle.f90 index a73fe4fb3..1c3196a15 100644 --- a/src/phase_damage_isobrittle.f90 +++ b/src/phase_damage_isobrittle.f90 @@ -13,7 +13,15 @@ submodule(phase:damage) isobrittle output end type tParameters - type(tParameters), dimension(:), allocatable :: param !< containers of constitutive parameters (len Ninstances) + type :: tIsobrittleState + real(pReal), pointer, dimension(:) :: & !< vectors along Nmembers + r_W !< ratio between actual and critical strain energy density + end type tIsobrittleState + + type(tParameters), allocatable, dimension(:) :: param !< containers of constitutive parameters (len Ninstances) + type(tIsobrittleState), allocatable, dimension(:) :: & + deltaState, & + state contains @@ -44,13 +52,15 @@ module function isobrittle_init() result(mySources) phases => config_material%get('phase') allocate(param(phases%length)) + allocate(state(phases%length)) + allocate(deltaState(phases%length)) do ph = 1, phases%length if(mySources(ph)) then phase => phases%get(ph) sources => phase%get('damage') - associate(prm => param(ph)) + associate(prm => param(ph), dlt => deltaState(ph), stt => state(ph)) src => sources%get(1) prm%W_crit = src%get_asFloat('W_crit') @@ -69,6 +79,9 @@ module function isobrittle_init() result(mySources) damageState(ph)%atol = src%get_asFloat('atol_phi',defaultVal=1.0e-9_pReal) if(any(damageState(ph)%atol < 0.0_pReal)) extmsg = trim(extmsg)//' atol_phi' + stt%r_W => damageState(ph)%state(1,:) + dlt%r_W => damageState(ph)%deltaState(1,:) + end associate @@ -93,18 +106,18 @@ module subroutine isobrittle_deltaState(C, Fe, ph,me) C real(pReal), dimension(6) :: & - strain + epsilon real(pReal) :: & - strainenergy + r_W - strain = 0.5_pReal*math_sym33to6(matmul(transpose(Fe),Fe)-math_I3) + epsilon = 0.5_pReal*math_sym33to6(matmul(transpose(Fe),Fe)-math_I3) - associate(prm => param(ph)) - strainenergy = 2.0_pReal*dot_product(strain,matmul(C,strain))/prm%W_crit + associate(prm => param(ph), stt => state(ph), dlt => deltaState(ph)) + + r_W = 2.0_pReal*dot_product(epsilon,matmul(C,epsilon))/prm%W_crit + dlt%r_W(me) = merge(r_W - stt%r_W(me), 0.0_pReal, r_W > stt%r_W(me)) - damageState(ph)%deltaState(1,me) = merge(strainenergy - damageState(ph)%state(1,me), 0.0_pReal, & - strainenergy > damageState(ph)%state(1,me)) end associate end subroutine isobrittle_deltaState @@ -121,13 +134,15 @@ module subroutine isobrittle_results(phase,group) integer :: o - associate(prm => param(phase), stt => damageState(phase)%state) + associate(prm => param(phase), stt => damageState(phase)%state) ! point to state and output r_W (is scalar, not 1D vector) + outputsLoop: do o = 1,size(prm%output) select case(trim(prm%output(o))) case ('f_phi') call results_writeDataset(stt,group,trim(prm%output(o)),'driving force','J/m³') ! Wrong, this is dimensionless end select enddo outputsLoop + end associate end subroutine isobrittle_results From 6ad6158bfb590830321b4f6e8afc583948741d0d Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 18 Jul 2021 09:44:52 +0200 Subject: [PATCH 35/36] (en)try is the name used in the DADF5 file --- src/phase.f90 | 8 ++-- src/phase_damage.f90 | 64 +++++++++++++++---------------- src/phase_damage_anisobrittle.f90 | 16 ++++---- src/phase_damage_isobrittle.f90 | 6 +-- 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/phase.f90 b/src/phase.f90 index 49f1adc16..d90f41ccc 100644 --- a/src/phase.f90 +++ b/src/phase.f90 @@ -168,8 +168,8 @@ module phase real(pReal) :: dot_T end function thermal_dot_T - module function damage_phi(ph,me) result(phi) - integer, intent(in) :: ph,me + module function damage_phi(ph,en) result(phi) + integer, intent(in) :: ph,en real(pReal) :: phi end function damage_phi @@ -273,8 +273,8 @@ module phase end subroutine plastic_dependentState - module subroutine damage_anisobrittle_LiAndItsTangent(Ld, dLd_dTstar, S, ph,me) - integer, intent(in) :: ph, me + module subroutine damage_anisobrittle_LiAndItsTangent(Ld, dLd_dTstar, S, ph,en) + integer, intent(in) :: ph, en real(pReal), intent(in), dimension(3,3) :: & S real(pReal), intent(out), dimension(3,3) :: & diff --git a/src/phase_damage.f90 b/src/phase_damage.f90 index 4164854fe..12a5ddd41 100644 --- a/src/phase_damage.f90 +++ b/src/phase_damage.f90 @@ -39,8 +39,8 @@ submodule(phase) damage end function isobrittle_init - module subroutine isobrittle_deltaState(C, Fe, ph, me) - integer, intent(in) :: ph,me + module subroutine isobrittle_deltaState(C, Fe, ph, en) + integer, intent(in) :: ph,en real(pReal), intent(in), dimension(3,3) :: & Fe real(pReal), intent(in), dimension(6,6) :: & @@ -48,8 +48,8 @@ submodule(phase) damage end subroutine isobrittle_deltaState - module subroutine anisobrittle_dotState(S, ph, me) - integer, intent(in) :: ph,me + module subroutine anisobrittle_dotState(S, ph, en) + integer, intent(in) :: ph,en real(pReal), intent(in), dimension(3,3) :: & S end subroutine anisobrittle_dotState @@ -229,7 +229,7 @@ function integrateDamageState(Delta_t,co,ce) result(broken) integer :: & NiterationState, & !< number of iterations in state loop ph, & - me, & + en, & size_so real(pReal) :: & zeta @@ -240,7 +240,7 @@ function integrateDamageState(Delta_t,co,ce) result(broken) converged_ ph = material_phaseID(co,ce) - me = material_phaseEntry(co,ce) + en = material_phaseEntry(co,ce) if (damageState(ph)%sizeState == 0) then broken = .false. @@ -248,37 +248,37 @@ function integrateDamageState(Delta_t,co,ce) result(broken) endif converged_ = .true. - broken = phase_damage_collectDotState(ph,me) + broken = phase_damage_collectDotState(ph,en) if(broken) return size_so = damageState(ph)%sizeDotState - damageState(ph)%state(1:size_so,me) = damageState(ph)%state0 (1:size_so,me) & - + damageState(ph)%dotState(1:size_so,me) * Delta_t + damageState(ph)%state(1:size_so,en) = damageState(ph)%state0 (1:size_so,en) & + + damageState(ph)%dotState(1:size_so,en) * Delta_t source_dotState(1:size_so,2) = 0.0_pReal iteration: do NiterationState = 1, num%nState if(nIterationState > 1) source_dotState(1:size_so,2) = source_dotState(1:size_so,1) - source_dotState(1:size_so,1) = damageState(ph)%dotState(:,me) + source_dotState(1:size_so,1) = damageState(ph)%dotState(:,en) - broken = phase_damage_collectDotState(ph,me) + broken = phase_damage_collectDotState(ph,en) if(broken) exit iteration - zeta = damper(damageState(ph)%dotState(:,me),source_dotState(1:size_so,1),source_dotState(1:size_so,2)) - damageState(ph)%dotState(:,me) = damageState(ph)%dotState(:,me) * zeta & + zeta = damper(damageState(ph)%dotState(:,en),source_dotState(1:size_so,1),source_dotState(1:size_so,2)) + damageState(ph)%dotState(:,en) = damageState(ph)%dotState(:,en) * zeta & + source_dotState(1:size_so,1)* (1.0_pReal - zeta) - r(1:size_so) = damageState(ph)%state (1:size_so,me) & - - damageState(ph)%State0 (1:size_so,me) & - - damageState(ph)%dotState(1:size_so,me) * Delta_t - damageState(ph)%state(1:size_so,me) = damageState(ph)%state(1:size_so,me) - r(1:size_so) + r(1:size_so) = damageState(ph)%state (1:size_so,en) & + - damageState(ph)%State0 (1:size_so,en) & + - damageState(ph)%dotState(1:size_so,en) * Delta_t + damageState(ph)%state(1:size_so,en) = damageState(ph)%state(1:size_so,en) - r(1:size_so) converged_ = converged_ .and. converged(r(1:size_so), & - damageState(ph)%state(1:size_so,me), & + damageState(ph)%state(1:size_so,en), & damageState(ph)%atol(1:size_so)) if(converged_) then - broken = phase_damage_deltaState(mechanical_F_e(ph,me),ph,me) + broken = phase_damage_deltaState(mechanical_F_e(ph,en),ph,en) exit iteration endif @@ -340,11 +340,11 @@ end subroutine damage_results !-------------------------------------------------------------------------------------------------- !> @brief contains the constitutive equation for calculating the rate of change of microstructure !-------------------------------------------------------------------------------------------------- -function phase_damage_collectDotState(ph,me) result(broken) +function phase_damage_collectDotState(ph,en) result(broken) integer, intent(in) :: & ph, & - me !< counter in source loop + en !< counter in source loop logical :: broken @@ -355,11 +355,11 @@ function phase_damage_collectDotState(ph,me) result(broken) sourceType: select case (phase_damage(ph)) case (DAMAGE_ANISOBRITTLE_ID) sourceType - call anisobrittle_dotState(mechanical_S(ph,me), ph,me) ! correct stress? + call anisobrittle_dotState(mechanical_S(ph,en), ph,en) ! correct stress? end select sourceType - broken = broken .or. any(IEEE_is_NaN(damageState(ph)%dotState(:,me))) + broken = broken .or. any(IEEE_is_NaN(damageState(ph)%dotState(:,en))) endif @@ -398,11 +398,11 @@ end function phase_K_phi !> @brief for constitutive models having an instantaneous change of state !> will return false if delta state is not needed/supported by the constitutive model !-------------------------------------------------------------------------------------------------- -function phase_damage_deltaState(Fe, ph, me) result(broken) +function phase_damage_deltaState(Fe, ph, en) result(broken) integer, intent(in) :: & ph, & - me + en real(pReal), intent(in), dimension(3,3) :: & Fe !< elastic deformation gradient integer :: & @@ -419,13 +419,13 @@ function phase_damage_deltaState(Fe, ph, me) result(broken) sourceType: select case (phase_damage(ph)) case (DAMAGE_ISOBRITTLE_ID) sourceType - call isobrittle_deltaState(phase_homogenizedC(ph,me), Fe, ph,me) - broken = any(IEEE_is_NaN(damageState(ph)%deltaState(:,me))) + call isobrittle_deltaState(phase_homogenizedC(ph,en), Fe, ph,en) + broken = any(IEEE_is_NaN(damageState(ph)%deltaState(:,en))) if(.not. broken) then myOffset = damageState(ph)%offsetDeltaState mySize = damageState(ph)%sizeDeltaState - damageState(ph)%state(myOffset + 1: myOffset + mySize,me) = & - damageState(ph)%state(myOffset + 1: myOffset + mySize,me) + damageState(ph)%deltaState(1:mySize,me) + damageState(ph)%state(myOffset + 1: myOffset + mySize,en) = & + damageState(ph)%state(myOffset + 1: myOffset + mySize,en) + damageState(ph)%deltaState(1:mySize,en) endif end select sourceType @@ -476,13 +476,13 @@ module subroutine phase_set_phi(phi,co,ce) end subroutine phase_set_phi -module function damage_phi(ph,me) result(phi) +module function damage_phi(ph,en) result(phi) - integer, intent(in) :: ph, me + integer, intent(in) :: ph, en real(pReal) :: phi - phi = current(ph)%phi(me) + phi = current(ph)%phi(en) end function damage_phi diff --git a/src/phase_damage_anisobrittle.f90 b/src/phase_damage_anisobrittle.f90 index cc3628323..213d04f28 100644 --- a/src/phase_damage_anisobrittle.f90 +++ b/src/phase_damage_anisobrittle.f90 @@ -110,10 +110,10 @@ end function anisobrittle_init !-------------------------------------------------------------------------------------------------- !> @brief !-------------------------------------------------------------------------------------------------- -module subroutine anisobrittle_dotState(S, ph,me) +module subroutine anisobrittle_dotState(S, ph,en) integer, intent(in) :: & - ph,me + ph,en real(pReal), intent(in), dimension(3,3) :: & S @@ -124,15 +124,15 @@ module subroutine anisobrittle_dotState(S, ph,me) associate(prm => param(ph)) - damageState(ph)%dotState(1,me) = 0.0_pReal + damageState(ph)%dotState(1,en) = 0.0_pReal do i = 1, prm%sum_N_cl traction_d = math_tensordot(S,prm%cleavage_systems(1:3,1:3,1,i)) traction_t = math_tensordot(S,prm%cleavage_systems(1:3,1:3,2,i)) traction_n = math_tensordot(S,prm%cleavage_systems(1:3,1:3,3,i)) - traction_crit = prm%g_crit(i)*damage_phi(ph,me)**2.0_pReal + traction_crit = prm%g_crit(i)*damage_phi(ph,en)**2.0_pReal - damageState(ph)%dotState(1,me) = damageState(ph)%dotState(1,me) & + damageState(ph)%dotState(1,en) = damageState(ph)%dotState(1,en) & + prm%dot_o / prm%s_crit(i) & * ((max(0.0_pReal, abs(traction_d) - traction_crit)/traction_crit)**prm%q + & (max(0.0_pReal, abs(traction_t) - traction_crit)/traction_crit)**prm%q + & @@ -169,10 +169,10 @@ end subroutine anisobrittle_results !-------------------------------------------------------------------------------------------------- !> @brief contains the constitutive equation for calculating the velocity gradient !-------------------------------------------------------------------------------------------------- -module subroutine damage_anisobrittle_LiAndItsTangent(Ld, dLd_dTstar, S, ph,me) +module subroutine damage_anisobrittle_LiAndItsTangent(Ld, dLd_dTstar, S, ph,en) integer, intent(in) :: & - ph,me + ph,en real(pReal), intent(in), dimension(3,3) :: & S real(pReal), intent(out), dimension(3,3) :: & @@ -191,7 +191,7 @@ module subroutine damage_anisobrittle_LiAndItsTangent(Ld, dLd_dTstar, S, ph,me) dLd_dTstar = 0.0_pReal associate(prm => param(ph)) do i = 1,prm%sum_N_cl - traction_crit = prm%g_crit(i)*damage_phi(ph,me)**2.0_pReal + traction_crit = prm%g_crit(i)*damage_phi(ph,en)**2.0_pReal traction_d = math_tensordot(S,prm%cleavage_systems(1:3,1:3,1,i)) if (abs(traction_d) > traction_crit + tol_math_check) then diff --git a/src/phase_damage_isobrittle.f90 b/src/phase_damage_isobrittle.f90 index 1c3196a15..066cab47e 100644 --- a/src/phase_damage_isobrittle.f90 +++ b/src/phase_damage_isobrittle.f90 @@ -97,9 +97,9 @@ end function isobrittle_init !-------------------------------------------------------------------------------------------------- !> @brief calculates derived quantities from state !-------------------------------------------------------------------------------------------------- -module subroutine isobrittle_deltaState(C, Fe, ph,me) +module subroutine isobrittle_deltaState(C, Fe, ph,en) - integer, intent(in) :: ph,me + integer, intent(in) :: ph,en real(pReal), intent(in), dimension(3,3) :: & Fe real(pReal), intent(in), dimension(6,6) :: & @@ -116,7 +116,7 @@ module subroutine isobrittle_deltaState(C, Fe, ph,me) associate(prm => param(ph), stt => state(ph), dlt => deltaState(ph)) r_W = 2.0_pReal*dot_product(epsilon,matmul(C,epsilon))/prm%W_crit - dlt%r_W(me) = merge(r_W - stt%r_W(me), 0.0_pReal, r_W > stt%r_W(me)) + dlt%r_W(en) = merge(r_W - stt%r_W(en), 0.0_pReal, r_W > stt%r_W(en)) end associate From 53b7aab29dc3ba165a65e4038bd71f6eb7818faa Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 18 Jul 2021 09:48:49 +0200 Subject: [PATCH 36/36] use ph,en access pattern --- src/phase_damage.f90 | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/phase_damage.f90 b/src/phase_damage.f90 index 12a5ddd41..172f6f22a 100644 --- a/src/phase_damage.f90 +++ b/src/phase_damage.f90 @@ -140,8 +140,10 @@ module function phase_damage_constitutive(Delta_t,co,ip,el) result(converged_) integer :: & ph, en + ph = material_phaseID(co,(el-1)*discretization_nIPs + ip) + en = material_phaseEntry(co,(el-1)*discretization_nIPs + ip) - converged_ = .not. integrateDamageState(Delta_t,co,(el-1)*discretization_nIPs + ip) + converged_ = .not. integrateDamageState(Delta_t,ph,en) end function phase_damage_constitutive @@ -218,18 +220,16 @@ end function phase_f_phi !> @brief integrate stress, state with adaptive 1st order explicit Euler method !> using Fixed Point Iteration to adapt the stepsize !-------------------------------------------------------------------------------------------------- -function integrateDamageState(Delta_t,co,ce) result(broken) +function integrateDamageState(Delta_t,ph,en) result(broken) real(pReal), intent(in) :: Delta_t integer, intent(in) :: & - ce, & - co + ph, & + en logical :: broken integer :: & NiterationState, & !< number of iterations in state loop - ph, & - en, & size_so real(pReal) :: & zeta @@ -239,8 +239,6 @@ function integrateDamageState(Delta_t,co,ce) result(broken) logical :: & converged_ - ph = material_phaseID(co,ce) - en = material_phaseEntry(co,ce) if (damageState(ph)%sizeState == 0) then broken = .false.