summaryrefslogtreecommitdiffstats
path: root/src/H5FPclient.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FPclient.c')
-rw-r--r--src/H5FPclient.c129
1 files changed, 116 insertions, 13 deletions
diff --git a/src/H5FPclient.c b/src/H5FPclient.c
index 2628fb9..200517c 100644
--- a/src/H5FPclient.c
+++ b/src/H5FPclient.c
@@ -639,6 +639,8 @@ H5FP_request_allocate(H5FD_t *file, H5FD_mem_t mem_type, hsize_t size,
/* check args */
assert(file);
+ assert(addr);
+ assert(eoa);
assert(req_id);
assert(status);
@@ -725,10 +727,6 @@ H5FP_request_free(H5FD_t *file, H5FD_mem_t mem_type, haddr_t addr, hsize_t size,
if (sap_alloc.status != H5FP_STATUS_OK)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCHANGE, FAIL, "can't free space on server");
- if ((mrc = MPI_Bcast(&sap_alloc, 1, H5FP_alloc, (int)H5FP_capt_barrier_rank,
- H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed!", mrc);
-
/* Set the EOA for all processes. This call doesn't fail. */
file->cls->set_eoa(file, sap_alloc.eoa);
*status = H5FP_STATUS_OK;
@@ -739,6 +737,112 @@ done:
}
/*
+ * Function: H5FP_request_get_eoa
+ * Purpose: Request the SAP send the EOA of the file.
+ * Return: Success: SUCCEED
+ * Failure: FAIL
+ * Programmer: Bill Wendling, 30. October 2003
+ * Modifications:
+ */
+herr_t
+H5FP_request_get_eoa(H5FD_t *file, haddr_t *eoa, unsigned *req_id, H5FP_status_t *status)
+{
+ H5FP_eoa_t sap_eoa;
+ H5FP_request_t req;
+ MPI_Status mpi_status;
+ int mrc;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI(H5FP_request_get_eoa, FAIL);
+
+ /* check args */
+ assert(file);
+ assert(eoa);
+ assert(req_id);
+ assert(status);
+
+ HDmemset(&req, 0, sizeof(req));
+
+ req.req_type = H5FP_REQ_GET_EOA;
+ req.req_id = H5FP_gen_request_id();
+ req.file_id = H5FD_fphdf5_file_id(file);
+ req.proc_rank = H5FD_fphdf5_mpi_rank(file);
+
+ if ((mrc = MPI_Send(&req, 1, H5FP_request, (int)H5FP_sap_rank,
+ H5FP_TAG_REQUEST, H5FP_SAP_COMM)) != MPI_SUCCESS)
+ HMPI_GOTO_ERROR(FAIL, "MPI_Send failed", mrc);
+
+ HDmemset(&mpi_status, 0, sizeof(mpi_status));
+
+ if ((mrc = MPI_Recv(&sap_eoa, 1, H5FP_eoa, (int)H5FP_sap_rank,
+ H5FP_TAG_EOA, H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS)
+ HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc);
+
+ if (sap_eoa.status != H5FP_STATUS_OK)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCHANGE, FAIL, "can't free space on server");
+
+ /* Set the EOA for all processes. This doesn't fail. */
+ *eoa = sap_eoa.eoa;
+ *status = H5FP_STATUS_OK;
+
+done:
+ *req_id = req.req_id;
+ FUNC_LEAVE_NOAPI(ret_value);
+}
+
+/*
+ * Function: H5FP_request_set_eoa
+ * Purpose: Request the SAP set the EOA of the file.
+ * Return: Success: SUCCEED
+ * Failure: FAIL
+ * Programmer: Bill Wendling, 31. October 2003
+ * Modifications:
+ */
+herr_t
+H5FP_request_set_eoa(H5FD_t *file, haddr_t eoa, unsigned *req_id, H5FP_status_t *status)
+{
+ H5FP_reply_t sap_reply;
+ H5FP_request_t req;
+ MPI_Status mpi_status;
+ int mrc;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI(H5FP_request_set_eoa, FAIL);
+
+ /* check args */
+ assert(file);
+ assert(req_id);
+ assert(status);
+
+ HDmemset(&req, 0, sizeof(req));
+
+ req.req_type = H5FP_REQ_SET_EOA;
+ req.req_id = H5FP_gen_request_id();
+ req.file_id = H5FD_fphdf5_file_id(file);
+ req.proc_rank = H5FD_fphdf5_mpi_rank(file);
+ req.addr = eoa;
+
+ if ((mrc = MPI_Send(&req, 1, H5FP_request, (int)H5FP_sap_rank,
+ H5FP_TAG_REQUEST, H5FP_SAP_COMM)) != MPI_SUCCESS)
+ HMPI_GOTO_ERROR(FAIL, "MPI_Send failed", mrc);
+
+ HDmemset(&mpi_status, 0, sizeof(mpi_status));
+
+ if ((mrc = MPI_Recv(&sap_reply, 1, H5FP_reply, (int)H5FP_sap_rank,
+ H5FP_TAG_REPLY, H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS)
+ HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc);
+
+ if (sap_reply.status != H5FP_STATUS_OK)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCHANGE, FAIL, "can't close file on server");
+
+ *status = H5FP_STATUS_OK;
+
+done:
+ *req_id = req.req_id;
+ FUNC_LEAVE_NOAPI(ret_value);
+}
+
+/*
* Function: H5FP_request_update_eoma_eosda
* Purpose: Request the SAP updates the EOMA and EOSDA information
* for the file.
@@ -748,10 +852,9 @@ done:
* Modifications:
*/
herr_t
-H5FP_request_update_eoma_eosda(H5FD_t *file, unsigned *req_id,
- H5FP_status_t *status)
+H5FP_request_update_eoma_eosda(H5FD_t *file, unsigned *req_id, H5FP_status_t *status)
{
- H5FP_alloc_t sap_alloc;
+ H5FP_eoa_t sap_eoa;
H5FP_request_t req;
MPI_Status mpi_status;
int mrc;
@@ -777,19 +880,19 @@ H5FP_request_update_eoma_eosda(H5FD_t *file, unsigned *req_id,
HDmemset(&mpi_status, 0, sizeof(mpi_status));
- if ((mrc = MPI_Recv(&sap_alloc, 1, H5FP_alloc, (int)H5FP_sap_rank,
- H5FP_TAG_ALLOC, H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS)
+ if ((mrc = MPI_Recv(&sap_eoa, 1, H5FP_eoa, (int)H5FP_sap_rank,
+ H5FP_TAG_EOA, H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS)
HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc);
- if (sap_alloc.status != H5FP_STATUS_OK)
+ if (sap_eoa.status != H5FP_STATUS_OK)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCHANGE, FAIL, "can't free space on server");
- if ((mrc = MPI_Bcast(&sap_alloc, 1, H5FP_alloc, (int)H5FP_capt_barrier_rank,
+ if ((mrc = MPI_Bcast(&sap_eoa, 1, H5FP_eoa, (int)H5FP_capt_barrier_rank,
H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed!", mrc);
/* Set the EOA for all processes. This doesn't fail. */
- file->cls->set_eoa(file, sap_alloc.eoa);
+ file->cls->set_eoa(file, sap_eoa.eoa);
*status = H5FP_STATUS_OK;
done: