6 Module containing virtual testing & benchmark scripts. 12 ---------------------------------------------------------------------------------------------- 19 @author: garb_ma [DLR-FA,STM Braunschweig] 20 ---------------------------------------------------------------------------------------------- 33 import os, sys, platform
36 from ..Tools
import Utility
39 Scratch = os.path.join(os.path.dirname(os.path.abspath(__file__)),
"scratch")
43 Get a list of source codes files associated with the build of MCODAC, BoxBeam or BEOS. 45 @param: key_opt: An integer value representing the source code files. 46 @type: key_opt: integer 49 mcd_src_files = [
"mcd_data",
"mcd_error",
"mcd_plugins",
"mcd_tools",
"mcd_contact",
"mcd_material",
50 "mcd_load",
"mcd_element",
"mcd_subbuckling",
"mcd_dmginitiation",
51 "mcd_dmgevolution",
"mcd_fracture",
"mcd_dmginfluence",
"mcd_degradation",
52 "mcd_dg8",
"mcd_iostream",
"mcd_fatigue",
"mcd_prony",
"mcd_wrapper",
53 "mcd_toplevel",
"mcd_main"]
56 box_src_files = [
"box_data",
"box_tools",
"box_main"]
59 beos_src_files = [
"Main.f90",
"BEOSMain.for",
"A11xst.for",
"A11yst.for",
"A21ast.for",
"A22ast.for",
"ABDetc.for",
60 "BmtstN.for",
"BuVi.for",
"Chneig.for",
"Chodec.for",
"Chosol.for",
"Cktype.for",
"Cmpa11.for",
"Cmpa21.for",
61 "Cmpa22.for",
"Cmpbmt.for",
"Cmpmmt.for",
"Cntr.for",
"CripplingO.for",
"CripplingT.for",
"EIGVPR.FOR",
62 "F01kbf.for",
"F01KTF.FOR",
"GlBuck.for",
"Incs2.for",
"Incs3N.for",
"Iuoriv3.for",
"JACOB2.FOR",
"Kuorkv2.for",
63 "Lqfit95.for",
"MKLVBD.F90",
"Mmtst.for",
"Modes.for",
"Phi.for",
"Plotmesh.for",
"PPROBTM95.for",
"Prtout.for",
64 "Prtvib.for",
"PRTYPE.FOR",
"RddataN-Ak.for",
"Rdtype.for",
"Redfkq.for",
"Setkey_2.for",
"SIMVT2003.FOR",
65 "TCZINC.FOR",
"Tfmstf.for",
"TMINC.FOR",
"Trnpsi.for",
"Vibs2.for",
"Vibs3NN.for",
"#PRAMS"]
68 muesli_src_files = [
"material.cpp",
"tensor.cpp",
"brownmiller.cpp",
"jcfailure.cpp",
"arrheniustype.cpp",
"arrudaboyce.cpp",
69 "finitestrain.cpp",
"fisotropic.cpp",
"fplastic.cpp",
"johnsoncook.cpp",
"mooney.cpp",
"neohook.cpp",
"reducedfinitestrain.cpp",
70 "svk.cpp",
"yeoh.cpp",
"zerilliarmstrong.cpp",
"fluid.cpp",
"newtonian.cpp",
"thermofinitestrain.cpp",
71 "fmechmass.cpp",
"interface_abaqus.cpp",
"interface_lsdyna.cpp",
"mtensor.cpp",
"mmatrix.cpp",
72 "mrealvector.cpp",
"smallstrain.cpp",
"elastic.cpp",
"reducedsmallstrain.cpp",
"sdamage.cpp",
"splastic.cpp",
73 "viscoelastic.cpp",
"viscoplastic.cpp",
"smallthermo.cpp",
"conductor.cpp",
"utils.cpp"]
76 compdam_src_files = [
"vumatArgs.for",
"version.for.nogit",
"forlog.for",
"matrixUtil.for",
"matProp.for",
"stateVar.for",
"parameters.for",
"schapery.for",
77 "stress.for",
"strain.for",
"schaefer.for",
"plasticity.for",
"fiberDamage.for",
"friction.for",
"cohesive.for",
"DGD.for"]
81 dispmod_src_files = [
"dispmodule.f90",
"disp_i1mod.f90",
"disp_i2mod.f90",
"disp_i4mod.f90",
"disp_i8mod.f90",
"disp_l1mod.f90",
"disp_r16mod.f90"]
84 toms_src_files = [
"toms790.f",
"toms661.f90"]
87 misc_src_files =[
"nms.f90",
"pchip.f90",
"slatec.f90",
"interp.f90"]
90 pyc_src_files = [
"__exe__.py"]
94 source = mcd_src_files
96 source = box_src_files
98 source = beos_src_files
100 source = muesli_src_files
102 source = compdam_src_files
104 source = dispmod_src_files
106 source = toms_src_files
108 source = misc_src_files
110 source = pyc_src_files
112 raise NotImplementedError
118 Return the recommended command line during the build process for selected make operations. 120 @param: make_opt: An integer value representing the make operation. 121 @type: make_opt: integer 124 win_java_command =
"-nologo -O3 -Qopenmp -Qauto_scalar -Qparallel -Qmkl:parallel -Qopt-matmul -fpp -recursive \ 125 -reentrancy:threaded -"+_format+
" -extend_source:132 -fpe:0 -heap-arrays1 -iface:cref -libs:static -threads -MT -W1" 128 win_fortran_command =
"-nologo -O3 -QxSSE3 -Qopenmp -Qauto_scalar -Qparallel -Qmkl:parallel -Qopt-matmul -fpp -recursive \ 129 -reentrancy:threaded -"+_format+
" -extend_source:132 -fpe:0 -traceback -heap-arrays1 -iface:cref -libs:dll -threads -MD -W1" 132 win_cxx_command =
"-nologo -Os -W0 -MD -TP -EHsc -Qpar -clr:nostdlib -fp:precise -std:c++latest " 133 win_cxx_command +=
"-FI pyx_muesli_def.h " 134 win_cxx_command +=
"-FI algorithm -FI ctime " 135 win_cxx_command +=
"-FI pyx_muesli_undef.h " 138 win_pyd_command =
' -DNO_APPEND_FORTRAN ' 139 win_pyd_command +=
' --f90flags="-'+_format+
' -fpe:0 -fp:precise -threads -recursive -Qauto-scalar -Qopenmp -Qmkl:parallel -heap-arrays:1" ' 140 win_pyd_command +=
' --opt="-O2" --arch="-QaxSSE3 /assume:nounderscore" --quiet --compiler=msvc ' 143 lin_pyd_command =
'--quiet --fcompiler=intelem --opt="-O2" --f90flags="-'+_format+
' -fp-model precise -fpe0 -recursive -parallel -auto -qopenmp -qopt-matmul -mkl:parallel"' 146 lin_fortran_command =
"-fpp -qopenmp -DCLUSTER -DDEBUG -DUSE_MUESLI -fPIC -auto -mkl:parallel -extend_source -O2 -"+_format+
" -parallel -fpe0 -traceback -recursive" 149 win_abq_command =
"ECHO import os >> %ABQ_ENV_FILE% " 150 win_abq_command +=
"&& ECHO usub_lib_dir=os.getcwd() >> %ABQ_ENV_FILE% " 151 win_abq_command +=
"&& ( " 152 win_abq_command +=
"ECHO compile_fortran=['ifort', " 153 win_abq_command +=
"'/c','/DABQ_WIN86_64', '/extend-source', '/fpp', " 154 win_abq_command +=
"'/iface:cref', '/recursive', " 155 win_abq_command +=
"'/QxSSE3', '/QaxAVX', '/heap-arrays:1', " 156 win_abq_command +=
"'/O3', " 157 win_abq_command +=
"'/MD', " 158 win_abq_command +=
"'/Qparallel', " 159 win_abq_command +=
"'/fpe:0', " 160 win_abq_command +=
"'/traceback', " 161 win_abq_command +=
"'/Qmkl:parallel', " 162 win_abq_command +=
"'/Qopt-matmul', " 163 win_abq_command +=
"'/libs:dll', " 164 win_abq_command +=
"'/threads', " 165 win_abq_command +=
"'/reentrancy:threaded', " 166 win_abq_command +=
"'/Qopenmp', " 168 if sys.getwindowsversion() >= (10, 0, 0):
170 win_abq_command +=
"'/DABQ_FORTRAN', " 171 win_abq_command +=
"'/Qauto', " 172 win_abq_command +=
"'/align:array64byte', " 173 win_abq_command +=
"'/Qpc64', " 174 win_abq_command +=
"'/Qprec-div', '/Qprec-sqrt', " 175 win_abq_command +=
"'/Qfma-', " 176 win_abq_command +=
"'/fp:precise', " 177 win_abq_command +=
"'/Qimf-arch-consistency:true', " 178 win_abq_command +=
"'/Qfp-speculation:safe', " 179 win_abq_command +=
"'/Qprotect-parens', " 180 win_abq_command +=
"'/Qfp-stack-check', " 183 win_abq_command +=
"'/Qauto-scalar', " 199 win_abq_command +=
"'/include:%I'] ) >> %ABQ_ENV_FILE% " 200 win_abq_command +=
"&& ( " 201 win_abq_command +=
"ECHO link_sl=['LINK', '/nologo', '/NOENTRY', '/INCREMENTAL:NO', '/subsystem:console', '/machine:AMD64', " 202 win_abq_command +=
"'/NODEFAULTLIB:LIBC.LIB', '/NODEFAULTLIB:LIBCMT.LIB', " 203 win_abq_command +=
"'/DEFAULTLIB:OLDNAMES.LIB', '/DEFAULTLIB:LIBIFCOREMD.LIB', '/DEFAULTLIB:LIBIFPORTMD.LIB', '/DEFAULTLIB:LIBMMD.LIB', " 204 win_abq_command +=
"'/DEFAULTLIB:kernel32.lib', '/DEFAULTLIB:user32.lib', '/DEFAULTLIB:advapi32.lib', " 205 win_abq_command +=
"'/FIXED:NO', '/dll', " 208 win_abq_command +=
"'/def:%E', '/out:%U', '%F', '%A', '%L', '%B', " 210 win_abq_command +=
"r'/def:"+os.getenv("pyx_abaqus_def","%E")+"', '/INCLUDE:_DllMainCRTStartup', '/FORCE', "
211 win_abq_command +=
"'oldnames.lib', 'user32.lib', 'ws2_32.lib', 'netapi32.lib', 'advapi32.lib', " 212 win_abq_command +=
"%pyx_libs%] ) >> %ABQ_ENV_FILE% " 213 win_abq_command +=
'&& %pyx_abaqus% make -library %pyx_file%' 218 win_pyd_command +=
" --fcompiler=intelv" 220 elif (
'x64' in _arch):
222 win_pyd_command +=
" --fcompiler=intelvem" 225 command = win_pyd_command
227 command = win_java_command
229 command = win_fortran_command
231 command = win_cxx_command
233 command = lin_pyd_command
235 command = lin_fortran_command
238 command = win_abq_command
240 raise NotImplementedError
246 Return all mandatory include directories for the requested make operation in dependence of key_opt. 248 @param: key_opt, make_opt: [An integer value representing the source code file (e.g. MCODAC, BoxBeam, BEOS), 249 An integer value representing the make operation.] 250 @type: key_opt, make_opt: integer 253 if key_opt == 0
and make_opt
in range(6):
255 inc = list(Utility.PathWalk(os.path.join(base_path,
"include",Utility.GetPlatform(),architecture),
True, startswith=(
".",
"__")))[0][1]
260 if os.path.exists(base_path):
261 sys.path.append(base_path)
268 __occ_name = OCC.__name__
269 __pyc_name = PyCODAC.__name__
271 __occ_src_path = OCC.__path__[0]
272 __pyc_src_path = PyCODAC.PyCODACPath
275 __occ_name =
""; __occ_src_path =
"" 276 __pyc_name =
""; __pyc_src_path =
"" 279 inc = [
"six.py",
"ipykernel_launcher.py",
281 os.path.pathsep.join([__occ_src_path,os.path.join(__occ_name,
".")]),
283 os.path.join(__pyc_name,
"__init__.py"),
284 os.path.join(__pyc_name,
"Paths.log"),
285 os.path.join(__pyc_name,
"Tools",
"__init__.py"),
286 os.path.join(__pyc_name,
"Tools",
"Utility.py"),
287 os.path.join(__pyc_name,
"Core",
"cmd"),
289 os.path.join(__pyc_name,
"Core",
"bin",Utility.GetPlatform(),architecture),
290 os.path.join(__pyc_name,
"Study",
"bin",architecture),
291 os.path.join(__pyc_name,
"Study",
"cmd",Utility.GetPlatform()),
293 os.path.join(__pyc_name,
"Plugin",
"JupyterLab",
"bin", Utility.GetPlatform()),
294 os.path.pathsep.join([os.path.join(__pyc_src_path,
"Plugin",
"JupyterLab",
"config",
"jupyter_notebook_utils.py"),
"."]),
295 os.path.pathsep.join([os.path.join(__pyc_src_path,
"Plugin",
"JupyterLab",
"config"),os.path.join(__pyc_name,
"Plugin",
"JupyterLab",
"config",
".")]),
297 os.path.join(__pyc_name,
"Plugin",
"Smetana",
"config",
"pyc_smetana.config"),
298 os.path.pathsep.join([os.path.join(__pyc_src_path,
"Plugin",
"Smetana",
"src",
"smetana",
"static",
"abaqus_msa_reports.py"),os.path.join(
"static",
".")]),
300 os.path.pathsep.join([os.path.join(__pyc_src_path,
"GUI",
"res",
"pyc_lab_icon.png"), os.path.join(__pyc_name,
"GUI",
"res",
".")]),
301 os.path.pathsep.join([os.path.join(__pyc_src_path,
"GUI",
"res",
"pyc_dic_analysis.png"),os.path.join(__pyc_name,
"GUI",
"res",
".")]),
302 os.path.pathsep.join([os.path.join(__pyc_src_path,
"GUI",
"res",
"stm_lab_icon.png"), os.path.join(__pyc_name,
"GUI",
"res",
".")]),
303 os.path.pathsep.join([os.path.join(__pyc_src_path,
"GUI",
"res",
"stm_main.png"),os.path.join(__pyc_name,
"GUI",
"res",
".")]),
304 os.path.pathsep.join([os.path.join(__pyc_src_path,
"GUI",
"res",
"stm_lightweight.png"),os.path.join(__pyc_name,
"GUI",
"res",
".")]),
305 os.path.pathsep.join([os.path.join(__pyc_src_path,
"GUI",
"res",
"stm_vph.png"), os.path.join(__pyc_name,
"GUI",
"res",
".")])]
312 Return all mandatory external libraries for the requested make operation in dependence of key_opt. 314 @param: key_opt, make_opt: [An integer value representing the source code file (e.g. MCODAC, BoxBeam, BEOS), 315 An integer value representing the make operation.] 316 @type: key_opt, make_opt: integer 319 if key_opt == 0
and make_opt
in range(6):
320 lib = [x + architecture
for x
in [
"interp",
"pchip",
"bbeam",
"muesli",
"dispmodule",
"toms"]]
327 __pyc_src_path = PyCODAC.PyCODACPath
333 lib = [os.path.join(__pyc_src_path,
"Plugin",
"DELiS",
"src"),os.path.join(__pyc_src_path,
"Plugin",
"Smetana"),
334 os.path.join(__pyc_src_path,
"Plugin",
"Smetana",
"src",
"smetana")]
341 Return predefined source environment to initiate a build process. 343 @param: env_opt An integer value representing a predefined environment 344 @type: env_opt: integer 348 env = [posixpath.join(Utility.AsDrive(
"cluster",posixpath.sep),
"software",
"slurm",
"etc",
"env.d",
"ifort2016.sh")]
351 env = [posixpath.join(Utility.AsDrive(
"cluster",posixpath.sep),
"software",
"slurm",
"etc",
"env.d",
"ifort2016.sh"),
352 posixpath.join(Utility.AsDrive(
"cluster",posixpath.sep),
"software",
"python2.7",
"env.sh")],
355 env = [posixpath.join(Utility.AsDrive(
"cluster",posixpath.sep),
"software",
"slurm",
"etc",
"env.d",
"ifort2016.sh"),
356 posixpath.join(Utility.AsDrive(
"cluster",posixpath.sep),
"software",
"python3.5",
"env.sh")],
359 env = [posixpath.join(Utility.AsDrive(
"cluster",posixpath.sep),
"software",
"slurm",
"etc",
"env.d",
"ifort2016.sh"),
360 posixpath.join(Utility.AsDrive(
"cluster",posixpath.sep),
"software",
"mcodac",
"anaconda",
"envs",
"Conda36",
"env.sh")],
362 raise NotImplementedError
368 from .doxygen
import main
as doxygen
369 from .sphinx
import main
as sphinx
371 if sys.version_info >= (3,6):
372 from .api
import main
as api
374 from .app
import main
as app
375 from .bundle
import main
as bundle
377 from .abaqus
import main
as abaqus
378 from .ifort
import main
as ifort
379 from .java
import main
as java
380 from .py2x
import main
as py2x
381 from .cxx
import main
as cxx
383 from .ssh_ifort
import main
as ssh_ifort
384 from .ssh_f2py
import main
as ssh_f2py
385 from .ssh_make
import main
as ssh_make
389 if __name__ ==
'__main__':
def GetBuildCommand(make_opt=0, _format="fixed", _arch=Utility.GetArchitecture())
def GetSourceCode(key_opt=0)
def GetEnvironment(env_opt=0)
def GetIncludeDirectory(base_path, key_opt=0, make_opt=0, architecture="x64")
def GetLinkDependency(key_opt=0, make_opt=0, architecture="x64")