DAMASK_EICMD/DAMASK_env.zsh

75 lines
2.5 KiB
Bash
Raw Normal View History

2016-09-16 06:53:59 +05:30
# sets up an environment for DAMASK on bash
# usage: source DAMASK_env.sh
2016-09-16 06:53:59 +05:30
if [ "$OSTYPE" = "linux-gnu" ] || [ "$OSTYPE" = 'linux' ]; then
DAMASK_ROOT=$(readlink -f "`dirname ${(%):-%N}`")
else
print 'Not done yet'
fi
2015-05-08 15:15:38 +05:30
2016-09-16 06:53:59 +05:30
[[ -f $HOME/.damask/damask.conf ]] && source $HOME/.damask/damask.conf || source /etc/damask.conf
2015-05-08 15:15:38 +05:30
2016-09-16 06:53:59 +05:30
# if DAMASK_BIN is present and not in $PATH, add it
#if [[ [[ "x$DAMASK_BIN" != "x" ]] && ! `echo ":$PATH:" | grep $DAMASK_BIN:` ]]; then
2015-05-08 15:15:38 +05:30
export PATH=$DAMASK_BIN:$PATH
2016-09-16 06:53:59 +05:30
#fi
2015-05-08 15:15:38 +05:30
SOLVER=`which DAMASK_spectral 2>/dev/null`
2016-09-16 06:53:59 +05:30
if [ "x$SOLVER" = "x" ]; then
export SOLVER='Not found!'
fi
2015-05-08 15:15:38 +05:30
PROCESSING=`which postResults 2>/dev/null`
2016-09-16 06:53:59 +05:30
if [ "x$PROCESSING" = "x" ]; then
export PROCESSING='Not found!'
fi
2015-05-08 15:15:38 +05:30
# according to http://software.intel.com/en-us/forums/topic/501500
# this seems to make sense for the stack size
2016-09-16 06:53:59 +05:30
#FREE=`which free 2>/dev/null`
#if [ "x$FREE" != "x" ]; then
# freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'`
# heap=`expr $freeMem / 2`
# stack=`expr $freeMem / 2`
#
# # http://superuser.com/questions/220059/what-parameters-has-ulimit
# ulimit -s $stack 2>/dev/null # maximum stack size (kB)
# ulimit -d $heap 2>/dev/null # maximum heap size (kB)
#fi
#ulimit -c 2000 2>/dev/null # core file size (512-byte blocks)
#ulimit -v unlimited 2>/dev/null # maximum virtual memory size
2015-05-08 15:15:38 +05:30
ulimit -m unlimited 2>/dev/null # maximum physical memory size
# disable output in case of scp
if [ ! -z "$PS1" ]; then
echo
2016-09-16 06:53:59 +05:30
echo Düsseldorf Advanced Materials Simulation Kit - DAMASK
echo Max-Planck-Institut für Eisenforschung, Düsseldorf
echo http://damask.mpie.de
2015-05-08 15:15:38 +05:30
echo
2016-09-16 06:53:59 +05:30
echo Using environment with ...
2015-05-08 15:15:38 +05:30
echo "DAMASK $DAMASK_ROOT"
2016-09-16 06:53:59 +05:30
[[ "x$SOLVER" != "x" ]] && echo "Spectral Solver $SOLVER"
[[ "x$PROCESSING" != "x" ]] && echo "Post Processing $PROCESSING"
2015-05-08 15:15:38 +05:30
echo "Multithreading DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS"
2016-03-11 17:18:35 +05:30
if [ "x$PETSC_DIR" != "x" ]; then
echo "PETSc location $PETSC_DIR"
2016-09-16 06:53:59 +05:30
[[ `readlink -f $PETSC_DIR` == $PETSC_DIR ]] || echo " ~~> "`readlink -f $PETSC_DIR`
2016-03-11 17:18:35 +05:30
fi
2016-09-16 06:53:59 +05:30
[[ "x$PETSC_ARCH" != "x" ]] && echo "PETSc architecture $PETSC_ARCH"
2015-05-08 15:15:38 +05:30
echo "MSC.Marc/Mentat $MSC_ROOT"
echo
2016-09-16 06:53:59 +05:30
echo -n "heap size/MiB "; echo "`ulimit -d`/1024" | bc
echo -n "stack size/MiB "; echo "`ulimit -s`/1024" | bc
2015-05-08 15:15:38 +05:30
fi
export DAMASK_NUM_THREADS
export PYTHONPATH=$DAMASK_ROOT/lib:$PYTHONPATH
2016-09-16 06:53:59 +05:30
for var in BASE STAT SOLVER PROCESSING FREE; do
2015-05-08 15:15:38 +05:30
unset "${var}"
done
2016-09-16 06:53:59 +05:30
for var in DAMASK IMKL ACML LAPACK MSC FFTW HDF5; do
2015-05-08 15:15:38 +05:30
unset "${var}_ROOT"
done
2016-09-16 06:53:59 +05:30