Commit 8525238d authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

Merge branch 'exp/libbench' into next

Conflicts:
	ChangeLog
parents 46eed8c3 dc624bf5
......@@ -84,6 +84,36 @@
computation. This was causing the wrong value of VCSN_DATA_PATH
to be defined on my test installation on FreeBSD.
 
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-07 d-halluin <d-halluin@lrde.epita.fr>
 
Update CBS.
......
......@@ -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
......
......@@ -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.
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
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.
// 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);
}
......@@ -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; \
......
......@@ -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; \
......
......@@ -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; \
......
# 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
......
......@@ -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; \
......
......@@ -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 15 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 17 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:
......
......@@ -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; \
......
......@@ -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; \
......
Supports Markdown
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