I have a parallel fortran application and I would like to read in medium-to-large data arrays that will be "mirrored" on all processors. In other words, this is "global" data such as observation locations which is necessary for all processing elements to have to do their work, and not the distributed arrays that will be distributed across processors.
Is there a pure HDF solution that will efficiently read in all of the data and broadcast it to the processing elements?
I understand from the HDF parallel documentation that I can select a hyperslab in parallel using the following:
! open the file, etc.
! ...
call h5sselect_hyperslab_f (slabspace, H5S_SELECT_SET_F, &
& data_offset, data_count, hdf_error)
call h5pcreate_f(H5P_DATASET_XFER_F, plist_id, hdf_error)
call h5pset_dxpl_mpio_f(plist_id, H5FD_MPIO_COLLECTIVE_F, &
& hdf_error)
call h5dread_f(dset_tb, H5T_IEEE_F32LE, obs, dims, &
& hdf_error, file_space_id = slabspace, mem_space_id = memspace, &
& xfer_prp = plist_id)
I understand this could be used to set the data_offset and data_count through a hyperslab, which could distribute the data to different processors.
However, I was wondering if I had missed something for my case where all of the processors will get all of the data. If I make the data_offset equal to 0 for h5sselect_hyperslab_f and ran with all of the data, am I correct to expect the performance to be terrible?
Or do I need to break up the I/O on the processors myself with a hyperslab then use an MPI allgather?