summaryrefslogtreecommitdiffstats
path: root/src/H5FDmpio.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-10-29 19:32:45 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-10-29 19:32:45 (GMT)
commitf34c639e3ffe8b8730b467e66c3872e810dca67a (patch)
tree8bdc6d66057362285db867ab2f036e5083163b33 /src/H5FDmpio.c
parenta481eaa62d9373e25083463bd027f405f6052fd5 (diff)
downloadhdf5-f34c639e3ffe8b8730b467e66c3872e810dca67a.zip
hdf5-f34c639e3ffe8b8730b467e66c3872e810dca67a.tar.gz
hdf5-f34c639e3ffe8b8730b467e66c3872e810dca67a.tar.bz2
[svn-r7790] Purpose:
Bug fix & code cleanups Description: Change our use of MPI derived datatypes to not create datatypes with "0-sized" lengths, which causes the LANL Q machine to hang. Also, get rid of "prefer MPI derived datatypes" environment variable since it has no advantage. Platforms tested: FreeBSD 4.9 (sleipnir) w & w/o parallel h5committest
Diffstat (limited to 'src/H5FDmpio.c')
-rw-r--r--src/H5FDmpio.c71
1 files changed, 20 insertions, 51 deletions
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 599fd62..dc98bc2 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -170,9 +170,6 @@ static int interface_initialize_g = 0;
/* Definitions for file MPI type property */
#define H5FD_MPIO_XFER_FILE_MPI_TYPE_NAME "H5FD_mpio_file_mpi_type"
#define H5FD_MPIO_XFER_FILE_MPI_TYPE_SIZE sizeof(MPI_Datatype)
-/* Definitions for whether to use MPI types property */
-#define H5FD_MPIO_XFER_USE_VIEW_NAME "H5FD_mpio_use_view"
-#define H5FD_MPIO_XFER_USE_VIEW_SIZE sizeof(unsigned)
/*-------------------------------------------------------------------------
@@ -637,7 +634,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5FD_mpio_setup(hid_t dxpl_id, MPI_Datatype btype, MPI_Datatype ftype, unsigned use_view)
+H5FD_mpio_setup(hid_t dxpl_id, MPI_Datatype btype, MPI_Datatype ftype)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
@@ -656,10 +653,6 @@ H5FD_mpio_setup(hid_t dxpl_id, MPI_Datatype btype, MPI_Datatype ftype, unsigned
if(H5P_insert(plist,H5FD_MPIO_XFER_FILE_MPI_TYPE_NAME,H5FD_MPIO_XFER_FILE_MPI_TYPE_SIZE,&ftype,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property");
- /* Set 'use view' property */
- if(H5P_insert(plist,H5FD_MPIO_XFER_USE_VIEW_NAME,H5FD_MPIO_XFER_USE_VIEW_SIZE,&use_view,NULL,NULL,NULL,NULL,NULL)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property");
-
done:
FUNC_LEAVE_NOAPI(ret_value);
}
@@ -700,10 +693,6 @@ H5FD_mpio_teardown(hid_t dxpl_id)
if(H5P_remove(dxpl_id,plist,H5FD_MPIO_XFER_FILE_MPI_TYPE_NAME)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property");
- /* Remove 'use view' property */
- if(H5P_remove(dxpl_id,plist,H5FD_MPIO_XFER_USE_VIEW_NAME)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property");
-
done:
FUNC_LEAVE_NOAPI(ret_value);
}
@@ -1474,10 +1463,6 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add
MPI_Datatype buf_type=MPI_BYTE; /* MPI description of the selection in memory */
int size_i, bytes_read, n;
unsigned use_view_this_time=0;
- H5P_genplist_t *plist; /* Property list pointer */
-#ifndef NDEBUG
- H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */
-#endif /* NDEBUG */
herr_t ret_value=SUCCEED;
FUNC_ENTER_NOAPI(H5FD_mpio_read, FAIL);
@@ -1509,30 +1494,27 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add
(long)mpi_off, size_i );
#endif
- /* Obtain the data transfer properties */
- if(NULL == (plist = H5I_object(dxpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
-#ifndef NDEBUG
- xfer_mode=(H5FD_mpio_xfer_t)H5P_peek_unsigned(plist, H5D_XFER_IO_XFER_MODE_NAME);
-#endif /* NDEBUG */
-
/* Only look for MPI views for raw data transfers */
if(type==H5FD_MEM_DRAW) {
+ H5P_genplist_t *plist; /* Property list pointer */
+ H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */
+
+ /* Obtain the data transfer properties */
+ if(NULL == (plist = H5I_object(dxpl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+ xfer_mode=(H5FD_mpio_xfer_t)H5P_peek_unsigned(plist, H5D_XFER_IO_XFER_MODE_NAME);
+
/*
* Set up for a fancy xfer using complex types, or single byte block. We
* wouldn't need to rely on the use_view field if MPI semantics allowed
* us to test that btype=ftype=MPI_BYTE (or even MPI_TYPE_NULL, which
* could mean "use MPI_BYTE" by convention).
*/
- if(H5P_exist_plist(plist,H5FD_MPIO_XFER_USE_VIEW_NAME)>0)
- if(H5P_get(plist,H5FD_MPIO_XFER_USE_VIEW_NAME,&use_view_this_time)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
-
- if (use_view_this_time) {
+ if(xfer_mode==H5FD_MPIO_COLLECTIVE) {
MPI_Datatype file_type;
- /* Sanity check that views will only be used by collective I/O */
- assert(xfer_mode==H5FD_MPIO_COLLECTIVE);
+ /* Remember that views are used */
+ use_view_this_time=TRUE;
/* prepare for a full-blown xfer using btype, ftype, and disp */
if(H5P_get(plist,H5FD_MPIO_XFER_MEM_MPI_TYPE_NAME,&buf_type)<0)
@@ -1552,10 +1534,6 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add
*/
mpi_off=0;
} /* end if */
- else {
- /* Sanity check that independent I/O must be occuring */
- assert(xfer_mode==H5FD_MPIO_INDEPENDENT);
- } /* end else */
} /* end if */
/* Read the data. */
@@ -1781,9 +1759,6 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
int size_i, bytes_written;
unsigned use_view_this_time=0;
H5P_genplist_t *plist; /* Property list pointer */
-#ifndef NDEBUG
- H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */
-#endif /* NDEBUG */
herr_t ret_value=SUCCEED;
FUNC_ENTER_NOAPI(H5FD_mpio_write, FAIL);
@@ -1818,26 +1793,24 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
/* Obtain the data transfer properties */
if(NULL == (plist = H5I_object(dxpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
-#ifndef NDEBUG
- xfer_mode = H5P_peek_unsigned(plist, H5D_XFER_IO_XFER_MODE_NAME);
-#endif /* NDEBUG */
if(type==H5FD_MEM_DRAW) {
+ H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */
+
+ /* Obtain the data transfer properties */
+ xfer_mode = H5P_peek_unsigned(plist, H5D_XFER_IO_XFER_MODE_NAME);
+
/*
* Set up for a fancy xfer using complex types, or single byte block. We
* wouldn't need to rely on the use_view field if MPI semantics allowed
* us to test that btype=ftype=MPI_BYTE (or even MPI_TYPE_NULL, which
* could mean "use MPI_BYTE" by convention).
*/
- if(H5P_exist_plist(plist,H5FD_MPIO_XFER_USE_VIEW_NAME)>0)
- if(H5P_get(plist,H5FD_MPIO_XFER_USE_VIEW_NAME,&use_view_this_time)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
-
- if (use_view_this_time) {
+ if(xfer_mode==H5FD_MPIO_COLLECTIVE) {
MPI_Datatype file_type;
- /* Sanity check that views will only be used by collective I/O */
- assert(xfer_mode==H5FD_MPIO_COLLECTIVE);
+ /* Remember that views are used */
+ use_view_this_time=TRUE;
/* prepare for a full-blown xfer using btype, ftype, and disp */
if(H5P_get(plist,H5FD_MPIO_XFER_MEM_MPI_TYPE_NAME,&buf_type)<0)
@@ -1857,10 +1830,6 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
*/
mpi_off=0;
} /* end if */
- else {
- /* Sanity check that independent I/O must occur */
- assert(xfer_mode==H5FD_MPIO_INDEPENDENT);
- } /* end else */
} /* end if */
else {
unsigned block_before_meta_write=0; /* Whether to block before a metadata write */