Note that chunking does not have to do with the hyperslab selections, but just 
represents how the data is physically stored on disk and allows extending the 
dataset if you care to do that.

So you can accomplish what you want bellow with contiguous storage too.

What you are missing is setting the block and stride parameters for hyperslab 
selections.
So you needs something like the following when selecting your hyperslab in the 
filespace:

#define BLOCK_SIZE 10
#define NUM_BLOCKS x;  // set to how many blocks you have (count of 10 integers 
per process)

start[0] = mpi_rank * BLOCK_SIZE;
count[0] = NUM_BLOCKS;
block[0] = BLOCK_SIZE;
stride[0] = BLOCK_SIZE * mpi_size;

Thanks,
Mohamad

-----Original Message-----
From: Hdf-forum [mailto:[email protected]] On Behalf Of 
Brandon Barker
Sent: Thursday, May 21, 2015 9:45 PM
To: [email protected]
Subject: [Hdf-forum] Interleaving data?

Hi All,

If there are two processes, and the rank 0 process has data that looks like:
0   ... 9
20 ... 29
40 ... 49
...

While rank 1 has:

10 ... 19
30 ... 39
...


In this example, I have MPI_CHUNK_SIZE = 10 and the following relevant
configurations:

  /* dataset and memoryset dimensions (just 1d here) */
  hsize_t     dimsm[] = {chunk_count * MPI_CHUNK_SIZE};
  hsize_t     dimsf[] = {dimsm[0] * mpi_size};

  /* hyperslab offset and size info */
  hsize_t     start[]   = {mpi_rank * MPI_CHUNK_SIZE * chunk_count};
  hsize_t     count[]   = {chunk_count * MPI_CHUNK_SIZE};

This gets all the data, but in such a way that all the data from rank
0 comes before rank 1, rather than having the data written in order:
0   ... 9
10 ... 19
20 ... 29
30 ... 39
40 ... 49
...

Is this possible with pHDF5?

Best,
Brandon

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Reply via email to