fn() computeSplitters
Compute splitters for a sequence of objects.

Defined in <seqan/parallel.h>
Signature void computeSplitters(splitters, size, count);


splitters Resulting splitters, will be resized to contain count + 1 elements, e.g. an AllocString of integers.
size The number of objects to split.
count The number of chunks.

Detailed Description


The first count - 1 chunks will have the size ceil(size / count), the last chunk will contain the rest.


Most simple case for splitting.

String<unsigned> splitters;
computeSplitters(splitters, 10, 5);
// splitters == {0, 5, 10}

In this case, the last chunks will stay empty.

computeSplitters(splitters, 3, 5);
// splitters == {0, 1, 2, 3, 3, 3}

Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.