From 6f2c5231c27b2176449c8b29ba9276428c38a850 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 31 Oct 2020 10:34:16 +0100 Subject: [PATCH 01/10] shell script not needed anymore --- PRIVATE | 2 +- processing/pre/geom_fromTable.py | 57 -------------------------------- 2 files changed, 1 insertion(+), 58 deletions(-) delete mode 100755 processing/pre/geom_fromTable.py diff --git a/PRIVATE b/PRIVATE index fb8647f77..7e7452fe1 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit fb8647f77aeb52098605f0fd7fe95764e6d26027 +Subproject commit 7e7452fe11187cd816fccf83a947bd7ea7713586 diff --git a/processing/pre/geom_fromTable.py b/processing/pre/geom_fromTable.py deleted file mode 100755 index 9ff4ffdc2..000000000 --- a/processing/pre/geom_fromTable.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -from optparse import OptionParser - -import damask - - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName,damask.version]) - - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- - -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ -Converts ASCII table. Input can be microstructure or orientation (as quaternion). For the latter, -phase information can be given additionally. - -""", version = scriptID) - -parser.add_option('--coordinates', - dest = 'pos', - type = 'string', metavar = 'string', - help = 'coordinates label (%default)') -parser.add_option('--phase', - dest = 'phase', - type = 'string', metavar = 'string', - help = 'phase label') -parser.add_option('--microstructure', - dest = 'microstructure', - type = 'string', metavar = 'string', - help = 'microstructure label') -parser.add_option('-q', '--quaternion', - dest = 'quaternion', - type = 'string', metavar='string', - help = 'quaternion label') - -parser.set_defaults(pos= 'pos') - -(options,filenames) = parser.parse_args() -if filenames == []: filenames = [None] - -for name in filenames: - damask.util.report(scriptName,name) - - labels = [] - for l in [options.quaternion,options.phase,options.microstructure]: - if l is not None: labels.append(l) - - t = damask.Table.load(name) - geom = damask.Geom.from_table(t,options.pos,labels) - damask.util.croak(geom) - - geom.save_ASCII(sys.stdout if name is None else os.path.splitext(name)[0]+'.geom') From e11391c750a966f0ee6fcd544174f7d7b4ed6ef4 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 31 Oct 2020 10:36:50 +0100 Subject: [PATCH 02/10] easier to do directly on a numpy array --- processing/post/permuteData.py | 61 ---------------------------------- 1 file changed, 61 deletions(-) delete mode 100755 processing/post/permuteData.py diff --git a/processing/post/permuteData.py b/processing/post/permuteData.py deleted file mode 100755 index 073ccfd9f..000000000 --- a/processing/post/permuteData.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -from io import StringIO -from optparse import OptionParser - -import numpy as np - -import damask - - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName,damask.version]) - - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- - -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ -Permute all values in given column(s). - -""", version = scriptID) - -parser.add_option('-l','--label', - dest = 'label', - action = 'extend', metavar = '', - help ='column(s) to permute') -parser.add_option('-u', '--unique', - dest = 'unique', - action = 'store_true', - help = 'shuffle unique values as group') -parser.add_option('-r', '--rnd', - dest = 'randomSeed', - type = 'int', metavar = 'int', - help = 'seed of random number generator [%default]') - -parser.set_defaults(label = [], - unique = False, - randomSeed = None, - ) - -(options,filenames) = parser.parse_args() -if filenames == []: filenames = [None] - -for name in filenames: - damask.util.report(scriptName,name) - - table = damask.Table.load(StringIO(''.join(sys.stdin.read())) if name is None else name) - - randomSeed = int(os.urandom(4).hex(), 16) if options.randomSeed is None else options.randomSeed # random seed per file - rng = np.random.default_rng(randomSeed) - - for label in options.label: - data = table.get(label) - uniques,inverse = np.unique(data,return_inverse=True,axis=0) if options.unique else (data,np.arange(len(data))) - rng.shuffle(uniques) - table = table.set(label,uniques[inverse], scriptID+' '+' '.join(sys.argv[1:])) - - table.save((sys.stdout if name is None else name), legacy=True) From 8224122bb984d1230bd318a0bf3cee439bc67182 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 31 Oct 2020 12:59:46 +0100 Subject: [PATCH 03/10] more user friendly error handling --- python/damask/solver/_marc.py | 63 +++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/python/damask/solver/_marc.py b/python/damask/solver/_marc.py index e37a46488..fb1e12b82 100644 --- a/python/damask/solver/_marc.py +++ b/python/damask/solver/_marc.py @@ -1,6 +1,7 @@ import subprocess import shlex -import string +import re +import io from pathlib import Path from .. import environment @@ -27,7 +28,10 @@ class Marc: path_MSC = environment.options['MSC_ROOT'] path_lib = Path(f'{path_MSC}/mentat{self.version}/shlib/linux64') - return path_lib if path_lib.is_dir() else None + if not path_lib.is_dir(): + raise FileNotFoundError(f'library path "{path_lib}" not found') + + return path_lib @property @@ -36,10 +40,12 @@ class Marc: path_MSC = environment.options['MSC_ROOT'] path_tools = Path(f'{path_MSC}/marc{self.version}/tools') - return path_tools if path_tools.is_dir() else None + if not path_tools.is_dir(): + raise FileNotFoundError(f'tools path "{path_tools}" not found') + + return path_tools -#-------------------------- def submit_job(self, model, job = 'job1', @@ -48,38 +54,37 @@ class Marc: optimization = '', ): - usersub = environment.root_dir/'src/DAMASK_marc' usersub = usersub.parent/(usersub.name + ('.f90' if compile else '.marc')) if not usersub.is_file(): - raise FileNotFoundError("DAMASK4Marc ({}) '{}' not found".format(('source' if compile else 'binary'),usersub)) + raise FileNotFoundError(f'subroutine ({"source" if compile else "binary"}) "{usersub}" not found') # Define options [see Marc Installation and Operation Guide, pp 23] script = f'run_damask_{optimization}mp' - cmd = str(self.tools_path/Path(script)) + \ - ' -jid ' + model + '_' + job + \ - ' -nprocd 1 -autorst 0 -ci n -cr n -dcoup 0 -b no -v no' - - if compile: cmd += ' -u ' + str(usersub) + ' -save y' - else: cmd += ' -prog ' + str(usersub.with_suffix('')) - - print('job submission {} compilation: {}'.format(('with' if compile else 'without'),usersub)) - if logfile: log = open(logfile, 'w') + cmd = str(self.tools_path/script) + \ + ' -jid ' + model+'_'+job + \ + ' -nprocd 1 -autorst 0 -ci n -cr n -dcoup 0 -b no -v no' + cmd += ' -u ' + str(usersub) + ' -save y' if compile else \ + ' -prog ' + str(usersub.with_suffix('')) print(cmd) - process = subprocess.Popen(shlex.split(cmd),stdout = log,stderr = subprocess.STDOUT) - log.close() - process.wait() -#-------------------------- - def exit_number_from_outFile(self,outFile=None): - exitnumber = -1 - with open(outFile,'r') as fid_out: - for line in fid_out: - if (string.find(line,'tress iteration') != -1): - print(line) - elif (string.find(line,'Exit number') != -1): - substr = line[string.find(line,'Exit number'):len(line)] - exitnumber = int(substr[12:16]) + if logfile is not None: + try: + f = open(logfile,'w+') + except TypeError: + f = logfile + else: + f = io.StringIO() - return exitnumber + proc = subprocess.Popen(shlex.split(cmd),stdout=f,stderr=subprocess.STDOUT) + proc.wait() + f.seek(0) + + try: + v = int(re.search('Exit number ([0-9]+)',f.readlines()[-1]).group(1)) + except (AttributeError,ValueError): + raise RuntimeError('Marc simulation failed (unknown return value)') + + if v != 3004: + raise RuntimeError(f'Marc simulation failed ({v})') From 772fd18d81cf720ccbb8dfb59e4f8d96f5e22cdd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 31 Oct 2020 14:45:19 +0100 Subject: [PATCH 04/10] only use pytest-based compile_Marc test --- .gitlab-ci.yml | 6 +++--- PRIVATE | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 17728632d..acdf6d9de 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -109,7 +109,7 @@ Pytest_python: stage: python script: - cd $DAMASKROOT/python - - pytest --basetemp=/tmp/${CI_PIPELINE_ID}/python + - pytest --basetemp=/tmp/${CI_PIPELINE_ID}/python -v except: - master - release @@ -253,7 +253,7 @@ Pytest_grid: script: - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel - cd pytest - - pytest -m 'not compile' --basetemp=/tmp/${CI_PIPELINE_ID}/fortran + - pytest -m 'not compile' --basetemp=/tmp/${CI_PIPELINE_ID}/fortran -k except: - master - release @@ -316,7 +316,7 @@ Marc_compileIfort: - module load $IntelMarc $HDF5Marc $MSC - Marc_compileIfort/test.py - cd pytest - - pytest -k 'compile and Marc' + - pytest -k 'compile and Marc' --basetemp=/tmp/${CI_PIPELINE_ID}/compile_Marc except: - master - release diff --git a/PRIVATE b/PRIVATE index 7e7452fe1..f1ab98fe9 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 7e7452fe11187cd816fccf83a947bd7ea7713586 +Subproject commit f1ab98fe98dc6a5c5f1d75d03e65a5defe147fed From 433b346f0ccb8df5f1cc1cb70e3b21b649096683 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 31 Oct 2020 16:19:56 +0100 Subject: [PATCH 05/10] simplified selection of tests --- .gitlab-ci.yml | 2 +- PRIVATE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index acdf6d9de..864f9302d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -253,7 +253,7 @@ Pytest_grid: script: - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel - cd pytest - - pytest -m 'not compile' --basetemp=/tmp/${CI_PIPELINE_ID}/fortran -k + - pytest -k 'not compile' --basetemp=/tmp/${CI_PIPELINE_ID}/fortran -v except: - master - release diff --git a/PRIVATE b/PRIVATE index f1ab98fe9..768bae34b 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit f1ab98fe98dc6a5c5f1d75d03e65a5defe147fed +Subproject commit 768bae34b26cc09a9ffa47b8f5a1b20b43dd115d From f2d0c2aca37de4a3e259e660f5bacda141b6c0ef Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 31 Oct 2020 20:51:27 +0100 Subject: [PATCH 06/10] test does not exist anymore --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 864f9302d..46ae5d1fa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -314,7 +314,6 @@ Marc_compileIfort: stage: compileMarc script: - module load $IntelMarc $HDF5Marc $MSC - - Marc_compileIfort/test.py - cd pytest - pytest -k 'compile and Marc' --basetemp=/tmp/${CI_PIPELINE_ID}/compile_Marc except: From 37ff11dc9dd86f982e7edce1e08933a78f4515d0 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 1 Nov 2020 10:50:03 +0100 Subject: [PATCH 07/10] doxygen not useful anymore --- .gitlab-ci.yml | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 46ae5d1fa..016ba2668 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -75,11 +75,6 @@ variables: MSC: "$MSC2019_1" IntelMarc: "$IntelCompiler17_8" HDF5Marc: "HDF5/1.10.5/Intel-17.8" - # ++++++++++++ Documentation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - Doxygen1_8_17: "Documentation/Doxygen/1.8.17" - # ------------ Defaults ---------------------------------------------- - Doxygen: "$Doxygen1_8_17" - ################################################################################################### checkout: @@ -400,20 +395,10 @@ createTar: - release ################################################################################################### -Marc: +Python: stage: createDocumentation script: - - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen - - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT marc - except: - - master - - release - -GridSolver: - stage: createDocumentation - script: - - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen - - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT grid + - echo 'tbd one matesting1' except: - master - release From 1a010a3973e2b45cb45336232a5549cd4bc76d9a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 1 Nov 2020 10:52:43 +0100 Subject: [PATCH 08/10] better matching name --- .gitlab-ci.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 016ba2668..57fbf04a8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,12 +20,12 @@ stages: ################################################################################################### before_script: - - if [ $(awk "/$CI_PIPELINE_ID/{print NR}" $TESTROOT/GitLabCI.queue)x == 'x' ]; - then echo $CI_PIPELINE_ID >> $TESTROOT/GitLabCI.queue; + - if [ $(awk "/$CI_PIPELINE_ID/{print NR}" $LOCAL_HOME/GitLabCI.queue)x == 'x' ]; + then echo $CI_PIPELINE_ID >> $LOCAL_HOME/GitLabCI.queue; fi - - while [ $(awk "/$CI_PIPELINE_ID/{print NR}" $TESTROOT/GitLabCI.queue) != 1 ]; + - while [ $(awk "/$CI_PIPELINE_ID/{print NR}" $LOCAL_HOME/GitLabCI.queue) != 1 ]; do sleep 5m; - echo -e "Currently queued pipelines:\n$(cat $TESTROOT/GitLabCI.queue)\n"; + echo -e "Currently queued pipelines:\n$(cat $LOCAL_HOME/GitLabCI.queue)\n"; done - source $DAMASKROOT/env/DAMASK.sh - cd $DAMASKROOT/PRIVATE/testing @@ -45,7 +45,7 @@ variables: # =============================================================================================== # Shortcut names # =============================================================================================== - DAMASKROOT: "$TESTROOT/GitLabCI_Pipeline_$CI_PIPELINE_ID/DAMASK" + DAMASKROOT: "$LOCAL_HOME/GitLabCI_Pipeline_$CI_PIPELINE_ID/DAMASK" # =============================================================================================== # Names of module files to load @@ -80,10 +80,10 @@ variables: checkout: stage: prepareAll before_script: - - echo $CI_PIPELINE_ID >> $TESTROOT/GitLabCI.queue - - while [ $(awk "/$CI_PIPELINE_ID/{print NR}" $TESTROOT/GitLabCI.queue) != 1 ]; + - echo $CI_PIPELINE_ID >> $LOCAL_HOME/GitLabCI.queue + - while [ $(awk "/$CI_PIPELINE_ID/{print NR}" $LOCAL_HOME/GitLabCI.queue) != 1 ]; do sleep 5m; - echo -e "Currently queued pipelines:\n$(cat $TESTROOT/GitLabCI.queue)\n"; + echo -e "Currently queued pipelines:\n$(cat $LOCAL_HOME/GitLabCI.queue)\n"; done script: - mkdir -p $DAMASKROOT @@ -376,10 +376,10 @@ SpectralRuntime: - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel - cd $DAMASKROOT - make clean grid processing OPTIMIZATION=AGGRESSIVE - - cd $TESTROOT/performance # location of old results + - cd $LOCAL_HOME/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 + - SpectralAll_runtime/test.py -d $LOCAL_HOME/performance except: - master - release @@ -407,11 +407,11 @@ Python: backupData: stage: saveDocumentation script: - - cd $TESTROOT/performance # location of new runtime results + - cd $LOCAL_HOME/performance # location of new runtime results - git commit -am"${CI_PIPELINE_ID}_${CI_COMMIT_SHA}" - mkdir $BACKUP/${CI_PIPELINE_ID}_${CI_COMMIT_SHA} - - mv $TESTROOT/performance/time.png $BACKUP/${CI_PIPELINE_ID}_${CI_COMMIT_SHA}/ - - mv $TESTROOT/performance/memory.png $BACKUP/${CI_PIPELINE_ID}_${CI_COMMIT_SHA}/ + - mv $LOCAL_HOME/performance/time.png $BACKUP/${CI_PIPELINE_ID}_${CI_COMMIT_SHA}/ + - mv $LOCAL_HOME/performance/memory.png $BACKUP/${CI_PIPELINE_ID}_${CI_COMMIT_SHA}/ - mv $DAMASKROOT/PRIVATE/documenting/DAMASK_* $BACKUP/${CI_PIPELINE_ID}_${CI_COMMIT_SHA}/ only: - development @@ -441,8 +441,8 @@ removeData: before_script: - echo "Removing data and lock of pipeline $CI_PIPELINE_ID" 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 + - rm -rf $LOCAL_HOME/GitLabCI_Pipeline_$CI_PIPELINE_ID + - sed -i "/$CI_PIPELINE_ID/d" $LOCAL_HOME/GitLabCI.queue # in case pipeline was manually (web GUI) restarted and releaseLock was performed already except: - master - release @@ -453,7 +453,7 @@ removeLock: before_script: - echo "Removing lock of pipeline $CI_PIPELINE_ID" when: always - script: sed -i "/$CI_PIPELINE_ID/d" $TESTROOT/GitLabCI.queue + script: sed -i "/$CI_PIPELINE_ID/d" $LOCAL_HOME/GitLabCI.queue except: - master - release From 93faf4f2b3b25f1aaf91ac4450f52d2265d117cb Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 1 Nov 2020 12:58:41 +0100 Subject: [PATCH 09/10] correct folders --- .gitlab-ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 57fbf04a8..5c6d1d6f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,6 +46,7 @@ variables: # Shortcut names # =============================================================================================== DAMASKROOT: "$LOCAL_HOME/GitLabCI_Pipeline_$CI_PIPELINE_ID/DAMASK" + TESTROOT: "$LOCAL_HOME/GitLabCI_Pipeline_$CI_PIPELINE_ID/tests" # =============================================================================================== # Names of module files to load @@ -87,14 +88,13 @@ checkout: done script: - mkdir -p $DAMASKROOT + - mkdir -p $TESTROOT - cd $DAMASKROOT - - if [ -d DAMASK ]; then rm -rf DAMASK; fi # there might be some leftovers from a failed clone - git clone -q git@magit1.mpie.de:damask/DAMASK.git . - git checkout $CI_COMMIT_SHA - git submodule update --init - source env/DAMASK.sh - make processing - - mkdir /tmp/$CI_PIPELINE_ID except: - master - release @@ -104,7 +104,7 @@ Pytest_python: stage: python script: - cd $DAMASKROOT/python - - pytest --basetemp=/tmp/${CI_PIPELINE_ID}/python -v + - pytest --basetemp=${TESTROOT}/python -v except: - master - release @@ -190,7 +190,7 @@ grid_mech_compile_Intel: - cp -r grid_mech_compile grid_mech_compile_Intel - grid_mech_compile_Intel/test.py - cd pytest - - pytest -k 'compile and grid' --basetemp=/tmp/${CI_PIPELINE_ID}/compile_grid_Intel + - pytest -k 'compile and grid' --basetemp=${TESTROOT}/compile_grid_Intel except: - master - release @@ -202,7 +202,7 @@ Compile_FEM_Intel: - cp -r FEM_compile FEM_compile_Intel - FEM_compile_Intel/test.py - cd pytest - - pytest -k 'compile and mesh' --basetemp=/tmp/${CI_PIPELINE_ID}/compile_mesh_Intel + - pytest -k 'compile and mesh' --basetemp=${TESTROOT}/compile_mesh_Intel except: - master - release @@ -214,7 +214,7 @@ grid_mech_compile_GNU: - cp -r grid_mech_compile grid_mech_compile_GNU - grid_mech_compile_GNU/test.py - cd pytest - - pytest -k 'compile and grid' --basetemp=/tmp/${CI_PIPELINE_ID}/compile_grid_GNU + - pytest -k 'compile and grid' --basetemp=${TESTROOT}/compile_grid_GNU except: - master - release @@ -226,7 +226,7 @@ Compile_FEM_GNU: - cp -r FEM_compile FEM_compile_GNU - FEM_compile_GNU/test.py - cd pytest - - pytest -k 'compile and mesh' --basetemp=/tmp/${CI_PIPELINE_ID}/compile_mesh_GNU + - pytest -k 'compile and mesh' --basetemp=${TESTROOT}/compile_mesh_GNU except: - master - release @@ -248,7 +248,7 @@ Pytest_grid: script: - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel - cd pytest - - pytest -k 'not compile' --basetemp=/tmp/${CI_PIPELINE_ID}/fortran -v + - pytest -k 'not compile' --basetemp=${TESTROOT}/fortran -v except: - master - release @@ -310,7 +310,7 @@ Marc_compileIfort: script: - module load $IntelMarc $HDF5Marc $MSC - cd pytest - - pytest -k 'compile and Marc' --basetemp=/tmp/${CI_PIPELINE_ID}/compile_Marc + - pytest -k 'compile and Marc' --basetemp=${TESTROOT}/compile_Marc except: - master - release From 7059e6af6e9f5ecd5835c05adf1c7428cf4d7f86 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 1 Nov 2020 18:34:52 +0100 Subject: [PATCH 10/10] might not be in the last line --- python/damask/solver/_marc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/solver/_marc.py b/python/damask/solver/_marc.py index fb1e12b82..5ddcf8898 100644 --- a/python/damask/solver/_marc.py +++ b/python/damask/solver/_marc.py @@ -82,7 +82,7 @@ class Marc: f.seek(0) try: - v = int(re.search('Exit number ([0-9]+)',f.readlines()[-1]).group(1)) + v = int(re.search('Exit number ([0-9]+)',''.join(f.readlines())).group(1)) except (AttributeError,ValueError): raise RuntimeError('Marc simulation failed (unknown return value)')