Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vcsn
Vaucanson 1
Commits
dddbceb2
Commit
dddbceb2
authored
Sep 17, 2009
by
Alexandre Duret-Lutz
Browse files
Merge branch 'exp/libbench' into hive
Conflicts: ChangeLog
parents
c0d760fb
dc624bf5
Changes
14
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
dddbceb2
2009-09-14 d-halluin <d-halluin@lrde.epita.fr>
Update benchmark documentation.
* src/bench/README,
* src/bench/common/README_AUTOMATA: Update.
* src/bench/common/Makefile.am: Add file.
* src/bench/common/bench_constructs.cc: New program, generate a
sample of the benchmark automata in dot format.
2009-09-11 d-halluin <d-halluin@lrde.epita.fr>
Remove seq in benchmarks.
* src/bench/composition/Makefile.bench,
* src/bench/derived_terms/Makefile.bench,
* src/bench/determinization/Makefile.bench,
* src/bench/eps_removal/Makefile.bench,
* src/bench/eval/Makefile.bench,
* src/bench/minimization/Makefile.bench,
* src/bench/product/Makefile.bench,
* src/bench/quotient/Makefile.bench: List all the values instead.
2009-09-11 d-halluin <d-halluin@lrde.epita.fr>
Remove --with-openfst.
* configure.ac: Enable OpenFST benchmarks if fstcompile
is accessible from the current PATH.
2009-09-17 Alexandre Duret-Lutz <adl@lrde.epita.fr>
* include/generate_headers.sh: Also erase context files directly
...
...
configure.ac
View file @
dddbceb2
...
...
@@ -46,20 +46,15 @@ case $ac_default_graph_impl in
*) AC_ERROR([Unknown graph implementation: $ac_default_graph_impl]);;
esac
# Specify the path OpenFST binaries for benchmarks.
ac_openfst_path=/usr/local/bin # default install dir in OpenFST 1.1
AC_ARG_WITH([openfst],
[AC_HELP_STRING([--with-openfst@<:@=DIR@:>@],
[specify the path to OpenFST binaries for benchmarks])],
[ac_openfst_path="$withval"],[])
AM_CONDITIONAL([ENABLE_OPENFST], [test -e "${ac_openfst_path}/fstcompile"])
if test -e "${ac_openfst_path}/fstcompile"; then
AC_DEFINE_UNQUOTED([OPENFST_PATH], ["$ac_openfst_path"],
[Path to OpenFST binaries.])
# Enable OpenFST benchmarks if fstcompile is available.
ac_enable_openfst=no
if [fstcompile < /dev/null > /dev/null]; then
ac_enable_openfst=yes
AC_MSG_NOTICE([OpenFST benchmarks are enabled.])
else
AC_MSG_WARN([OpenFST binaries
not found in ${ac_openfst_path},
OpenFST benchmarks are disabled.])
AC_MSG_WARN([OpenFST binaries
are not directly accessible;
OpenFST benchmarks are disabled.])
fi
AM_CONDITIONAL([ENABLE_OPENFST], [test "x$ac_enable_openfst" = "xyes"])
# Some C and C++ code used.
AC_PROG_CXX
...
...
src/bench/README
View file @
dddbceb2
...
...
@@ -114,10 +114,8 @@ Note that step 1 can take longer that step 2.
=============
If OpenFST is available on the current host, some extra benchmarks are
made.
Use the `--with-openfst' configuration option to specify the path
to OpenFST binaries.
made. These benchmarks are activated during the ./configure if fstcompile
is directly available from the PATH.
OpenFST benchmarks are similar to Vaucanson benchmarks and a corresponding
source file ending in _openfst_bench.hh
...
...
@@ -137,3 +135,5 @@ These are the general steps:
of the benchmarked algorithm.
5. Remove temporary files, write results.
Note that contrary to Vaucanson benchmarks, OpenFST benchmarks
include file I/O. This may introduce a bias in the results.
src/bench/common/Makefile.am
View file @
dddbceb2
EXTRA_DIST
=
alpha.syms
\
bench_constructs.hh bench.mk
\
bench_macros.hh
\
include
$(srcdir)/../common/bench.mk
EXTRA_DIST
=
alpha.syms
\
bench.mk
\
bench_macros.hh
\
README_AUTOMATA
noinst_PROGRAMS
=
noinst_PROGRAMS
+=
bench_constructs
bench_constructs_SOURCES
=
bench_constructs.cc bench_constructs.hh
bench_constructs_LDADD
=
$(benchlib)
bench
:
all
@
echo
"Generating examples of benchmark automata..."
./bench_constructs
bench-clean
:
rm
-rf
aut_
*
.xml
rm
-rf
aut_
*
.dot
rm
-rf
aut_
*
.png
src/bench/common/README_AUTOMATA
View file @
dddbceb2
This file describes the automata used for benchmarking.
Functions to create these automata are located in bench_constructs.hh.
The program bench-constructs generates .dot files of the benchmark
automata. These files can be used to generate figures using dot/circo:
circo -Tpng aut_ladybird_6.dot -o aut_ladybird_6.png
n is the parameter specified during the automaton creation (integer).
FIXME: Add references.
The TAF-Kit manual (doc/manual/taf-koit-manual.pdf) also lists
some of these automata, along with their representation (chapter 3).
============
...
...
@@ -13,26 +20,10 @@ FIXME: Add references.
Automaton on the `abc' alphabet.
Has n states in its original form and 2^n states once determinized.
Note: aut_ladybird has the same property and is the preferred benchmark
automaton.
==================
-- aut_debruijn --
==================
FIXME.
==================
-- aut_ladybird --
==================
FIXME.
====================
-- aut_linear_eps --
====================
FIXME.
FIXME: Remove, since aut_ladybird is very similar to aut_2n.
===========
...
...
@@ -42,6 +33,8 @@ FIXME.
A simple automaton that recognizes words containing `b' on the
`ab' alphabet.
[See 'b1.xml' in TAF-Kit manual]
==================
-- aut_complete --
...
...
@@ -54,3 +47,34 @@ the two states.
* n states.
* state 0 is initial and final.
==================
-- aut_debruijn --
==================
Automaton used for minimization benchmarks.
FIXME: Add details.
==================
-- aut_ladybird --
==================
Non-deterministic automaton on the `abc' alphabet.
Has n states in its original form and 2^n states once determinized.
Because of this property, it is used in many benchmarks.
[See 'ladybird-6.xml' in TAF-Kit manual]
====================
-- aut_linear_eps --
====================
Automaton on the 'a' alphabet.
Has n * 500 states.
Each state with an even index has a spontaneous transition to the next state.
Each state with an odd index has a transition labeled by 'a' to the next state.
This automaton is used solely for the eps-removal benchmark.
src/bench/common/bench_constructs.cc
0 → 100644
View file @
dddbceb2
// bench_constructs.hh: this file is part of the Vaucanson project.
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2005, 2006, 2007, 2008, 2009 The Vaucanson Group.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// The complete GNU General Public Licence Notice can be found as the
// `COPYING' file in the root directory.
//
// The Vaucanson Group consists of people listed in the `AUTHORS' file.
//
#include <iostream>
#include <sstream>
#include <common/bench_macros.hh>
#include <vaucanson/boolean_automaton.hh>
#include <vaucanson/tools/dot_dump.hh>
using
namespace
vcsn
;
using
namespace
vcsn
::
boolean_automaton
;
using
namespace
vcsn
::
tools
;
#include <common/bench_constructs.hh>
#define DUMP(Name, N) \
do { \
std::stringstream str; \
str << Name; \
if (N) \
str << "_" << N; \
str << ".dot"; \
std::ofstream file(str.str().c_str()); \
dot_dump(file, aut, ""); \
file.close(); \
} while(0)
int
main
(
int
argc
,
char
*
argv
[])
{
automaton_t
aut
;
for
(
int
n
=
1
;
n
<
11
;
++
n
)
{
aut
=
aut_ladybird
(
n
);
DUMP
(
"aut_ladybird"
,
n
);
aut
=
aut_2n
(
n
);
DUMP
(
"aut_2n"
,
n
);
aut
=
aut_debruijn
(
n
);
DUMP
(
"aut_debruijn"
,
n
);
aut
=
aut_linear_eps
(
n
);
DUMP
(
"aut_linear_eps"
,
n
);
aut
=
aut_complete
(
n
);
DUMP
(
"aut_complete"
,
n
);
}
aut
=
aut_b
();
DUMP
(
"aut_b"
,
0
);
}
src/bench/composition/Makefile.bench
View file @
dddbceb2
...
...
@@ -6,7 +6,7 @@ bench: all
echo
'==================='
;
\
echo
'|Composition bench|'
;
\
echo
'==================='
;
\
for
n
in
$$
(
seq
20
40
)
;
do
\
for
n
in
20 22 24 26 28 30 32 34 36 38
40
;
do
\
echo
"----------------------For
$$
n:"
;
\
echo
"--------------VCSN (Realtime):"
;
\
./realtime_composition_bench
$$
n
;
\
...
...
src/bench/derived_terms/Makefile.bench
View file @
dddbceb2
...
...
@@ -5,7 +5,7 @@ bench: all
echo
'====================='
;
\
echo
'|Derived Terms bench|'
;
\
echo
'====================='
;
\
for
n
in
$$
(
seq
15 15
)
;
do
\
for
n
in
15
;
do
\
echo
"----------------------For
$$
n states"
;
\
echo
"--------------VCSN:"
;
\
./derived_terms_bench
$$
n
;
\
...
...
src/bench/determinization/Makefile.bench
View file @
dddbceb2
...
...
@@ -14,7 +14,7 @@ bench: all
echo
'======================================'
;
\
echo
'|Determinization bench - aut_ladybird|'
;
\
echo
'======================================'
;
\
for
n
in
$$
(
seq
12
20
)
;
do
\
for
n
in
12 13 14 15 16 17 18 19
20
;
do
\
echo
"----------------------For
$$
n"
;
\
echo
"--------------VCSN:"
;
\
./determinization_aut_ladybird_bench
$$
n
;
\
...
...
@@ -26,7 +26,7 @@ bench: all
echo
'================================'
;
\
echo
'|Determinization bench - aut_2n|'
;
\
echo
'================================'
;
\
for
n
in
$$
(
seq
14
20
)
;
do
\
for
n
in
14 15 16 17 18 19
20
;
do
\
echo
"----------------------For
$$
n states"
;
\
echo
"--------------VCSN:"
;
\
./determinization_aut_2n_bench
$$
n
;
\
...
...
src/bench/eps_removal/Makefile.bench
View file @
dddbceb2
# eps_removal/Makefile.bench * -*- Makefile -*-
bench
:
all
@
mkdir
aut_linear_eps
;
\
@
mkdir
aut_linear_eps
;
\
echo
'==================='
;
\
echo
'|eps_removal bench|'
;
\
echo
'==================='
;
\
for
n
in
$$
(
seq
1
20
)
;
do
\
for
n
in
1 3 5 7 9 11 13 15 16 17 18 19
20
;
do
\
echo
"----------------------For
$
${n}
0:"
;
\
./eps_removal_bench
$
${n}
0
;
\
done
...
...
src/bench/eval/Makefile.bench
View file @
dddbceb2
...
...
@@ -6,7 +6,7 @@ bench: all
echo
'==========================='
;
\
echo
'|Eval bench - aut_ladybird|'
;
\
echo
'==========================='
;
\
for
n
in
$$
(
seq
10
18
)
;
do
\
for
n
in
10 11 12 13 14 15 16 17
18
;
do
\
echo
"----------------------For
$$
n"
;
\
echo
"--------------VCSN:"
;
\
./eval_aut_ladybird_bench
$$
n
;
\
...
...
@@ -14,7 +14,7 @@ bench: all
echo
'=========================================='
;
\
echo
'|Eval bench - aut_ladybird (determinized)|'
;
\
echo
'=========================================='
;
\
for
n
in
$$
(
seq
10
18
)
;
do
\
for
n
in
10 11 12 13 14 15 16 17
18
;
do
\
echo
"----------------------For
$$
n"
;
\
echo
"--------------VCSN:"
;
\
./eval_aut_ladybird_determinized_bench
$$
n
;
\
...
...
@@ -22,7 +22,7 @@ bench: all
echo
'===================='
;
\
echo
'|Eval bench - aut_b|'
;
\
echo
'===================='
;
\
for
n
in
$$
(
seq
1
10
)
;
do
\
for
n
in
1 2 3 4 5 6 7 8 9
10
;
do
\
echo
"----------------------For
$$
n"
;
\
echo
"--------------VCSN:"
;
\
./eval_aut_b_bench
$$
n
;
\
...
...
src/bench/minimization/Makefile.bench
View file @
dddbceb2
...
...
@@ -11,17 +11,17 @@ bench-clean: aut_2n-clean aut_debruijn-clean
aut_2n
:
@
mkdir
aut_2n_moore
;
\
mkdir
aut_2n_hopcroft
;
\
mkdir
aut_2n_brzozowski
;
\
mkdir
aut_2n_brzozowski
;
\
if
[
!
-z
$(HAS_OPENFST)
]
;
then
\
mkdir
aut_2n_openfst
;
\
fi
;
\
echo
'===================================='
;
\
echo
'|Minimization bench - 2^n automaton|'
;
\
echo
'===================================='
;
\
for
n
in
$$
(
seq
11
16
)
;
do
\
for
n
in
11 12 13 14 15
16
;
do
\
echo
"----------------------For
$$
n states"
;
\
echo
"--------------VCSN (moore):"
;
\
./minimization_aut_2n_moore_bench
$$
n
;
\
./minimization_aut_2n_moore_bench
$$
n
;
\
echo
"--------------VCSN (hopcroft):"
;
\
./minimization_aut_2n_hopcroft_bench
$$
n
;
\
if
[
$$
n
-lt
13
]
;
then
\
...
...
@@ -42,26 +42,26 @@ aut_2n-clean:
aut_debruijn
:
@
mkdir
aut_debruijn_moore
;
\
mkdir
aut_debruijn_hopcroft
;
\
mkdir
aut_debruijn_brzozowski
;
\
if
[
!
-z
$(HAS_OPENFST)
]
;
then
\
mkdir
aut_debruijn-openfst
;
\
fi
;
\
echo
'================================'
;
\
echo
'|Minimization bench - De Bruijn|'
;
\
echo
'================================'
;
\
for
n
in
$$
(
seq
1
5
18
)
;
do
\
echo
"----------------------For
$$
n states"
;
\
echo
"--------------VCSN (moore):"
;
\
./minimization_aut_debruijn_moore_bench
$$
n
;
\
echo
"--------------VCSN (hopcroft):"
;
\
mkdir
aut_debruijn_hopcroft
;
\
mkdir
aut_debruijn_brzozowski
;
\
if
[
!
-z
$(HAS_OPENFST)
]
;
then
\
mkdir
aut_debruijn-openfst
;
\
fi
;
\
echo
'================================'
;
\
echo
'|Minimization bench - De Bruijn|'
;
\
echo
'================================'
;
\
for
n
in
15 16
1
7
18
;
do
\
echo
"----------------------For
$$
n states"
;
\
echo
"--------------VCSN (moore):"
;
\
./minimization_aut_debruijn_moore_bench
$$
n
;
\
echo
"--------------VCSN (hopcroft):"
;
\
./minimization_aut_debruijn_hopcroft_bench
$$
n
;
\
echo
"--------------VCSN (brzozowski):"
;
\
echo
"--------------VCSN (brzozowski):"
;
\
./minimization_aut_debruijn_brzozowski_bench
$$
n
;
\
if
[
!
-z
$(HAS_OPENFST)
]
;
then
\
echo
"--------------OpenFST:"
;
\
./minimization_aut_2n_openfst_bench
$$
n
;
\
fi
;
\
if
[
!
-z
$(HAS_OPENFST)
]
;
then
\
echo
"--------------OpenFST:"
;
\
./minimization_aut_2n_openfst_bench
$$
n
;
\
fi
;
\
done
;
aut_debruijn-clean
:
...
...
src/bench/product/Makefile.bench
View file @
dddbceb2
...
...
@@ -6,7 +6,7 @@ bench: all
echo
'==============='
;
\
echo
'|Product bench|'
;
\
echo
'==============='
;
\
for
n
in
$$
(
seq
5
13
)
;
do
\
for
n
in
5 6 7 8 9 10 11 12
13
;
do
\
echo
"----------------------For
$$
n"
;
\
echo
"--------------VCSN (over Z):"
;
\
./product_aut_b_z_bench
$$
n
;
\
...
...
src/bench/quotient/Makefile.bench
View file @
dddbceb2
...
...
@@ -6,7 +6,7 @@ bench: all
echo
'================'
;
\
echo
'|Quotient bench|'
;
\
echo
'================'
;
\
for
n
in
$$
(
seq
5
13
)
;
do
\
for
n
in
5 6 7 8 9 10 11 12
13
;
do
\
echo
"----------------------For power
$$
n"
;
\
echo
"--------------VCSN (over Z):"
;
\
./quotient_z_bench
$$
n
;
\
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment