Append HDF5 files in parallel

I used H5Dread_chunk and H5Dwrite_chunk as suggested.
The error message was gone. This appears to work for
independent I/O mode.

However, I was encountering a new problem. The program
hangs at H5Fclose. After some digging into HDF5 source codes,
I found the hanging is inside of H5FD__mpio_truncate() and the same
problem was reported earlier by @gdsjaar in Hang in H5Fclose

I added a printf statement to check the values of ‘size’ and ‘needed_eof’.
Below is what I got from my program running on 2 MPI processes.
[0] …/…/hdf5-1.12.0/src/H5FDmpio.c line 1654: size=5113724 needed_eof=4683672
[1] …/…/hdf5-1.12.0/src/H5FDmpio.c line 1654: size=5113724 needed_eof=5113724

My program hangs because of the MPI_Barrier called inside the if condition:
if(size != needed_eof) {