summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2014-06-11 21:13:46 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2014-06-11 21:13:46 (GMT)
commita0aa11c0b2ba024e69e3d8ff5185057acd49df3a (patch)
tree3fc26068dedb83bc6a6c2974da04746aadcea9e3 /src
parent3da72f1d5b1f6894bef117dba0eaa86ce3d9c526 (diff)
downloadhdf5-a0aa11c0b2ba024e69e3d8ff5185057acd49df3a.zip
hdf5-a0aa11c0b2ba024e69e3d8ff5185057acd49df3a.tar.gz
hdf5-a0aa11c0b2ba024e69e3d8ff5185057acd49df3a.tar.bz2
[svn-r25264] implement H5TRset_dependency()
Diffstat (limited to 'src')
-rw-r--r--src/H5VLiod_trans.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/H5VLiod_trans.c b/src/H5VLiod_trans.c
index 5c77834..ca5b590 100644
--- a/src/H5VLiod_trans.c
+++ b/src/H5VLiod_trans.c
@@ -586,7 +586,10 @@ H5VL_iod_server_trans_set_dependency_cb(AXE_engine_t UNUSED axe_engine,
op_data_t *op_data = (op_data_t *)_op_data;
tr_set_depend_in_t *input = (tr_set_depend_in_t *)op_data->input;
iod_handle_t coh = input->coh; /* the container handle */
- iod_trans_depend_desc_t depends;
+ iod_trans_id_t lower = input->parent_trans_num;
+ iod_trans_id_t higher = input->child_trans_num;
+ iod_trans_depend_desc_t *depends;
+ iod_ret_t ret;
herr_t ret_value = SUCCEED;
#if H5_EFF_DEBUG
@@ -594,10 +597,15 @@ H5VL_iod_server_trans_set_dependency_cb(AXE_engine_t UNUSED axe_engine,
input->child_trans_num, input->parent_trans_num);
#endif
- /* MSC - set depends */
+ depends = (iod_trans_depend_desc_t *)malloc(sizeof(iod_trans_depend_desc_t) +
+ sizeof(iod_trans_range_t));
+ depends->n_depend = 1;
+ depends->depend[0].lower_tid = lower;
+ depends->depend[0].higher_tid = higher;
- //if(iod_trans_depend(coh, depends, NULL) < 0)
- //HGOTO_ERROR_FF(FAIL, "can't set dependency between transactions");
+ ret = iod_trans_depend(coh, depends, NULL);
+ if(ret != 0 && -IOD_EC_TRANS_DISCARDED != ret)
+ HGOTO_ERROR_FF(FAIL, "can't set dependency between transactions");
#if H5_EFF_DEBUG
fprintf(stderr, "Done with Transaction Set_Dependency\n");
@@ -607,6 +615,11 @@ done:
if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value))
fprintf(stderr, "Failed to Set_Dependency between Transactions\n");
+ if(depends) {
+ free(depends);
+ depends = NULL;
+ }
+
HG_Handler_free_input(op_data->hg_handle, input);
HG_Handler_free(op_data->hg_handle);
input = (tr_set_depend_in_t *)H5MM_xfree(input);