58 path2src=os.path.join(__mcd_core_path,
"src"),
59 path2feature=os.path.join(__mcd_core_path,
"solver"),
61 files=VTL.GetSourceCode(0),
63 source_file=
"mcd_astandard.f",
65 version=
"abq2019", makeopt=0,
69 dependency=posixpath.join(Utility.AsDrive(
"cluster",posixpath.sep),
"software",
"mcodac",
"stable"), verbosity=2,
71 host=
"129.247.54.37", port=22,
75 Main function to execute the script.
78 print(
'==================================')
79 print(
'Starting build process on the institute cluster')
80 print(
'==================================')
83 pyx_comp = VTL.GetBuildCommand(5)
87 pyx_make = posixpath.join(Utility.AsDrive(
"cluster",posixpath.sep),
"software",
"abaqus",
"Commands", version)
88 pyx_post =
"function ifort() { $pyx_ifort $@ \
89 -O2 -fpe0 -traceback -recursive -qopenmp -DDEBUG -DCLUSTER -lmcd_corex64; } && \
90 export -f ifort; rm -f *.so; rm -f *.o; "+ pyx_make +
" make -library pyx_file"
92 pyx_make = posixpath.join(Utility.AsDrive(
"cluster",posixpath.sep),
"software",
"ansys_inc",version,
"ansys")
93 pyx_post =
"export ANS_PATH="+pyx_make+
" && \
94 export FPATH=$FPATH:$ANS_PATH/customize/include && \
95 export CPATH=$CPATH:$ANS_PATH/customize/include && \
96 function fcomp() { $pyx_ifort \
97 -w -c -fpp -openmp -fpic -O2 -ftz \
99 -module ./ -DLINX64_SYS -DLINUXEM64T_SYS -DFORTRAN -DOPENMP\
100 -DCADOE_SOLVER -DDEBUG -DCLUSTER $@; } && \
101 function flink() { $pyx_ifort \
102 -shared -Xlinker -relax -Xlinker \
103 --whole-archive userlib.a -Xlinker --no-whole-archive \
104 -o libansuser.so -Xlinker -soname=libansuser.so $@; } && \
105 source $ANS_PATH/bin/anssh.ini; \
106 rm -f *.o; rm -f *.so; \
107 fcomp pyx_file.f && wait; \
108 ar -qc userlib.a *.o && flink -lmcd_corex64; rm -f *.a; rm -f *.o; "
112 dependency = posixpath.join(Utility.AsDrive(
"home",posixpath.sep),user,
"mcodac")
114 pyx_post =
"function ifort() { $pyx_ifort $@ \
115 -O2 -fpe0 -traceback -recursive -qopenmp -DDEBUG -DCLUSTER -lmcd_corex64; } && \
116 export -f ifort; "+
'export abaquslm_license_file="27018@abaqussd1.intra.dlr.de"'+
"; rm -f *.so; rm -f *.o; "+ pyx_make +
" make -library pyx_file"
119 pyx_comp = VTL.GetBuildCommand(makeopt)
121 pyx_post =
"mv --force Peridigm " + posixpath.join(Utility.AsDrive(
"home",posixpath.sep),user,
"mcodac",
"bin") +
" && rm -f pyx_file.f"
123 raise NotImplementedError
126 outpath = posixpath.join(Utility.AsDrive(
"home",posixpath.sep),user)
127 libpath = posixpath.join(dependency,
"lib"); incpath = posixpath.join(dependency,
"include")
128 includes = [outpath, [posixpath.join(incpath, x)
for x
in VTL.GetIncludeDirectory(__mcd_core_path, 0, 4,
"x64")]]
129 libs = [posixpath.join(libpath,
"libinterpx64.a"), posixpath.join(libpath,
"libmueslix64.a"),
130 posixpath.join(libpath,
"libpchipx64.a"), posixpath.join(libpath,
"libbbeamx64.a"),
131 posixpath.join(libpath,
"libdispmodulex64.a")]
134 SSHBuild = pyx.SSH(BuildID, files, scratch=scratch, verbose=verbosity)
137 print(
'==================================')
138 print(
'Establishing SSH connection.')
139 print(
'==================================')
140 SSHBuild.Settings(user, key, host, port, **kwargs)
141 SSH = SSHBuild.ssh_client.open_sftp()
142 if not source_file.endswith(
".zip"):
143 SSH.put(os.path.join(path2feature,source_file),
"pyx_file.f")
145 SSH.put(os.path.join(path2feature,source_file),source_file)
149 SSHBuild.SourcePath(path2src)
150 SSHBuild.AddIncludePath(includes)
151 SSHBuild.AddDependencyPath(outpath)
154 SSHBuild.Environment(posixpath.join(Utility.AsDrive(
"cluster",posixpath.sep),
"software",
"slurm",
"etc",
"env.d"),
"ifort2016.sh")
157 SSHBuild.Environment(bash=VTL.GetEnvironment(4)[0])
160 SSHBuild.Environment(posixpath.join(Utility.AsDrive(
"cluster",posixpath.sep),
"software",
"slurm",
"etc",
"env.d"),
"mpibuild.sh")
161 SSHBuild.Environment(posixpath.join(Utility.AsDrive(
"cluster",posixpath.sep),
"software",
"slurm",
"etc",
"env.d"),
"peridigm.sh")
162 SSHBuild.Build(pyx_comp,run=
"custom");
165 SSHBuild.Preprocessing(inend=
'.for', outend=
'.f90')
166 SSHBuild.Build(pyx_comp, linkedIn=libs)
167 SSHBuild.OutputPath(outpath)
168 SSHBuild.Postprocessing(pyx_post)
207 main(BuildID,user,key,path2src=os.getcwd(),files=os.listdir(os.getcwd())[0], scratch=os.getcwd(), makeopt=7)
218 main(BuildID,user,key,path2src,path2feature,version=
"abaqus",makeopt=2)
main(BuildID, user, key, path2src=os.path.join(__mcd_core_path,"src"), path2feature=os.path.join(__mcd_core_path,"solver"), files=VTL.GetSourceCode(0), source_file="mcd_astandard.f", version="abq2019", makeopt=0, scratch=VTL.Scratch, dependency=posixpath.join(Utility.AsDrive("cluster", posixpath.sep),"software","mcodac","stable"), verbosity=2, host="129.247.54.37", port=22, **kwargs)