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 bf90421 commit c1ac1a5
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/layout/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
#include <filesystem>
#include <fstream>
#include <iostream>
#include <numeric>
#include <stdexcept>
#include <string>
#include <tuple>
#include <vector>
#include <numeric>

#include <chopper/configuration.hpp>
#include <chopper/layout/determine_best_number_of_technical_bins.hpp>
Expand All @@ -28,9 +28,9 @@

#include <hibf/layout/compute_layout.hpp>
#include <hibf/layout/layout.hpp>
#include <hibf/sketch/toolbox.hpp>
#include <hibf/sketch/compute_sketches.hpp>
#include <hibf/sketch/hyperloglog.hpp>
#include <hibf/sketch/toolbox.hpp>

namespace chopper::layout
{
Expand Down Expand Up @@ -83,10 +83,10 @@ int execute(chopper::configuration & config, std::vector<std::string> const & fi
compute_sketches_timer.stop();
dp_algorithm_timer.start();
hibf_layout = seqan::hibf::layout::compute_layout(config.hibf_config,
kmer_counts,
sketches,
union_estimation_timer,
rearrangement_timer);
kmer_counts,
sketches,
union_estimation_timer,
rearrangement_timer);
dp_algorithm_timer.stop();

if (config.output_verbose_statistics)
Expand Down Expand Up @@ -120,9 +120,9 @@ int execute(chopper::configuration & config, std::vector<std::string> const & fi
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 All @@ -139,8 +139,10 @@ int execute(chopper::configuration & config, std::vector<std::string> const & fi
// compute sketches of all user bins
seqan::hibf::sketch::compute_sketches(config.hibf_config, cardinalities, sketches);

size_t const sum_of_cardinalities = std::accumulate(cardinalities.begin(), cardinalities.end(), 0u); // can this overflow?
size_t const cardinality_per_part = seqan::hibf::div_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::div_and_ceil(sum_of_cardinalities / config.number_of_partitions);

size_t current_cardinality{0u};
size_t current_part{0u};
Expand All @@ -166,10 +168,11 @@ int execute(chopper::configuration & config, std::vector<std::string> const & fi
}
}

#pragma omp parallel for schedule(dynamic) num_threads(config.hibf_config.threads)
#pragma omp parallel for schedule(dynamic) num_threads(config.hibf_config.threads)
for (size_t i = 0; i < config.number_of_partitions; ++i)
{
hibf_layouts[i] = seqan::hibf::layout::compute_layout(config.hibf_config, cardinalities, sketches, positions[i]);
hibf_layouts[i] =
seqan::hibf::layout::compute_layout(config.hibf_config, cardinalities, sketches, positions[i]);
}

// brief Write the output to the layout file.
Expand Down

0 comments on commit c1ac1a5

Please sign in to comment.