Skip to content

Commit

Permalink
[MISC] automatic linting
Browse files Browse the repository at this point in the history
  • Loading branch information
seqan-actions committed Nov 9, 2023
1 parent b4dc08a commit 98303cd
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions src/layout/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <hibf/layout/compute_layout.hpp>
#include <hibf/layout/layout.hpp>
#include <hibf/misc/divide_and_ceil.hpp>
#include <hibf/sketch/toolbox.hpp>
#include <hibf/sketch/compute_sketches.hpp>
#include <hibf/sketch/hyperloglog.hpp>
#include <hibf/sketch/toolbox.hpp>
Expand Down Expand Up @@ -94,11 +93,11 @@ int execute(chopper::configuration & config, std::vector<std::string> const & fi

dp_algorithm_timer.start();
hibf_layout = seqan::hibf::layout::compute_layout(config.hibf_config,
kmer_counts,
sketches,
std::move(positions),
union_estimation_timer,
rearrangement_timer);
kmer_counts,
sketches,
std::move(positions),
union_estimation_timer,
rearrangement_timer);
dp_algorithm_timer.stop();

if (config.output_verbose_statistics)
Expand Down Expand Up @@ -154,8 +153,10 @@ int execute(chopper::configuration & config, std::vector<std::string> const & fi
seqan::hibf::sketch::compute_sketches(config.hibf_config, cardinalities, sketches);
compute_sketches_timer.stop();

size_t const sum_of_cardinalities = std::accumulate(cardinalities.begin(), cardinalities.end(), 0u); // can this overflow?
size_t const cardinality_per_part = seqan::hibf::divide_and_ceil(sum_of_cardinalities, config.number_of_partitions);
size_t const sum_of_cardinalities =
std::accumulate(cardinalities.begin(), cardinalities.end(), 0u); // can this overflow?
size_t const cardinality_per_part =
seqan::hibf::divide_and_ceil(sum_of_cardinalities, config.number_of_partitions);

size_t current_cardinality{0u};
size_t current_part{0u};
Expand Down Expand Up @@ -189,17 +190,22 @@ int execute(chopper::configuration & config, std::vector<std::string> const & fi
seqan::hibf::concurrent_timer dp_algorithm_timer{};

dp_algorithm_timer.start();
hibf_layouts[i] = seqan::hibf::layout::compute_layout(config.hibf_config, cardinalities, sketches, std::move(positions[i]), union_estimation_timer, rearrangement_timer);
hibf_layouts[i] = seqan::hibf::layout::compute_layout(config.hibf_config,
cardinalities,
sketches,
std::move(positions[i]),
union_estimation_timer,
rearrangement_timer);
dp_algorithm_timer.stop();

if (!config.output_timings.empty())
{
std::ofstream output_stream{config.output_timings};
output_stream << std::fixed << std::setprecision(2);
output_stream << "sketching_in_seconds\t"
<< "layouting_in_seconds\t"
<< "union_estimation_in_seconds\t"
<< "rearrangement_in_seconds\n";
<< "layouting_in_seconds\t"
<< "union_estimation_in_seconds\t"
<< "rearrangement_in_seconds\n";
output_stream << compute_sketches_timer.in_seconds() << '\t';
output_stream << dp_algorithm_timer.in_seconds() << '\t';
output_stream << union_estimation_timer.in_seconds() << '\t';
Expand Down

0 comments on commit 98303cd

Please sign in to comment.