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/single node check #500

Draft
wants to merge 21 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion experiments/amg2023/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def compute_applications_section(self):
"strong": self.spec.satisfies("+strong"),
"weak": self.spec.satisfies("+weak"),
"throughput": self.spec.satisfies("+throughput"),
"single_node": self.spec.satisfies("+single_node"),
}

scaling_mode_enabled = [key for key, value in scaling_modes.items() if value]
Expand Down
1 change: 0 additions & 1 deletion experiments/ior/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def compute_applications_section(self):
scaling_modes = {
"strong": self.spec.satisfies("+strong"),
"weak": self.spec.satisfies("+weak"),
"single_node": self.spec.satisfies("+single_node"),
}

scaling_mode_enabled = [key for key, value in scaling_modes.items() if value]
Expand Down
1 change: 0 additions & 1 deletion experiments/kripke/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def compute_applications_section(self):
"strong": self.spec.satisfies("+strong"),
"weak": self.spec.satisfies("+weak"),
"throughput": self.spec.satisfies("+throughput"),
"single_node": self.spec.satisfies("+single_node"),
}

scaling_mode_enabled = [key for key, value in scaling_modes.items() if value]
Expand Down
12 changes: 0 additions & 12 deletions experiments/laghos/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,6 @@ class Laghos(
)

def compute_applications_section(self):
# TODO: Replace with conflicts clause
scaling_modes = {
"strong": self.spec.satisfies("+strong"),
"single_node": self.spec.satisfies("+single_node"),
}

scaling_mode_enabled = [key for key, value in scaling_modes.items() if value]
if len(scaling_mode_enabled) != 1:
raise BenchparkError(
f"Only one type of scaling per experiment is allowed for application package {self.name}"
)

# Number of initial nodes
num_nodes = {"n_nodes": 1}

Expand Down
13 changes: 0 additions & 13 deletions experiments/remhos/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,6 @@ class Remhos(
)

def compute_applications_section(self):
# TODO: Replace with conflicts clause
scaling_modes = {
"strong": self.spec.satisfies("+strong"),
"single_node": self.spec.satisfies("+single_node"),
}

scaling_mode_enabled = [key for key, value in scaling_modes.items() if value]
if len(scaling_mode_enabled) != 1:
print(scaling_mode_enabled)
raise BenchparkError(
f"Only one type of scaling per experiment is allowed for application package {self.name}"
)

# Number of initial nodes
num_nodes = {"n_nodes": 1}

Expand Down
7 changes: 7 additions & 0 deletions lib/benchpark/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ class SingleNode:
description="Single node execution mode",
)

def run_single_node_expr(self):
return 1 if self.spec.satisfies("+single_node") else 0

class Helper(ExperimentHelper):
def get_helper_name_prefix(self):
return "single_node" if self.spec.satisfies("+single_node") else ""
Expand Down Expand Up @@ -172,6 +175,10 @@ def compute_applications_section_wrapper(self):

self.compute_applications_section()

self.add_experiment_variable(
"run_single_node_expr", self.run_single_node_expr()
)

expr_helper_list = []
for cls in self.helpers:
helper_prefix = cls.get_helper_name_prefix()
Expand Down
8 changes: 8 additions & 0 deletions modifiers/allocation/modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class AllocOpt(Enum):
POST_EXEC_CMDS = 302
PRE_EXEC_CMDS = 303

RUN_SINGLE_NODE_EXPR = 666

@staticmethod
def as_type(enumval, input):
if enumval in [
Expand Down Expand Up @@ -291,6 +293,12 @@ def determine_allocation(self, v):
)
v.n_nodes = max(cores_node_request or 0, gpus_node_request or 0)

if v.run_single_node_expr and v.n_nodes > 1:
raise ValueError(
f"Experiment must run on 1 node. Requested {v.n_nodes} nodes"
)


scheibelp marked this conversation as resolved.
Show resolved Hide resolved
if not v.n_threads_per_proc:
v.n_threads_per_proc = 1

Expand Down
Loading