Skip to content

Commit eec964d

Browse files
author
Taina Coleman
committed
Fixes percentage checks
1 parent c63d001 commit eec964d

2 files changed

Lines changed: 3 additions & 17 deletions

File tree

wfcommons/wfperf/perf.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ def __init__(self, Recipe: Type[WorkflowRecipe], num_tasks: int) -> None:
1616

1717
def create(self,
1818
save_dir: pathlib.Path,
19-
cpu: int = 50,
20-
mem: int = 50,
19+
percent_cpu: float = 0.5,
2120
data_footprint: int = 100,
2221
test_mode: str = "seqwr",
2322
mem_total_size: str = "1000000G",
@@ -30,9 +29,6 @@ def create(self,
3029
threads: int = 2, #cpu threads
3130
verbose: bool = False) -> Dict:
3231

33-
self.check_percent(cpu, mem)
34-
cpu_threads= cpu/10
35-
mem_threads= mem/10
3632

3733
if verbose:
3834
print("Checking if the sysbench is installed.")
@@ -61,9 +57,8 @@ def create(self,
6157
f"--memory-block-size={block_size}",
6258
f"--memory-scope={scope}",
6359
f"--memory-total-size={mem_total_size}",
64-
f"memory-threads={mem_threads}"
6560
f"--cpu-max-prime={max_prime}",
66-
f"cpu-threads={cpu_threads}",
61+
f"--percent_cpu={percent_cpu}",
6762
f"--time={max_time}"]
6863

6964
for job in wf["workflow"]["jobs"]:
@@ -157,15 +152,6 @@ def add_io_to_json(self, wf: Dict[str, Dict], file_size: int) -> None:
157152
)
158153

159154

160-
def check_percent(self, cpu:int, mem:int):
161-
if not cpu % 10:
162-
raise ValueError("CPU percentage must be multiple of 10.")
163-
164-
if not mem % 10:
165-
raise ValueError("Memory percentage must be multiple of 10.")
166-
167-
if cpu + mem != 100:
168-
raise ValueError("CPU + Memory must be 100.")
169155

170156
def _check_sysbench(self,):
171157
proc = subprocess.Popen(["which", "sysbench"], stdout=subprocess.PIPE)

wfcommons/wfperf/wfperf_benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def main():
2020
parser = get_parser()
2121
args, other = parser.parse_known_args()
2222
name = args.name
23-
assert(args.percent_cpu >= 0 and args.percent_cpu <= 1)
23+
assert(args.percent_cpu >= 0.0 and args.percent_cpu <= 1.0)
2424

2525
save_dir = [item for item in other if "save" in item][0]
2626
save_dir = pathlib.Path(save_dir.split("=")[1])

0 commit comments

Comments
 (0)