From f34c639e3ffe8b8730b467e66c3872e810dca67a Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 29 Oct 2003 14:32:45 -0500 Subject: [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 --- release_docs/RELEASE.txt | 4 + src/H5FDmpio.c | 71 +++++----------- src/H5FDmpio.h | 2 +- src/H5S.c | 7 -- src/H5Smpio.c | 208 +++++++++++------------------------------------ src/H5Sprivate.h | 1 - 6 files changed, 72 insertions(+), 221 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e108856..c4b3754 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -60,6 +60,10 @@ Bug Fixes since HDF5-1.6.1 release Library ------- + - Fixed problems with MPI datatypes that caused ASCI Q machine to + hang. QAK - 2003/10/28 + - Removed HDF5_MPI_PREFER_DERIVED_TYPES environment variable support, + since it had no benefit. QAK - 2003/10/28 - Single hyperslab selections (which were set with only one call to H5Sselect_hyperslab) that had dimensions that could be "flattened" but were interspersed with dimensions that could not be flattened 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 */ diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h index ae4cf4b..7bd2545 100644 --- a/src/H5FDmpio.h +++ b/src/H5FDmpio.h @@ -61,7 +61,7 @@ H5_DLL herr_t H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode); H5_DLL herr_t H5Pget_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode/*out*/); H5_DLL MPI_Comm H5FD_mpio_communicator(H5FD_t *_file); H5_DLL herr_t H5FD_mpio_setup(hid_t dxpl_id, MPI_Datatype btype, - MPI_Datatype ftype, unsigned use_view); + MPI_Datatype ftype); H5_DLL herr_t H5FD_mpio_teardown(hid_t dxpl_id); H5_DLL herr_t H5FD_mpio_wait_for_left_neighbor(H5FD_t *file); H5_DLL herr_t H5FD_mpio_signal_right_neighbor(H5FD_t *file); diff --git a/src/H5S.c b/src/H5S.c index e1d0327..0f1e905 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -51,7 +51,6 @@ static size_t H5S_nconv_g = 0; /*entries used*/ #ifdef H5_HAVE_PARALLEL /* Global vars whose value can be set from environment variable also */ hbool_t H5S_mpi_opt_types_g = TRUE; -hbool_t H5S_mpi_prefer_derived_types_g = TRUE; #endif /* H5_HAVE_PARALLEL */ /* Declare a free list to manage the H5S_simple_t struct */ @@ -98,12 +97,6 @@ H5S_init_interface(void) if (s && HDisdigit(*s)) H5S_mpi_opt_types_g = (int)HDstrtol (s, NULL, 0); } - { - /* Prefer MPI derived types for collective data transfers? */ - const char *s = HDgetenv ("HDF5_MPI_PREFER_DERIVED_TYPES"); - if (s && HDisdigit(*s)) - H5S_mpi_prefer_derived_types_g = (int)HDstrtol (s, NULL, 0); - } #endif /* H5_HAVE_PARALLEL */ done: diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 224f15a..44d391a 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -51,44 +51,39 @@ static int interface_initialize_g = 0; static herr_t -H5S_mpio_all_type( const H5S_t *space, size_t elmt_size, hbool_t prefer_derived_types, +H5S_mpio_all_type( const H5S_t *space, size_t elmt_size, /* out: */ MPI_Datatype *new_type, size_t *count, hsize_t *extra_offset, - hbool_t *use_view, hbool_t *is_derived_type ); static herr_t -H5S_mpio_none_type( const H5S_t *space, size_t elmt_size, hbool_t prefer_derived_types, +H5S_mpio_none_type( const H5S_t *space, size_t elmt_size, /* out: */ MPI_Datatype *new_type, size_t *count, hsize_t *extra_offset, - hbool_t *use_view, hbool_t *is_derived_type ); static herr_t -H5S_mpio_hyper_type( const H5S_t *space, size_t elmt_size, hbool_t prefer_derived_types, +H5S_mpio_hyper_type( const H5S_t *space, size_t elmt_size, /* out: */ MPI_Datatype *new_type, size_t *count, hsize_t *extra_offset, - hbool_t *use_view, hbool_t *is_derived_type ); static herr_t -H5S_mpio_hyper_contig_type( const H5S_t *space, size_t elmt_size, hbool_t prefer_derived_types, +H5S_mpio_hyper_contig_type( const H5S_t *space, size_t elmt_size, /* out: */ MPI_Datatype *new_type, size_t *count, hsize_t *extra_offset, - hbool_t *use_view, hbool_t *is_derived_type ); static herr_t -H5S_mpio_space_type( const H5S_t *space, size_t elmt_size, hbool_t prefer_derived_types, +H5S_mpio_space_type( const H5S_t *space, size_t elmt_size, /* out: */ MPI_Datatype *new_type, size_t *count, hsize_t *extra_offset, - hbool_t *use_view, hbool_t *is_derived_type ); static herr_t H5S_mpio_spaces_xfer(H5F_t *f, const H5O_layout_t *layout, size_t elmt_size, @@ -107,7 +102,6 @@ H5S_mpio_spaces_xfer(H5F_t *f, const H5O_layout_t *layout, size_t elmt_size, * *count how many objects of the new_type in selection * (useful if this is the buffer type for xfer) * *extra_offset Number of bytes of offset within dataset - * *use_view 0 if view not needed, 1 if needed * *is_derived_type 0 if MPI primitive type, 1 if derived * * Programmer: rky 980813 @@ -115,27 +109,20 @@ H5S_mpio_spaces_xfer(H5F_t *f, const H5O_layout_t *layout, size_t elmt_size, * Modifications: * * Quincey Koziol, June 18, 2002 - * Added 'extra_offset' and 'use_view' parameters - * - * Quincey Koziol, June 19, 2002 - * Added 'prefer_derived_types' flag to choose whether MPI derived types - * should be created or not. + * Added 'extra_offset' parameter * *------------------------------------------------------------------------- */ static herr_t -H5S_mpio_all_type( const H5S_t *space, size_t elmt_size, hbool_t prefer_derived_types, +H5S_mpio_all_type( const H5S_t *space, size_t elmt_size, /* out: */ MPI_Datatype *new_type, size_t *count, hsize_t *extra_offset, - hbool_t *use_view, hbool_t *is_derived_type ) { hsize_t total_bytes; unsigned u; - int mpi_code; /* MPI return code */ - herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOINIT(H5S_mpio_all_type); @@ -147,33 +134,13 @@ H5S_mpio_all_type( const H5S_t *space, size_t elmt_size, hbool_t prefer_derived_ for (u=0; uextent.u.simple.rank; ++u) total_bytes *= space->extent.u.simple.size[u]; - /* Check if we should prefer creating a derived type */ - if(prefer_derived_types) { - /* fill in the return values */ - H5_CHECK_OVERFLOW(total_bytes, hsize_t, int); - if (MPI_SUCCESS != (mpi_code=MPI_Type_contiguous( (int)total_bytes, MPI_BYTE, new_type ))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code); - if(MPI_SUCCESS != (mpi_code=MPI_Type_commit(new_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); - *count = 1; - *extra_offset = 0; - *use_view = 1; - *is_derived_type = 1; - } /* end if */ - else { - /* fill in the return values */ - *new_type = MPI_BYTE; - H5_ASSIGN_OVERFLOW(*count, total_bytes, hsize_t, size_t); - *extra_offset = 0; - *use_view = 0; - *is_derived_type = 0; - } /* end else */ + /* fill in the return values */ + *new_type = MPI_BYTE; + H5_ASSIGN_OVERFLOW(*count, total_bytes, hsize_t, size_t); + *extra_offset = 0; + *is_derived_type = 0; -done: -#ifdef H5Smpi_DEBUG - HDfprintf(stdout, "Leave %s total_bytes=%Hu\n", FUNC, total_bytes ); -#endif - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(SUCCEED); } /* H5S_mpio_all_type() */ @@ -188,7 +155,6 @@ done: * *count how many objects of the new_type in selection * (useful if this is the buffer type for xfer) * *extra_offset Number of bytes of offset within dataset - * *use_view 0 if view not needed, 1 if needed * *is_derived_type 0 if MPI primitive type, 1 if derived * * Programmer: Quincey Koziol, October 29, 2002 @@ -198,45 +164,22 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5S_mpio_none_type( const H5S_t *space, size_t UNUSED elmt_size, hbool_t prefer_derived_types, +H5S_mpio_none_type( const H5S_t UNUSED *space, size_t UNUSED elmt_size, /* out: */ MPI_Datatype *new_type, size_t *count, hsize_t *extra_offset, - hbool_t *use_view, hbool_t *is_derived_type ) { - int mpi_code; /* MPI return code */ - herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOINIT(H5S_mpio_none_type); - /* Check args */ - assert(space); - - /* Check if we should prefer creating a derived type */ - if(prefer_derived_types) { - /* fill in the return values */ - if (MPI_SUCCESS != (mpi_code=MPI_Type_contiguous(0, MPI_BYTE, new_type ))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code); - if(MPI_SUCCESS != (mpi_code=MPI_Type_commit(new_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); - *count = 1; - *extra_offset = 0; - *use_view = 1; - *is_derived_type = 1; - } /* end if */ - else { - /* fill in the return values */ - *new_type = MPI_BYTE; - *count = 0; - *extra_offset = 0; - *use_view = 0; - *is_derived_type = 0; - } /* end else */ + /* fill in the return values */ + *new_type = MPI_BYTE; + *count = 0; + *extra_offset = 0; + *is_derived_type = 0; -done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(SUCCEED); } /* H5S_mpio_none_type() */ @@ -251,7 +194,6 @@ done: * *count how many objects of the new_type in selection * (useful if this is the buffer type for xfer) * *extra_offset Number of bytes of offset within dataset - * *use_view 0 if view not needed, 1 if needed * *is_derived_type 0 if MPI primitive type, 1 if derived * * Programmer: rky 980813 @@ -264,22 +206,17 @@ done: * H5S_MAX_RANK. * * Quincey Koziol, June 18, 2002 - * Added 'extra_offset' and 'use_view' parameters. Also accomodate + * Added 'extra_offset' parameter. Also accomodate * selection offset in MPI type built. * - * Quincey Koziol, June 19, 2002 - * Added 'prefer_derived_types' flag to choose whether MPI derived types - * should be created or not. (Ignored for this routine) - * *------------------------------------------------------------------------- */ static herr_t -H5S_mpio_hyper_type( const H5S_t *space, size_t elmt_size, hbool_t UNUSED prefer_derived_types, +H5S_mpio_hyper_type( const H5S_t *space, size_t elmt_size, /* out: */ MPI_Datatype *new_type, size_t *count, hsize_t *extra_offset, - hbool_t *use_view, hbool_t *is_derived_type ) { struct dim { /* less hassle than malloc/free & ilk */ @@ -560,7 +497,6 @@ H5S_mpio_hyper_type( const H5S_t *space, size_t elmt_size, hbool_t UNUSED prefer /* fill in the remaining return values */ *count = 1; /* only have to move one of these suckers! */ *extra_offset = 0; - *use_view = 1; *is_derived_type = 1; HGOTO_DONE(SUCCEED); @@ -569,7 +505,6 @@ empty: *new_type = MPI_BYTE; *count = 0; *extra_offset = 0; - *use_view = 1; /* Note that this 'use_view' could go either way, but go with '1' for now */ *is_derived_type = 0; done: @@ -592,26 +527,20 @@ done: * *count how many objects of the new_type in selection * (useful if this is the buffer type for xfer) * *extra_offset Number of bytes of offset within dataset - * *use_view 0 if view not needed, 1 if needed * *is_derived_type 0 if MPI primitive type, 1 if derived * * Programmer: Quincey Koziol, 2002/06/17 * * Modifications: * - * Quincey Koziol, June 19, 2002 - * Added 'prefer_derived_types' flag to choose whether MPI derived types - * should be created or not. - * *------------------------------------------------------------------------- */ static herr_t -H5S_mpio_hyper_contig_type( const H5S_t *space, size_t elmt_size, hbool_t prefer_derived_types, +H5S_mpio_hyper_contig_type( const H5S_t *space, size_t elmt_size, /* out: */ MPI_Datatype *new_type, size_t *count, hsize_t *extra_offset, - hbool_t *use_view, hbool_t *is_derived_type ) { hsize_t total_bytes; /* Number of bytes in selection */ @@ -622,8 +551,6 @@ H5S_mpio_hyper_contig_type( const H5S_t *space, size_t elmt_size, hbool_t prefer hssize_t offset[H5O_LAYOUT_NDIMS]; /* Offset in selection */ int ndims; /* Number of dimensions of dataset */ int i; /* Local index */ - int mpi_code; /* MPI return code */ - herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOINIT(H5S_mpio_hyper_contig_type); @@ -636,7 +563,7 @@ H5S_mpio_hyper_contig_type( const H5S_t *space, size_t elmt_size, hbool_t prefer /* Compute the number of bytes in selection */ total_bytes = (hsize_t)elmt_size*nelem; - /* Set up convenient aliased */ + /* Set up convenient alias */ ndims=space->extent.u.simple.rank; /* Initialize row sizes for each dimension */ @@ -654,33 +581,13 @@ H5S_mpio_hyper_contig_type( const H5S_t *space, size_t elmt_size, hbool_t prefer for(i=0,byte_offset=0; iselect.type) { case H5S_SEL_NONE: - if ( H5S_mpio_none_type( space, elmt_size, prefer_derived_types, - /* out: */ new_type, count, extra_offset, use_view, is_derived_type ) <0) + if ( H5S_mpio_none_type( space, elmt_size, + /* out: */ new_type, count, extra_offset, is_derived_type ) <0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert \"all\" selection to MPI type"); break; case H5S_SEL_ALL: - if ( H5S_mpio_all_type( space, elmt_size, prefer_derived_types, - /* out: */ new_type, count, extra_offset, use_view, is_derived_type ) <0) + if ( H5S_mpio_all_type( space, elmt_size, + /* out: */ new_type, count, extra_offset, is_derived_type ) <0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert \"all\" selection to MPI type"); break; @@ -753,15 +653,15 @@ H5S_mpio_space_type( const H5S_t *space, size_t elmt_size, hbool_t prefer_derive case H5S_SEL_HYPERSLABS: if((*space->select.is_contiguous)(space)) { - err = H5S_mpio_hyper_contig_type( space, elmt_size, prefer_derived_types, - /* out: */ new_type, count, extra_offset, use_view, is_derived_type ); + if(H5S_mpio_hyper_contig_type( space, elmt_size, + /* out: */ new_type, count, extra_offset, is_derived_type )<0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert \"all\" selection to MPI type"); } /* end if */ else { - err = H5S_mpio_hyper_type( space, elmt_size, prefer_derived_types, - /* out: */ new_type, count, extra_offset, use_view, is_derived_type ); + if(H5S_mpio_hyper_type( space, elmt_size, + /* out: */ new_type, count, extra_offset, is_derived_type )<0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert \"all\" selection to MPI type"); } /* end else */ - if (err<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert \"all\" selection to MPI type"); break; default: @@ -772,7 +672,7 @@ H5S_mpio_space_type( const H5S_t *space, size_t elmt_size, hbool_t prefer_derive case H5S_COMPLEX: /* not yet implemented */ - ret_value = FAIL; + HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "complex data spaces are not supported yet"); break; default: @@ -824,12 +724,7 @@ done: * * QAK - 2002/06/18 * Removed 'dc_plist' parameter, since it was not used. Also, switch to - * getting the 'use_view' and 'extra_offset' settings for each selection. - * - * Quincey Koziol, June 19, 2002 - * Use 'prefer_derived_types' flag (from HDF5_MPI_PREFER_DERIVED_TYPES - * environment variable) to choose whether MPI derived types should be - * preferred or not. + * getting the 'extra_offset' setting for each selection. * *------------------------------------------------------------------------- */ @@ -843,12 +738,9 @@ H5S_mpio_spaces_xfer(H5F_t *f, const H5O_layout_t *layout, size_t elmt_size, size_t mpi_buf_count, mpi_file_count; /* Number of "objects" to transfer */ hsize_t mpi_buf_offset, mpi_file_offset; /* Offset within dataset where selection (ie. MPI type) begins */ MPI_Datatype mpi_buf_type, mpi_file_type; /* MPI types for buffer (memory) and file */ - hbool_t mbt_use_view=0, /* Whether we need to use a view for the buffer (memory) type */ - mft_use_view=0; /* Whether we need to use a view for the file type */ hbool_t mbt_is_derived=0, /* Whether the buffer (memory) type is derived and needs to be free'd */ mft_is_derived=0; /* Whether the file type is derived and needs to be free'd */ hbool_t plist_is_setup=0; /* Whether the dxpl has been customized */ - hbool_t prefer_derived_types=0;/* Whether to prefer MPI derived types or not */ uint8_t *buf=(uint8_t *)_buf; /* Alias for pointer arithmetic */ int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; /* Return value */ @@ -865,27 +757,21 @@ H5S_mpio_spaces_xfer(H5F_t *f, const H5O_layout_t *layout, size_t elmt_size, /* Make certain we have the correct type of property list */ assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); - /* Get the preference for MPI derived types */ - /* (Set via the "HDF5_MPI_PREFER_DERIVED_TYPES" environment variable for now) */ - prefer_derived_types= H5S_mpi_prefer_derived_types_g; - /* create the MPI buffer type */ - if (H5S_mpio_space_type( mem_space, elmt_size, prefer_derived_types, + if (H5S_mpio_space_type( mem_space, elmt_size, /* out: */ &mpi_buf_type, &mpi_buf_count, &mpi_buf_offset, - &mbt_use_view, &mbt_is_derived )<0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't create MPI buf type"); /* create the MPI file type */ - if ( H5S_mpio_space_type( file_space, elmt_size, prefer_derived_types, + if ( H5S_mpio_space_type( file_space, elmt_size, /* out: */ &mpi_file_type, &mpi_file_count, &mpi_file_offset, - &mft_use_view, &mft_is_derived )<0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't create MPI file type"); @@ -902,7 +788,7 @@ H5S_mpio_spaces_xfer(H5F_t *f, const H5O_layout_t *layout, size_t elmt_size, * Pass buf type, file type to the file driver. Request an MPI type * transfer (instead of an elementary byteblock transfer). */ - if(H5FD_mpio_setup(dxpl_id, mpi_buf_type, mpi_file_type, (unsigned)(mbt_use_view || mft_use_view))<0) + if(H5FD_mpio_setup(dxpl_id, mpi_buf_type, mpi_file_type)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O properties"); plist_is_setup=1; diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index b8400eb..1a924d3 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -255,7 +255,6 @@ H5_DLL herr_t H5S_select_iter_release(H5S_sel_iter_t *sel_iter); /* Global vars whose value comes from environment variable */ /* (Defined in H5S.c) */ H5_DLLVAR hbool_t H5S_mpi_opt_types_g; -H5_DLLVAR hbool_t H5S_mpi_prefer_derived_types_g; #endif /* _H5S_IN_H5S_C */ #endif /* H5_HAVE_PARALLEL */ -- cgit v0.12