summaryrefslogtreecommitdiffstats
path: root/src/H5FP.c
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2003-10-31 21:46:58 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2003-10-31 21:46:58 (GMT)
commitd677a77c4d56460b7e0238ba512933c7fd67e3d6 (patch)
treeaf5e59454b544db6056964d08d010febd3e56647 /src/H5FP.c
parent61d964625ebb39af5326bc11dc52790ab39c8202 (diff)
downloadhdf5-d677a77c4d56460b7e0238ba512933c7fd67e3d6.zip
hdf5-d677a77c4d56460b7e0238ba512933c7fd67e3d6.tar.gz
hdf5-d677a77c4d56460b7e0238ba512933c7fd67e3d6.tar.bz2
[svn-r7805] Purpose:
Bug Fix Description: The End of Address information needed to be kept by the SAP. Some processes were trying to get the EOA information in collective mode, but the action wasn't collective at the time. Solution: Keep the EOA information for the file on the SAP. Clients query the SAP to get/set it when needed. Platforms tested: Linux (w/ FPHDF5) Copper (w/o FPHDF5) (FPHDF5 specific, so no need for full testing) Misc. update:
Diffstat (limited to 'src/H5FP.c')
-rw-r--r--src/H5FP.c57
1 files changed, 46 insertions, 11 deletions
diff --git a/src/H5FP.c b/src/H5FP.c
index 40b5309..77383ee 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_eoa; /* MPI datatype for the H5FP_eoa_t type */
MPI_Datatype H5FP_super; /* MPI datatype for the H5FP_super_t type */
/* SAP specific variables */
@@ -77,6 +78,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_eoa = MPI_DATATYPE_NULL;
H5FP_super = MPI_DATATYPE_NULL;
*sap_comm = H5FP_SAP_COMM = MPI_COMM_NULL;
@@ -164,6 +166,10 @@ done:
if (MPI_Type_free(&H5FP_alloc) != MPI_SUCCESS)
HDONE_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_free failed");
+ if (H5FP_eoa != MPI_DATATYPE_NULL)
+ if (MPI_Type_free(&H5FP_eoa) != MPI_SUCCESS)
+ HDONE_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_free failed");
+
if (H5FP_super != MPI_DATATYPE_NULL)
if (MPI_Type_free(&H5FP_super) != MPI_SUCCESS)
HDONE_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_free failed");
@@ -216,20 +222,29 @@ H5FPfinalize(void)
HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Error stopping the SAP");
/* Release the MPI types we created */
- if (MPI_Type_free(&H5FP_request) != MPI_SUCCESS)
- HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_free failed");
+ if (H5FP_request != MPI_DATATYPE_NULL)
+ if (MPI_Type_free(&H5FP_request) != MPI_SUCCESS)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_free failed");
- if (MPI_Type_free(&H5FP_reply) != MPI_SUCCESS)
- HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_free failed");
+ if (H5FP_reply != MPI_DATATYPE_NULL)
+ if (MPI_Type_free(&H5FP_reply) != MPI_SUCCESS)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_free failed");
- if (MPI_Type_free(&H5FP_read) != MPI_SUCCESS)
- HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_free failed");
+ if (H5FP_read != MPI_DATATYPE_NULL)
+ if (MPI_Type_free(&H5FP_read) != MPI_SUCCESS)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_free failed");
- if (MPI_Type_free(&H5FP_alloc) != MPI_SUCCESS)
- HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_free failed");
+ if (H5FP_alloc != MPI_DATATYPE_NULL)
+ 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");
+ if (H5FP_eoa != MPI_DATATYPE_NULL)
+ if (MPI_Type_free(&H5FP_eoa) != 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");
/* Release the barrier communicator */
if (H5FP_SAP_BARRIER_COMM != MPI_COMM_NULL)
@@ -327,7 +342,8 @@ done:
/*
* Function: H5FP_commit_sap_datatypes
* Purpose: Commit the H5FP_request, H5FP_reply, H5FP_read,
- * H5FP_alloc and H5FP_super structure datatypes to MPI.
+ * H5FP_alloc, H5FP_eoa and H5FP_super structure datatypes
+ * to MPI.
* Return: Success: SUCCEED
* Failure: FAIL
* Programmer: Bill Wendling, 26. July, 2002
@@ -344,6 +360,7 @@ H5FP_commit_sap_datatypes(void)
H5FP_reply_t sap_reply;
H5FP_read_t sap_read;
H5FP_alloc_t sap_alloc;
+ H5FP_eoa_t sap_eoa;
H5FP_super_t sap_super;
herr_t ret_value = SUCCEED;
@@ -424,6 +441,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_eoa datatype */
+ block_length[0] = 3;
+ block_length[1] = 1;
+ old_types[0] = MPI_UNSIGNED;
+ old_types[1] = HADDR_AS_MPI_TYPE;
+ MPI_Address(&sap_eoa.req_id, &displs[0]);
+ MPI_Address(&sap_eoa.eoa, &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_eoa) != MPI_SUCCESS)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Type_struct failed");
+
+ if (MPI_Type_commit(&H5FP_eoa) != 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;