From bd67296e8d476d3a310b3bb2f70379c9d0a9dfb5 Mon Sep 17 00:00:00 2001 From: Vitesh Shah Date: Thu, 22 Oct 2020 11:48:06 +0200 Subject: [PATCH 1/5] MARC_VERSION as MSCVERSION --- installation/mods_MarcMentat/apply_DAMASK_modifications.py | 6 +++--- python/damask/_environment.py | 2 +- python/damask/solver/_marc.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/installation/mods_MarcMentat/apply_DAMASK_modifications.py b/installation/mods_MarcMentat/apply_DAMASK_modifications.py index 38a6078b3..ef0001074 100755 --- a/installation/mods_MarcMentat/apply_DAMASK_modifications.py +++ b/installation/mods_MarcMentat/apply_DAMASK_modifications.py @@ -7,7 +7,7 @@ from pathlib import Path import damask -marc_version = float(damask.environment.options['MARC_VERSION']) +marc_version = float(damask.environment.options['MSCVERSION']) if int(marc_version) == marc_version: marc_version = int(marc_version) msc_root = Path(damask.environment.options['MSC_ROOT']) @@ -15,7 +15,7 @@ damask_root = damask.environment.root_dir parser = argparse.ArgumentParser( description='Apply DAMASK modification to MSC.Marc/Mentat', - epilog = f'MSC_ROOT={msc_root} and MARC_VERSION={marc_version} (from {damask_root}/env/CONFIG)') + epilog = f'MSC_ROOT={msc_root} and MSCVERSION={marc_version} (from {damask_root}/env/CONFIG)') parser.add_argument('--editor', dest='editor', metavar='string', default='vi', help='Name of the editor for MSC.Mentat (executable)') @@ -23,7 +23,7 @@ parser.add_argument('--editor', dest='editor', metavar='string', default='vi', def copy_and_replace(in_file,dst): with open(in_file) as f: content = f.read() - content = content.replace('%INSTALLDIR%',msc_root) + content = content.replace('%INSTALLDIR%',str(msc_root)) content = content.replace('%VERSION%',str(marc_version)) content = content.replace('%EDITOR%', parser.parse_args().editor) with open(dst/Path(in_file).name,'w') as f: diff --git a/python/damask/_environment.py b/python/damask/_environment.py index d4b7abe51..d3629de31 100644 --- a/python/damask/_environment.py +++ b/python/damask/_environment.py @@ -32,7 +32,7 @@ class Environment: options = {} for item in ['DAMASK_NUM_THREADS', 'MSC_ROOT', - 'MARC_VERSION', + 'MSCVERSION', ]: options[item] = os.environ[item] if item in os.environ else None diff --git a/python/damask/solver/_marc.py b/python/damask/solver/_marc.py index 12e36f7ed..29e7fe671 100644 --- a/python/damask/solver/_marc.py +++ b/python/damask/solver/_marc.py @@ -8,7 +8,7 @@ from .. import environment class Marc: """Wrapper to run DAMASK with MSCMarc.""" - def __init__(self,version=environment.options['MARC_VERSION']): + def __init__(self,version=environment.options['MSCVERSION']): """ Create a Marc solver object. From 904c338b136660283de355e052cdf1923a1e81d7 Mon Sep 17 00:00:00 2001 From: Vitesh Shah Date: Thu, 29 Oct 2020 15:21:40 +0100 Subject: [PATCH 2/5] Reflect version underscore of installation files --- installation/mods_MarcMentat/apply_DAMASK_modifications.py | 4 ++-- python/damask/_environment.py | 2 +- python/damask/solver/_marc.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/installation/mods_MarcMentat/apply_DAMASK_modifications.py b/installation/mods_MarcMentat/apply_DAMASK_modifications.py index ef0001074..51f5e2312 100755 --- a/installation/mods_MarcMentat/apply_DAMASK_modifications.py +++ b/installation/mods_MarcMentat/apply_DAMASK_modifications.py @@ -7,7 +7,7 @@ from pathlib import Path import damask -marc_version = float(damask.environment.options['MSCVERSION']) +marc_version = float(damask.environment.options['MSC_VERSION']) if int(marc_version) == marc_version: marc_version = int(marc_version) msc_root = Path(damask.environment.options['MSC_ROOT']) @@ -15,7 +15,7 @@ damask_root = damask.environment.root_dir parser = argparse.ArgumentParser( description='Apply DAMASK modification to MSC.Marc/Mentat', - epilog = f'MSC_ROOT={msc_root} and MSCVERSION={marc_version} (from {damask_root}/env/CONFIG)') + epilog = f'MSC_ROOT={msc_root} and MSC_VERSION={marc_version} (from {damask_root}/env/CONFIG)') parser.add_argument('--editor', dest='editor', metavar='string', default='vi', help='Name of the editor for MSC.Mentat (executable)') diff --git a/python/damask/_environment.py b/python/damask/_environment.py index d3629de31..9983a91aa 100644 --- a/python/damask/_environment.py +++ b/python/damask/_environment.py @@ -32,7 +32,7 @@ class Environment: options = {} for item in ['DAMASK_NUM_THREADS', 'MSC_ROOT', - 'MSCVERSION', + 'MSC_VERSION', ]: options[item] = os.environ[item] if item in os.environ else None diff --git a/python/damask/solver/_marc.py b/python/damask/solver/_marc.py index 29e7fe671..e37a46488 100644 --- a/python/damask/solver/_marc.py +++ b/python/damask/solver/_marc.py @@ -8,7 +8,7 @@ from .. import environment class Marc: """Wrapper to run DAMASK with MSCMarc.""" - def __init__(self,version=environment.options['MSCVERSION']): + def __init__(self,version=environment.options['MSC_VERSION']): """ Create a Marc solver object. From 680799ae5a213442a2f3fdc63cc23711f90d5316 Mon Sep 17 00:00:00 2001 From: Vitesh Shah Date: Thu, 29 Oct 2020 16:19:11 +0100 Subject: [PATCH 3/5] updated private --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index 1e8c66897..e02d78d1a 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 1e8c66897820468ab46958d995005e2b69204d0e +Subproject commit e02d78d1ad4bef7a85c8895c97cb78871e8faad2 From 8e68b4f5d38071db42d1653c6f65fa53a36fd476 Mon Sep 17 00:00:00 2001 From: Vitesh Shah Date: Fri, 30 Oct 2020 11:46:15 +0100 Subject: [PATCH 4/5] environment should adhere to MSC_VERSION naming --- env/CONFIG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/env/CONFIG b/env/CONFIG index 380197583..5d92af7fa 100644 --- a/env/CONFIG +++ b/env/CONFIG @@ -2,4 +2,4 @@ set DAMASK_NUM_THREADS = 4 set MSC_ROOT = /opt/msc -set MARC_VERSION = 2019.1 +set MSC_VERSION = 2019.1 From 9fa0528b85449197a375cf63f6e3c9122e25361a Mon Sep 17 00:00:00 2001 From: Vitesh Shah Date: Fri, 30 Oct 2020 11:56:37 +0100 Subject: [PATCH 5/5] More tests in PRIVATE using MSC_VERSION --- PRIVATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index e02d78d1a..e0cee6bda 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit e02d78d1ad4bef7a85c8895c97cb78871e8faad2 +Subproject commit e0cee6bda1e3819563618113f5a46ae6ccaf026b