diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f472d2bb8..709655863 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,14 +14,17 @@ stages: - compileAbaqus2016 - compileAbaqus2017 - example + - performance - createDocumentation + - saveDocumentation - updateMaster - clean + - releaseLock ################################################################################################### before_script: - - if [ $(awk "/$CI_PIPELINE_ID/{print NR}" $HOME/GitLabCI.queue)x == 'x' ]; then echo $CI_PIPELINE_ID >> $HOME/GitLabCI.queue; fi - - while [ $(awk "/$CI_PIPELINE_ID/{print NR}" $HOME/GitLabCI.queue) -ne 1 ];do sleep 5m; done + - if [ $(awk "/$CI_PIPELINE_ID/{print NR}" $TESTROOT/GitLabCI.queue)x == 'x' ]; then echo $CI_PIPELINE_ID >> $TESTROOT/GitLabCI.queue; fi + - while [ $(awk "/$CI_PIPELINE_ID/{print NR}" $TESTROOT/GitLabCI.queue) -ne 1 ];do sleep 5m; done - source $DAMASKROOT/DAMASK_env.sh - cd $DAMASKROOT/PRIVATE/testing @@ -35,7 +38,7 @@ variables: #================================================================================================ # Shortcut names #================================================================================================ - DAMASKROOT: "$HOME/GitLabCI_Pipeline_$CI_PIPELINE_ID/DAMASK" + DAMASKROOT: "$TESTROOT/GitLabCI_Pipeline_$CI_PIPELINE_ID/DAMASK" #================================================================================================ # Names of module files to load @@ -81,8 +84,8 @@ variables: checkout: stage: prepareAll before_script: - - echo $CI_PIPELINE_ID >> $HOME/GitLabCI.queue - - while [ $(awk "/$CI_PIPELINE_ID/{print NR}" $HOME/GitLabCI.queue) -ne 1 ];do sleep 5m; done + - echo $CI_PIPELINE_ID >> $TESTROOT/GitLabCI.queue + - while [ $(awk "/$CI_PIPELINE_ID/{print NR}" $TESTROOT/GitLabCI.queue) -ne 1 ];do sleep 5m; done script: - mkdir -p $DAMASKROOT - cd $DAMASKROOT @@ -425,25 +428,21 @@ AbaqusExample: only: - development -################################################################################################## -mergeIntoMaster: - stage: updateMaster +################################################################################################### +SpectralRuntime: + stage: performance script: + - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel - cd $DAMASKROOT - - export TESTEDREV=$(git describe) # might be detached from development branch - - echo $TESTEDREV > VERSION - - git commit VERSION -m "[skip ci] updated version information after successful test of $TESTEDREV" - - export UPDATEDREV=$(git describe) # tested state + 1 commit - - git checkout master - - git merge $UPDATEDREV -s recursive -X ours # conflicts occur only for inconsistent state - - git push origin master # master is now tested version and has updated VERSION file - - git checkout development - - git pull - - git merge master -s recursive -X ours -m "[skip ci] Merge branch 'master' into development" # only possible conflict is in VERSION file - - git push origin development # development is unchanged (as master is based on it) but has updated VERSION file - only: - - development - + - make clean spectral processing OPTIMIZATION=AGGRESSIVE + - cd $TESTROOT/performance # location of old results + - git checkout . # undo any changes (i.e. run time data from non-development branch) + - cd $DAMASKROOT/PRIVATE/testing + - SpectralAll_runtime/test.py -d $TESTROOT/performance + except: + - master + - release + ################################################################################################### AbaqusExp: stage: createDocumentation @@ -481,13 +480,59 @@ Spectral: - master - release +################################################################################################## +backupData: + stage: saveDocumentation + script: + - cd $TESTROOT/performance # location of new runtime results + - git commit -am"${CI_PIPELINE_ID}_${CI_COMMIT_SHA}" + - mkdir $BACKUP/${CI_PIPELINE_ID}_${CI_COMMIT_SHA} + - cp $TESTROOT/performance/time.txt $BACKUP/${CI_PIPELINE_ID}_${CI_COMMIT_SHA}/ + - mv $TESTROOT/performance/time.png $BACKUP/${CI_PIPELINE_ID}_${CI_COMMIT_SHA}/ + - cp $TESTROOT/performance/memory.txt $BACKUP/${CI_PIPELINE_ID}_${CI_COMMIT_SHA}/ + - mv $TESTROOT/performance/memory.png $BACKUP/${CI_PIPELINE_ID}_${CI_COMMIT_SHA}/ + - mv $DAMASKROOT/PRIVATE/documenting/DAMASK_* $BACKUP/${CI_PIPELINE_ID}_${CI_COMMIT_SHA}/ + only: + - development + +################################################################################################## +mergeIntoMaster: + stage: updateMaster + script: + - cd $DAMASKROOT + - export TESTEDREV=$(git describe) # might be detached from development branch + - echo $TESTEDREV > VERSION + - git commit VERSION -m "[skip ci] updated version information after successful test of $TESTEDREV" + - export UPDATEDREV=$(git describe) # tested state + 1 commit + - git checkout master + - git merge $UPDATEDREV -s recursive -X ours # conflicts occur only for inconsistent state + - git push origin master # master is now tested version and has updated VERSION file + - git checkout development + - git pull + - git merge master -s recursive -X ours -m "[skip ci] Merge branch 'master' into development" # only possible conflict is in VERSION file + - git push origin development # development is unchanged (as master is based on it) but has updated VERSION file + only: + - development + ################################################################################################### -removeLock: +removeData: stage: clean - before_script: + before_script: - echo 'Do nothing' - when: always - script: sed -i "/$CI_PIPELINE_ID/d" $HOME/GitLabCI.queue + script: + - rm -rf $TESTROOT/GitLabCI_Pipeline_$CI_PIPELINE_ID + - sed -i "/$CI_PIPELINE_ID/d" $TESTROOT/GitLabCI.queue # in case pipeline was manually (web GUI) restarted and releaseLock was performed already + except: + - master + - release + +################################################################################################### +removeLock: + stage: releaseLock + before_script: + - echo 'Do nothing' + when: always + script: sed -i "/$CI_PIPELINE_ID/d" $TESTROOT/GitLabCI.queue except: - master - release diff --git a/DAMASK_env.csh b/DAMASK_env.csh deleted file mode 100644 index 81d4de421..000000000 --- a/DAMASK_env.csh +++ /dev/null @@ -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 diff --git a/DAMASK_env.csh b/DAMASK_env.csh new file mode 120000 index 000000000..4535015d8 --- /dev/null +++ b/DAMASK_env.csh @@ -0,0 +1 @@ +env/DAMASK_env.csh \ No newline at end of file diff --git a/DAMASK_env.sh b/DAMASK_env.sh deleted file mode 100644 index 0ae3a2abf..000000000 --- a/DAMASK_env.sh +++ /dev/null @@ -1,103 +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 \ - || echo "cannot unlimit stack..." \ - && 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 diff --git a/DAMASK_env.sh b/DAMASK_env.sh new file mode 120000 index 000000000..e49b7df7c --- /dev/null +++ b/DAMASK_env.sh @@ -0,0 +1 @@ +env/DAMASK_env.sh \ No newline at end of file diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh deleted file mode 100644 index 0d043c390..000000000 --- a/DAMASK_env.zsh +++ /dev/null @@ -1,88 +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 - 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 diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh new file mode 120000 index 000000000..22da3bd4d --- /dev/null +++ b/DAMASK_env.zsh @@ -0,0 +1 @@ +env/DAMASK_env.zsh \ No newline at end of file diff --git a/Makefile b/Makefile index 891d4b5f2..0ba67963e 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ all: spectral FEM marc processing .PHONY: spectral spectral: build/spectral - @(cd build/spectral;make --no-print-directory -ws all install VERBOSE=1;) + @(cd build/spectral;make --no-print-directory -ws all install;) .PHONY: FEM FEM: build/FEM diff --git a/PRIVATE b/PRIVATE index 02c172417..19a53f622 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 02c172417e5f170b8b00b1f4c4b65b7b7aeb310b +Subproject commit 19a53f6229603aeafb2466b58679a1cd04fc0142 diff --git a/VERSION b/VERSION index b69932daf..5dabd576c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-684-gb7a138e +v2.0.1-735-gf52e62e diff --git a/env/DAMASK_env.csh b/env/DAMASK_env.csh new file mode 100644 index 000000000..81d4de421 --- /dev/null +++ b/env/DAMASK_env.csh @@ -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 diff --git a/env/DAMASK_env.sh b/env/DAMASK_env.sh new file mode 100644 index 000000000..264ae9c94 --- /dev/null +++ b/env/DAMASK_env.sh @@ -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 diff --git a/env/DAMASK_env.zsh b/env/DAMASK_env.zsh new file mode 100644 index 000000000..9098352bf --- /dev/null +++ b/env/DAMASK_env.zsh @@ -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 diff --git a/examples/ConfigFiles/Phase_DisloUCLA_Tungsten.config b/examples/ConfigFiles/Phase_DisloUCLA_Tungsten.config index 6d7dd6859..d69a4b82a 100644 --- a/examples/ConfigFiles/Phase_DisloUCLA_Tungsten.config +++ b/examples/ConfigFiles/Phase_DisloUCLA_Tungsten.config @@ -29,21 +29,20 @@ SolidSolutionStrength 0.0 # Strength due to elements in solid solution #per family Nslip 12 0 slipburgers 2.72e-10 # Burgers vector of slip system [m] -rhoedge0 1.0e12 # Initial edge dislocation density [m/m**3] 1.0e12 +rhoedge0 1.0e12 # Initial edge dislocation density [m/m**3] rhoedgedip0 1.0 # Initial edged dipole dislocation density [m/m**3] -Qedge 2.725e-19 # Activation energy for dislocation glide [J] -v0 3693.4 # Initial glide velocity [m/s] 1.0e-4 (kmC 3693.4 ; 755.59) +Qedge 2.61154e-19 # Activation energy for dislocation glide [J], 1.63 eV +v0 1 # Initial glide velocity [m/s] p_slip 0.86 # p-exponent in glide velocity q_slip 1.69 # q-exponent in glide velocity tau_peierls 2.03e9 # peierls stress [Pa] #mobility law -kink_height 2.567e-10 # kink height sqrt(6)/3*lattice_parameter [m] -omega 9.1e11 # attemp frequency (from kMC paper) [s^(-1)] +kink_height 2.567e-10 # kink height sqrt(6)/3*lattice_parameter [m] +omega 9.1e11 # attemp frequency (from kMC paper) [s^(-1)] kink_width 29.95e-10 # kink pair width ~ 11 b (kMC paper) [m] -dislolength 78.0e-10 # dislocation length (ideally lambda) [m] initial value 25b -friction_coeff 8.3e-5 # friction coeff. B (kMC) [Pa*s] -# +dislolength 78e-10 # dislocation length (ideally lambda) [m] initial value 11b +friction_coeff 8.3e-5 # friction coeff. B [Pa*s] #hardening dipoleformationfactor 0 # to have hardening due to dipole formation off @@ -52,5 +51,5 @@ D0 4.0e-5 # Vacancy diffusion prefactor [m**2/ Qsd 4.5e-19 # Activation energy for climb [J] Catomicvolume 1.0 # Adj. parameter controlling the atomic volume [in b] Cedgedipmindistance 1.0 # Adj. parameter controlling the minimum dipole distance [in b] -interaction_slipslip 0.0625 0.0625 0.72 0.05 0.09 0.06 # Queyreau -#nonschmid_coefficients 0 0.56 0.75 0 0 0 #?????????????? +interaction_slipslip 0.009 0.009 0.72 0.05 009 006 +nonschmid_coefficients 0.938 0.71 4.43 0.0 0.0 0.0 diff --git a/installation/mods_MarcMentat/apply_DAMASK_modifications.sh b/installation/mods_MarcMentat/apply_DAMASK_modifications.sh index 761883de5..d1c1e37dd 100755 --- a/installation/mods_MarcMentat/apply_DAMASK_modifications.sh +++ b/installation/mods_MarcMentat/apply_DAMASK_modifications.sh @@ -129,7 +129,7 @@ for filename in marc$VERSION/tools/run_damask* \ chmod 755 $INSTALLDIR/${filename} done -#creating symlinks for run_damask_scripts in /usr/local/bin +#creating symlinks for run_damask_scripts if [ -d "$BIN_DIR" ]; then echo '' @@ -158,11 +158,6 @@ if [ -d "$BIN_DIR" ]; then esac fi -# cloning user subroutine -echo '' -echo 'cloning $VERSION HYPELA2 user subroutine...' -ln -s DAMASK_marc.f90 ${DAMASK_ROOT}/src/DAMASK_marc${VERSION}.f90 - # precompiling user subroutine echo '' echo 'precompiling $VERSION HYPELA2 user subroutine...' diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index 1bb80a939..d67b31f72 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -99,7 +99,6 @@ class Test(): self.run(variant) self.postprocess(variant) - self.compare(variant) if self.options.update: if self.update(variant) != 0: logging.critical('update for "{}" failed.'.format(name)) diff --git a/src/.gitignore b/src/.gitignore index c90e213cf..e9956554e 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1,4 +1,3 @@ -DAMASK_marc*.f90 Makefile cmake_install.cmake quit__genmod.f90 diff --git a/src/DAMASK_marc2012.f90 b/src/DAMASK_marc2012.f90 deleted file mode 120000 index 2c5bec706..000000000 --- a/src/DAMASK_marc2012.f90 +++ /dev/null @@ -1 +0,0 @@ -DAMASK_marc.f90 \ No newline at end of file diff --git a/src/DAMASK_marc2013.1.f90 b/src/DAMASK_marc2013.1.f90 deleted file mode 120000 index 2c5bec706..000000000 --- a/src/DAMASK_marc2013.1.f90 +++ /dev/null @@ -1 +0,0 @@ -DAMASK_marc.f90 \ No newline at end of file diff --git a/src/DAMASK_marc2013.f90 b/src/DAMASK_marc2013.f90 deleted file mode 120000 index 2c5bec706..000000000 --- a/src/DAMASK_marc2013.f90 +++ /dev/null @@ -1 +0,0 @@ -DAMASK_marc.f90 \ No newline at end of file diff --git a/src/DAMASK_marc2011.f90 b/src/DAMASK_marc2016.f90 similarity index 100% rename from src/DAMASK_marc2011.f90 rename to src/DAMASK_marc2016.f90 diff --git a/src/IO.f90 b/src/IO.f90 index 452bc0588..3d80feefa 100644 --- a/src/IO.f90 +++ b/src/IO.f90 @@ -14,10 +14,11 @@ module IO private character(len=5), parameter, public :: & IO_EOF = '#EOF#' !< end of file string - character(len=168), parameter, private :: & - IO_divider = '───────────────────'//& + character(len=207), parameter, private :: & + IO_DIVIDER = '───────────────────'//& '───────────────────'//& - '──────────────────' + '───────────────────'//& + '────────────' public :: & IO_init, & IO_read, & @@ -1457,11 +1458,11 @@ end function IO_timeStamp !> @brief write error statements to standard out and terminate the Marc/spectral run with exit #9xxx !> in ABAQUS either time step is reduced or execution terminated !-------------------------------------------------------------------------------------------------- -subroutine IO_error(error_ID,el,ip,g,ext_msg) +subroutine IO_error(error_ID,el,ip,g,instance,ext_msg) implicit none integer(pInt), intent(in) :: error_ID - integer(pInt), optional, intent(in) :: el,ip,g + integer(pInt), optional, intent(in) :: el,ip,g,instance character(len=*), optional, intent(in) :: ext_msg external :: quit @@ -1672,34 +1673,28 @@ subroutine IO_error(error_ID,el,ip,g,ext_msg) end select !$OMP CRITICAL (write2out) - write(0,'(/,a)') ' ┌'//IO_divider//'┐' - write(0,'(a)') ' │ error │' - write(0,'(a)') ' ├'//IO_divider//'┤' - write(0,'(a,i3,a)') ' │ ',error_ID,' │' - write(0,'(a)') ' │ │' + write(0,'(/,a)') ' ┌'//IO_DIVIDER//'┐' + write(0,'(a,24x,a,40x,a)') ' │','error', '│' + write(0,'(a,24x,i3,42x,a)') ' │',error_ID, '│' + write(0,'(a)') ' ├'//IO_DIVIDER//'┤' write(formatString,'(a,i6.6,a,i6.6,a)') '(1x,a4,a',max(1,len(trim(msg))),',',& - max(1,60-len(trim(msg))-5),'x,a)' - write(0,formatString) '│ ',trim(msg),'│' + max(1,72-len(trim(msg))-4),'x,a)' + write(0,formatString) '│ ',trim(msg), '│' if (present(ext_msg)) then write(formatString,'(a,i6.6,a,i6.6,a)') '(1x,a4,a',max(1,len(trim(ext_msg))),',',& - max(1,60-len(trim(ext_msg))-5),'x,a)' - write(0,formatString) '│ ',trim(ext_msg),'│' + max(1,72-len(trim(ext_msg))-4),'x,a)' + write(0,formatString) '│ ',trim(ext_msg), '│' endif - if (present(el)) then - if (present(ip)) then - if (present(g)) then - write(0,'(a13,1x,i9,1x,a2,1x,i2,1x,a5,1x,i4,18x,a1)') ' │ at element',el,'IP',ip,'grain',g,'│' - else - write(0,'(a13,1x,i9,1x,a2,1x,i2,29x,a1)') ' │ at element',el,'IP',ip,'│' - endif - else - write(0,'(a13,1x,i9,35x,a1)') ' │ at element',el,'│' - endif - elseif (present(ip)) then ! now having the meaning of "instance" - write(0,'(a14,1x,i9,34x,a1)') ' │ at instance',ip,'│' - endif - write(0,'(a)') ' │ │' - write(0,'(a)') ' └'//IO_divider//'┘' + if (present(el)) & + write(0,'(a19,1x,i9,44x,a3)') ' │ at element ',el, '│' + if (present(ip)) & + write(0,'(a19,1x,i9,44x,a3)') ' │ at IP ',ip, '│' + if (present(g)) & + write(0,'(a19,1x,i9,44x,a3)') ' │ at constituent',g, '│' + if (present(instance)) & + write(0,'(a19,1x,i9,44x,a3)') ' │ at instance ',instance, '│' + write(0,'(a,69x,a)') ' │', '│' + write(0,'(a)') ' └'//IO_DIVIDER//'┘' flush(0) call quit(9000_pInt+error_ID) !$OMP END CRITICAL (write2out) @@ -1766,30 +1761,26 @@ subroutine IO_warning(warning_ID,el,ip,g,ext_msg) end select !$OMP CRITICAL (write2out) - write(6,'(/,a)') ' +--------------------------------------------------------+' - write(6,'(a)') ' + warning +' - write(6,'(a,i3,a)') ' + ',warning_ID,' +' - write(6,'(a)') ' + +' - write(formatString,'(a,i6.6,a,i6.6,a)') '(1x,a2,a',max(1,len(trim(msg))),',',& - max(1,60-len(trim(msg))-5),'x,a)' - write(6,formatString) '+ ', trim(msg),'+' + write(6,'(/,a)') ' ┌'//IO_DIVIDER//'┐' + write(6,'(a,24x,a,38x,a)') ' │','warning', '│' + write(6,'(a,24x,i3,42x,a)') ' │',warning_ID, '│' + write(6,'(a)') ' ├'//IO_DIVIDER//'┤' + write(formatString,'(a,i6.6,a,i6.6,a)') '(1x,a4,a',max(1,len(trim(msg))),',',& + max(1,72-len(trim(msg))-4),'x,a)' + write(6,formatString) '│ ',trim(msg), '│' if (present(ext_msg)) then - write(formatString,'(a,i6.6,a,i6.6,a)') '(1x,a2,a',max(1,len(trim(ext_msg))),',',& - max(1,60-len(trim(ext_msg))-5),'x,a)' - write(6,formatString) '+ ', trim(ext_msg),'+' + write(formatString,'(a,i6.6,a,i6.6,a)') '(1x,a4,a',max(1,len(trim(ext_msg))),',',& + max(1,72-len(trim(ext_msg))-4),'x,a)' + write(6,formatString) '│ ',trim(ext_msg), '│' endif - if (present(el)) then - if (present(ip)) then - if (present(g)) then - write(6,'(a13,1x,i9,1x,a2,1x,i2,1x,a5,1x,i4,18x,a1)') ' + at element',el,'IP',ip,'grain',g,'+' - else - write(6,'(a13,1x,i9,1x,a2,1x,i2,29x,a1)') ' + at element',el,'IP',ip,'+' - endif - else - write(6,'(a13,1x,i9,35x,a1)') ' + at element',el,'+' - endif - endif - write(6,'(a)') ' +--------------------------------------------------------+' + if (present(el)) & + write(6,'(a19,1x,i9,44x,a3)') ' │ at element ',el, '│' + if (present(ip)) & + write(6,'(a19,1x,i9,44x,a3)') ' │ at IP ',ip, '│' + if (present(g)) & + write(6,'(a19,1x,i9,44x,a3)') ' │ at constituent',g, '│' + write(6,'(a,69x,a)') ' │', '│' + write(6,'(a)') ' └'//IO_DIVIDER//'┘' flush(6) !$OMP END CRITICAL (write2out) diff --git a/src/plastic_isotropic.f90 b/src/plastic_isotropic.f90 index def4c5a35..bea9c616e 100644 --- a/src/plastic_isotropic.f90 +++ b/src/plastic_isotropic.f90 @@ -567,18 +567,13 @@ subroutine plastic_isotropic_dotState(Tstar_v,ipc,ip,el) if (dEq0(param(instance)%tausat_SinhFitA)) then saturation = param(instance)%tausat else - saturation = ( param(instance)%tausat & - + ( log( ( gamma_dot / param(instance)%tausat_SinhFitA& - )**(1.0_pReal / param(instance)%tausat_SinhFitD)& - + sqrt( ( gamma_dot / param(instance)%tausat_SinhFitA & - )**(2.0_pReal / param(instance)%tausat_SinhFitD) & - + 1.0_pReal ) & - ) & ! asinh(K) = ln(K + sqrt(K^2 +1)) + saturation = param(instance)%tausat & + + asinh( (gamma_dot / param(instance)%tausat_SinhFitA& + )**(1.0_pReal / param(instance)%tausat_SinhFitD)& )**(1.0_pReal / param(instance)%tausat_SinhFitC) & - / ( param(instance)%tausat_SinhFitB & - * (gamma_dot / param(instance)%gdot0)**(1.0_pReal / param(instance)%n) & - ) & - ) + / ( param(instance)%tausat_SinhFitB & + * (gamma_dot / param(instance)%gdot0)**(1.0_pReal / param(instance)%n) & + ) endif hardening = ( param(instance)%h0 + param(instance)%h0_slopeLnRate * log(gamma_dot) ) & * abs( 1.0_pReal - state(instance)%flowstress(of)/saturation )**param(instance)%a &