2017-05-15 21:10:49 +05:30
|
|
|
# sets up an environment for DAMASK on tcsh
|
|
|
|
# usage: source DAMASK_env.csh
|
|
|
|
|
|
|
|
set CALLED=($_)
|
|
|
|
set DIRNAME=`dirname $CALLED[2]`
|
2018-07-02 23:23:26 +05:30
|
|
|
set DAMASK_ROOT=`python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" $DIRNAME"/../"`
|
2017-05-17 12:23:37 +05:30
|
|
|
|
2017-05-15 21:10:49 +05:30
|
|
|
source $DAMASK_ROOT/CONFIG
|
|
|
|
|
2018-12-18 19:41:44 +05:30
|
|
|
# add BRANCH if DAMASK_ROOT is a git repository
|
|
|
|
cd $DAMASK_ROOT >/dev/null
|
|
|
|
set BRANCH = `git branch 2>/dev/null| grep -E '^\* ')`
|
|
|
|
cd - >/dev/null
|
|
|
|
|
2017-05-17 12:23:37 +05:30
|
|
|
# if DAMASK_BIN is present
|
2017-05-15 21:10:49 +05:30
|
|
|
if ( $?DAMASK_BIN) then
|
2017-05-17 12:23:37 +05:30
|
|
|
set path = ($DAMASK_BIN $path)
|
2017-05-15 21:10:49 +05:30
|
|
|
endif
|
|
|
|
|
|
|
|
set SOLVER=`which DAMASK_spectral`
|
|
|
|
set PROCESSING=`which postResults`
|
|
|
|
if ( "x$DAMASK_NUM_THREADS" == "x" ) then
|
|
|
|
set DAMASK_NUM_THREADS=1
|
|
|
|
endif
|
|
|
|
|
2017-07-12 16:20:59 +05:30
|
|
|
# currently, there is no information that unlimited causes problems
|
2018-08-04 18:05:57 +05:30
|
|
|
# still, http://software.intel.com/en-us/forums/topic/501500 suggest to fix it
|
|
|
|
# more info https://jblevins.org/log/segfault
|
|
|
|
# https://stackoverflow.com/questions/79923/what-and-where-are-the-stack-and-heap
|
2017-08-01 12:43:25 +05:30
|
|
|
# http://superuser.com/questions/220059/what-parameters-has-ulimit
|
2017-07-12 16:20:59 +05:30
|
|
|
limit datasize unlimited # maximum heap size (kB)
|
|
|
|
limit stacksize unlimited # maximum stack size (kB)
|
2017-05-15 21:10:49 +05:30
|
|
|
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 ...
|
2018-12-18 19:41:44 +05:30
|
|
|
echo "DAMASK $DAMASK_ROOT $BRANCH"
|
2017-05-15 21:10:49 +05:30
|
|
|
echo "Spectral Solver $SOLVER"
|
|
|
|
echo "Post Processing $PROCESSING"
|
|
|
|
if ( $?PETSC_DIR) then
|
|
|
|
echo "PETSc location $PETSC_DIR"
|
|
|
|
endif
|
|
|
|
if ( $?MSC_ROOT) then
|
|
|
|
echo "MSC.Marc/Mentat $MSC_ROOT"
|
|
|
|
endif
|
|
|
|
echo
|
2018-11-30 21:05:01 +05:30
|
|
|
echo "Multithreading DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS"
|
2017-05-15 21:10:49 +05:30
|
|
|
echo `limit datasize`
|
|
|
|
echo `limit stacksize`
|
2018-11-30 21:05:01 +05:30
|
|
|
echo
|
2017-05-15 21:10:49 +05:30
|
|
|
endif
|
|
|
|
|
|
|
|
setenv DAMASK_NUM_THREADS $DAMASK_NUM_THREADS
|
2017-05-17 12:23:37 +05:30
|
|
|
if ( ! $?PYTHONPATH ) then
|
|
|
|
setenv PYTHONPATH $DAMASK_ROOT/lib
|
|
|
|
else
|
|
|
|
setenv PYTHONPATH $DAMASK_ROOT/lib:$PYTHONPATH
|
|
|
|
endif
|