Hyperslabs: count vs blocks

Reading the HDF5 Guide section the way to describe hyperslab is to use count for dimension and offset for position defaulting block to 1-s. On the other hand it is entirely possible to create equivalent description by using block and offset defaulting count to a vector of 1-s with proper rank.

Some time ago in a conversation @gheber suggested that the second version, using blocks to describe dimension defaulting count to 1-s is the right way for doing selection, even though the first one gives the same result.

Today I noticed that when querying the number of selected blocks with H5Sget_select_hyper_nblocks the latter approach, suggested by @gheber returns only a single block selected, whereas the former is proportional the number of elements being selected. – even though the example does the opposite.

The questions: Is there a difference between the two operations in terms of resource usage? Anyone has profiled this? Is the example depicted in is semantically correct?

ps.: strides are left out on purpose, defaulting it to 1-s of proper rank.


Hi Steven,

Both of these operations should be equivalent. Either way is fine. If you are seeing a performance issue using one way or the other, please let us know!