summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5Dio.c3
-rw-r--r--src/H5Dmpio.c24
-rw-r--r--src/H5Ppublic.h3
-rw-r--r--src/H5Smpio.c35
-rw-r--r--src/libhdf5.settings.in35
5 files changed, 78 insertions, 22 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 452105e..5fea91f 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -1189,7 +1189,8 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset,
"data transforms needed to be applied",
"optimized MPI types flag wasn't set",
"one of the dataspaces was neither simple nor scalar",
- "dataset was not contiguous or chunked" };
+ "dataset was not contiguous or chunked",
+ "parallel writes to filtered datasets are disabled" };
if(H5CX_get_mpio_local_no_coll_cause(&local_no_collective_cause) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get local no collective cause value")
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index d721ae6..5ebdc06 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -229,9 +229,11 @@ static herr_t H5D__mpio_get_sum_chunk(const H5D_io_info_t *io_info,
static herr_t H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info,
const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm,
H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries);
+#if MPI_VERSION >= 3
static herr_t H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info,
const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm,
H5D_filtered_collective_io_info_t *local_chunk_array, size_t *local_chunk_array_num_entries);
+#endif
static herr_t H5D__mpio_array_gatherv(void *local_array, size_t local_array_num_entries,
size_t array_entry_size, void **gathered_array, size_t *gathered_array_num_entries,
hbool_t allgather, int root, MPI_Comm comm, int (*sort_func)(const void *, const void *));
@@ -244,8 +246,10 @@ static herr_t H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io
static int H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2);
static int H5D__cmp_filtered_collective_io_info_entry(const void *filtered_collective_io_info_entry1,
const void *filtered_collective_io_info_entry2);
+#if MPI_VERSION >= 3
static int H5D__cmp_filtered_collective_io_info_entry_owner(const void *filtered_collective_io_info_entry1,
const void *filtered_collective_io_info_entry2);
+#endif
/*********************/
@@ -330,6 +334,18 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space,
* use collective IO will defer until each chunk IO is reached.
*/
+#if MPI_VERSION < 3
+ /*
+ * Don't allow parallel writes to filtered datasets if the MPI version
+ * is less than 3. The functions needed (MPI_Mprobe and MPI_Imrecv) will
+ * not be available.
+ */
+ if (io_info->op_type == H5D_IO_OP_WRITE &&
+ io_info->dset->shared->layout.type == H5D_CHUNKED &&
+ io_info->dset->shared->dcpl_cache.pline.nused > 0)
+ local_cause |= H5D_MPIO_PARALLEL_FILTERED_WRITES_DISABLED;
+#endif
+
/* Check for independent I/O */
if(local_cause & H5D_MPIO_SET_INDEPENDENT)
global_cause = local_cause;
@@ -2127,6 +2143,7 @@ H5D__cmp_filtered_collective_io_info_entry(const void *filtered_collective_io_in
FUNC_LEAVE_NOAPI(H5F_addr_cmp(addr1, addr2))
} /* end H5D__cmp_filtered_collective_io_info_entry() */
+#if MPI_VERSION >= 3
/*-------------------------------------------------------------------------
* Function: H5D__cmp_filtered_collective_io_info_entry_owner
@@ -2157,6 +2174,7 @@ H5D__cmp_filtered_collective_io_info_entry_owner(const void *filtered_collective
FUNC_LEAVE_NOAPI(owner1 - owner2)
} /* end H5D__cmp_filtered_collective_io_info_entry_owner() */
+#endif
/*-------------------------------------------------------------------------
@@ -2585,8 +2603,12 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ
/* Redistribute shared chunks to new owners as necessary */
if (io_info->op_type == H5D_IO_OP_WRITE)
+#if MPI_VERSION >= 3
if (H5D__chunk_redistribute_shared_chunks(io_info, type_info, fm, local_info_array, &num_chunks_selected) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to redistribute shared chunks")
+#else
+ HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to redistribute shared chunks - MPI version < 3 (MPI_Mprobe and MPI_Imrecv missing)")
+#endif
*chunk_list = local_info_array;
*num_entries = num_chunks_selected;
@@ -2595,6 +2617,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__construct_filtered_io_info_list() */
+#if MPI_VERSION >= 3
/*-------------------------------------------------------------------------
* Function: H5D__chunk_redistribute_shared_chunks
@@ -2893,6 +2916,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_redistribute_shared_chunks() */
+#endif
/*-------------------------------------------------------------------------
diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h
index 58f3d18..c5596e5 100644
--- a/src/H5Ppublic.h
+++ b/src/H5Ppublic.h
@@ -166,7 +166,8 @@ typedef enum H5D_mpio_no_collective_cause_t {
H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED = 0x08,
H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES = 0x10,
H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET = 0x20,
- H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE = 0x40
+ H5D_MPIO_PARALLEL_FILTERED_WRITES_DISABLED = 0x40,
+ H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE = 0x80
} H5D_mpio_no_collective_cause_t;
/********************/
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index db81ffc..2bd275a 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -271,29 +271,58 @@ H5S_mpio_create_point_datatype (size_t elmt_size, hsize_t num_points,
if(NULL == (inner_disps = (MPI_Aint *)H5MM_malloc(sizeof(MPI_Aint) * (size_t)total_types)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of blocks")
+#if MPI_VERSION < 3
+ /* Allocate block sizes for MPI datatype call */
+ if(NULL == (blocks = (int *)H5MM_malloc(sizeof(int) * bigio_count)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of blocks")
+
+ for(u = 0; u < bigio_count; u++)
+ blocks[u] = 1;
+#endif
+
for(i=0 ; i<num_big_types ; i++) {
+#if MPI_VERSION >= 3
if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block(bigio_count,
1,
&disp[i*bigio_count],
elmt_type,
&inner_types[i]))) {
- HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed_block failed", mpi_code);
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed_block failed", mpi_code);
}
+#else
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)bigio_count,
+ blocks,
+ &disp[i*bigio_count],
+ elmt_type,
+ &inner_types[i]))) {
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code)
+ }
+#endif
inner_blocks[i] = 1;
inner_disps[i] = 0;
}
if(remaining_points) {
+#if MPI_VERSION >= 3
if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block(remaining_points,
1,
&disp[num_big_types*bigio_count],
elmt_type,
&inner_types[num_big_types]))) {
HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed_block failed", mpi_code);
- }
+ }
+#else
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)remaining_points,
+ blocks,
+ &disp[num_big_types*bigio_count],
+ elmt_type,
+ &inner_types[num_big_types]))) {
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code)
+ }
+#endif
inner_blocks[num_big_types] = 1;
inner_disps[num_big_types] = 0;
- }
+ }
if(MPI_SUCCESS != (mpi_code = MPI_Type_create_struct(total_types,
inner_blocks,
diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in
index 51b24dc..61fa1eb 100644
--- a/src/libhdf5.settings.in
+++ b/src/libhdf5.settings.in
@@ -67,20 +67,21 @@ Languages:
Features:
---------
- Parallel HDF5: @PARALLEL@
- High-level library: @HDF5_HL@
- Threadsafety: @THREADSAFE@
- Default API mapping: @DEFAULT_API_VERSION@
- With deprecated public symbols: @DEPRECATED_SYMBOLS@
- I/O filters (external): @EXTERNAL_FILTERS@
- MPE: @MPE@
- Direct VFD: @DIRECT_VFD@
- dmalloc: @HAVE_DMALLOC@
- Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@
- API tracing: @TRACE_API@
- Using memory checker: @USINGMEMCHECKER@
-Memory allocation sanity checks: @MEMORYALLOCSANITYCHECK@
- Metadata trace file: @METADATATRACEFILE@
- Function stack tracing: @CODESTACK@
- Strict file format checks: @STRICT_FORMAT_CHECKS@
- Optimization instrumentation: @INSTRUMENT_LIBRARY@
+ Parallel HDF5: @PARALLEL@
+Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@
+ High-level library: @HDF5_HL@
+ Threadsafety: @THREADSAFE@
+ Default API mapping: @DEFAULT_API_VERSION@
+ With deprecated public symbols: @DEPRECATED_SYMBOLS@
+ I/O filters (external): @EXTERNAL_FILTERS@
+ MPE: @MPE@
+ Direct VFD: @DIRECT_VFD@
+ dmalloc: @HAVE_DMALLOC@
+ Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@
+ API tracing: @TRACE_API@
+ Using memory checker: @USINGMEMCHECKER@
+ Memory allocation sanity checks: @MEMORYALLOCSANITYCHECK@
+ Metadata trace file: @METADATATRACEFILE@
+ Function stack tracing: @CODESTACK@
+ Strict file format checks: @STRICT_FORMAT_CHECKS@
+ Optimization instrumentation: @INSTRUMENT_LIBRARY@