diff --git a/tansiv/api.py b/tansiv/api.py index 1d347027d8cb5c19a798ff897eed0861de7f8035..af6113e23e462e455261bb5045941b02e0b90d70 100644 --- a/tansiv/api.py +++ b/tansiv/api.py @@ -441,4 +441,4 @@ def generate_platform(latency: str, bandwidth: str, out: Path): ) template = env.get_template("star.xml.j2") out.parent.mkdir(parents=True, exist_ok=True) - out.write_text(template.render(latency=latency, bandwidth=bandwidth)) + out.write_text(template.render(latency=latency, bandwidth=bandwidth)) \ No newline at end of file diff --git a/tansiv/linpack/__init__.py b/tansiv/linpack/__init__.py deleted file mode 100644 index 5a6fdcd7293164582c2c2d6091e0f97936cfc1dd..0000000000000000000000000000000000000000 --- a/tansiv/linpack/__init__.py +++ /dev/null @@ -1,58 +0,0 @@ -from re import A -import enoslib as en -from pathlib import Path - -from typing import List, Union - - -LINPACK_INPUT = """Shared-memory version of Intel(R) Distribution for LINPACK* Benchmark. *Other names and brands may be claimed as the property of others. -Sample data file lininput_xeon64. -1 # number of tests -1000 -1000 -1 # times to run a test -1 # alignment values (in KBytes) - -""" - -CMD = "/opt/linpack/l_mklb_p_2018.3.011/benchmarks_2018/linux/mkl/benchmarks/linpack/xlinpack_xeon64" - - -def linpack( - hosts: List[en.Host], working_dir: Path, linpack_input: str = LINPACK_INPUT -) -> float: - """Runs linpack on nodes. - - linpack must be installed on the node (in /opt/linpack) - ~wget http://registrationcenter-download.intel.com/akdlm/irc_nas/9752/l_mklb_p_2018.3.011.tgz && tar xf l_mklb_p_2018.3.011.tgz~ - - - Args - hosts: - EnOSlib's hosts - linpack_input: - Content of the benchmark's input - - - Returns: - average GFlops - """ - with en.actions(roles=hosts) as a: - a.copy(dest="/tmp/linpack_input", content=linpack_input) - a.shell(f"{CMD} /tmp/linpack_input | tee /tmp/linpack.out") - a.fetch(src="/tmp/linpack.out", dest=str(working_dir / "linpack_results")) - - -def parse_result(linpack_result_dir: Union[str, Path]) -> float: - import re - - avgs = [] - for f in Path(linpack_result_dir).rglob("*.out"): - lines = f.open("r").readlines() - for i in range(len(lines)): - l = lines[i] - if l.startswith("Size LDA Align. Average Maximal"): - print(lines[i + 1]) - m = re.match(r"\d+ +\d+ + \d+ +(\d+.\d+) +.*", lines[i + 1]) - avgs.append(float(m.group(1))) - return sum(avgs) / len(avgs) diff --git a/tansiv/undercloud.py b/tansiv/undercloud.py index ab5ecacd8b9f98a8e13b6cdb0eb1460bcc9aa8cf..f804e7d0cdb1ce7babc6eb56ec38cec6b312db4b 100644 --- a/tansiv/undercloud.py +++ b/tansiv/undercloud.py @@ -1,10 +1,43 @@ from threading import local -from typing import Dict, Tuple +from typing import Dict, List, Tuple, Union import enoslib as en from enoslib.infra.provider import Provider +def vmong5k(clusters: Union[List[str], str], density: int, **kwargs): + """Build a VMonG5k conf. + + Purpose, offer more flexibility on the VMs locations. + Esp. we want to run some of our baseline on different physical hosts to + avoid the contentions due to running all VMs on a single host (bridged + network and share CPU). + + Args: + clusters: a list of g5k cluster + They will be used to store ``density`` vms each + density: number of VM to deploy on each cluster + kwargs: keyword argument / will be passed to .from_settings + """ + conf = ( + en.VMonG5kConf.from_settings(job_name="tansiv", **kwargs) + ) + for cluster in clusters: + conf.add_machine( + roles=["tansiv"], + cluster=cluster, + number=density, + flavour_desc={ + "core": 1, + "mem": 1024 + } + ) + + conf.finalize() + + provider = en.VMonG5k(conf) + return provider.init() + def g5k(cluster: str, walltime: str, number: int, queue: str) -> Tuple[en.Roles, Provider]: prod = en.G5kNetworkConf( id="id",