libfabric: use the class variable to get the list of fabrics (#49007)

Suggested by: alalazo <alalazo@users.noreply.github.com>

Signed-off-by: Justin Cook <jscook@lbl.gov>
This commit is contained in:
Justin Cook 2025-02-12 07:07:06 -06:00 committed by GitHub
parent 9747978c7f
commit d7f05e08be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -160,9 +160,8 @@ def determine_variants(cls, exes, version):
variants = []
output = Executable(exe)("--list", output=str, error=os.devnull)
# fabrics
fabrics = get_options_from_variant(cls, "fabrics")
used_fabrics = []
for fabric in fabrics:
for fabric in cls.fabrics:
match = re.search(r"^%s:.*\n.*version: (\S+)" % fabric, output, re.MULTILINE)
if match:
used_fabrics.append(fabric)
@ -219,20 +218,3 @@ def configure_args(self):
def installcheck(self):
fi_info = Executable(self.prefix.bin.fi_info)
fi_info()
# This code gets all the fabric names from the variants list
# Idea taken from the AutotoolsPackage source.
def get_options_from_variant(self, name):
values = self.variants[name][0].values
explicit_values = []
if getattr(values, "feature_values", None):
values = values.feature_values
for value in sorted(values):
if hasattr(value, "when"):
if value.when is True:
# Explicitly extract the True value for downstream use
explicit_values.append("{0}".format(value))
else:
explicit_values.append(value)
return explicit_values