Commit 7882e480 authored by John Zhang's avatar John Zhang

updated documentation

parent 6056b900
......@@ -14,8 +14,7 @@ The interface consists of 4 functions:
- `end()`
- `report()`
`init()` function creates a callback instance.
The `init()` function creates a callback instance.
It accepts a parameter string `param_s`.
What and how information can be extracted is callback implementation defined.
......@@ -23,7 +22,7 @@ What and how information can be extracted is callback implementation defined.
Each pair of these two function calls should produce a data point.
To minimise the overhead, these two functions should be kept minimal and fast.
At the end of the benchmark run, `report()` is called to dump the collected data. The data should be written to `stdout`, which will be piped to the framework and written to the reuslt file.
At the end of the benchmark run, `report()` is called to dump the collected data. The data should be written to `stdout`, which will be piped to the framework and written to the result record file.
The following is an example of the interface binding in C and how it is used in a benchmark:
```c
......@@ -81,14 +80,12 @@ def target(driver, args):
def main(argv):
cb_param = argv[1]
iterations = int(argv[2])
...
cb = cb_cls(cb_param)
for i in range(iterations):
cb.begin()
work()
cb.end()
cb.begin()
work()
cb.end()
cb.report()
return 0
......@@ -110,7 +107,7 @@ The `-I` flag will be set at compile time to include `mubench/suite/callbacks/c`
Each implementation of the callback interface should concretely define `struct Callback`.
Examples:
* callback: [clockcallback.c](../mubench/suite/callbacks/c/clockcallback.c)
* callback: [cb_clock.c](../mubench/suite/callbacks/c/cb_clock.c)
* benchmark: [fib.c](../mubench/suite/micro/fib/fib.c)
### Mu
......@@ -141,7 +138,7 @@ Each benchmark implementation should include the following headers:
Like C, the relevant include path will be automatically added to the C compiler by the framework.
Examples:
* callback: [build_clockcallback.c](../mubench/suite/callbacks/mu/build_clockcallback.c)
* callback: [build_cb_clock.c](../mubench/suite/callbacks/mu/build_cb_clock.c)
* benchmark: [build_fib.c](../mubench/suite/micro/fib/build_fib.c)
----
......@@ -170,8 +167,7 @@ The order and meaning of the command line arguments passed to a benchmark are la
| 0 | program name |
| 1 | callback class name |
| 2 | callback parameter string |
| 3 | iterations |
| 4+ | program arguments |
| 3+ | program arguments |
#### RPython
......@@ -179,8 +175,7 @@ The order and meaning of the command line arguments passed to a benchmark are la
| ----- | ----------------------------- |
| 0 | program name |
| 1 | callback parameter string |
| 2 | iterations |
| 3+ | program arguments |
| 2+ | program arguments |
#### C
Same as RPython
......
This diff is collapsed.
......@@ -27,7 +27,7 @@ fib:
backend: c
source: targetfib.py
compiler:
pypy_dir: /Users/johnz/Documents/Work/mu-client-pypy
pypy_dir: $PYPY_MU
flags:
- --gc=none
environ:
......@@ -41,9 +41,8 @@ fib:
impl: zebu
source: targetfib.py
compiler:
pypy_dir: /Users/johnz/Documents/Work/mu-client-pypy
pypy_dir: $PYPY_MU
environ:
MU_ZEBU: /Users/johnz/Documents/Work/mu-impl-fast
ZEBU_BUILD: release
PYPY_USESSION_DIR: example
PYPY_USESSION_BASENAME: fib_rpyzebu
......@@ -54,14 +53,13 @@ fib:
impl: holstein
source: targetfib.py
compiler:
pypy_dir: /Users/johnz/Documents/Work/mu-client-pypy
pypy_dir: $PYPY_MU
flags:
- --mu-vmargs=vmLog=ERROR
runner:
flags:
- --vmLog=ERROR
environ:
MU_HOLSTEIN: /Users/johnz/Documents/Work/mu-impl-ref2
PYPY_USESSION_DIR: example
PYPY_USESSION_BASENAME: fib_rpyzebu
c_O0:
......
......@@ -44,7 +44,7 @@ class Task:
# callback
self.callback = taskset.callback
# check source & result
# check source
assert 'source' in conf, 'source not defined'
src = SUITE_DIR / self.benchmark['name'] / conf['source']
assert src.exists(), "source file %(src)s not found" % locals()
......
......@@ -134,11 +134,11 @@ class TaskSet:
"benchmark %(name)s not found" % conf['benchmark']
conf['benchmark'].setdefault('args', [])
# check result file
# check result
resfile = Path(conf.get('result', '%(name)s.json' % locals()))
# check record file
# check record
resfile = Path(conf.get('recfile', '%(name)s.json' % locals()))
if not resfile.is_absolute():
resfile = run_dir / resfile
resfile = output_dir / resfile
resfile.parent.mkdir(parents=True, exist_ok=True)
# check callback
......
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