From ae3a5187c098fcee7778d2078565aeca8d559ac3 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 13 Apr 2017 21:35:46 +0200 Subject: [PATCH 1/7] syntax error --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1403b24c5..72728cebe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -483,7 +483,7 @@ removeLock: before_script: - echo 'Do nothing' when: always - script: if grep -q $CI_PIPELINE_ID $HOME/GitLabCI.lock; then; rm $HOME/GitLabCI.lock; fi + script: if grep -q $CI_PIPELINE_ID $HOME/GitLabCI.lock; then rm $HOME/GitLabCI.lock; fi except: - master - release From 6114541dba9c8c72f59d72f03cfdfe7e977b6a0f Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 13 Apr 2017 18:59:52 -0400 Subject: [PATCH 2/7] try unlimited heap and stack first --- DAMASK_env.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/DAMASK_env.sh b/DAMASK_env.sh index 078dd582b..0ae3a2abf 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -39,12 +39,15 @@ fi # according to http://software.intel.com/en-us/forums/topic/501500 # this seems to make sense for the stack size -FREE=$(which free 2>/dev/null) +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 $(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) + 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 From d1c2e2114d5fe5337ab8a427dcc20d4dfedd52e6 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 13 Apr 2017 19:00:19 -0400 Subject: [PATCH 3/7] switch auto drawing back on at end of pipeline --- processing/pre/mentat_spectralBox.py | 1 + 1 file changed, 1 insertion(+) diff --git a/processing/pre/mentat_spectralBox.py b/processing/pre/mentat_spectralBox.py index 681aca724..16c982f82 100755 --- a/processing/pre/mentat_spectralBox.py +++ b/processing/pre/mentat_spectralBox.py @@ -247,6 +247,7 @@ for name in filenames: '*identify_sets', '*show_model', '*redraw', + '*draw_automatic', ] outputLocals = {} From 4ffca8f0dcc6e5a2cb20fc5a24f4ee185fc6796c Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 13 Apr 2017 19:01:42 -0400 Subject: [PATCH 4/7] check for erroneous total phase fraction --- code/IO.f90 | 2 +- code/material.f90 | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/IO.f90 b/code/IO.f90 index c55a03b6a..acac40785 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -878,7 +878,7 @@ function IO_spotTagInPart(fileUnit,part,tag,Nsections) IO_spotTagInPart = .false. ! assume to nowhere spot tag section = 0_pInt - line ='' + line = '' rewind(fileUnit) do while (trim(line) /= IO_EOF .and. IO_lc(IO_getTag(line,'<','>')) /= part) ! search for part diff --git a/code/material.f90 b/code/material.f90 index ec5537b00..1945bb7da 100644 --- a/code/material.f90 +++ b/code/material.f90 @@ -758,7 +758,7 @@ subroutine material_parseMicrostructure(fileUnit,myPart) allocate(microstructure_elemhomo(Nsections), source=.false.) if(any(mesh_element(4,1:mesh_NcpElems) > Nsections)) & - call IO_error(155_pInt,ext_msg='Microstructure in geometry > Sections in material.config') + call IO_error(155_pInt,ext_msg='More microstructures in geometry than sections in material.config') forall (e = 1_pInt:mesh_NcpElems) microstructure_active(mesh_element(4,e)) = .true. ! current microstructure used in model? Elementwise view, maximum N operations for N elements @@ -801,7 +801,7 @@ subroutine material_parseMicrostructure(fileUnit,myPart) microstructure_crystallite(section) = IO_intValue(line,chunkPos,2_pInt) case ('(constituent)') constituent = constituent + 1_pInt - do i=2_pInt,6_pInt,2_pInt + do i = 2_pInt,6_pInt,2_pInt tag = IO_lc(IO_stringValue(line,chunkPos,i)) select case (tag) case('phase') @@ -816,6 +816,11 @@ subroutine material_parseMicrostructure(fileUnit,myPart) endif enddo + !sanity check +do section = 1_pInt, Nsections + if (sum(microstructure_fraction(:,section)) /= 1.0_pReal) & + call IO_error(153_pInt,ext_msg=microstructure_name(section)) +enddo end subroutine material_parseMicrostructure From a46107ba7f8fa6f7d204338dce33e2319d6148d0 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 14 Apr 2017 09:16:21 +0200 Subject: [PATCH 5/7] pull needed to avoid conflicts --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 72728cebe..2767c46dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -435,6 +435,7 @@ mergeIntoMaster: - git merge $UPDATEDREV - git push origin master # master is now tested version and has updated VERSION file - git checkout development + - git pull - git merge master -s ours # 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: From c34716a0da7fe1a13fcba013ab787039bbd00690 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Fri, 14 Apr 2017 15:07:43 -0400 Subject: [PATCH 6/7] modern form of croaking, added '*draw_automatic' as final output --- processing/pre/mentat_pbcOnBoxMesh.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/processing/pre/mentat_pbcOnBoxMesh.py b/processing/pre/mentat_pbcOnBoxMesh.py index 71bc0d121..f71247618 100755 --- a/processing/pre/mentat_pbcOnBoxMesh.py +++ b/processing/pre/mentat_pbcOnBoxMesh.py @@ -153,34 +153,31 @@ parser.add_option("-p", "--port", type="int", dest="port", metavar='int', help="Mentat connection port [%default]") parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help="write Mentat command stream also to stdout [%default]") -parser.set_defaults(port = 40007) -parser.set_defaults(verbose = False) +parser.set_defaults(port = 40007, + verbose = False) (options, args) = parser.parse_args() -if options.verbose: - file={'croak':sys.stderr} -else: - file={'croak':sys.stdout} - try: import py_mentat except: - file['croak'].write('error: no valid Mentat release found') + damask.util.croak('error: no valid Mentat release found') sys.exit(-1) outputLocals = {} -file['croak'].write('\033[1m'+scriptName+'\033[0m\n\n') -file['croak'].write( 'waiting to connect...\n') +damask.util.report(scriptName,'waiting to connect...') + try: py_mentat.py_connect('',options.port) -# prevent redrawing in Mentat, should be much faster. Since py_connect has no return value, try this to determine if failed or not +# prevent redrawing in Mentat, should be much faster. +# Since py_connect has no return value, try this to determine if failed or not output(['*draw_manual'],outputLocals,'Mentat') except: - file['croak'].write('Could not connect. Set Tools/Python/"Run as Separate Process" & "Initiate"...\n') + damask.util.croak('Could not connect. Set Tools/Python/"Run as Separate Process" & "Initiate"...') sys.exit() -file['croak'].write( 'connected...\n') + +damask.util.croak('connected...') output(['*remove_all_servos', '*sweep_all', @@ -190,6 +187,10 @@ output(['*remove_all_servos', cmds = servoLink() output(cmds,outputLocals,'Mentat') + +output(['*draw_automatic', + ],outputLocals,'Mentat') # script depends on consecutive numbering of nodes + py_mentat.py_disconnect() if options.verbose: From 62dd57313e9925284037c19bf496e0d6cf1b930d Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 15 Apr 2017 12:07:59 +0200 Subject: [PATCH 7/7] queue for runners to retain order --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2767c46dd..d9aec3a0a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,7 +34,7 @@ variables: #================================================================================================ # Shortcut names #================================================================================================ - DAMASKROOT: "$HOME/GitlabCI_Pipeline_$CI_PIPELINE_ID/DAMASK" + DAMASKROOT: "$HOME/GitLabCI_Pipeline_$CI_PIPELINE_ID/DAMASK" #================================================================================================ # Names of module files to load @@ -79,8 +79,8 @@ variables: checkout: stage: prepareAll before_script: - - while [ -e $HOME/GitLabCI.lock ]; do sleep 5m; done - - echo $CI_PIPELINE_ID > $HOME/GitLabCI.lock + - echo $CI_PIPELINE_ID >> $HOME/GitLabCI.queue + - while [ "$(awk '/$CI_PIPELINE_ID/{print NR}' GitLabCI.queue)" -ne 1 ];do sleep 5m; done script: - mkdir -p $DAMASKROOT - git clone -q git@magit1.mpie.de:damask/DAMASK.git $DAMASKROOT @@ -484,7 +484,7 @@ removeLock: before_script: - echo 'Do nothing' when: always - script: if grep -q $CI_PIPELINE_ID $HOME/GitLabCI.lock; then rm $HOME/GitLabCI.lock; fi + script: sed -i '/$CI_PIPELINE_ID/d' GitLabCI.queue except: - master - release