18#include <hibf/contrib/std/chunk_view.hpp>
19#include <hibf/contrib/std/zip_view.hpp>
20#include <hibf/misc/divide_and_ceil.hpp>
25template <
typename algorithm_t>
26void call_parallel_on_bins(algorithm_t && worker,
28 uint8_t
const threads)
30 size_t const number_of_bins = bin_paths.size();
33 std::bit_ceil(seqan::hibf::divide_and_ceil(number_of_bins, threads)),
36 auto chunked_view = seqan::stl::views::zip(bin_paths, std::views::iota(0u, number_of_bins))
37 | seqan::stl::views::chunk(chunk_size);
39 size_t const number_of_chunks = std::ranges::size(chunked_view);
41#pragma omp parallel for schedule(dynamic) num_threads(threads)
42 for (
size_t i = 0; i < number_of_chunks; ++i)