clean root directory, symbolic links for transition compatibility
This commit is contained in:
parent
3633a036cd
commit
c813e98d22
|
@ -1,65 +0,0 @@
|
||||||
# sets up an environment for DAMASK on tcsh
|
|
||||||
# usage: source DAMASK_env.csh
|
|
||||||
|
|
||||||
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
|
|
||||||
if ( `which free` != "free: Command not found." ) 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 datasize $heap # maximum heap size (kB)
|
|
||||||
limit stacksize $stack # maximum stack size (kB)
|
|
||||||
endif
|
|
||||||
if ( `limit | grep memoryuse` != "" ) then
|
|
||||||
limit memoryuse unlimited # maximum physical memory size
|
|
||||||
endif
|
|
||||||
if ( `limit | grep vmemoryuse` != "" ) then
|
|
||||||
limit vmemoryuse unlimited # maximum virtual memory size
|
|
||||||
endif
|
|
||||||
|
|
||||||
# disable output in case of scp
|
|
||||||
if ( $?prompt ) then
|
|
||||||
echo ''
|
|
||||||
echo Düsseldorf Advanced Materials Simulation Kit --- DAMASK
|
|
||||||
echo Max-Planck-Institut für Eisenforschung GmbH, Düsseldorf
|
|
||||||
echo https://damask.mpie.de
|
|
||||||
echo
|
|
||||||
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 ( $?MSC_ROOT) then
|
|
||||||
echo "MSC.Marc/Mentat $MSC_ROOT"
|
|
||||||
endif
|
|
||||||
echo
|
|
||||||
echo `limit datasize`
|
|
||||||
echo `limit stacksize`
|
|
||||||
endif
|
|
||||||
|
|
||||||
setenv DAMASK_NUM_THREADS $DAMASK_NUM_THREADS
|
|
||||||
setenv PYTHONPATH $DAMASK_ROOT/lib:$PYTHONPATH
|
|
|
@ -0,0 +1 @@
|
||||||
|
env/DAMASK_env.csh
|
102
DAMASK_env.sh
102
DAMASK_env.sh
|
@ -1,102 +0,0 @@
|
||||||
# sets up an environment for DAMASK on bash
|
|
||||||
# usage: source DAMASK_env.sh
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == 'linux' ]; then
|
|
||||||
DAMASK_ROOT=$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$(dirname $BASH_SOURCE)")
|
|
||||||
else
|
|
||||||
[[ "${BASH_SOURCE::1}" == "/" ]] && BASE="" || BASE="$(pwd)/"
|
|
||||||
STAT=$(stat "$(dirname $BASE$BASH_SOURCE)")
|
|
||||||
DAMASK_ROOT=${STAT##* }
|
|
||||||
fi
|
|
||||||
|
|
||||||
# shorthand command to change to DAMASK_ROOT directory
|
|
||||||
eval "function damask() { cd $DAMASK_ROOT; }"
|
|
||||||
|
|
||||||
# defining set() allows to source the same file for tcsh and bash, with and without space around =
|
|
||||||
set() {
|
|
||||||
export $1$2$3
|
|
||||||
}
|
|
||||||
source $DAMASK_ROOT/CONFIG
|
|
||||||
unset -f set
|
|
||||||
|
|
||||||
# add DAMASK_BIN if present but not yet in $PATH
|
|
||||||
if [[ "x$DAMASK_BIN" != "x" && ! $(echo ":$PATH:" | grep $DAMASK_BIN:) ]]; then
|
|
||||||
export PATH=$DAMASK_BIN:$PATH
|
|
||||||
fi
|
|
||||||
|
|
||||||
SOLVER=$(which DAMASK_spectral || true 2>/dev/null)
|
|
||||||
if [ "x$SOLVER" == "x" ]; then
|
|
||||||
SOLVER='Not found!'
|
|
||||||
fi
|
|
||||||
PROCESSING=$(which postResults || true 2>/dev/null)
|
|
||||||
if [ "x$PROCESSING" == "x" ]; then
|
|
||||||
PROCESSING='Not found!'
|
|
||||||
fi
|
|
||||||
if [ "x$DAMASK_NUM_THREADS" == "x" ]; then
|
|
||||||
DAMASK_NUM_THREADS=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# according to http://software.intel.com/en-us/forums/topic/501500
|
|
||||||
# this seems to make sense for the stack size
|
|
||||||
FREE=$(type -p free 2>/dev/null)
|
|
||||||
if [ "x$FREE" != "x" ]; then
|
|
||||||
freeMem=$(free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}')
|
|
||||||
# http://superuser.com/questions/220059/what-parameters-has-ulimit
|
|
||||||
ulimit -d unlimited 2>/dev/null \
|
|
||||||
|| ulimit -d $(expr $freeMem / 2) 2>/dev/null # maximum heap size (kB)
|
|
||||||
ulimit -s unlimited 2>/dev/null \
|
|
||||||
|| ulimit -s $(expr $freeMem / $DAMASK_NUM_THREADS / 2) 2>/dev/null # maximum stack size (kB)
|
|
||||||
fi
|
|
||||||
ulimit -v unlimited 2>/dev/null # maximum virtual memory size
|
|
||||||
ulimit -m unlimited 2>/dev/null # maximum physical memory size
|
|
||||||
|
|
||||||
# disable output in case of scp
|
|
||||||
if [ ! -z "$PS1" ]; then
|
|
||||||
echo
|
|
||||||
echo Düsseldorf Advanced Materials Simulation Kit --- DAMASK
|
|
||||||
echo Max-Planck-Institut für Eisenforschung GmbH, Düsseldorf
|
|
||||||
echo https://damask.mpie.de
|
|
||||||
echo
|
|
||||||
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 [ "x$PETSC_DIR" != "x" ]; then
|
|
||||||
echo "PETSc location $PETSC_DIR"
|
|
||||||
[[ $(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") == $PETSC_DIR ]] \
|
|
||||||
|| echo " ~~> "$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR")
|
|
||||||
fi
|
|
||||||
echo "MSC.Marc/Mentat $MSC_ROOT"
|
|
||||||
echo
|
|
||||||
echo -n "heap size "
|
|
||||||
[[ "$(ulimit -d)" == "unlimited" ]] \
|
|
||||||
&& echo "unlimited" \
|
|
||||||
|| echo $(python -c \
|
|
||||||
"import math; \
|
|
||||||
size=$(( 1024*$(ulimit -d) )); \
|
|
||||||
print('{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \
|
|
||||||
['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0]))")
|
|
||||||
echo -n "stack size "
|
|
||||||
[[ "$(ulimit -s)" == "unlimited" ]] \
|
|
||||||
&& echo "unlimited" \
|
|
||||||
|| echo $(python -c \
|
|
||||||
"import math; \
|
|
||||||
size=$(( 1024*$(ulimit -s) )); \
|
|
||||||
print('{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \
|
|
||||||
['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0]))")
|
|
||||||
fi
|
|
||||||
|
|
||||||
export DAMASK_NUM_THREADS
|
|
||||||
export PYTHONPATH=$DAMASK_ROOT/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
for var in BASE STAT SOLVER PROCESSING FREE DAMASK_BIN; do
|
|
||||||
unset "${var}"
|
|
||||||
done
|
|
||||||
for var in DAMASK MSC; do
|
|
||||||
unset "${var}_ROOT"
|
|
||||||
done
|
|
||||||
for var in ABAQUS MARC; do
|
|
||||||
unset "${var}_VERSION"
|
|
||||||
done
|
|
|
@ -0,0 +1 @@
|
||||||
|
env/DAMASK_env.sh
|
|
@ -1,90 +0,0 @@
|
||||||
# sets up an environment for DAMASK on zsh
|
|
||||||
# usage: source DAMASK_env.zsh
|
|
||||||
|
|
||||||
DAMASK_ROOT=${0:a:h}
|
|
||||||
|
|
||||||
# shorthand command to change to DAMASK_ROOT directory
|
|
||||||
eval "function damask() { cd $DAMASK_ROOT; }"
|
|
||||||
|
|
||||||
# defining set() allows to source the same file for tcsh and zsh, with and without space around =
|
|
||||||
set() {
|
|
||||||
export $1$2$3
|
|
||||||
}
|
|
||||||
source $DAMASK_ROOT/CONFIG
|
|
||||||
unset -f set
|
|
||||||
|
|
||||||
# add DAMASK_BIN if present but not yet in $PATH
|
|
||||||
MATCH=`echo ":$PATH:" | grep $DAMASK_BIN:`
|
|
||||||
if [[ ( "x$DAMASK_BIN" != "x" ) && ( "x$MATCH" = "x" ) ]]; then
|
|
||||||
export PATH=$DAMASK_BIN:$PATH
|
|
||||||
fi
|
|
||||||
|
|
||||||
SOLVER=`which DAMASK_spectral || True 2>/dev/null`
|
|
||||||
PROCESSING=`which postResults || True 2>/dev/null`
|
|
||||||
if [ "x$DAMASK_NUM_THREADS" = "x" ]; then
|
|
||||||
DAMASK_NUM_THREADS=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# according to http://software.intel.com/en-us/forums/topic/501500
|
|
||||||
# this seems to make sense for the stack size
|
|
||||||
if [ "`which free 2>/dev/null`" != "free not found" ]; then
|
|
||||||
freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'`
|
|
||||||
|
|
||||||
# http://superuser.com/questions/220059/what-parameters-has-ulimit
|
|
||||||
#ulimit -d `expr $freeMem / 2` 2>/dev/null # maximum heap size (kB)
|
|
||||||
ulimit -s `expr $freeMem / $DAMASK_NUM_THREADS / 2` 2>/dev/null # maximum stack size (kB)
|
|
||||||
fi
|
|
||||||
ulimit -v unlimited 2>/dev/null # maximum virtual memory size
|
|
||||||
ulimit -m unlimited 2>/dev/null # maximum physical memory size
|
|
||||||
|
|
||||||
# disable output in case of scp
|
|
||||||
if [ ! -z "$PS1" ]; then
|
|
||||||
echo
|
|
||||||
echo Düsseldorf Advanced Materials Simulation Kit --- DAMASK
|
|
||||||
echo Max-Planck-Institut für Eisenforschung GmbH, Düsseldorf
|
|
||||||
echo https://damask.mpie.de
|
|
||||||
echo
|
|
||||||
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 [ "x$PETSC_DIR" != "x" ]; then
|
|
||||||
echo "PETSc location $PETSC_DIR"
|
|
||||||
[[ $(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") == $PETSC_DIR ]] \
|
|
||||||
|| echo " ~~> "$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR")
|
|
||||||
fi
|
|
||||||
[[ "x$PETSC_ARCH" == "x" ]] \
|
|
||||||
|| echo "PETSc architecture $PETSC_ARCH"
|
|
||||||
echo "MSC.Marc/Mentat $MSC_ROOT"
|
|
||||||
echo
|
|
||||||
echo -n "heap size "
|
|
||||||
[[ "$(ulimit -d)" == "unlimited" ]] \
|
|
||||||
&& echo "unlimited" \
|
|
||||||
|| echo $(python -c \
|
|
||||||
"import math; \
|
|
||||||
size=$(( 1024*$(ulimit -d) )); \
|
|
||||||
print('{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \
|
|
||||||
['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0]))")
|
|
||||||
echo -n "stack size "
|
|
||||||
[[ "$(ulimit -s)" == "unlimited" ]] \
|
|
||||||
&& echo "unlimited" \
|
|
||||||
|| echo $(python -c \
|
|
||||||
"import math; \
|
|
||||||
size=$(( 1024*$(ulimit -s) )); \
|
|
||||||
print('{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \
|
|
||||||
['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0]))")
|
|
||||||
fi
|
|
||||||
|
|
||||||
export DAMASK_NUM_THREADS
|
|
||||||
export PYTHONPATH=$DAMASK_ROOT/lib:$PYTHONPATH
|
|
||||||
|
|
||||||
for var in BASE STAT SOLVER PROCESSING FREE DAMASK_BIN MATCH; do
|
|
||||||
unset "${var}"
|
|
||||||
done
|
|
||||||
for var in DAMASK MSC; do
|
|
||||||
unset "${var}_ROOT"
|
|
||||||
done
|
|
||||||
for var in ABAQUS MARC; do
|
|
||||||
unset "${var}_VERSION"
|
|
||||||
done
|
|
|
@ -0,0 +1 @@
|
||||||
|
env/DAMASK_env.zsh
|
|
@ -0,0 +1,65 @@
|
||||||
|
# sets up an environment for DAMASK on tcsh
|
||||||
|
# usage: source DAMASK_env.csh
|
||||||
|
|
||||||
|
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
|
||||||
|
if ( `which free` != "free: Command not found." ) 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 datasize $heap # maximum heap size (kB)
|
||||||
|
limit stacksize $stack # maximum stack size (kB)
|
||||||
|
endif
|
||||||
|
if ( `limit | grep memoryuse` != "" ) then
|
||||||
|
limit memoryuse unlimited # maximum physical memory size
|
||||||
|
endif
|
||||||
|
if ( `limit | grep vmemoryuse` != "" ) then
|
||||||
|
limit vmemoryuse unlimited # maximum virtual memory size
|
||||||
|
endif
|
||||||
|
|
||||||
|
# disable output in case of scp
|
||||||
|
if ( $?prompt ) then
|
||||||
|
echo ''
|
||||||
|
echo Düsseldorf Advanced Materials Simulation Kit --- DAMASK
|
||||||
|
echo Max-Planck-Institut für Eisenforschung GmbH, Düsseldorf
|
||||||
|
echo https://damask.mpie.de
|
||||||
|
echo
|
||||||
|
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 ( $?MSC_ROOT) then
|
||||||
|
echo "MSC.Marc/Mentat $MSC_ROOT"
|
||||||
|
endif
|
||||||
|
echo
|
||||||
|
echo `limit datasize`
|
||||||
|
echo `limit stacksize`
|
||||||
|
endif
|
||||||
|
|
||||||
|
setenv DAMASK_NUM_THREADS $DAMASK_NUM_THREADS
|
||||||
|
setenv PYTHONPATH $DAMASK_ROOT/lib:$PYTHONPATH
|
|
@ -0,0 +1,102 @@
|
||||||
|
# sets up an environment for DAMASK on bash
|
||||||
|
# usage: source DAMASK_env.sh
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == 'linux' ]; then
|
||||||
|
DAMASK_ROOT=$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$(dirname $BASH_SOURCE)")
|
||||||
|
else
|
||||||
|
[[ "${BASH_SOURCE::1}" == "/" ]] && BASE="" || BASE="$(pwd)/"
|
||||||
|
STAT=$(stat "$(dirname $BASE$BASH_SOURCE)")
|
||||||
|
DAMASK_ROOT=${STAT##* }
|
||||||
|
fi
|
||||||
|
|
||||||
|
# shorthand command to change to DAMASK_ROOT directory
|
||||||
|
eval "function damask() { cd $DAMASK_ROOT; }"
|
||||||
|
|
||||||
|
# defining set() allows to source the same file for tcsh and bash, with and without space around =
|
||||||
|
set() {
|
||||||
|
export $1$2$3
|
||||||
|
}
|
||||||
|
source $DAMASK_ROOT/CONFIG
|
||||||
|
unset -f set
|
||||||
|
|
||||||
|
# add DAMASK_BIN if present but not yet in $PATH
|
||||||
|
if [[ "x$DAMASK_BIN" != "x" && ! $(echo ":$PATH:" | grep $DAMASK_BIN:) ]]; then
|
||||||
|
export PATH=$DAMASK_BIN:$PATH
|
||||||
|
fi
|
||||||
|
|
||||||
|
SOLVER=$(which DAMASK_spectral || true 2>/dev/null)
|
||||||
|
if [ "x$SOLVER" == "x" ]; then
|
||||||
|
SOLVER='Not found!'
|
||||||
|
fi
|
||||||
|
PROCESSING=$(which postResults || true 2>/dev/null)
|
||||||
|
if [ "x$PROCESSING" == "x" ]; then
|
||||||
|
PROCESSING='Not found!'
|
||||||
|
fi
|
||||||
|
if [ "x$DAMASK_NUM_THREADS" == "x" ]; then
|
||||||
|
DAMASK_NUM_THREADS=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# according to http://software.intel.com/en-us/forums/topic/501500
|
||||||
|
# this seems to make sense for the stack size
|
||||||
|
FREE=$(type -p free 2>/dev/null)
|
||||||
|
if [ "x$FREE" != "x" ]; then
|
||||||
|
freeMem=$(free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}')
|
||||||
|
# http://superuser.com/questions/220059/what-parameters-has-ulimit
|
||||||
|
ulimit -d unlimited 2>/dev/null \
|
||||||
|
|| ulimit -d $(expr $freeMem / 2) 2>/dev/null # maximum heap size (kB)
|
||||||
|
ulimit -s unlimited 2>/dev/null \
|
||||||
|
|| ulimit -s $(expr $freeMem / $DAMASK_NUM_THREADS / 2) 2>/dev/null # maximum stack size (kB)
|
||||||
|
fi
|
||||||
|
ulimit -v unlimited 2>/dev/null # maximum virtual memory size
|
||||||
|
ulimit -m unlimited 2>/dev/null # maximum physical memory size
|
||||||
|
|
||||||
|
# disable output in case of scp
|
||||||
|
if [ ! -z "$PS1" ]; then
|
||||||
|
echo
|
||||||
|
echo Düsseldorf Advanced Materials Simulation Kit --- DAMASK
|
||||||
|
echo Max-Planck-Institut für Eisenforschung GmbH, Düsseldorf
|
||||||
|
echo https://damask.mpie.de
|
||||||
|
echo
|
||||||
|
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 [ "x$PETSC_DIR" != "x" ]; then
|
||||||
|
echo "PETSc location $PETSC_DIR"
|
||||||
|
[[ $(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") == $PETSC_DIR ]] \
|
||||||
|
|| echo " ~~> "$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR")
|
||||||
|
fi
|
||||||
|
echo "MSC.Marc/Mentat $MSC_ROOT"
|
||||||
|
echo
|
||||||
|
echo -n "heap size "
|
||||||
|
[[ "$(ulimit -d)" == "unlimited" ]] \
|
||||||
|
&& echo "unlimited" \
|
||||||
|
|| echo $(python -c \
|
||||||
|
"import math; \
|
||||||
|
size=$(( 1024*$(ulimit -d) )); \
|
||||||
|
print('{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \
|
||||||
|
['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0]))")
|
||||||
|
echo -n "stack size "
|
||||||
|
[[ "$(ulimit -s)" == "unlimited" ]] \
|
||||||
|
&& echo "unlimited" \
|
||||||
|
|| echo $(python -c \
|
||||||
|
"import math; \
|
||||||
|
size=$(( 1024*$(ulimit -s) )); \
|
||||||
|
print('{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \
|
||||||
|
['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0]))")
|
||||||
|
fi
|
||||||
|
|
||||||
|
export DAMASK_NUM_THREADS
|
||||||
|
export PYTHONPATH=$DAMASK_ROOT/lib:$PYTHONPATH
|
||||||
|
|
||||||
|
for var in BASE STAT SOLVER PROCESSING FREE DAMASK_BIN; do
|
||||||
|
unset "${var}"
|
||||||
|
done
|
||||||
|
for var in DAMASK MSC; do
|
||||||
|
unset "${var}_ROOT"
|
||||||
|
done
|
||||||
|
for var in ABAQUS MARC; do
|
||||||
|
unset "${var}_VERSION"
|
||||||
|
done
|
|
@ -0,0 +1,90 @@
|
||||||
|
# sets up an environment for DAMASK on zsh
|
||||||
|
# usage: source DAMASK_env.zsh
|
||||||
|
|
||||||
|
DAMASK_ROOT=${0:a:h}
|
||||||
|
|
||||||
|
# shorthand command to change to DAMASK_ROOT directory
|
||||||
|
eval "function damask() { cd $DAMASK_ROOT; }"
|
||||||
|
|
||||||
|
# defining set() allows to source the same file for tcsh and zsh, with and without space around =
|
||||||
|
set() {
|
||||||
|
export $1$2$3
|
||||||
|
}
|
||||||
|
source $DAMASK_ROOT/CONFIG
|
||||||
|
unset -f set
|
||||||
|
|
||||||
|
# add DAMASK_BIN if present but not yet in $PATH
|
||||||
|
MATCH=`echo ":$PATH:" | grep $DAMASK_BIN:`
|
||||||
|
if [[ ( "x$DAMASK_BIN" != "x" ) && ( "x$MATCH" = "x" ) ]]; then
|
||||||
|
export PATH=$DAMASK_BIN:$PATH
|
||||||
|
fi
|
||||||
|
|
||||||
|
SOLVER=`which DAMASK_spectral || True 2>/dev/null`
|
||||||
|
PROCESSING=`which postResults || True 2>/dev/null`
|
||||||
|
if [ "x$DAMASK_NUM_THREADS" = "x" ]; then
|
||||||
|
DAMASK_NUM_THREADS=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# according to http://software.intel.com/en-us/forums/topic/501500
|
||||||
|
# this seems to make sense for the stack size
|
||||||
|
if [ "`which free 2>/dev/null`" != "free not found" ]; then
|
||||||
|
freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'`
|
||||||
|
|
||||||
|
# http://superuser.com/questions/220059/what-parameters-has-ulimit
|
||||||
|
#ulimit -d `expr $freeMem / 2` 2>/dev/null # maximum heap size (kB)
|
||||||
|
ulimit -s `expr $freeMem / $DAMASK_NUM_THREADS / 2` 2>/dev/null # maximum stack size (kB)
|
||||||
|
fi
|
||||||
|
ulimit -v unlimited 2>/dev/null # maximum virtual memory size
|
||||||
|
ulimit -m unlimited 2>/dev/null # maximum physical memory size
|
||||||
|
|
||||||
|
# disable output in case of scp
|
||||||
|
if [ ! -z "$PS1" ]; then
|
||||||
|
echo
|
||||||
|
echo Düsseldorf Advanced Materials Simulation Kit --- DAMASK
|
||||||
|
echo Max-Planck-Institut für Eisenforschung GmbH, Düsseldorf
|
||||||
|
echo https://damask.mpie.de
|
||||||
|
echo
|
||||||
|
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 [ "x$PETSC_DIR" != "x" ]; then
|
||||||
|
echo "PETSc location $PETSC_DIR"
|
||||||
|
[[ $(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") == $PETSC_DIR ]] \
|
||||||
|
|| echo " ~~> "$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR")
|
||||||
|
fi
|
||||||
|
[[ "x$PETSC_ARCH" == "x" ]] \
|
||||||
|
|| echo "PETSc architecture $PETSC_ARCH"
|
||||||
|
echo "MSC.Marc/Mentat $MSC_ROOT"
|
||||||
|
echo
|
||||||
|
echo -n "heap size "
|
||||||
|
[[ "$(ulimit -d)" == "unlimited" ]] \
|
||||||
|
&& echo "unlimited" \
|
||||||
|
|| echo $(python -c \
|
||||||
|
"import math; \
|
||||||
|
size=$(( 1024*$(ulimit -d) )); \
|
||||||
|
print('{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \
|
||||||
|
['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0]))")
|
||||||
|
echo -n "stack size "
|
||||||
|
[[ "$(ulimit -s)" == "unlimited" ]] \
|
||||||
|
&& echo "unlimited" \
|
||||||
|
|| echo $(python -c \
|
||||||
|
"import math; \
|
||||||
|
size=$(( 1024*$(ulimit -s) )); \
|
||||||
|
print('{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \
|
||||||
|
['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0]))")
|
||||||
|
fi
|
||||||
|
|
||||||
|
export DAMASK_NUM_THREADS
|
||||||
|
export PYTHONPATH=$DAMASK_ROOT/lib:$PYTHONPATH
|
||||||
|
|
||||||
|
for var in BASE STAT SOLVER PROCESSING FREE DAMASK_BIN MATCH; do
|
||||||
|
unset "${var}"
|
||||||
|
done
|
||||||
|
for var in DAMASK MSC; do
|
||||||
|
unset "${var}_ROOT"
|
||||||
|
done
|
||||||
|
for var in ABAQUS MARC; do
|
||||||
|
unset "${var}_VERSION"
|
||||||
|
done
|
Loading…
Reference in New Issue