adopted csh script
This commit is contained in:
parent
46cf0394ec
commit
cd36e752e8
|
@ -1,26 +1,67 @@
|
|||
# sets up an environment for DAMASK on tcsh
|
||||
# usage: source DAMASK_env.csh
|
||||
set MAGIG=($_)
|
||||
set FILENAME=`readlink -f $called[2]`
|
||||
set LOCATION = `dirname $FILENAME`
|
||||
setenv DAMASK_ROOT ${LOCATION}
|
||||
setenv DAMASK_NUM_THREADS 2
|
||||
|
||||
set CALLED=($_)
|
||||
set DIRNAME=`dirname $CALLED[2]`
|
||||
set DAMASK_ROOT=`python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" $DIRNAME`
|
||||
|
||||
source $DAMASK_ROOT/CONFIG
|
||||
|
||||
# if DAMASK_BIN is present and not in $PATH, add it
|
||||
if ( $?DAMASK_BIN) then
|
||||
set MATCH=`echo :${PATH}: | grep ${DAMASK_BIN}:`
|
||||
if ( "x$MATCH" == "x" ) then
|
||||
set PATH=${DAMASK_BIN}:${PATH}
|
||||
endif
|
||||
endif
|
||||
|
||||
set SOLVER=`which DAMASK_spectral`
|
||||
set PROCESSING=`which postResults`
|
||||
if ( "x$DAMASK_NUM_THREADS" == "x" ) then
|
||||
set DAMASK_NUM_THREADS=1
|
||||
endif
|
||||
|
||||
# according to http://software.intel.com/en-us/forums/topic/501500
|
||||
# this seems to make sense for the stack size
|
||||
set FREE=`which free`
|
||||
set FREE=''
|
||||
if ( "x$FREE" != "x" ) then
|
||||
set freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'`
|
||||
set heap=`expr $freeMem / 2`
|
||||
set stack=`expr $freeMem / $DAMASK_NUM_THREADS / 2`
|
||||
# http://superuser.com/questions/220059/what-parameters-has-ulimit
|
||||
limit stacksize $stack # maximum stack size (kB)
|
||||
limit datasize $heap # maximum heap size (kB)
|
||||
endif
|
||||
limit coredumpsize 2000 # core file size (512-byte blocks)
|
||||
limit vmemoryuse unlimited # maximum virtual memory size
|
||||
limit memoryuse unlimited # maximum physical memory size
|
||||
|
||||
# disable output in case of scp
|
||||
if($?prompt) then
|
||||
echo
|
||||
echo ''
|
||||
echo Düsseldorf Advanced Materials Simulation Kit - DAMASK
|
||||
echo Max-Planck-Institut für Eisenforschung, Düsseldorf
|
||||
echo http://damask.mpie.de
|
||||
echo https://damask.mpie.de
|
||||
echo
|
||||
echo Preparing environment ...
|
||||
echo "DAMASK_ROOT=$DAMASK_ROOT"
|
||||
echo "DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS"
|
||||
echo Using environment with ...
|
||||
echo "DAMASK $DAMASK_ROOT"
|
||||
echo "Spectral Solver $SOLVER"
|
||||
echo "Post Processing $PROCESSING"
|
||||
echo "Multithreading DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS"
|
||||
if ( $?PETSC_DIR) then
|
||||
echo "PETSc location $PETSC_DIR"
|
||||
endif
|
||||
if ( $?PETSC_ARCH) then
|
||||
echo "PETSc architecture $PETSC_ARCH"
|
||||
endif
|
||||
if ( $?MSC_ROOT) then
|
||||
echo "MSC.Marc/Mentat $MSC_ROOT"
|
||||
endif
|
||||
echo
|
||||
echo `limit stacksize`
|
||||
echo `limit datasize`
|
||||
endif
|
||||
ulimit -s unlimited
|
||||
ulimit -c 0
|
||||
ulimit -v unlimited
|
||||
ulimit -m unlimited
|
||||
setenv DAMASK_BIN ${DAMASK_ROOT}/bin
|
||||
setenv PATH ${PATH}:${DAMASK_BIN}
|
||||
setenv PYTHONPATH ${PYTHONPATH}:${DAMASK_ROOT}/lib
|
||||
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}
|
||||
|
||||
setenv DAMASK_NUM_THREADS $DAMASK_NUM_THREADS
|
||||
setenv PYTHONPATH $DAMASK_ROOT/lib:$PYTHONPATH
|
||||
|
|
|
@ -54,7 +54,7 @@ if [ ! -z "$PS1" ]; then
|
|||
echo
|
||||
echo Düsseldorf Advanced Materials Simulation Kit - DAMASK
|
||||
echo Max-Planck-Institut für Eisenforschung, Düsseldorf
|
||||
echo http://damask.mpie.de
|
||||
echo https://damask.mpie.de
|
||||
echo
|
||||
echo Using environment with ...
|
||||
echo "DAMASK $DAMASK_ROOT"
|
||||
|
|
|
@ -53,7 +53,7 @@ if [ ! -z "$PS1" ]; then
|
|||
echo
|
||||
echo Düsseldorf Advanced Materials Simulation Kit - DAMASK
|
||||
echo Max-Planck-Institut für Eisenforschung, Düsseldorf
|
||||
echo http://damask.mpie.de
|
||||
echo https://damask.mpie.de
|
||||
echo
|
||||
echo Using environment with ...
|
||||
echo "DAMASK $DAMASK_ROOT"
|
||||
|
|
Loading…
Reference in New Issue