summaryrefslogtreecommitdiffstats
path: root/src/H5FP.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-09-19 17:20:01 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-09-19 17:20:01 (GMT)
commite38803837f7f6357bff03bf6ad9c04ace52d38e3 (patch)
treef0453469640269798604c4170a4959b4cd466e65 /src/H5FP.c
parent43f06303db610abc857711f4e4046c9db2750030 (diff)
downloadhdf5-e38803837f7f6357bff03bf6ad9c04ace52d38e3.zip
hdf5-e38803837f7f6357bff03bf6ad9c04ace52d38e3.tar.gz
hdf5-e38803837f7f6357bff03bf6ad9c04ace52d38e3.tar.bz2
[svn-r7494] Purpose:
Bug fix Description: Buffer for decoding superblock's driver information was too small when using some VFDs (like the multi-file VFD). Also made FPH5 code more portable and obvious when it's broadcasting the superblock from the captain process to the other clients. Solution: Allocate the buffer for the driver information dynamicly Platforms tested: Copper No h5committest because it's already working on other platforms.
Diffstat (limited to 'src/H5FP.c')
-rw-r--r--src/H5FP.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/H5FP.c b/src/H5FP.c
index 5f38f5e..2600d11 100644
--- a/src/H5FP.c
+++ b/src/H5FP.c
@@ -33,6 +33,7 @@ MPI_Datatype H5FP_request; /* MPI datatype for the H5FP_request_t type */
MPI_Datatype H5FP_reply; /* MPI datatype for the H5FP_reply_t type */
MPI_Datatype H5FP_read; /* MPI datatype for the H5FP_read_t type */
MPI_Datatype H5FP_alloc; /* MPI datatype for the H5FP_alloc_t type */
+MPI_Datatype H5FP_super; /* MPI datatype for the H5FP_super_t type */
/* SAP specific variables */
MPI_Comm H5FP_SAP_COMM; /* Comm we use: Supplied by user */
@@ -76,6 +77,7 @@ H5FPinit(MPI_Comm comm, int sap_rank, MPI_Comm *sap_comm, MPI_Comm *sap_barrier_
H5FP_reply = MPI_DATATYPE_NULL;
H5FP_read = MPI_DATATYPE_NULL;
H5FP_alloc = MPI_DATATYPE_NULL;
+ H5FP_super = MPI_DATATYPE_NULL;
*sap_comm = H5FP_SAP_COMM = MPI_COMM_NULL;
*sap_barrier_comm = H5FP_SAP_BARRIER_COMM = MPI_COMM_NULL;
@@ -162,6 +164,10 @@ done:
if (MPI_Type_free(&H5FP_alloc) != MPI_SUCCESS)
HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_free failed");
+ if (H5FP_super != MPI_DATATYPE_NULL)
+ if (MPI_Type_free(&H5FP_super) != MPI_SUCCESS)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_free failed");
+
if (H5FP_SAP_BARRIER_COMM != MPI_COMM_NULL)
/* this comm will be NULL for the SAP */
if (MPI_Comm_free(&H5FP_SAP_BARRIER_COMM) != MPI_SUCCESS)
@@ -222,6 +228,9 @@ H5FPfinalize(void)
if (MPI_Type_free(&H5FP_alloc) != MPI_SUCCESS)
HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_free failed");
+ if (MPI_Type_free(&H5FP_super) != MPI_SUCCESS)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_free failed");
+
/* Release the barrier communicator */
if (H5FP_SAP_BARRIER_COMM != MPI_COMM_NULL)
/* this comm will be NULL for the SAP */
@@ -317,8 +326,8 @@ done:
/*
* Function: H5FP_commit_sap_datatypes
- * Purpose: Commit the H5FP_request, H5FP_reply, H5FP_read, and
- * H5FP_alloc structure datatypes to MPI.
+ * Purpose: Commit the H5FP_request, H5FP_reply, H5FP_read,
+ * H5FP_alloc and H5FP_super structure datatypes to MPI.
* Return: Success: SUCCEED
* Failure: FAIL
* Programmer: Bill Wendling, 26. July, 2002
@@ -335,6 +344,7 @@ H5FP_commit_sap_datatypes(void)
H5FP_reply_t sap_reply;
H5FP_read_t sap_read;
H5FP_alloc_t sap_alloc;
+ H5FP_super_t sap_super;
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI(H5FP_commit_sap_datatypes, FAIL);
@@ -414,6 +424,24 @@ H5FP_commit_sap_datatypes(void)
if (MPI_Type_commit(&H5FP_alloc) != MPI_SUCCESS)
HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_commit failed");
+ /* Commit the H5FP_super datatype */
+ block_length[0] = 1;
+ block_length[1] = 1;
+ old_types[0] = HADDR_AS_MPI_TYPE;
+ old_types[1] = MPI_LONG_LONG_INT;
+ MPI_Address(&sap_super.addr, &displs[0]);
+ MPI_Address(&sap_super.size, &displs[1]);
+
+ /* Calculate the displacements */
+ for (i = 1; i >= 0; --i)
+ displs[i] -= displs[0];
+
+ if (MPI_Type_struct(2, block_length, displs, old_types, &H5FP_super) != MPI_SUCCESS)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_struct failed");
+
+ if (MPI_Type_commit(&H5FP_super) != MPI_SUCCESS)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_commit failed");
+
done:
FUNC_LEAVE_NOAPI(ret_value);
}