diff options
Diffstat (limited to 'src/H5Distore.c')
-rw-r--r-- | src/H5Distore.c | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c index a44ce5a..a9f7f56 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -45,8 +45,9 @@ #include "H5Sprivate.h" /* Dataspaces */ #include "H5Vprivate.h" -/* MPIO driver needed for special checks */ +/* MPIO & MPIPOSIX drivers needed for special checks */ #include "H5FDmpio.h" +#include "H5FDmpiposix.h" /* * Feature: If this constant is defined then every cache preemption and load @@ -1781,12 +1782,12 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, #ifdef H5_HAVE_PARALLEL /* - * If MPIO is used and file can be written to, we must bypass the + * If MPIO or MPIPOSIX is used and file can be written to, we must bypass the * chunk-cache scheme because other MPI processes could be writing to * other elements in the same chunk. * Do a direct write-through of only the elements requested. */ - || (IS_H5FD_MPIO(f) && (H5F_ACC_RDWR & f->shared->flags)) + || ((IS_H5FD_MPIO(f) ||IS_H5FD_MPIPOSIX(f)) && (H5F_ACC_RDWR & f->shared->flags)) #endif /* H5_HAVE_PARALLEL */ ) { H5O_layout_t l; /* temporary layout */ @@ -1965,11 +1966,11 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, #ifdef H5_HAVE_PARALLEL /* - * If MPIO is used, must bypass the chunk-cache scheme because other + * If MPIO or MPIPOSIX is used, must bypass the chunk-cache scheme because other * MPI processes could be writing to other elements in the same chunk. * Do a direct write-through of only the elements requested. */ - || (IS_H5FD_MPIO(f) && (H5F_ACC_RDWR & f->shared->flags)) + || ((IS_H5FD_MPIO(f) ||IS_H5FD_MPIPOSIX(f)) && (H5F_ACC_RDWR & f->shared->flags)) #endif /* H5_HAVE_PARALLEL */ ) { H5O_layout_t l; /* temporary layout */ @@ -2416,10 +2417,22 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, } /* end if */ /* Retrieve up MPI parameters */ - if ((mpi_rank=H5FD_mpio_mpi_rank(f->shared->lf))<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI rank"); - if ((mpi_size=H5FD_mpio_mpi_size(f->shared->lf))<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI size"); + if(IS_H5FD_MPIO(f)) { + if ((mpi_rank=H5FD_mpio_mpi_rank(f->shared->lf))<0) + HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI rank"); + if ((mpi_size=H5FD_mpio_mpi_size(f->shared->lf))<0) + HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI size"); + } /* end if */ + else { + /* Sanity Check */ + assert(IS_H5FD_MPIPOSIX(f)); + + /* Get the MPI rank & size */ + if ((mpi_rank=H5FD_mpiposix_mpi_rank(f->shared->lf))<0) + HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI rank"); + if ((mpi_size=H5FD_mpiposix_mpi_size(f->shared->lf))<0) + HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI size"); + } /* end else */ /* Loop over all chunks */ carry=0; @@ -2469,8 +2482,17 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, * still writing out chunks and other processes race ahead to read * them in, getting bogus data. */ - if (MPI_Barrier(H5FD_mpio_communicator(f->shared->lf))) - HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Barrier failed"); + if(IS_H5FD_MPIO(f)) { + if (MPI_Barrier(H5FD_mpio_communicator(f->shared->lf))) + HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Barrier failed"); + } /* end if */ + else { + /* Sanity Check */ + assert(IS_H5FD_MPIPOSIX(f)); + + if (MPI_Barrier(H5FD_mpiposix_communicator(f->shared->lf))) + HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Barrier failed"); + } /* end else */ } /* end if */ done: |