From 9db6fb601b6929320ed0bc430c10fb60774f5380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20Sir=C3=A9n?= Date: Fri, 10 Nov 2017 15:22:11 +0000 Subject: [PATCH] Use benchmark to inspect index statistics --- benchmark.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/benchmark.cpp b/benchmark.cpp index b930baf..094c4a4 100644 --- a/benchmark.cpp +++ b/benchmark.cpp @@ -53,13 +53,14 @@ void extractBenchmark(const GBWT& compressed_index, const DynamicGBWT& dynamic_i int main(int argc, char** argv) { - if(argc < 3) { printUsage(); } - std::string index_base = argv[1], query_base = argv[2]; + if(argc < 2) { printUsage(); } + std::string index_base = argv[1], query_base; + if(argc > 2) { query_base = argv[2]; } Version::print(std::cout, tool_name); printHeader("Index name"); std::cout << index_base << std::endl; - printHeader("Query name"); std::cout << query_base << std::endl; + if(!(query_base.empty())) { printHeader("Query name"); std::cout << query_base << std::endl; } std::cout << std::endl; double start = readTimer(); @@ -67,6 +68,7 @@ main(int argc, char** argv) GBWT compressed_index; sdsl::load_from_file(compressed_index, index_base + GBWT::EXTENSION); printStatistics(compressed_index, index_base); + if(query_base.empty()) { return 0; } DynamicGBWT dynamic_index; sdsl::load_from_file(dynamic_index, index_base + DynamicGBWT::EXTENSION); @@ -93,7 +95,7 @@ printUsage(int exit_code) { Version::print(std::cerr, tool_name); - std::cerr << "Usage: benchmark index_base query_base" << std::endl; + std::cerr << "Usage: benchmark index_base [query_base]" << std::endl; std::cerr << std::endl; std::exit(exit_code);