Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
copar-benchmarks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Hans-Peter Deifel
copar-benchmarks
Commits
d16f3738
Commit
d16f3738
authored
6 years ago
by
Hans-Peter Deifel
Browse files
Options
Downloads
Patches
Plain Diff
wta: Pass --different-values argument through
parent
0415ff22
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
wta/bench.py
+15
-7
15 additions, 7 deletions
wta/bench.py
with
15 additions
and
7 deletions
wta/bench.py
+
15
−
7
View file @
d16f3738
...
...
@@ -10,9 +10,9 @@ import scipy.stats as st
samples
=
5
def
coalg_file
(
states
,
monoid
,
symbols
,
zero_frequency
,
i
):
return
"
bench/wta_%s_%s_%s_%s_%d
"
%
(
monoid
,
symbols
,
zero_frequency
,
states
,
i
)
def
coalg_file
(
states
,
monoid
,
symbols
,
zero_frequency
,
different_values
,
i
):
return
"
bench/wta_%s_%s_%s_%s_%
s_%
d
"
%
(
monoid
,
symbols
,
zero_frequency
,
different_values
,
states
,
i
)
def
generate
(
args
):
...
...
@@ -21,11 +21,12 @@ def generate(args):
monoid
=
args
.
monoid
symbols
=
args
.
symbols
zero_frequency
=
args
.
zero_frequency
different_values
=
args
.
different_values
os
.
makedirs
(
"
bench
"
,
exist_ok
=
True
)
for
i
in
range
(
0
,
samples
):
f
=
coalg_file
(
states
,
monoid
,
symbols
,
zero_frequency
,
f
=
coalg_file
(
states
,
monoid
,
symbols
,
zero_frequency
,
different_values
,
i
)
+
"
.coalgebra
"
if
os
.
path
.
exists
(
f
):
...
...
@@ -33,7 +34,8 @@ def generate(args):
cmd
=
[
generator
,
"
--states
"
,
states
,
"
--monoid
"
,
monoid
,
"
--symbols
"
,
symbols
,
"
--zero-frequency
"
,
zero_frequency
symbols
,
"
--zero-frequency
"
,
zero_frequency
,
"
--different-values
"
,
different_values
]
subprocess
.
run
(
cmd
,
stdout
=
open
(
f
,
"
w+
"
))
...
...
@@ -44,8 +46,9 @@ def run_one(args, i):
monoid
=
args
.
monoid
symbols
=
args
.
symbols
zero_frequency
=
args
.
zero_frequency
different_values
=
args
.
different_values
f
=
coalg_file
(
states
,
monoid
,
symbols
,
zero_frequency
,
i
)
+
"
.coalgebra
"
f
=
coalg_file
(
states
,
monoid
,
symbols
,
zero_frequency
,
different_values
,
i
)
+
"
.coalgebra
"
copar_args
=
[
copar
,
'
refine
'
,
'
--stats-json
'
,
f
]
...
...
@@ -60,6 +63,7 @@ def run_one(args, i):
stats
[
'
monoid
'
]
=
monoid
stats
[
'
symbols
'
]
=
symbols
stats
[
'
zero-freq
'
]
=
zero_frequency
stats
[
'
mon-values
'
]
=
different_values
stats
[
'
i
'
]
=
i
return
stats
...
...
@@ -71,8 +75,9 @@ def run_one_simple(args, i):
monoid
=
args
.
monoid
symbols
=
args
.
symbols
zero_frequency
=
args
.
zero_frequency
different_values
=
args
.
different_values
f
=
coalg_file
(
states
,
monoid
,
symbols
,
zero_frequency
,
i
)
+
"
.coalgebra
"
f
=
coalg_file
(
states
,
monoid
,
symbols
,
zero_frequency
,
different_values
,
i
)
+
"
.coalgebra
"
copar_args
=
[
copar
,
'
refine
'
,
f
]
...
...
@@ -228,6 +233,7 @@ def main():
gen_parser
.
add_argument
(
'
--monoid
'
,
required
=
True
)
gen_parser
.
add_argument
(
'
--symbols
'
,
required
=
True
)
gen_parser
.
add_argument
(
'
--zero-frequency
'
,
required
=
True
)
gen_parser
.
add_argument
(
'
--different-values
'
,
required
=
True
)
gen_parser
.
set_defaults
(
func
=
generate
)
run_parser
=
subparsers
.
add_parser
(
'
run
'
)
...
...
@@ -236,6 +242,7 @@ def main():
run_parser
.
add_argument
(
'
--monoid
'
,
required
=
True
)
run_parser
.
add_argument
(
'
--symbols
'
,
required
=
True
)
run_parser
.
add_argument
(
'
--zero-frequency
'
,
required
=
True
)
run_parser
.
add_argument
(
'
--different-values
'
,
required
=
True
)
run_parser
.
add_argument
(
'
--stddev
'
,
action
=
'
store_true
'
,
help
=
"
report stddev for timings
"
)
run_parser
.
add_argument
(
...
...
@@ -250,6 +257,7 @@ def main():
bisect_parser
.
add_argument
(
'
--monoid
'
,
required
=
True
)
bisect_parser
.
add_argument
(
'
--symbols
'
,
required
=
True
)
bisect_parser
.
add_argument
(
'
--zero-frequency
'
,
required
=
True
)
bisect_parser
.
add_argument
(
'
--different-values
'
,
required
=
True
)
bisect_parser
.
add_argument
(
'
--start-states
'
,
type
=
int
,
default
=
50
)
bisect_parser
.
add_argument
(
'
--good
'
,
type
=
int
)
bisect_parser
.
add_argument
(
'
--bad
'
,
type
=
int
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment