To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit a35d622b authored by John Zhang's avatar John Zhang
Browse files

Merge branch 'master' into core

parents 6d85e2ad 24cdc1a7
......@@ -18,13 +18,17 @@ import click
from mubench.frontend.utils import go_through_pipelines
from mubench.models.revision import LocalRevision
from mubench.models.pipeline import pipelines
logger = logging.getLogger(__name__)
@click.command()
@click.argument('file', type=click.Path(exists=True))
@click.argument('pipeline', default="log,boxplot,barplot")
@click.option("--pipeline", default="box,bar",
help="Combination of [{}], separated by comma".format(
",".join(pipelines.keys())
))
@click.option('--skip_compile', default='none',
help="a list of tasks to skip compilation." +
"Can be 'all', 'none', or a string in the form of 'taskset1:task1,task2;taskset2'. " +
......
......@@ -21,6 +21,7 @@ from pathlib import Path
from mubench import CALLBACKS_DIR
from mubench.util import expandenv
from mubench.exceptions import ExecutionFailure
from types import SimpleNamespace
logger = logging.getLogger(__name__)
......@@ -63,8 +64,10 @@ class Language:
cmd = list(map(str, cmd))
logger.info(" ".join(cmd))
t0 = time.perf_counter()
res = subproc.run(cmd, stdout=subproc.PIPE, stderr=subproc.PIPE,
env=env)
res = subproc.Popen(cmd, stdout=subproc.PIPE, stderr=subproc.PIPE,
env=env)
so, se = res.communicate()
res = SimpleNamespace(stdout=so, stderr=se, returncode=res.returncode)
t1 = time.perf_counter()
if res.returncode != 0:
raise ExecutionFailure(cmd, res)
......
......@@ -21,6 +21,7 @@ from mubench.lang import Language
from mubench import CALLBACKS_DIR
from mubench.util import expandenv
from mubench.exceptions import ExecutionFailure
from types import SimpleNamespace
logger = logging.getLogger(__name__)
......@@ -85,15 +86,17 @@ class WASM(Language):
cmd.extend(task.benchmark['args'])
return cls.run_in_subproc(cmd, task.env, cwd=target.parent.resolve())
return cls.run_in_subproc(cmd, task.env, cwd=str(target.parent.resolve()))
@classmethod
def run_in_subproc(cls, cmd, env=None, **kwargs):
cmd = list(map(str, cmd))
logger.info(" ".join(cmd))
t0 = time.perf_counter()
res = subproc.run(cmd, stdout=subproc.PIPE, stderr=subproc.PIPE,
env=env, **kwargs)
res = subproc.Popen(cmd, stdout=subproc.PIPE, stderr=subproc.PIPE,
env=env, **kwargs)
so, se = res.communicate()
res = SimpleNamespace(stdout=so, stderr=se, returncode=res.returncode)
t1 = time.perf_counter()
if res.returncode != 0:
raise ExecutionFailure(cmd, res)
......
......@@ -98,16 +98,17 @@ class BarplotPipeline(Pipeline):
width = 0.35
fig, ax = plt.subplots()
rects2 = ax.bar(ind, t_proc_means, width,
color='lightblue',
yerr=t_proc_stds,
capsize=3)
rects1 = ax.bar(ind, callback_means, width,
color='pink',
yerr=callback_stds)
rects2 = ax.bar(ind + width, t_proc_means, width,
color='lightblue',
yerr=t_proc_stds)
yerr=callback_stds,
capsize=3)
ax.set_ylabel('Time')
ax.set_title(ts.name)
ax.set_xticks(ind + width / 2)
ax.set_xticks(ind)
ax.set_xticklabels(labels)
ax.legend((rects1[0], rects2[0]), ('Callback', 'T_proc'))
......@@ -146,7 +147,7 @@ class BoxplotPipeline(Pipeline):
pipelines = {
"boxplot": BoxplotPipeline,
"barplot": BarplotPipeline,
"box": BoxplotPipeline,
"bar": BarplotPipeline,
"log": LogOutputPipeline
}
......@@ -97,7 +97,8 @@ class TaskSet:
resfile = Path(conf_d.get('recfile', '%(name)s.json' % locals()))
if not resfile.is_absolute():
resfile = output_dir / resfile
resfile.parent.mkdir(parents=True, exist_ok=True)
if not resfile.parent.exists():
resfile.parent.mkdir(parents=True)
# check callback
assert 'callback' in conf_d, 'callback not defined'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment