# some values not read from chunked dataset

**URL:** <https://forum.hdfgroup.org/t/some-values-not-read-from-chunked-dataset/3940>\
**Category:** Hdf-forum archives\
**Created:** [January 1, 2017, 6:20pm UTC](https://forum.hdfgroup.org/t/some-values-not-read-from-chunked-dataset/3940 "2017-01-01T18:20:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crni\_Gorac](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/c/0ea827/32.png) [@Crni\_Gorac](https://forum.hdfgroup.org/u/Crni_Gorac)\
**Post date:** [January 1, 2017, 6:20pm UTC](https://forum.hdfgroup.org/t/some-values-not-read-from-chunked-dataset/3940/1 "2017-01-01T18:20:48Z")

</div>

Hello,

I have a HDF5 file with 129x128x128 dataset, that is chunked in  
32x32x32 blocks. When I try to read the dataset in parallel, from  
Fortran 90 piece of code, and 8 MPI ranks running in parallel, it  
seems that some values get skipped. Attached is small program  
demonstrating the problem, as well as the HDF5 file in question. I've  
tested on Linux, with GCC compiler version 5.4.0, and HDF5 version  
1.10.0-patch1, built against OpenMPI 2.0.1. In order to build the  
program:  
&nbsp;&nbsp;&nbsp;mpifort -o foo foo.f90 -lhdf5\_fortran -lhdf5  
Then, unpack the archive with the HDF5 file:  
&nbsp;&nbsp;&nbsp;tar xfv foo.tgz  
and then run the program:  
&nbsp;&nbsp;&nbsp;mpirun -np 8 foo

All values in the HDF5 file are set to 0. The array in the program is  
initialized to very large values. Then, the dataset is read in  
parallel. Note that there is small overlap in reading between various  
MPI ranks, this is because the actual problem occurred in a finite  
difference code, and the overlap is because of halo regions. After  
reading values from HDF5 file, the program will check are all array  
elements set to 0, and report any array elements that still have very  
large values set. Quite a few elements get reported with wrong values  
when I run the code. However, if I repack the HDF5 file so that  
chunking is removed:  
&nbsp;&nbsp;&nbsp;h5repack -l CONTI foo.h5 bar.h5 && mv bar.h5 foo.h5  
then all values are read properly.

I tried to find are there any limitations on selections in case when  
dataset is chunked in the HDF5 file, but was not able to confirm that  
this could be the issue here. Otherwise, I really have no idea of  
what's wrong... So, any suggestions?

Thanks.

[foo.f90](https://hdf-discourse-1.s3.amazonaws.com/original/1X/520ea038ca46457080980e7cf3d2af1f49218c7e.f90) (4.1 KB)

[foo.tgz](https://hdf-discourse-1.s3.amazonaws.com/original/1X/6ab34c7099dbd3e0cc8be8cbd9654e24d48b6482.tgz) (20.8 KB)
