Skip to content

Commit

Permalink
More reasonable block size: 16MB
Browse files Browse the repository at this point in the history
  • Loading branch information
horta committed Aug 10, 2020
1 parent 71bd794 commit b40fc36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bgen_reader/_genotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ def read_genotype_partition(bgen_filepath: Path, offsets):


def _estimate_best_nsub_parts(nsamples, part_size):
# Assume ideal block size, `bs`: 256KB
# Assume ideal block size, `bs`: 16MB
# Assume 16 bytes per genotype per sample, `vs`
# ideal nvariants to read: iv = bs / (vs * nsamples)
# We then use iv to figure out in how many parts a partition will be subdivided
# Let part_size be the number of variants in a partition
# nsub_parts = min(int(part_size / iv), 1)
bs = 256 * 1024
bs = 16 * 1024 * 1024
vs = 16
iv = bs / (vs * nsamples)
return max(int(part_size / iv), 1)
Expand Down

0 comments on commit b40fc36

Please sign in to comment.