diff --git a/include/valik/search/iterate_queries.hpp b/include/valik/search/iterate_queries.hpp index 80581b69..c75c8af9 100644 --- a/include/valik/search/iterate_queries.hpp +++ b/include/valik/search/iterate_queries.hpp @@ -43,7 +43,7 @@ void iterate_distributed_queries(search_arguments const & arguments, start = std::chrono::high_resolution_clock::now(); prefilter_queries_parallel(ibf, arguments, query_records, thresholder, queue); end = std::chrono::high_resolution_clock::now(); - time_statistics.prefilter_time += std::chrono::duration_cast>(end - start).count(); + time_statistics.search_time += std::chrono::duration_cast>(end - start).count(); } } @@ -101,7 +101,7 @@ void iterate_short_queries(search_arguments const & arguments, auto start = std::chrono::high_resolution_clock::now(); prefilter_queries_parallel>>(ibf, arguments, query_records, thresholder, queue); auto end = std::chrono::high_resolution_clock::now(); - time_statistics.prefilter_time += std::chrono::duration_cast>(end - start).count(); + time_statistics.search_time += std::chrono::duration_cast>(end - start).count(); query_records.clear(); } } @@ -112,7 +112,7 @@ void iterate_short_queries(search_arguments const & arguments, auto start = std::chrono::high_resolution_clock::now(); prefilter_queries_parallel>>(ibf, arguments, query_records, thresholder, queue); auto end = std::chrono::high_resolution_clock::now(); - time_statistics.prefilter_time += std::chrono::duration_cast>(end - start).count(); + time_statistics.search_time += std::chrono::duration_cast>(end - start).count(); } /** @@ -175,7 +175,7 @@ void iterate_split_queries(search_arguments const & arguments, auto start = std::chrono::high_resolution_clock::now(); prefilter_queries_parallel>>(ibf, arguments, query_records, thresholder, queue); auto end = std::chrono::high_resolution_clock::now(); - time_statistics.prefilter_time += std::chrono::duration_cast>(end - start).count(); + time_statistics.search_time += std::chrono::duration_cast>(end - start).count(); query_records.clear(); } } @@ -188,7 +188,7 @@ void iterate_split_queries(search_arguments const & arguments, auto start = std::chrono::high_resolution_clock::now(); prefilter_queries_parallel>>(ibf, arguments, query_records, thresholder, queue); auto end = std::chrono::high_resolution_clock::now(); - time_statistics.prefilter_time += std::chrono::duration_cast>(end - start).count(); + time_statistics.search_time += std::chrono::duration_cast>(end - start).count(); } } // namespace valik::app diff --git a/include/valik/search/search_time_statistics.hpp b/include/valik/search/search_time_statistics.hpp index 57cfda93..7a197827 100644 --- a/include/valik/search/search_time_statistics.hpp +++ b/include/valik/search/search_time_statistics.hpp @@ -13,7 +13,8 @@ struct search_time_statistics double index_io_time{0.0}; std::vector cart_processing_times; double reads_io_time{0.0}; - double prefilter_time{0.0}; + double search_time{0.0}; + double consolidation_time{0.0}; double get_cart_min() const { @@ -41,22 +42,23 @@ inline void write_time_statistics(search_time_statistics const & time_statistics std::filesystem::path file_path{time_file}; std::ofstream file_handle(file_path, std::ofstream::app); - file_handle << "Ref I/O\tIBF I/O\tReads I/O\tPrefilter\tMin cart time\tAvg cart time\tMax cart time\tNr carts\n"; + file_handle << "Ref I/O\tIBF I/O\tReads I/O\tSearch\tMin cart time\tAvg cart time\tMax cart time\tNr carts\tConsolidation\n"; file_handle << std::fixed << std::setprecision(2) << time_statistics.ref_io_time << '\t' << time_statistics.index_io_time << '\t' << time_statistics.reads_io_time << '\t' - << time_statistics.prefilter_time << '\t'; + << time_statistics.search_time << '\t'; if (!time_statistics.cart_processing_times.empty()) { file_handle << time_statistics.get_cart_min() << '\t' << time_statistics.get_cart_avg() << '\t' << time_statistics.get_cart_max() << '\t' - << time_statistics.cart_processing_times.size() << '\n'; - + << time_statistics.cart_processing_times.size() << '\t'; } + file_handle << time_statistics.consolidation_time << '\n'; + } } // namespace valik::app diff --git a/src/valik_search.cpp b/src/valik_search.cpp index 1fab9a50..5267f7d0 100644 --- a/src/valik_search.cpp +++ b/src/valik_search.cpp @@ -45,6 +45,7 @@ void valik_search(search_arguments const & arguments) } // Consolidate matches (not necessary when searching a metagenomic database) + auto start = std::chrono::high_resolution_clock::now(); if (!arguments.ref_meta_path.empty()) { consolidate_matches(arguments); @@ -53,6 +54,8 @@ void valik_search(search_arguments const & arguments) std::cerr << "Could not clean up intermediate file: \t" << std::string(arguments.all_matches) << '\n'; failed = failed || error_in_delete; } + auto end = std::chrono::high_resolution_clock::now(); + time_statistics.consolidation_time += std::chrono::duration_cast>(end - start).count(); if (arguments.write_time) write_time_statistics(time_statistics, arguments.out_file.string() + ".time");