openfoam-org: zoltan renumbering and decompsition (#39915)

This commit is contained in:
kjrstory 2023-09-11 23:42:50 +09:00 committed by GitHub
parent e99750fd3c
commit 19f8e9147d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,6 +88,7 @@ class OpenfoamOrg(Package):
)
variant("metis", default=False, description="With metis decomposition")
variant("scotch", default=True, description="With scotch/ptscotch decomposition")
variant("zoltan", default=False, description="Enable Zoltan renumbering and decomposition")
variant(
"precision",
default="dp",
@ -104,6 +105,7 @@ class OpenfoamOrg(Package):
# Require scotch with ptscotch - corresponds to standard OpenFOAM setup
depends_on("scotch~metis+mpi~int64", when="+scotch~int64")
depends_on("scotch~metis+mpi+int64", when="+scotch+int64")
depends_on("zoltan+shared", when="+zoltan")
depends_on("metis@5:", when="+metis")
depends_on("metis+int64", when="+metis+int64")
@ -260,6 +262,13 @@ def patch(self):
rewrite_environ_files( # Adjust etc/bashrc and etc/cshrc
edits, posix=join_path("etc", "bashrc"), cshell=join_path("etc", "cshrc")
)
if self.spec.satisfies("@10:") and "+zoltan" in self.spec:
filter_file("libzoltan.a", "libzoltan.so", join_path("src", "renumber", "Allwmake"))
filter_file(
"libzoltan.a",
"libzoltan.so",
join_path("src", "parallel", "decompose", "Allwmake"),
)
def configure(self, spec, prefix):
"""Make adjustments to the OpenFOAM configuration files in their various
@ -289,6 +298,7 @@ def configure(self, spec, prefix):
self.etc_config = {
"CGAL": {},
"scotch": {},
"zoltan": {},
"metis": {},
"paraview": [],
"gperftools": [], # Currently unused
@ -301,6 +311,16 @@ def configure(self, spec, prefix):
"SCOTCH_VERSION": "scotch-{0}".format(spec["scotch"].version),
}
if "+zoltan" in spec:
if spec.satisfies("@:9"):
self.etc_prefs["ZOLTAN_ARCH_PATH"] = spec["zoltan"].prefix
self.etc_prefs["ZOLTAN_VERSION"] = "Zoltan-{0}".format(spec["zoltan"].version)
else:
self.etc_config["zoltan"] = {
"ZOLTAN_ARCH_PATH": spec["zoltan"].prefix,
"ZOLTAN_VERSION": "Zoltan-{0}".format(spec["zoltan"].version),
}
if "+metis" in spec:
self.etc_config["metis"] = {"METIS_ARCH_PATH": spec["metis"].prefix}