Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ffe314e8 authored by SIMONIN Matthieu's avatar SIMONIN Matthieu
Browse files

Add linpack

needs to have a GenuineIntel cpu so forcing the qemu args accordingly
parent 8b1dc1b3
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<argument value="--qemu_mem"/> <argument value="--qemu_mem"/>
<argument value="1g"/> <argument value="1g"/>
<argument value="--qemu_args"/> <argument value="--qemu_args"/>
<argument value="-icount shift=0,sleep=off,align=off -rtc clock=vm"/> <argument value="-cpu core2duo -icount shift=0,sleep=off,align=off -rtc clock=vm"/>
<argument value="--base_working_dir"/> <argument value="--base_working_dir"/>
<argument value="/srv/tansiv"/> <argument value="/srv/tansiv"/>
<argument value="--autoconfig_net"/> <!-- this configure the tap/bridges useful for the secondary management interface --> <argument value="--autoconfig_net"/> <!-- this configure the tap/bridges useful for the secondary management interface -->
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<argument value="--qemu_mem"/> <argument value="--qemu_mem"/>
<argument value="1g"/> <argument value="1g"/>
<argument value="--qemu_args"/> <argument value="--qemu_args"/>
<argument value="-icount shift=0,sleep=off,align=off -rtc clock=vm"/> <argument value="-cpu core2duo -icount shift=0,sleep=off,align=off -rtc clock=vm"/>
<argument value="--base_working_dir"/> <argument value="--base_working_dir"/>
<argument value="/srv/tansiv"/> <argument value="/srv/tansiv"/>
<argument value="--autoconfig_net"/> <argument value="--autoconfig_net"/>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<argument value="--qemu_mem"/> <argument value="--qemu_mem"/>
<argument value="1g"/> <argument value="1g"/>
<argument value="--qemu_args"/> <argument value="--qemu_args"/>
<argument value="-icount shift=0,sleep=off,align=off -rtc clock=vm"/> <argument value="-cpu core2duo -icount shift=0,sleep=off,align=off -rtc clock=vm"/>
<argument value="--base_working_dir"/> <argument value="--base_working_dir"/>
<argument value="/srv/tansiv"/> <argument value="/srv/tansiv"/>
<argument value="--autoconfig_net"/> <!-- this configure the tap/bridges useful for the secondary management interface --> <argument value="--autoconfig_net"/> <!-- this configure the tap/bridges useful for the secondary management interface -->
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<argument value="1g"/> <argument value="1g"/>
<argument value="--qemu_args"/> <argument value="--qemu_args"/>
<!-- <argument value="-icount shift=0,sleep=off,align=off -rtc clock=vm -object filter-dump,id=f1,netdev=mynet0,file=dump.dat"/> --> <!-- <argument value="-icount shift=0,sleep=off,align=off -rtc clock=vm -object filter-dump,id=f1,netdev=mynet0,file=dump.dat"/> -->
<argument value="-icount shift=0,sleep=off,align=off -rtc clock=vm"/> <argument value="-cpu core2duo -icount shift=0,sleep=off,align=off -rtc clock=vm"/>
<argument value="--base_working_dir"/> <argument value="--base_working_dir"/>
<argument value="/srv/tansiv"/> <argument value="/srv/tansiv"/>
<argument value="--autoconfig_net"/> <argument value="--autoconfig_net"/>
......
...@@ -322,7 +322,7 @@ def start_nts( ...@@ -322,7 +322,7 @@ def start_nts(
] ]
if qemu_args: if qemu_args:
# covers None or empty str # covers None or empty str
command.append(f"--qemu_args {qemu_args}") command.append(f"--qemu_args '{qemu_args}'")
_start_internal(" ".join(command), p, qemu_image, docker_image) _start_internal(" ".join(command), p, qemu_image, docker_image)
tansiv_roles = build_tansiv_roles(number, roles["tansiv"][0]) tansiv_roles = build_tansiv_roles(number, roles["tansiv"][0])
en.wait_for(roles=tansiv_roles) en.wait_for(roles=tansiv_roles)
......
import argparse import argparse
import logging import logging
import traceback import traceback
from tansiv import linpack
from tansiv.api import NETWORKS from tansiv.api import NETWORKS
...@@ -10,6 +11,7 @@ from tansiv.tasks import ( ...@@ -10,6 +11,7 @@ from tansiv.tasks import (
start_nts, start_nts,
start_ts, start_ts,
flent, flent,
linpack,
fping, fping,
vm_emulate, vm_emulate,
host_emulate, host_emulate,
...@@ -143,6 +145,11 @@ def main(): ...@@ -143,6 +145,11 @@ def main():
) )
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# -------------------------------------------------------------------- LINPACK
parser_linpack = subparsers.add_parser("linpack", help="Run linpack")
parser_linpack.set_defaults(func=linpack)
# --------------------------------------------------------------------------
# ------------------------------------------------------------------ VM_EMULATE # ------------------------------------------------------------------ VM_EMULATE
parser_emulate = subparsers.add_parser("vm_emulate", help="emulate") parser_emulate = subparsers.add_parser("vm_emulate", help="emulate")
parser_emulate.set_defaults(func=vm_emulate) parser_emulate.set_defaults(func=vm_emulate)
......
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)
...@@ -89,6 +89,16 @@ def flent(args, env=None): ...@@ -89,6 +89,16 @@ def flent(args, env=None):
api.flent(tansiv_roles, working_dir=working_dir, duration=args.duration) api.flent(tansiv_roles, working_dir=working_dir, duration=args.duration)
@en.enostask()
def linpack(args, env=None):
"""Runs linpack."""
tansiv_roles = env["tansiv_roles"]
working_dir = env.env_name
from tansiv.linpack import linpack
linpack(tansiv_roles, working_dir)
@en.enostask() @en.enostask()
def destroy(args, env=None): def destroy(args, env=None):
force = args.force force = args.force
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment