Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/variant helpers #404

Draft
wants to merge 68 commits into
base: develop
Choose a base branch
from
Draft

Feature/variant helpers #404

wants to merge 68 commits into from

Conversation

rfhaque
Copy link
Collaborator

@rfhaque rfhaque commented Oct 20, 2024

Merge #356 first. Closes #400.

Programming model and modifier.

alecbcs and others added 30 commits August 21, 2024 17:14
@rfhaque rfhaque requested a review from pearce8 October 20, 2024 09:06
@github-actions github-actions bot added experiment New or modified experiment application New or modified application labels Oct 20, 2024
@github-actions github-actions bot added the ci Involving Project CI & Unit Tests label Oct 22, 2024
Comment on lines 154 to 196
def compute_applications_section_wrapper(self):
self.expr_name = []
self.variables = {}
self.zips = {}
self.matrix = []
self.excludes = []

self.compute_applications_section()

expr_name_list = [self.name, self.workload]
for cls in self.helpers:
helper_prefix = cls.get_helper_name_prefix()
if helper_prefix:
expr_name_list.append(helper_prefix)
expr_name = "_".join(expr_name_list + self.expr_name)

return {
self.name: {
"workloads": {
self.workload: {
"experiments": {
expr_name: {
"variants": {"package_manager": "spack"},
"variables": self.variables,
"zips": self.zips,
"matrix": self.matrix,
"exclude": {"where" : self.excludes} if self.excludes else {},
}
}
}
}
}
}

def add_spack_spec(self, package_name, spec=None):
if spec:
self.package_specs[package_name] = {
"pkg_spec": spec[0],
"compiler": spec[1],
}
else:
self.package_specs[package_name] = {}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scheibelp @pearce8 Refactored lib/experiment.py to remove much of the boilerplate code from the application experiment.py

Comment on lines 202 to 225
def compute_spack_section_wrapper(self):
for cls in self.helpers:
cls_package_specs = cls.compute_spack_section()
if (
cls_package_specs
and "packages" in cls_package_specs
):
self.package_specs |= cls_package_specs["packages"]

self.compute_spack_section()

if not self.name in self.package_specs:
raise BenchparkError(
f"Spack section must be defined for application package {self.name}"
)

spack_variants = [cls.get_spack_variants() for cls in self.helpers]
self.package_specs[self.name]["pkg_spec"] += " ".join(spack_variants+list(self.spec.variants["extra_spack_specs"])).strip()

return {
"packages": {k: v for k, v in self.package_specs.items() if v},
"environments": {self.name: {"packages": list(self.package_specs.keys())}},
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scheibelp @pearce8 Refactored lib/experiment.py to remove much of the boilerplate code from the application experiment.py

Comment on lines +232 to +234
"modifiers": self.compute_modifiers_section_wrapper(),
"applications": self.compute_applications_section_wrapper(),
"software": self.compute_spack_section_wrapper(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scheibelp @pearce8 Refactored lib/experiment.py to remove much of the boilerplate code from the application experiment.py

Comment on lines +68 to +70
self.add_experiment_variable("px", p, True)
self.add_experiment_variable("py", p, True)
self.add_experiment_variable("pz", p, True)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scheibelp @pearce8 The application can use an API to set experiment variables and other constructs

@github-actions github-actions bot added the configs New or modified system config label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
application New or modified application ci Involving Project CI & Unit Tests configs New or modified system config experiment New or modified experiment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants