From 263d13a4c760c61c293ae9840aaf2f4ce76d541a Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Thu, 5 Sep 2013 17:59:46 -0500 Subject: [svn-r24102] add trans and read context operations: add small test to verify correct function shipping usage of transaction in other operations is still missing. --- examples/Makefile.am | 2 +- examples/Makefile.in | 2 +- examples/h5ff_client_map.c | 28 +- examples/h5ff_client_trans.c | 191 ++++++++++++++ src/CMakeLists.txt | 8 + src/H5.c | 3 + src/H5FF.c | 159 ++++++++---- src/H5FFpublic.h | 100 ++++---- src/H5M.c | 44 ++-- src/H5Mpublic.h | 16 +- src/H5Pdxpl.c | 6 +- src/H5Pint.c | 19 +- src/H5Prcapl.c | 2 +- src/H5Ptrfpl.c | 131 ++++++++++ src/H5Ptrspl.c | 2 +- src/H5RC.c | 222 ++++++++++++++-- src/H5RCprivate.h | 12 +- src/H5RCpublic.h | 17 +- src/H5TR.c | 192 +++++++++++--- src/H5TRprivate.h | 19 +- src/H5TRpublic.h | 8 +- src/H5VLiod.c | 594 ++++++++++++++++++++++++++++++++++++++++--- src/H5VLiod_client.c | 98 ++++++- src/H5VLiod_client.h | 53 +++- src/H5VLiod_common.h | 26 ++ src/H5VLiod_encdec.c | 3 +- src/H5VLiod_server.c | 497 ++++++++++++++++++++++++++++++++++++ src/H5VLiod_server.h | 46 ++++ src/H5VLiod_trans.c | 536 ++++++++++++++++++++++++++++++++++++++ src/H5private.h | 2 + src/Makefile.am | 11 +- src/Makefile.in | 64 ++--- 32 files changed, 2779 insertions(+), 334 deletions(-) create mode 100644 examples/h5ff_client_trans.c create mode 100644 src/H5Ptrfpl.c create mode 100644 src/H5VLiod_trans.c diff --git a/examples/Makefile.am b/examples/Makefile.am index 4307e68..7fb18ab 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -31,7 +31,7 @@ if BUILD_EFF_CONDITIONAL INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/test LDADD = $(LIBH5TEST) $(LIBHDF5) $(MYAXE_LIBS) $(MYIOD_LIBS) EXAMPLE_PROG_EFF = h5ff_server h5ff_client h5ff_client_map h5ff_client_do \ - h5ff_client_old_api h5ff_client_multiple_cont + h5ff_client_old_api h5ff_client_multiple_cont h5ff_client_trans endif # Example programs. diff --git a/examples/Makefile.in b/examples/Makefile.in index af8ff11..dc56c93 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -402,7 +402,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog $(EXTLINK_DIRS) *.h5 @BUILD_PARALLEL_CONDITIONAL_TRUE@LDADD = $(LIBH5TEST) $(LIBHDF5) @BUILD_PARALLEL_CONDITIONAL_TRUE@EXAMPLE_PROG_PARA = ph5example @BUILD_EFF_CONDITIONAL_TRUE@EXAMPLE_PROG_EFF = h5ff_server h5ff_client h5ff_client_map h5ff_client_do \ -@BUILD_EFF_CONDITIONAL_TRUE@ h5ff_client_old_api h5ff_client_multiple_cont +@BUILD_EFF_CONDITIONAL_TRUE@ h5ff_client_old_api h5ff_client_multiple_cont h5ff_client_trans # Example programs. diff --git a/examples/h5ff_client_map.c b/examples/h5ff_client_map.c index 103ae03..3c1e198 100644 --- a/examples/h5ff_client_map.c +++ b/examples/h5ff_client_map.c @@ -68,47 +68,47 @@ int main(int argc, char **argv) { assert(file_id); /* create two groups */ - gid1 = H5Gcreate_ff(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, (uint64_t)0, event_q); - gid2 = H5Gcreate_ff(file_id, "G1/G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, (uint64_t)0, event_q); + gid1 = H5Gcreate_ff(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, 0, event_q); + gid2 = H5Gcreate_ff(file_id, "G1/G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, 0, event_q); /* Create Map objects with the key type and val type being 32 bit LE integers */ map1 = H5Mcreate_ff(file_id, "MAP_1", H5T_STD_I32LE, H5T_STD_I32LE, - H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT, (uint64_t)0, event_q); + H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT, 0, event_q); map2 = H5Mcreate_ff(file_id, "G1/MAP_2", H5T_STD_I32LE, H5T_STD_I32LE, - H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT, (uint64_t)0, event_q); + H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT, 0, event_q); map3 = H5Mcreate_ff(file_id, "G1/G2/MAP_3", H5T_STD_I32LE, H5T_STD_I32LE, - H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT, (uint64_t)0, event_q); + H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT, 0, event_q); { key = 1; value = 1000; ret = H5Mset_ff(map3, H5T_STD_I32LE, &key, H5T_STD_I32LE, &value, - H5P_DEFAULT, (uint64_t)0, event_q); + H5P_DEFAULT, 0, event_q); assert(ret == 0); key = 2; value = 2000; ret = H5Mset_ff(map3, H5T_STD_I32LE, &key, H5T_STD_I32LE, &value, - H5P_DEFAULT, (uint64_t)0, event_q); + H5P_DEFAULT, 0, event_q); assert(ret == 0); key = 3; value = 3000; ret = H5Mset_ff(map3, H5T_STD_I32LE, &key, H5T_STD_I32LE, &value, - H5P_DEFAULT, (uint64_t)0, event_q); + H5P_DEFAULT, 0, event_q); assert(ret == 0); } - ret = H5Mget_count_ff(map3, &count, (uint64_t)0, event_q); + ret = H5Mget_count_ff(map3, &count, 0, event_q); assert(ret == 0); key = 1; - ret = H5Mexists_ff(map3, H5T_STD_I32LE, &key, &exists, (uint64_t)0, event_q); + ret = H5Mexists_ff(map3, H5T_STD_I32LE, &key, &exists, 0, event_q); assert(ret == 0); key = 1; - ret = H5Mdelete_ff(map3, H5T_STD_I32LE, &key, (uint64_t)0, event_q); + ret = H5Mdelete_ff(map3, H5T_STD_I32LE, &key, 0, event_q); assert(ret == 0); assert(H5Gclose_ff(gid1, event_q) == 0); @@ -117,7 +117,7 @@ int main(int argc, char **argv) { assert(H5Mclose_ff(map2, event_q) == 0); assert(H5Mclose_ff(map3, event_q) == 0); - map3 = H5Mopen_ff(file_id, "G1/G2/MAP_3", H5P_DEFAULT, (uint64_t)0, event_q); + map3 = H5Mopen_ff(file_id, "G1/G2/MAP_3", H5P_DEFAULT, 0, event_q); { int key, value; @@ -125,7 +125,7 @@ int main(int argc, char **argv) { key = 1; value = -1; ret = H5Mget_ff(map3, H5T_STD_I32LE, &key, H5T_STD_I32LE, &value, - H5P_DEFAULT, (uint64_t)0, event_q); + H5P_DEFAULT, 0, event_q); if(H5EQpop(event_q, &req1) < 0) exit(1); @@ -138,7 +138,7 @@ int main(int argc, char **argv) { key = 1; value = -1; ret = H5Mget_ff(map3, H5T_STD_I32LE, &key, H5T_STD_I32LE, &value, - H5P_DEFAULT, (uint64_t)0, event_q); + H5P_DEFAULT, 0, event_q); if(H5EQpop(event_q, &req1) < 0) exit(1); diff --git a/examples/h5ff_client_trans.c b/examples/h5ff_client_trans.c new file mode 100644 index 0000000..c92ce3f --- /dev/null +++ b/examples/h5ff_client_trans.c @@ -0,0 +1,191 @@ +/* + * test_client.c: Client side of Milestone 4.2 Asynchronous I/O and initial + * IOD VOL plugin demonstration. This is, in effect, the application program that + * would run on one or more compute nodes and make calls to the HDF5 API. + */ + +#include +#include +#include +#include +#include "mpi.h" +#include "hdf5.h" + +int main(int argc, char **argv) { + const char file_name[]="eff_file.h5"; + hid_t file_id; + hid_t fapl_id, trspl_id; + hid_t tid1, tid2, tid3; + hid_t rid1, rid2, rid3; + uint64_t version; + int my_rank, my_size; + int provided; + hid_t event_q; + H5_status_t *status = NULL; + int i, num_requests = 0; + herr_t ret; + H5_request_t req1; + H5_status_t status1; + + MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided); + if(MPI_THREAD_MULTIPLE != provided) { + fprintf(stderr, "MPI does not have MPI_THREAD_MULTIPLE support\n"); + exit(1); + } + + fprintf(stderr, "\n*****************************************************************************************************************\n"); + fprintf(stderr, "Initialize EFF stack\n"); + fprintf(stderr, "*****************************************************************************************************************\n"); + + /* Call EFF_init to initialize the EFF stack. + As a result of this call, the Function Shipper client is started, + and HDF5 VOL calls are registered with the function shipper. + An "IOD init" call is forwarded from the FS client to the FS server + which should already be running. */ + EFF_init(MPI_COMM_WORLD, MPI_INFO_NULL); + + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &my_size); + fprintf(stderr, "APP processes = %d, my rank is %d\n", my_size, my_rank); + + fprintf(stderr, "Create the FAPL to set the IOD VOL plugin and create the file\n"); + /* Choose the IOD VOL plugin to use with this file. + First we create a file access property list. Then we call a new routine to set + the IOD plugin to use with this fapl */ + fapl_id = H5Pcreate (H5P_FILE_ACCESS); + H5Pset_fapl_iod(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL); + + event_q = H5EQcreate(fapl_id); + assert(event_q); + + /* create the file */ + file_id = H5Fcreate(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); + assert(file_id); + + version = 0; + /* acquire container version 0 - EXACT */ + rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, event_q); + + /* Need to wait for acquire before using it */ + if(H5EQpop(event_q, &req1) < 0) + exit(1); + assert(H5AOwait(req1, &status1) == 0); + assert (status1); + + /* create 2 transactions objects (does not start transactions). Local call. */ + tid1 = H5TRcreate(file_id, rid1, (uint64_t)1); + assert(tid1); + + tid2 = H5TRcreate(file_id, rid1, (uint64_t)555); + assert(tid2); + + /* start transaction 1 with default num_peers (= 0). + This is asynchronous. */ + if(my_rank == 0) { + ret = H5TRstart(tid1, H5P_DEFAULT, event_q); + assert(0 == ret); + } + + /* skip transactions 2 till 554. This is asynchronous. */ + ret = H5TRskip(file_id, (uint64_t)2, (uint64_t)553, event_q); + assert(0 == ret); + + /* start transaction 555 with num_peers = n */ + trspl_id = H5Pcreate (H5P_TR_START); + ret = H5Pset_trspl_num_peers(trspl_id, my_size); + assert(0 == ret); + ret = H5TRstart(tid2, trspl_id, event_q); + assert(0 == ret); + ret = H5Pclose(trspl_id); + assert(0 == ret); + + /* set dependency from transaction 555 on 2. + This is asynchronous but has a dependency on H5TRstart() of tid2. */ + ret = H5TRset_dependency(tid2, (uint64_t)1, event_q); + assert(0 == ret); + + /* finish transaction 1. + This is asynchronous, but has a dependency on H5TRstart() of tid1. */ + if(my_rank == 0) { + ret = H5TRfinish(tid1, H5P_DEFAULT, NULL, event_q); + assert(0 == ret); + } + + /* Local op */ + ret = H5TRclose(tid1); + assert(0 == ret); + + /* finish transaction 555 and acquire a read context for it */ + ret = H5TRfinish(tid2, H5P_DEFAULT, &rid2, event_q); + assert(0 == ret); + ret = H5TRclose(tid2); + assert(0 == ret); + + /* release container version 0. This is async. */ + ret = H5RCrelease(rid1, event_q); + assert(0 == ret); + + ret = H5RCclose(rid1); + assert(0 == ret); + + /* wait on all requests in event queue */ + H5EQwait(event_q, &num_requests, &status); + fprintf(stderr, "%d requests in event queue. Completions: ", num_requests); + for(i=0 ; inrefs ++; + if(request && *req) { H5EQ_t *eq = NULL; /* event queue token */ @@ -304,7 +307,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5Mopen_ff(hid_t loc_id, const char *name, hid_t mapl_id, uint64_t trans, hid_t eq_id) +H5Mopen_ff(hid_t loc_id, const char *name, hid_t mapl_id, hid_t rcxt_id, hid_t eq_id) { H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ @@ -315,6 +318,7 @@ H5Mopen_ff(hid_t loc_id, const char *name, hid_t mapl_id, uint64_t trans, hid_t hid_t ret_value; FUNC_ENTER_API(FAIL) + H5TRACE5("i", "i*siii", loc_id, name, mapl_id, rcxt_id, eq_id); /* Check arguments */ if(!name || !*name) @@ -351,7 +355,7 @@ H5Mopen_ff(hid_t loc_id, const char *name, hid_t mapl_id, uint64_t trans, hid_t } /* call the IOD specific private routine to create a map object */ - if(NULL == (map = H5VL_iod_map_open(obj, loc_params, name, mapl_id, trans, req))) + if(NULL == (map = H5VL_iod_map_open(obj, loc_params, name, mapl_id, rcxt_id, req))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create map") /* increment the ref count on the VOL plugin */ @@ -395,7 +399,7 @@ done: */ herr_t H5Mset_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t val_mem_type_id, - const void *value, hid_t dxpl_id, uint64_t trans, hid_t eq_id) + const void *value, hid_t dxpl_id, hid_t trans_id, hid_t eq_id) { H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ @@ -404,6 +408,8 @@ H5Mset_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t val_mem_ty herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) + H5TRACE8("e", "ii*xi*xiii", map_id, key_mem_type_id, key, val_mem_type_id, + value, dxpl_id, trans_id, eq_id); /* check arguments */ if(!map_id) @@ -435,7 +441,7 @@ H5Mset_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t val_mem_ty /* Set the data through the IOD VOL */ if((ret_value = H5VL_iod_map_set(map, key_mem_type_id, key, val_mem_type_id, value, - dxpl_id, trans, req)) < 0) + dxpl_id, trans_id, req)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set map KV pair") if(request && *req) { @@ -470,7 +476,7 @@ done: */ herr_t H5Mget_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t val_mem_type_id, - void *value, hid_t dxpl_id, uint64_t trans, hid_t eq_id) + void *value, hid_t dxpl_id, hid_t rcxt_id, hid_t eq_id) { H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ @@ -479,6 +485,8 @@ H5Mget_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t val_mem_ty herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) + H5TRACE8("e", "ii*xi*xiii", map_id, key_mem_type_id, key, val_mem_type_id, + value, dxpl_id, rcxt_id, eq_id); /* check arguments */ if(!map_id) @@ -510,7 +518,7 @@ H5Mget_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t val_mem_ty /* Get the data through the IOD VOL */ if((ret_value = H5VL_iod_map_get(map, key_mem_type_id, key, val_mem_type_id, value, - dxpl_id, trans, req)) < 0) + dxpl_id, rcxt_id, req)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get map value") if(request && *req) { @@ -546,7 +554,7 @@ done: */ herr_t H5Mget_types_ff(hid_t map_id, hid_t *key_type_id, hid_t *val_type_id, - uint64_t trans, hid_t eq_id) + hid_t rcxt_id, hid_t eq_id) { H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ @@ -555,6 +563,7 @@ H5Mget_types_ff(hid_t map_id, hid_t *key_type_id, hid_t *val_type_id, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) + H5TRACE5("e", "i*i*iii", map_id, key_type_id, val_type_id, rcxt_id, eq_id); /* check arguments */ if(!map_id) @@ -578,7 +587,7 @@ H5Mget_types_ff(hid_t map_id, hid_t *key_type_id, hid_t *val_type_id, } /* Get the data through the IOD VOL */ - if((ret_value = H5VL_iod_map_get_types(map, key_type_id, val_type_id, trans, req)) < 0) + if((ret_value = H5VL_iod_map_get_types(map, key_type_id, val_type_id, rcxt_id, req)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get map value") if(request && *req) { @@ -609,7 +618,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Mget_count_ff(hid_t map_id, hsize_t *count, uint64_t trans, hid_t eq_id) +H5Mget_count_ff(hid_t map_id, hsize_t *count, hid_t rcxt_id, hid_t eq_id) { H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ @@ -618,6 +627,7 @@ H5Mget_count_ff(hid_t map_id, hsize_t *count, uint64_t trans, hid_t eq_id) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) + H5TRACE4("e", "i*hii", map_id, count, rcxt_id, eq_id); /* check arguments */ if(!map_id) @@ -641,7 +651,7 @@ H5Mget_count_ff(hid_t map_id, hsize_t *count, uint64_t trans, hid_t eq_id) } /* Get the data through the IOD VOL */ - if((ret_value = H5VL_iod_map_get_count(map, count, trans, req)) < 0) + if((ret_value = H5VL_iod_map_get_count(map, count, rcxt_id, req)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get map value") if(request && *req) { @@ -675,7 +685,7 @@ done: */ herr_t H5Mexists_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, - htri_t *exists, uint64_t trans, hid_t eq_id) + htri_t *exists, hid_t rcxt_id, hid_t eq_id) { H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ @@ -684,6 +694,7 @@ H5Mexists_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) + H5TRACE6("e", "ii*x*tii", map_id, key_mem_type_id, key, exists, rcxt_id, eq_id); /* check arguments */ if(!map_id) @@ -707,7 +718,7 @@ H5Mexists_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, } /* Get the data through the IOD VOL */ - if((ret_value = H5VL_iod_map_exists(map, key_mem_type_id, key, exists, trans, req)) < 0) + if((ret_value = H5VL_iod_map_exists(map, key_mem_type_id, key, exists, rcxt_id, req)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get map value") if(request && *req) { @@ -784,7 +795,7 @@ done: */ herr_t H5Mdelete_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, - uint64_t trans, hid_t eq_id) + hid_t trans_id, hid_t eq_id) { H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ @@ -793,6 +804,7 @@ H5Mdelete_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) + H5TRACE5("e", "ii*xii", map_id, key_mem_type_id, key, trans_id, eq_id); /* check arguments */ if(!map_id) @@ -816,7 +828,7 @@ H5Mdelete_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, } /* delete the key pair through the IOD VOL */ - if((ret_value = H5VL_iod_map_delete(map, key_mem_type_id, key, trans, req)) < 0) + if((ret_value = H5VL_iod_map_delete(map, key_mem_type_id, key, trans_id, req)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get map value") if(request && *req) { diff --git a/src/H5Mpublic.h b/src/H5Mpublic.h index 78b2fdf..22e416b 100644 --- a/src/H5Mpublic.h +++ b/src/H5Mpublic.h @@ -51,21 +51,21 @@ typedef herr_t (*H5M_iterate_func_t)(const void *key, const void *value, void *c /* API wrappers */ H5_DLL hid_t H5Mcreate_ff(hid_t loc_id, const char *name, hid_t keytype, hid_t valtype, hid_t lcpl_id, - hid_t mcpl_id, hid_t mapl_id, uint64_t trans, hid_t eq_id); -H5_DLL hid_t H5Mopen_ff(hid_t loc_id, const char *name, hid_t mapl_id, uint64_t trans, hid_t eq_id); + hid_t mcpl_id, hid_t mapl_id, hid_t trans_id, hid_t eq_id); +H5_DLL hid_t H5Mopen_ff(hid_t loc_id, const char *name, hid_t mapl_id, hid_t rcxt_id, hid_t eq_id); H5_DLL herr_t H5Mset_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t val_mem_type_id, - const void *value, hid_t dxpl_id, uint64_t trans, hid_t eq_id); + const void *value, hid_t dxpl_id, hid_t trans_id, hid_t eq_id); H5_DLL herr_t H5Mget_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t val_mem_type_id, - void *value, hid_t dxpl_id, uint64_t trans, hid_t eq_id); + void *value, hid_t dxpl_id, hid_t rcxt_id, hid_t eq_id); H5_DLL herr_t H5Mget_types_ff(hid_t map_id, hid_t *key_type_id, hid_t *val_type_id, - uint64_t trans, hid_t eq_id); -H5_DLL herr_t H5Mget_count_ff(hid_t map_id, hsize_t *count, uint64_t trans, hid_t eq_id); + hid_t rcxt_id, hid_t eq_id); +H5_DLL herr_t H5Mget_count_ff(hid_t map_id, hsize_t *count, hid_t rcxt_id, hid_t eq_id); H5_DLL herr_t H5Mexists_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, - htri_t *exists, uint64_t trans, hid_t eq_id); + htri_t *exists, hid_t rcxt_id, hid_t eq_id); H5_DLL herr_t H5Miterate(hid_t map_id, hid_t key_mem_type_id, hid_t value_mem_type_id, H5M_iterate_func_t callback_func, void *context); H5_DLL herr_t H5Mdelete_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, - uint64_t trans, hid_t eq_id); + hid_t trans_id, hid_t eq_id); H5_DLL herr_t H5Mclose_ff(hid_t map_id, hid_t eq_id); #ifdef __cplusplus diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index cb03c52..7ece9c6 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -50,9 +50,9 @@ #ifdef H5_HAVE_EFF #define H5D_XFER_INJECT_CORRUPTION_SIZE sizeof(hbool_t) -#define H5D_XFER_INJECT_CORRUPTION_DEF FALSE -#define H5D_XFER_INJECT_CORRUPTION_ENC H5P__encode_hbool_t -#define H5D_XFER_INJECT_CORRUPTION_DEC H5P__decode_hbool_t +#define H5D_XFER_INJECT_CORRUPTION_DEF FALSE +#define H5D_XFER_INJECT_CORRUPTION_ENC H5P__encode_hbool_t +#define H5D_XFER_INJECT_CORRUPTION_DEC H5P__decode_hbool_t #define H5D_XFER_CHECKSUM_SIZE sizeof(unsigned) #define H5D_XFER_CHECKSUM_DEF 0 diff --git a/src/H5Pint.c b/src/H5Pint.c index 64d283c..d6732fa 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -216,23 +216,6 @@ const H5P_libclass_t H5P_CLS_TACC[1] = {{ NULL /* Class close callback info */ }}; -/* Transaction finish property list class library initialization object */ -/* (move to proper source code file when used for real) */ -const H5P_libclass_t H5P_CLS_TRFCC[1] = {{ - "transaction finish", /* Class name for debugging */ - H5P_TYPE_TRANSACTION_FINISH, /* Class type */ - &H5P_CLS_ROOT_g, /* Parent class ID */ - &H5P_CLS_TRANSACTION_FINISH_g, /* Pointer to class ID */ - &H5P_LST_TRANSACTION_FINISH_g, /* Pointer to default property list ID */ - NULL, /* Default property registration routine */ - NULL, /* Class creation callback */ - NULL, /* Class creation callback info */ - NULL, /* Class copy callback */ - NULL, /* Class copy callback info */ - NULL, /* Class close callback */ - NULL /* Class close callback info */ -}}; - /* Library property list classes defined in other code modules */ H5_DLLVAR const H5P_libclass_t H5P_CLS_OCRT[1]; /* Object creation */ H5_DLLVAR const H5P_libclass_t H5P_CLS_STRCRT[1]; /* String create */ @@ -249,7 +232,7 @@ H5_DLLVAR const H5P_libclass_t H5P_CLS_ACRT[1]; /* Attribute creation */ H5_DLLVAR const H5P_libclass_t H5P_CLS_LCRT[1]; /* Link creation */ H5_DLLVAR const H5P_libclass_t H5P_CLS_RCACC[1]; /* Read Context acquire */ H5_DLLVAR const H5P_libclass_t H5P_CLS_TRSCC[1]; /* Transaction start */ -//H5_DLLVAR const H5P_libclass_t H5P_CLS_TRFCC[1]; /* Transaction finish */ +H5_DLLVAR const H5P_libclass_t H5P_CLS_TRFCC[1]; /* Transaction finish */ /*****************************/ /* Library Private Variables */ diff --git a/src/H5Prcapl.c b/src/H5Prcapl.c index 590d9b5..a858ef9 100644 --- a/src/H5Prcapl.c +++ b/src/H5Prcapl.c @@ -128,4 +128,4 @@ H5P__rcacc_reg_prop(H5P_genclass_t *pclass) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P__trscc_reg_prop() */ +} /* end H5P__rcacc_reg_prop() */ diff --git a/src/H5Ptrfpl.c b/src/H5Ptrfpl.c new file mode 100644 index 0000000..d072eb5 --- /dev/null +++ b/src/H5Ptrfpl.c @@ -0,0 +1,131 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*------------------------------------------------------------------------- + * + * Created: H5Ptrspl.c + * August 2013 + * Mohamad Chaarawi + * + * Purpose: Transaction Finish property list class routines + * + *------------------------------------------------------------------------- + */ + +/****************/ +/* Module Setup */ +/****************/ +#define H5P_PACKAGE /*suppress error about including H5Ppkg */ + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Ppkg.h" /* Property lists */ +#include "H5TRprivate.h" /* Transactions */ + +/****************/ +/* Local Macros */ +/****************/ + +/* ========= Read Context properties ============ */ +/* Definitions for Transaction being finished */ +#define H5TR_FINISH_ACQUIRE_SIZE sizeof(hbool_t) +#define H5TR_FINISH_ACQUIRE_DEF FALSE +#define H5TR_FINISH_ACQUIRE_ENC H5P__encode_hbool_t +#define H5TR_FINISH_ACQUIRE_DEC H5P__decode_hbool_t + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Package Typedefs */ +/********************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + +/* Property class callbacks */ +static herr_t H5P__trfcc_reg_prop(H5P_genclass_t *pclass); + + +/*********************/ +/* Package Variables */ +/*********************/ + +/* Transaction finish property list class library initialization object */ +const H5P_libclass_t H5P_CLS_TRFCC[1] = {{ + "transaction finish", /* Class name for debugging */ + H5P_TYPE_TRANSACTION_FINISH, /* Class type */ + &H5P_CLS_ROOT_g, /* Parent class ID */ + &H5P_CLS_TRANSACTION_FINISH_g, /* Pointer to class ID */ + &H5P_LST_TRANSACTION_FINISH_g, /* Pointer to default property list ID */ + H5P__trfcc_reg_prop, /* Default property registration routine */ + NULL, /* Class creation callback */ + NULL, /* Class creation callback info */ + NULL, /* Class copy callback */ + NULL, /* Class copy callback info */ + NULL, /* Class close callback */ + NULL /* Class close callback info */ +}}; + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + + + +/*------------------------------------------------------------------------- + * Function: H5P__trfcc_reg_prop + * + * Purpose: Register the transaction finish property list class's + * properties + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * August 2013 + *------------------------------------------------------------------------- + */ +static herr_t +H5P__trfcc_reg_prop(H5P_genclass_t *pclass) +{ + hbool_t acquire = H5TR_FINISH_ACQUIRE_DEF; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Register the size of raw data chunk cache (elements) */ + if(H5P_register_real(pclass, H5TR_FINISH_ACQUIRE_NAME, H5TR_FINISH_ACQUIRE_SIZE, &acquire, + NULL, NULL, NULL, H5TR_FINISH_ACQUIRE_ENC, H5TR_FINISH_ACQUIRE_DEC, + NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__trfcc_reg_prop() */ diff --git a/src/H5Ptrspl.c b/src/H5Ptrspl.c index aba5b3c..c75c761 100644 --- a/src/H5Ptrspl.c +++ b/src/H5Ptrspl.c @@ -37,7 +37,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5Ppkg.h" /* Property lists */ -#include "H5TRprivate.h" /* Read Context */ +#include "H5TRprivate.h" /* Transactions */ /****************/ /* Local Macros */ diff --git a/src/H5RC.c b/src/H5RC.c index f07cedb..aecf4f7 100644 --- a/src/H5RC.c +++ b/src/H5RC.c @@ -39,7 +39,9 @@ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5VLprivate.h" /* VOL plugins */ +#include "H5VLiod_client.h" /* IOD VOL plugin */ +#ifdef H5_HAVE_EFF /****************/ /* Local Macros */ @@ -79,8 +81,8 @@ static const H5I_class_t H5I_RC_CLS[1] = {{ 0, /* Class flags */ 64, /* Minimum hash size for class */ 2, /* # of reserved IDs for class */ - NULL, /* Callback routine for closing objects of this class */ - (H5I_free2_t)H5RC_close /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5RC_close, /* Callback routine for closing objects of this class */ + NULL /* Callback routine for closing auxilary objects of this class */ }}; @@ -204,7 +206,7 @@ H5Pset_rcapl_version_request(hid_t rcapl_id, H5RC_request_t acquire_req) FUNC_ENTER_API(FAIL) - if(H5RC_EXACT > acquire_req || H5RC_LAST < acquire_req) + if(H5RC_LAST < acquire_req) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "Acquire request can be either H5RC_EXACT, H5RC_NEXT, or H5RC_LAST"); /* Get the plist structure */ @@ -221,6 +223,41 @@ done: /*------------------------------------------------------------------------- + * Function: H5Pget_rcapl_version_request + * + * Purpose: Get the request type for acquring the container version, + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_rcapl_version_request(hid_t rcapl_id, H5RC_request_t *acquire_req) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(rcapl_id, H5P_RC_ACQUIRE))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + if(acquire_req) { + /* Get property */ + if(H5P_get(plist, H5RC_ACQUIRE_CV_REQUEST_NAME, acquire_req) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL, "can't get acquire request"); + } + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_rcapl_version_request() */ + + +/*------------------------------------------------------------------------- * Function: H5RCcreate * * Purpose: Wraps an hid_t around a container version and a file ID. @@ -281,8 +318,6 @@ done: H5RC_t * H5RC_create(void *file, uint64_t c_version) { - void *file = NULL; - H5VL_t *vol_plugin = NULL; H5RC_t *rc = NULL; H5RC_t *ret_value = NULL; /* Return value */ @@ -292,7 +327,7 @@ H5RC_create(void *file, uint64_t c_version) if(NULL == (rc = H5FL_CALLOC(H5RC_t))) HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, NULL, "can't allocate top read context structure") - rc->file = file; + rc->file = (H5VL_iod_file_t *)file; rc->c_version = c_version; /* set return value */ @@ -302,9 +337,26 @@ done: if(!ret_value && rc) rc = H5FL_FREE(H5RC_t, rc); - FUNC_LEAVE_API(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5RC_create() */ + +/*------------------------------------------------------------------------- + * Function: H5RCacquire + * + * Purpose: Acquires a read context from a container for a container + * version c_version. The user can specify options to + * what container version to get if the one being asked for + * is not available. + * + * Return: Success: RC ID + * Failure: NULL + * + * Programmer: Mohamad Chaarawi + * August 2013 + * + *------------------------------------------------------------------------- + */ hid_t H5RCacquire(hid_t file_id, /*IN/OUT*/ uint64_t *c_version, hid_t rcapl_id, hid_t eq_id) @@ -313,8 +365,8 @@ H5RCacquire(hid_t file_id, /*IN/OUT*/ uint64_t *c_version, H5VL_t *vol_plugin = NULL; H5RC_t *rc = NULL; H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ - void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ - hid_t ret_value; + void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ + hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) @@ -351,7 +403,7 @@ H5RCacquire(hid_t file_id, /*IN/OUT*/ uint64_t *c_version, request->vol_plugin = vol_plugin; } - if(H5VL_iod_rc_acquire(file, rc, req) < 0) + if(H5VL_iod_rc_acquire((H5VL_iod_file_t *)file, rc, c_version, rcapl_id, req) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "failed to request a read context on container"); if(request && *req) { @@ -361,15 +413,31 @@ H5RCacquire(hid_t file_id, /*IN/OUT*/ uint64_t *c_version, done: FUNC_LEAVE_API(ret_value) -} +} /* end H5RCacquire() */ + +/*------------------------------------------------------------------------- + * Function: H5RCrelease + * + * Purpose: Releases a previously acquired container version. Does not + * close the RC object (i.e. user has to call H5RCclose()). + * + * Return: Success: Non-Negative + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * August 2013 + * + *------------------------------------------------------------------------- + */ herr_t H5RCrelease(hid_t rc_id , hid_t eq_id) { H5RC_t *rc = NULL; + H5VL_t *vol_plugin = NULL; /* VOL plugin pointer this event queue should use */ H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ - herr_t ret_value; + herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) H5TRACE2("e", "ii", rc_id, eq_id); @@ -378,6 +446,10 @@ H5RCrelease(hid_t rc_id , hid_t eq_id) if(NULL == (rc = (H5RC_t *)H5I_object_verify(rc_id, H5I_RC))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a Read Context ID") + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(eq_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information"); + if(eq_id != H5_EVENT_QUEUE_NULL) { /* create the private request */ if(NULL == (request = (H5_priv_request_t *)H5MM_calloc(sizeof(H5_priv_request_t)))) @@ -398,7 +470,123 @@ H5RCrelease(hid_t rc_id , hid_t eq_id) done: FUNC_LEAVE_API(ret_value) -} +} /* end H5RCrelease() */ + + +/*------------------------------------------------------------------------- + * Function: H5RCpersist + * + * Purpose: Persists a previously acquired container version. + * + * Return: Success: Non-Negative + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * August 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5RCpersist(hid_t rc_id , hid_t eq_id) +{ + H5RC_t *rc = NULL; + H5VL_t *vol_plugin = NULL; /* VOL plugin pointer this event queue should use */ + H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ + void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "ii", rc_id, eq_id); + + /* get the RC object */ + if(NULL == (rc = (H5RC_t *)H5I_object_verify(rc_id, H5I_RC))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a Read Context ID") + + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(eq_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information"); + + if(eq_id != H5_EVENT_QUEUE_NULL) { + /* create the private request */ + if(NULL == (request = (H5_priv_request_t *)H5MM_calloc(sizeof(H5_priv_request_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); + request->req = NULL; + req = &request->req; + request->next = NULL; + request->vol_plugin = vol_plugin; + } + + if(H5VL_iod_rc_persist(rc, req) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "failed to request a persist on a read context on container"); + + if(request && *req) { + if(H5EQinsert(eq_id, request) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "failed to insert request in event queue"); + } + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5RCpersist() */ + + +/*------------------------------------------------------------------------- + * Function: H5RCsnapshot + * + * Purpose: Creates a permanently visible snapshot of a container state. + * + * Return: Success: Non-Negative + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * August 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5RCsnapshot(hid_t rc_id , const char *snapshot_name, hid_t eq_id) +{ + H5RC_t *rc = NULL; + H5VL_t *vol_plugin = NULL; /* VOL plugin pointer this event queue should use */ + H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ + void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + H5TRACE3("e", "i*si", rc_id, snapshot_name, eq_id); + + /* Check arguments */ + if(!snapshot_name || !*snapshot_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid snapshot name") + + /* get the RC object */ + if(NULL == (rc = (H5RC_t *)H5I_object_verify(rc_id, H5I_RC))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a Read Context ID") + + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(eq_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information"); + + if(eq_id != H5_EVENT_QUEUE_NULL) { + /* create the private request */ + if(NULL == (request = (H5_priv_request_t *)H5MM_calloc(sizeof(H5_priv_request_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); + request->req = NULL; + req = &request->req; + request->next = NULL; + request->vol_plugin = vol_plugin; + } + + if(H5VL_iod_rc_snapshot(rc, snapshot_name, req) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "failed to request a snapshot on a read context on container"); + + if(request && *req) { + if(H5EQinsert(eq_id, request) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "failed to insert request in event queue"); + } + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5RCsnapshot() */ /*------------------------------------------------------------------------- @@ -450,13 +638,11 @@ done: herr_t H5RC_close(H5RC_t *rc) { - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_API(FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR rc = H5FL_FREE(H5RC_t, rc); -done: - FUNC_LEAVE_API(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5RC_close() */ +#endif /* H5_HAVE_EFF */ diff --git a/src/H5RCprivate.h b/src/H5RCprivate.h index e4ffa75..bb77ede 100644 --- a/src/H5RCprivate.h +++ b/src/H5RCprivate.h @@ -27,6 +27,8 @@ #include "H5Pprivate.h" /* Property lists */ #include "H5VLprivate.h" /* VOL plugins */ +#ifdef H5_HAVE_EFF + /**************************/ /* Library Private Macros */ /**************************/ @@ -36,7 +38,7 @@ /****************************/ /* the client Read Context struct */ typedef struct H5RC_t { - void *file; + struct H5VL_iod_file_t *file; uint64_t c_version; } H5RC_t; @@ -47,15 +49,11 @@ typedef struct H5RC_t { /******************************/ /* Library Private Prototypes */ /******************************/ -#if 0 herr_t H5RC_init(void); -/* API wrappers */ H5_DLL H5RC_t *H5RC_create(void *file, uint64_t c_version); -H5_DLL herr_t H5RC_close(H5RC_t *rc); +H5_DLL herr_t H5RC_close(H5RC_t *rcxt); -H5_DLL herr_t H5VL_iod_rc_acquire(H5VL_iod_file_t *file, H5RC_t *rc, void **req); -H5_DLL herr_t H5VL_iod_rc_release(H5RC_t *rc, void **req); -#endif +#endif /* H5_HAVE_EFF */ #endif /* _H5RCprivate_H */ diff --git a/src/H5RCpublic.h b/src/H5RCpublic.h index e6083e3..4d6b500 100644 --- a/src/H5RCpublic.h +++ b/src/H5RCpublic.h @@ -25,6 +25,8 @@ #include "H5public.h" #include "H5Ipublic.h" +#ifdef H5_HAVE_EFF + /*****************/ /* Public Macros */ /*****************/ @@ -56,18 +58,15 @@ extern "C" { H5_DLL hid_t H5RCcreate(hid_t file_id, uint64_t container_version); H5_DLL hid_t H5RCacquire(hid_t file_id, /*IN/OUT*/ uint64_t *container_version, hid_t rcapl_id, hid_t eq_id); -H5_DLL herr_t H5RCrelease(hid_t rc_id , hid_t eq_id); -H5_DLL herr_t H5RCclose(hid_t rc_id); +H5_DLL herr_t H5RCrelease(hid_t rcxt_id , hid_t eq_id); +H5_DLL herr_t H5RCpersist(hid_t rcxt_id, hid_t eq_id); +H5_DLL herr_t H5RCsnapshot(hid_t rcxt_id, const char *snapshot_name, hid_t eq_id); +H5_DLL herr_t H5RCclose(hid_t rcxt_id); H5_DLL herr_t H5Pset_rcapl_version_request(hid_t rcapl_id, H5RC_request_t acquire_req); +H5_DLL herr_t H5Pget_rcapl_version_request(hid_t rcapl_id, H5RC_request_t *acquire_req); -#if 0 -/* Those are not set for now */ -H5_DLL herr_t H5Fskip_trans(hid_t file_id, uint64_t start_trans_num, uint64_t count, hid_t eq_id); -H5_DLL herr_t H5Fpersist(hid_t file_id, uint64_t rc_num, hid_t eq_id); -H5_DLL herr_t H5Fsnapshot(hid_t file_id, uint64_t container_version, - const char* snapshot_name, hid_t eq_id); -#endif +#endif /* H5_HAVE_EFF */ #ifdef __cplusplus } diff --git a/src/H5TR.c b/src/H5TR.c index d46823b..191c379 100644 --- a/src/H5TR.c +++ b/src/H5TR.c @@ -34,11 +34,15 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5TRprivate.h" /* Transactions */ +#include "H5EQprivate.h" /* Event Queues */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ +#include "H5RCprivate.h" /* Read Contexts */ +#include "H5TRprivate.h" /* Transactions */ #include "H5VLprivate.h" /* VOL plugins */ +#include "H5VLiod_client.h" /* IOD VOL plugin */ +#ifdef H5_HAVE_EFF /****************/ /* Local Macros */ @@ -78,8 +82,8 @@ static const H5I_class_t H5I_TR_CLS[1] = {{ 0, /* Class flags */ 64, /* Minimum hash size for class */ 2, /* # of reserved IDs for class */ - NULL, /* Callback routine for closing objects of this class */ - (H5I_free2_t)H5TR_close /* Callback routine for closing auxilary objects of this class */ + (H5I_free_t)H5TR_close, /* Callback routine for closing objects of this class */ + NULL /* Callback routine for closing auxilary objects of this class */ }}; @@ -233,6 +237,41 @@ done: /*------------------------------------------------------------------------- + * Function: H5Pget_trspl_num_peers + * + * Purpose: Get the number of peers that will call H5TRstart for a + * transaction. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_trspl_num_peers(hid_t trspl_id, unsigned *num_peers) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*Iu", trspl_id, num_peers); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(trspl_id, H5P_TR_START))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + /* Set property */ + if(H5P_get(plist, H5TR_START_NUM_PEERS_NAME, num_peers) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get num peers in transaction"); + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_trspl_num_peers() */ + + +/*------------------------------------------------------------------------- * Function: H5TRcreate * * Purpose: Wraps an hid_t around a transaction number, a file ID, @@ -253,6 +292,7 @@ H5TRcreate(hid_t file_id, hid_t rc_id, uint64_t trans_num) void *file = NULL; H5VL_t *vol_plugin = NULL; H5TR_t *tr = NULL; + H5RC_t *rc = NULL; hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -296,8 +336,6 @@ done: H5TR_t * H5TR_create(void *file, H5RC_t *rc, uint64_t trans_num) { - void *file = NULL; - H5VL_t *vol_plugin = NULL; H5TR_t *tr = NULL; H5TR_t *ret_value = NULL; /* Return value */ @@ -307,7 +345,7 @@ H5TR_create(void *file, H5RC_t *rc, uint64_t trans_num) if(NULL == (tr = H5FL_CALLOC(H5TR_t))) HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, NULL, "can't allocate top transaction structure") - tr->file = file; + tr->file = (H5VL_iod_file_t *)file; tr->c_version = rc->c_version; tr->trans_num = trans_num; @@ -315,10 +353,7 @@ H5TR_create(void *file, H5RC_t *rc, uint64_t trans_num) ret_value = tr; done: - if(!ret_value && tr) - tr = H5FL_FREE(H5TR_t, tr); - - FUNC_LEAVE_API(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5TR_create() */ @@ -326,6 +361,8 @@ done: * Function: H5TRstart * * Purpose: Starts a transaction that has been created with H5TRcreate. + * If the operation fails, the user is still reponsible to call + * H5TRclose() on the returned value to free resources. * * Return: Success: Non-Negative. * Failure: Negative @@ -339,9 +376,10 @@ herr_t H5TRstart(hid_t tr_id, hid_t trspl_id, hid_t eq_id) { H5TR_t *tr = NULL; + H5VL_t *vol_plugin = NULL; /* VOL plugin pointer this event queue should use */ H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ - herr_t ret_value; + herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) H5TRACE3("e", "iii", tr_id, trspl_id, eq_id); @@ -357,6 +395,10 @@ H5TRstart(hid_t tr_id, hid_t trspl_id, hid_t eq_id) if(TRUE != H5P_isa_class(trspl_id, H5P_TR_START)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not transaction start property list") + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(eq_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information"); + if(eq_id != H5_EVENT_QUEUE_NULL) { /* create the private request */ if(NULL == (request = (H5_priv_request_t *)H5MM_calloc(sizeof(H5_priv_request_t)))) @@ -383,7 +425,11 @@ done: /*------------------------------------------------------------------------- * Function: H5TRfinish * - * Purpose: Finishes/Commits a transaction. + * Purpose: Finishes/Commits a transaction. If rcxt_id is not NULL, + * create a read context from the finished transaction number. + * If the finish fails, the user is still reponsible to call + * H5RCclose() on the rcxt_id and H5TRclose() on the tr_id + * to free resources. * * Return: Success: Non-Negative. * Failure: Negative @@ -394,15 +440,19 @@ done: *------------------------------------------------------------------------- */ herr_t -H5TRfinish(hid_t trans_id, hid_t trfpl_id, hid_t eq_id) +H5TRfinish(hid_t tr_id, hid_t trfpl_id, hid_t *rcxt_id, hid_t eq_id) { H5TR_t *tr = NULL; + H5RC_t *rc = NULL; + H5P_genplist_t *plist; /* Property list pointer */ + hbool_t acquire = FALSE; + H5VL_t *vol_plugin = NULL; /* VOL plugin pointer this event queue should use */ H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ - herr_t ret_value; + herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "iii", trans_id, trfpl_id, eq_id); + H5TRACE4("e", "ii*ii", tr_id, trfpl_id, rcxt_id, eq_id); /* get the TR object */ if(NULL == (tr = (H5TR_t *)H5I_object_verify(tr_id, H5I_TR))) @@ -415,6 +465,22 @@ H5TRfinish(hid_t trans_id, hid_t trfpl_id, hid_t eq_id) if(TRUE != H5P_isa_class(trfpl_id, H5P_TR_FINISH)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not transaction finish property list") + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(eq_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information"); + + /* create a new read context object (if user requested it) with + the provided transaction number to finish */ + if(rcxt_id) { + acquire = TRUE; + + if(NULL == (rc = H5RC_create(tr->file, tr->trans_num))) + HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "unable to create read context"); + /* Get an atom for the event queue with the VOL information as the auxilary struct */ + if((*rcxt_id = H5I_register2(H5I_RC, rc, vol_plugin, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize read context handle"); + } + if(eq_id != H5_EVENT_QUEUE_NULL) { /* create the private request */ if(NULL == (request = (H5_priv_request_t *)H5MM_calloc(sizeof(H5_priv_request_t)))) @@ -425,7 +491,7 @@ H5TRfinish(hid_t trans_id, hid_t trfpl_id, hid_t eq_id) request->vol_plugin = vol_plugin; } - if(H5VL_iod_tr_finish(tr, trfpl_id, req) < 0) + if(H5VL_iod_tr_finish(tr, acquire, trfpl_id, req) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "failed to request a transaction finish"); if(request && *req) { @@ -439,12 +505,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5TRfinish + * Function: H5TRset_dependency * * Purpose: Set a depedency between two transactions. Transaction - * associated with trans_id is declaring a dependency on transaction + * associated with tr_id is declaring a dependency on transaction * numbered trans_num. trans_num must be < the transaction number - * trans_id is associated with. + * tr_id is associated with. * * Return: Success: Non-Negative. * Failure: Negative @@ -455,12 +521,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5TRset_dependency(hid_t trans_id, uint64_t trans_num, hid_t eq_id) +H5TRset_dependency(hid_t tr_id, uint64_t trans_num, hid_t eq_id) { H5TR_t *tr = NULL; + H5VL_t *vol_plugin = NULL; /* VOL plugin pointer this event queue should use */ H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ - herr_t ret_value; + herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -471,6 +538,10 @@ H5TRset_dependency(hid_t trans_id, uint64_t trans_num, hid_t eq_id) if(tr->trans_num <= trans_num) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The dependent transaction must be higher than the one it depends on") + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(eq_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information"); + if(eq_id != H5_EVENT_QUEUE_NULL) { /* create the private request */ if(NULL == (request = (H5_priv_request_t *)H5MM_calloc(sizeof(H5_priv_request_t)))) @@ -495,6 +566,61 @@ done: /*------------------------------------------------------------------------- + * Function: H5TRskip + * + * Purpose: Skip a sequence of transaction numbers from the container. + * + * Return: Success: Non-Negative. + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * August 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5TRskip(hid_t file_id, uint64_t start_trans_num, uint64_t count, hid_t eq_id) +{ + void *file = NULL; + H5VL_t *vol_plugin = NULL; /* VOL plugin pointer this event queue should use */ + H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ + void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + + /* get the file object */ + if(NULL == (file = (void *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") + + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + + if(eq_id != H5_EVENT_QUEUE_NULL) { + /* create the private request */ + if(NULL == (request = (H5_priv_request_t *)H5MM_calloc(sizeof(H5_priv_request_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); + request->req = NULL; + req = &request->req; + request->next = NULL; + request->vol_plugin = vol_plugin; + } + + if(H5VL_iod_tr_skip(file, start_trans_num, count, req) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "failed to request a transaction skip"); + + if(request && *req) { + if(H5EQinsert(eq_id, request) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "failed to insert request in event queue"); + } + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5TRskip()*/ + + +/*------------------------------------------------------------------------- * Function: H5TRabort * * Purpose: Aborts a transaction @@ -508,15 +634,20 @@ done: *------------------------------------------------------------------------- */ herr_t -H5TRabort(hid_t trans_id, hid_t eq_id) +H5TRabort(hid_t tr_id, hid_t eq_id) { H5TR_t *tr = NULL; + H5VL_t *vol_plugin = NULL; /* VOL plugin pointer this event queue should use */ H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ - herr_t ret_value; + herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ii", trans_id, eq_id); + H5TRACE2("e", "ii", tr_id, eq_id); + + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(eq_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information"); /* get the TR object */ if(NULL == (tr = (H5TR_t *)H5I_object_verify(tr_id, H5I_TR))) @@ -567,7 +698,7 @@ H5TRclose(hid_t tr_id) H5TRACE1("e", "i", tr_id); /* Check args */ - if(NULL == H5I_object_verify(tr_id,H5I_TR)) + if(NULL == H5I_object_verify(tr_id, H5I_TR)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an transaction ID") if(H5I_dec_app_ref(tr_id) < 0) @@ -581,8 +712,7 @@ done: /*------------------------------------------------------------------------- * Function: H5TR_close * - * Purpose: Closes the specified transaction ID. The ID will no longer be - * valid for accessing the transaction. + * Purpose: Frees the transaction struct. * * Return: Non-negative on success/Negative on failure * @@ -594,13 +724,11 @@ done: herr_t H5TR_close(H5TR_t *tr) { - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_API(FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR tr = H5FL_FREE(H5TR_t, tr); -done: - FUNC_LEAVE_API(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5TR_close() */ +#endif /* H5_HAVE_EFF */ diff --git a/src/H5TRprivate.h b/src/H5TRprivate.h index 54bbe20..d648d2b 100644 --- a/src/H5TRprivate.h +++ b/src/H5TRprivate.h @@ -22,22 +22,24 @@ #include "H5TRpublic.h" /* Private headers needed by this file */ -#include "H5private.h" /* Generic Functions */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5VLprivate.h" /* VOL plugins */ +#include "H5RCprivate.h" /* Read Contexts */ + +#ifdef H5_HAVE_EFF /**************************/ /* Library Private Macros */ /**************************/ +#define H5TR_FINISH_ACQUIRE_NAME "acquire_after_finishing" /****************************/ /* Library Private Typedefs */ /****************************/ /* the transaction struct */ typedef struct H5TR_t { - void *file; + struct H5VL_iod_file_t *file; uint64_t c_version; uint64_t trans_num; + struct H5VL_iod_request_t *request; } H5TR_t; /*****************************/ @@ -47,17 +49,10 @@ typedef struct H5TR_t { /******************************/ /* Library Private Prototypes */ /******************************/ -#if 0 herr_t H5TR_init(void); -/* API wrappers */ H5_DLL H5TR_t *H5TR_create(void *file, H5RC_t *rc, uint64_t trans_num); H5_DLL herr_t H5TR_close(H5TR_t *tr); - -H5_DLL herr_t H5VL_iod_tr_start(H5TR_t *tr, hid_t trspl_id, void **req); -H5_DLL herr_t H5VL_iod_tr_finish(H5TR_t *tr, hid_t trfpl_id, void **req); -H5_DLL herr_t H5VL_iod_tr_set_dependency(H5TR_t *tr, uint64_t trans_num, void **req); -H5_DLL herr_t H5VL_iod_tr_abort(H5TR_t *tr, void **req); -#endif +#endif /* H5_HAVE_EFF */ #endif /* _H5TRprivate_H */ diff --git a/src/H5TRpublic.h b/src/H5TRpublic.h index 07d6291..4d615ef 100644 --- a/src/H5TRpublic.h +++ b/src/H5TRpublic.h @@ -43,6 +43,8 @@ extern "C" { #endif +#ifdef H5_HAVE_EFF + /*********************/ /* Public Prototypes */ /*********************/ @@ -50,12 +52,16 @@ extern "C" { /* API wrappers */ H5_DLL hid_t H5TRcreate(hid_t file_id, hid_t rc_id, uint64_t trans_num); H5_DLL herr_t H5TRstart(hid_t trans_id, hid_t trspl_id, hid_t eq_id); -H5_DLL herr_t H5TRfinish(hid_t trans_id, hid_t trfpl_id, hid_t eq_id); +H5_DLL herr_t H5TRfinish(hid_t trans_id, hid_t trfpl_id, hid_t *rcntxt_id, hid_t eq_id); +H5_DLL herr_t H5TRskip(hid_t file_id, uint64_t start_trans_num, uint64_t count, hid_t eq_id); H5_DLL herr_t H5TRset_dependency(hid_t trans_id, uint64_t trans_num, hid_t eq_id); H5_DLL herr_t H5TRabort(hid_t trans_id, hid_t eq_id); H5_DLL herr_t H5TRclose(hid_t trans_id); H5_DLL herr_t H5Pset_trspl_num_peers(hid_t trspl_id, unsigned num_peers); +H5_DLL herr_t H5Pget_trspl_num_peers(hid_t trspl_id, unsigned *num_peers); + +#endif /* H5_HAVE_EFF */ #ifdef __cplusplus } diff --git a/src/H5VLiod.c b/src/H5VLiod.c index f0a1e20..771d4ff 100644 --- a/src/H5VLiod.c +++ b/src/H5VLiod.c @@ -89,8 +89,18 @@ static hg_id_t H5VL_OBJECT_VISIT_ID; static hg_id_t H5VL_OBJECT_SET_COMMENT_ID; static hg_id_t H5VL_OBJECT_GET_COMMENT_ID; static hg_id_t H5VL_OBJECT_GET_INFO_ID; +static hg_id_t H5VL_RC_ACQUIRE_ID; +static hg_id_t H5VL_RC_RELEASE_ID; +static hg_id_t H5VL_RC_PERSIST_ID; +static hg_id_t H5VL_RC_SNAPSHOT_ID; +static hg_id_t H5VL_TR_START_ID; +static hg_id_t H5VL_TR_FINISH_ID; +static hg_id_t H5VL_TR_SET_DEPEND_ID; +static hg_id_t H5VL_TR_SKIP_ID; +static hg_id_t H5VL_TR_ABORT_ID; static hg_id_t H5VL_CANCEL_OP_ID; + /* global AXE list struct */ typedef struct H5VL_iod_axe_list_t { H5VL_iod_request_t *head; @@ -405,11 +415,11 @@ H5VL__iod_request_add_to_axe_list(H5VL_iod_request_t *request) } request->global_next = NULL; - request->rc ++; + request->ref_count ++; /* process axe_list */ while(axe_list.head && /* If there is a head request */ - (axe_list.head->rc == 1 || (axe_list.head->rc == 2 && request->req != NULL)) && + (axe_list.head->ref_count == 1 || (axe_list.head->ref_count == 2 && request->req != NULL)) && H5VL_IOD_COMPLETED == axe_list.head->state) { axe_list.last_released_task = axe_list.head->axe_id; @@ -463,7 +473,7 @@ H5VL__iod_create_and_forward(hg_id_t op_id, H5RQ_type_t op_type, request->type = op_type; request->data = data; request->req = hg_req; - request->rc = 1; + request->ref_count = 1; request->obj = request_obj; request->axe_id = axe_info->axe_id; request->next = request->prev = NULL; @@ -511,7 +521,7 @@ H5VL__iod_create_and_forward(hg_id_t op_id, H5RQ_type_t op_type, H5VL_iod_request_decr_rc(request); request->req = H5MM_xfree(request->req); - HDassert(1 == request->rc); + HDassert(1 == request->ref_count); } /* end else */ done: @@ -640,6 +650,18 @@ EFF_init(MPI_Comm comm, MPI_Info UNUSED info) object_get_comment_out_t); H5VL_OBJECT_GET_INFO_ID = MERCURY_REGISTER("object_get_info", object_op_in_t, oinfo_t); + H5VL_RC_ACQUIRE_ID = MERCURY_REGISTER("read_context_acquire", + rc_acquire_in_t, rc_acquire_out_t); + H5VL_RC_RELEASE_ID = MERCURY_REGISTER("read_context_release", rc_release_in_t, ret_t); + H5VL_RC_PERSIST_ID = MERCURY_REGISTER("read_context_persist", rc_persist_in_t, ret_t); + H5VL_RC_SNAPSHOT_ID = MERCURY_REGISTER("read_context_snapshot", rc_snapshot_in_t, ret_t); + + H5VL_TR_START_ID = MERCURY_REGISTER("transaction_start", tr_start_in_t, ret_t); + H5VL_TR_FINISH_ID = MERCURY_REGISTER("transaction_finish", tr_finish_in_t, ret_t); + H5VL_TR_SET_DEPEND_ID = MERCURY_REGISTER("transaction_set_depend",tr_set_depend_in_t, ret_t); + H5VL_TR_SKIP_ID = MERCURY_REGISTER("transaction_skip", tr_skip_in_t, ret_t); + H5VL_TR_ABORT_ID = MERCURY_REGISTER("transaction_abort",tr_abort_in_t, ret_t); + H5VL_CANCEL_OP_ID = MERCURY_REGISTER("cancel_op", uint64_t, uint8_t); /* forward the init call to the ION and wait for its completion */ @@ -1591,7 +1613,7 @@ H5VL_iod_file_close(void *_file, hid_t dxpl_id, void **req) while(cur_req) { if(cur_req->state == H5VL_IOD_PENDING) { parent_reqs[num_parents] = cur_req; - cur_req->rc ++; + cur_req->ref_count ++; num_parents ++; } cur_req = cur_req->next; @@ -2296,10 +2318,10 @@ H5VL_iod_dataset_read(void *_dset, hid_t mem_type_id, hid_t mem_space_id, input.dset_type_id = dset->remote_dset.type_id; input.mem_type_id = mem_type_id; input.axe_info.axe_id = g_axe_id ++; - if(NULL != dset->common.request) { + if(NULL != dset->common.request && dset->common.request->state != H5VL_IOD_COMPLETED) { input.axe_info.num_parents = 1; input.axe_info.parent_axe_ids = &dset->common.request->axe_id; - dset->common.request->rc ++; + dset->common.request->ref_count ++; *parent_req = dset->common.request; } else { @@ -2317,10 +2339,10 @@ H5VL_iod_dataset_read(void *_dset, hid_t mem_type_id, hid_t mem_space_id, input_vl.space_id = file_space_id; input_vl.mem_type_id = mem_type_id; input_vl.axe_info.axe_id = g_axe_id ++; - if(NULL != dset->common.request) { + if(NULL != dset->common.request && dset->common.request->state != H5VL_IOD_COMPLETED) { input_vl.axe_info.num_parents = 1; input_vl.axe_info.parent_axe_ids = &dset->common.request->axe_id; - dset->common.request->rc ++; + dset->common.request->ref_count ++; *parent_req = dset->common.request; } else { @@ -2512,10 +2534,10 @@ H5VL_iod_dataset_write(void *_dset, hid_t mem_type_id, hid_t mem_space_id, input.dset_type_id = dset->remote_dset.type_id; input.mem_type_id = mem_type_id; input.axe_info.axe_id = g_axe_id ++; - if(NULL != dset->common.request) { + if(NULL != dset->common.request && dset->common.request->state != H5VL_IOD_COMPLETED) { input.axe_info.num_parents = 1; input.axe_info.parent_axe_ids = &dset->common.request->axe_id; - dset->common.request->rc ++; + dset->common.request->ref_count ++; *parent_req = dset->common.request; } else { @@ -3496,10 +3518,10 @@ H5VL_iod_attribute_read(void *_attr, hid_t type_id, void *buf, hid_t dxpl_id, vo input.bulk_handle = *bulk_handle; input.type_id = type_id; input.axe_info.axe_id = g_axe_id ++; - if(NULL != attr->common.request) { + if(NULL != attr->common.request && attr->common.request->state != H5VL_IOD_COMPLETED) { input.axe_info.num_parents = 1; input.axe_info.parent_axe_ids = &attr->common.request->axe_id; - attr->common.request->rc ++; + attr->common.request->ref_count ++; *parent_req = attr->common.request; } else { @@ -3592,10 +3614,10 @@ H5VL_iod_attribute_write(void *_attr, hid_t type_id, const void *buf, hid_t dxpl input.bulk_handle = *bulk_handle; input.type_id = type_id; input.axe_info.axe_id = g_axe_id ++; - if(NULL != attr->common.request) { + if(NULL != attr->common.request && attr->common.request->state != H5VL_IOD_COMPLETED) { input.axe_info.num_parents = 1; input.axe_info.parent_axe_ids = &attr->common.request->axe_id; - attr->common.request->rc ++; + attr->common.request->ref_count ++; *parent_req = attr->common.request; } else { @@ -5543,7 +5565,7 @@ done: void * H5VL_iod_map_create(void *_obj, H5VL_loc_params_t loc_params, const char *name, hid_t keytype, hid_t valtype, hid_t lcpl_id, hid_t mcpl_id, - hid_t mapl_id, uint64_t trans, void **req) + hid_t mapl_id, hid_t trans_id, void **req) { H5VL_iod_object_t *obj = (H5VL_iod_object_t *)_obj; /* location object to create the group */ H5VL_iod_map_t *map = NULL; /* the map object that is created and passed to the user */ @@ -5650,7 +5672,7 @@ done: void * H5VL_iod_map_open(void *_obj, H5VL_loc_params_t loc_params, const char *name, hid_t mapl_id, - uint64_t trans, void **req) + hid_t rcxt_id, void **req) { H5VL_iod_object_t *obj = (H5VL_iod_object_t *)_obj; /* location object to create the group */ H5VL_iod_map_t *map = NULL; /* the map object that is created and passed to the user */ @@ -5738,7 +5760,7 @@ done: herr_t H5VL_iod_map_set(void *_map, hid_t key_mem_type_id, const void *key, hid_t val_mem_type_id, const void *value, hid_t dxpl_id, - uint64_t trans, void **req) + hid_t trans_id, void **req) { H5VL_iod_map_t *map = (H5VL_iod_map_t *)_map; map_set_in_t input; @@ -5790,10 +5812,10 @@ H5VL_iod_map_set(void *_map, hid_t key_mem_type_id, const void *key, input.val.buf_size = val_size; input.val.buf = value; input.axe_info.axe_id = g_axe_id ++; - if(NULL != map->common.request) { + if(NULL != map->common.request && map->common.request->state != H5VL_IOD_COMPLETED) { input.axe_info.num_parents = 1; input.axe_info.parent_axe_ids = &map->common.request->axe_id; - map->common.request->rc ++; + map->common.request->ref_count ++; *parent_req = map->common.request; } else { @@ -5822,7 +5844,7 @@ done: herr_t H5VL_iod_map_get(void *_map, hid_t key_mem_type_id, const void *key, hid_t val_mem_type_id, void *value, hid_t dxpl_id, - uint64_t trans, void **req) + hid_t rcxt_id, void **req) { H5VL_iod_map_t *map = (H5VL_iod_map_t *)_map; map_get_in_t input; @@ -5872,10 +5894,10 @@ H5VL_iod_map_get(void *_map, hid_t key_mem_type_id, const void *key, input.key.buf = key; input.val_memtype_id = val_mem_type_id; input.axe_info.axe_id = g_axe_id ++; - if(NULL != map->common.request) { + if(NULL != map->common.request && map->common.request->state != H5VL_IOD_COMPLETED) { input.axe_info.num_parents = 1; input.axe_info.parent_axe_ids = &map->common.request->axe_id; - map->common.request->rc ++; + map->common.request->ref_count ++; *parent_req = map->common.request; } else { @@ -5890,7 +5912,7 @@ H5VL_iod_map_get(void *_map, hid_t key_mem_type_id, const void *key, #endif if(NULL == (output = (map_get_out_t *)H5MM_calloc(sizeof(map_get_out_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate a request"); + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate map get output struct"); output->val.val = value; output->val.val_size = val_size; @@ -5907,7 +5929,7 @@ done: herr_t H5VL_iod_map_get_types(void *_map, hid_t *key_type_id, hid_t *val_type_id, - uint64_t trans, void **req) + hid_t rcxt_id, void **req) { H5VL_iod_map_t *map = (H5VL_iod_map_t *)_map; herr_t ret_value = SUCCEED; @@ -5934,7 +5956,7 @@ done: } /* end H5VL_iod_map_get_types() */ herr_t -H5VL_iod_map_get_count(void *_map, hsize_t *count, uint64_t trans, void **req) +H5VL_iod_map_get_count(void *_map, hsize_t *count, hid_t rcxt_id, void **req) { H5VL_iod_map_t *map = (H5VL_iod_map_t *)_map; map_get_count_in_t input; @@ -5951,10 +5973,10 @@ H5VL_iod_map_get_count(void *_map, hsize_t *count, uint64_t trans, void **req) input.iod_oh = map->remote_map.iod_oh; input.iod_id = map->remote_map.iod_id; input.axe_info.axe_id = g_axe_id ++; - if(NULL != map->common.request) { + if(NULL != map->common.request && map->common.request->state != H5VL_IOD_COMPLETED) { input.axe_info.num_parents = 1; input.axe_info.parent_axe_ids = &map->common.request->axe_id; - map->common.request->rc ++; + map->common.request->ref_count ++; *parent_req = map->common.request; } else { @@ -5980,7 +6002,7 @@ done: herr_t H5VL_iod_map_exists(void *_map, hid_t key_mem_type_id, const void *key, - htri_t *exists, uint64_t trans, void **req) + htri_t *exists, hid_t rcxt_id, void **req) { H5VL_iod_map_t *map = (H5VL_iod_map_t *)_map; map_op_in_t input; @@ -6011,10 +6033,10 @@ H5VL_iod_map_exists(void *_map, hid_t key_mem_type_id, const void *key, input.key.buf_size = key_size; input.key.buf = key; input.axe_info.axe_id = g_axe_id ++; - if(NULL != map->common.request) { + if(NULL != map->common.request && map->common.request->state != H5VL_IOD_COMPLETED) { input.axe_info.num_parents = 1; input.axe_info.parent_axe_ids = &map->common.request->axe_id; - map->common.request->rc ++; + map->common.request->ref_count ++; *parent_req = map->common.request; } else { @@ -6052,7 +6074,7 @@ done: herr_t H5VL_iod_map_delete(void *_map, hid_t key_mem_type_id, const void *key, - uint64_t trans, void **req) + hid_t trans_id, void **req) { H5VL_iod_map_t *map = (H5VL_iod_map_t *)_map; map_op_in_t input; @@ -6084,10 +6106,10 @@ H5VL_iod_map_delete(void *_map, hid_t key_mem_type_id, const void *key, input.key.buf_size = key_size; input.key.buf = key; input.axe_info.axe_id = g_axe_id ++; - if(NULL != map->common.request) { + if(NULL != map->common.request && map->common.request->state != H5VL_IOD_COMPLETED) { input.axe_info.num_parents = 1; input.axe_info.parent_axe_ids = &map->common.request->axe_id; - map->common.request->rc ++; + map->common.request->ref_count ++; *parent_req = map->common.request; } else { @@ -6375,4 +6397,508 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_wait() */ + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_rc_acquire + * + * Purpose: Forwards an acquire for a read context to IOD. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5VL_iod_rc_acquire(H5VL_iod_file_t *file, H5RC_t *rc, uint64_t *c_version, + hid_t rcapl_id, void **req) +{ + rc_acquire_in_t input; + H5VL_iod_rc_info_t *rc_info = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* set the input structure for the HG encode routine */ + input.coh = file->remote_file.coh; + input.c_version = *c_version; + input.rcapl_id = rcapl_id; + input.axe_info.axe_id = g_axe_id ++; + input.axe_info.num_parents = 0; + input.axe_info.parent_axe_ids = NULL; + + /* setup the info structure for updating the RC on completion */ + if(NULL == (rc_info = (H5VL_iod_rc_info_t *)H5MM_calloc(sizeof(H5VL_iod_rc_info_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate RC info struct"); + + rc_info->read_cxt = rc; + rc_info->c_version_ptr = c_version; + +#if H5VL_IOD_DEBUG + printf("Read Context Acquire, version %llu, axe id %llu\n", + input.c_version, input.axe_info.axe_id); +#endif + + if(H5VL__iod_create_and_forward(H5VL_RC_ACQUIRE_ID, HG_RC_ACQUIRE, + (H5VL_iod_object_t *)file, 0, 0, NULL, + &input, &rc_info->result, rc_info, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship VOL op"); + +#if 0 + /* MSC - this is not needed because the user is repsonsible to wait on the acquire */ + if(NULL != req) { + H5VL_iod_request_t *request = (H5VL_iod_request_t *)(*req); + + rc->request = request; + request->ref_count ++; + } +#endif + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_rc_acquire() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_rc_release + * + * Purpose: Forwards an release on an acquired read context to IOD + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5VL_iod_rc_release(H5RC_t *rc, void **req) +{ + rc_release_in_t input; + int *status = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* set the input structure for the HG encode routine */ + input.coh = rc->file->remote_file.coh; + input.c_version = rc->c_version; + input.axe_info.axe_id = g_axe_id ++; + input.axe_info.num_parents = 0; + input.axe_info.parent_axe_ids = NULL; + + status = (int *)malloc(sizeof(int)); + +#if H5VL_IOD_DEBUG + printf("Read Context Release, version %llu, axe id %llu\n", + input.c_version, input.axe_info.axe_id); +#endif + + if(H5VL__iod_create_and_forward(H5VL_RC_RELEASE_ID, HG_RC_RELEASE, + (H5VL_iod_object_t *)rc->file, 0, 0, NULL, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship VOL op"); + +#if 0 + /* MSC - this is not needed because the user is repsonsible to wait on the acquire */ + if(NULL != rc->request) { + H5VL_iod_request_decr_rc(rc->request); + } +#endif + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_rc_release() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_rc_persist + * + * Purpose: Forwards an persist on an acquired read context to IOD + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5VL_iod_rc_persist(H5RC_t *rc, void **req) +{ + rc_persist_in_t input; + int *status = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* set the input structure for the HG encode routine */ + input.coh = rc->file->remote_file.coh; + input.c_version = rc->c_version; + input.axe_info.axe_id = g_axe_id ++; + input.axe_info.num_parents = 0; + input.axe_info.parent_axe_ids = NULL; + + status = (int *)malloc(sizeof(int)); + +#if H5VL_IOD_DEBUG + printf("Read Context Persist, version %llu, axe id %llu\n", + input.c_version, input.axe_info.axe_id); +#endif + + if(H5VL__iod_create_and_forward(H5VL_RC_PERSIST_ID, HG_RC_PERSIST, + (H5VL_iod_object_t *)rc->file, 0, 0, NULL, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship VOL op"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_rc_persist() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_rc_snapshot + * + * Purpose: Forwards an snapshot on an acquired read context to IOD + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5VL_iod_rc_snapshot(H5RC_t *rc, const char *snapshot_name, void **req) +{ + rc_snapshot_in_t input; + int *status = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* set the input structure for the HG encode routine */ + input.coh = rc->file->remote_file.coh; + input.c_version = rc->c_version; + input.snapshot_name = snapshot_name; + input.axe_info.axe_id = g_axe_id ++; + input.axe_info.num_parents = 0; + input.axe_info.parent_axe_ids = NULL; + + status = (int *)malloc(sizeof(int)); + +#if H5VL_IOD_DEBUG + printf("Read Context Snapshot, version %llu, axe id %llu\n", + input.c_version, input.axe_info.axe_id); +#endif + + if(H5VL__iod_create_and_forward(H5VL_RC_SNAPSHOT_ID, HG_RC_SNAPSHOT, + (H5VL_iod_object_t *)rc->file, 0, 0, NULL, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship VOL op"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_rc_snapshot() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_tr_start + * + * Purpose: Forwards a transaction start call to IOD + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5VL_iod_tr_start(H5TR_t *tr, hid_t trspl_id, void **req) +{ + tr_start_in_t input; + int *status = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* set the input structure for the HG encode routine */ + input.coh = tr->file->remote_file.coh; + input.trans_num = tr->trans_num; + input.trspl_id = trspl_id; + input.axe_info.axe_id = g_axe_id ++; + input.axe_info.num_parents = 0; + input.axe_info.parent_axe_ids = NULL; + + status = (int *)malloc(sizeof(int)); + +#if H5VL_IOD_DEBUG + printf("Transaction start, number %llu, axe id %llu\n", + input.trans_num, input.axe_info.axe_id); +#endif + + if(H5VL__iod_create_and_forward(H5VL_TR_START_ID, HG_TR_START, + (H5VL_iod_object_t *)tr->file, 0, 0, NULL, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship VOL op"); + + if(NULL != req) { + H5VL_iod_request_t *request = (H5VL_iod_request_t *)(*req); + + tr->request = request; + request->ref_count ++; + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_tr_start() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_tr_finish + * + * Purpose: Forwards a transaction finish call to IOD. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5VL_iod_tr_finish(H5TR_t *tr, hbool_t acquire, hid_t trfpl_id, void **req) +{ + tr_finish_in_t input; + int *status = NULL; + H5VL_iod_request_t **parent_req = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + if(NULL == (parent_req = (H5VL_iod_request_t **)H5MM_malloc(sizeof(H5VL_iod_request_t *)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate parent req element"); + + /* set the input structure for the HG encode routine */ + input.coh = tr->file->remote_file.coh; + input.trans_num = tr->trans_num; + input.trfpl_id = trfpl_id; + input.acquire = acquire; + input.axe_info.axe_id = g_axe_id ++; + input.axe_info.num_parents = 0; + input.axe_info.parent_axe_ids = NULL; + + if(NULL != tr->request && tr->request->state != H5VL_IOD_COMPLETED) { + input.axe_info.num_parents = 1; + input.axe_info.parent_axe_ids = &tr->request->axe_id; + tr->request->ref_count ++; + *parent_req = tr->request; + } + else { + input.axe_info.num_parents = 0; + input.axe_info.parent_axe_ids = NULL; + *parent_req = NULL; + } + + status = (int *)malloc(sizeof(int)); + +#if H5VL_IOD_DEBUG + printf("Transaction Finish, %llu, axe id %llu, Parent %llu\n", + input.trans_num, input.axe_info.axe_id, + ((input.axe_info.parent_axe_ids!=NULL) ? input.axe_info.parent_axe_ids[0] : 0)); +#endif + + if(H5VL__iod_create_and_forward(H5VL_TR_FINISH_ID, HG_TR_FINISH, + (H5VL_iod_object_t *)tr->file, 0, + input.axe_info.num_parents, parent_req, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship VOL op"); + + if(NULL != tr->request) { + H5VL_iod_request_decr_rc(tr->request); + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_tr_finish() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_tr_set_dependency + * + * Purpose: Forwards a transaction set dependency to IOD + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5VL_iod_tr_set_dependency(H5TR_t *tr, uint64_t trans_num, void **req) +{ + tr_set_depend_in_t input; + int *status = NULL; + H5VL_iod_request_t **parent_req = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + if(NULL == (parent_req = (H5VL_iod_request_t **)H5MM_malloc(sizeof(H5VL_iod_request_t *)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate parent req element"); + + /* set the input structure for the HG encode routine */ + input.coh = tr->file->remote_file.coh; + input.child_trans_num = tr->trans_num; + input.parent_trans_num = trans_num; + input.axe_info.axe_id = g_axe_id ++; + + if(NULL != tr->request && tr->request->state != H5VL_IOD_COMPLETED) { + input.axe_info.num_parents = 1; + input.axe_info.parent_axe_ids = &tr->request->axe_id; + tr->request->ref_count ++; + *parent_req = tr->request; + } + else { + input.axe_info.num_parents = 0; + input.axe_info.parent_axe_ids = NULL; + *parent_req = NULL; + } + +#if H5VL_IOD_DEBUG + printf("Transaction Set Dependency, %llu on %llu axe id %llu, Parent %llu\n", + input.child_trans_num, input.parent_trans_num, input.axe_info.axe_id, + ((input.axe_info.parent_axe_ids!=NULL) ? input.axe_info.parent_axe_ids[0] : 0)); +#endif + + status = (int *)malloc(sizeof(int)); + + if(H5VL__iod_create_and_forward(H5VL_TR_SET_DEPEND_ID, HG_TR_SET_DEPEND, + (H5VL_iod_object_t *)tr->file, 0, + input.axe_info.num_parents, parent_req, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship VOL op"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_tr_set_dependency() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_tr_skip + * + * Purpose: Forwards a transaction skip to IOD + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5VL_iod_tr_skip(H5VL_iod_file_t *file, uint64_t start_trans_num, uint64_t count, void **req) +{ + tr_skip_in_t input; + int *status = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* set the input structure for the HG encode routine */ + input.coh = file->remote_file.coh; + input.start_trans_num = start_trans_num; + input.count = count; + input.axe_info.axe_id = g_axe_id ++; + input.axe_info.num_parents = 0; + input.axe_info.parent_axe_ids = NULL; + +#if H5VL_IOD_DEBUG + printf("Transaction Skip, tr %llu count %llu,, axe id %llu\n", + input.start_trans_num, input.count, input.axe_info.axe_id); +#endif + + status = (int *)malloc(sizeof(int)); + + if(H5VL__iod_create_and_forward(H5VL_TR_SKIP_ID, HG_TR_SKIP, + (H5VL_iod_object_t *)file, 0, 0, NULL, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship VOL op"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_tr_skip() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_tr_abort + * + * Purpose: Forwards a transaction abort to IOD + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5VL_iod_tr_abort(H5TR_t *tr, void **req) +{ + tr_abort_in_t input; + int *status = NULL; + H5VL_iod_request_t **parent_req = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + if(NULL == (parent_req = (H5VL_iod_request_t **)H5MM_malloc(sizeof(H5VL_iod_request_t *)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate parent req element"); + + /* set the input structure for the HG encode routine */ + input.coh = tr->file->remote_file.coh; + input.trans_num = tr->trans_num; + input.axe_info.axe_id = g_axe_id ++; + if(NULL != tr->request && tr->request->state != H5VL_IOD_COMPLETED) { + input.axe_info.num_parents = 1; + input.axe_info.parent_axe_ids = &tr->request->axe_id; + tr->request->ref_count ++; + *parent_req = tr->request; + } + else { + input.axe_info.num_parents = 0; + input.axe_info.parent_axe_ids = NULL; + *parent_req = NULL; + } + + status = (int *)malloc(sizeof(int)); + +#if H5VL_IOD_DEBUG + printf("Transaction Abort, tr %llu, axe id %llu, Parent %llu\n", + input.trans_num, input.axe_info.axe_id, + ((input.axe_info.parent_axe_ids!=NULL) ? input.axe_info.parent_axe_ids[0] : 0)); +#endif + + if(H5VL__iod_create_and_forward(H5VL_TR_ABORT_ID, HG_TR_ABORT, + (H5VL_iod_object_t *)tr->file, 0, + input.axe_info.num_parents, parent_req, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship VOL op"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_tr_abort() */ + #endif /* H5_HAVE_EFF */ diff --git a/src/H5VLiod_client.c b/src/H5VLiod_client.c index 74db59b..4e126e9 100644 --- a/src/H5VLiod_client.c +++ b/src/H5VLiod_client.c @@ -65,9 +65,9 @@ H5VL_iod_request_decr_rc(H5VL_iod_request_t *request) { FUNC_ENTER_NOAPI_NOINIT_NOERR - request->rc --; + request->ref_count --; - if(0 == request->rc) { + if(0 == request->ref_count) { request->parent_reqs = (H5VL_iod_request_t **)H5MM_xfree(request->parent_reqs); request = (H5VL_iod_request_t *)H5MM_xfree(request); } @@ -1102,8 +1102,62 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) H5VL_iod_request_delete(file, req); break; } + case HG_RC_ACQUIRE: + { + H5VL_iod_rc_info_t *rc_info = (H5VL_iod_rc_info_t *)req->data; + + if(SUCCEED != rc_info->result.ret) { + fprintf(stderr, "Failed to Acquire Read Context %llu\n", *(rc_info->c_version_ptr)); + req->status = H5AO_FAILED; + req->state = H5VL_IOD_COMPLETED; + } + + rc_info->read_cxt->c_version = rc_info->result.c_version; + *rc_info->c_version_ptr = rc_info->result.c_version; + rc_info = (H5VL_iod_rc_info_t *)H5MM_xfree(rc_info); + req->data = NULL; + H5VL_iod_request_delete(file, req); + break; + } + case HG_RC_RELEASE: + case HG_RC_PERSIST: + case HG_RC_SNAPSHOT: + { + int *status = (int *)req->data; + + if(SUCCEED != *status) { + fprintf(stderr, "Failed to Read Context OP\n"); + req->status = H5AO_FAILED; + req->state = H5VL_IOD_COMPLETED; + } + + free(status); + req->data = NULL; + H5VL_iod_request_delete(file, req); + break; + } + case HG_TR_START: + case HG_TR_FINISH: + case HG_TR_SET_DEPEND: + case HG_TR_SKIP: + case HG_TR_ABORT: + { + int *status = (int *)req->data; + + if(SUCCEED != *status) { + fprintf(stderr, "Failed transaction OP\n"); + req->status = H5AO_FAILED; + req->state = H5VL_IOD_COMPLETED; + } + + free(status); + req->data = NULL; + H5VL_iod_request_delete(file, req); + break; + } case HG_LINK_ITERATE: case HG_OBJECT_VISIT: + case HG_MAP_ITERATE: default: req->status = H5AO_FAILED; req->state = H5VL_IOD_COMPLETED; @@ -1140,6 +1194,7 @@ H5VL_iod_request_cancel(H5VL_iod_file_t *file, H5VL_iod_request_t *req) case HG_DSET_READ: case HG_ATTR_WRITE: case HG_ATTR_READ: + case HG_DSET_GET_VL_SIZE: { H5VL_iod_io_info_t *info = (H5VL_iod_io_info_t *)req->data; @@ -1410,11 +1465,46 @@ H5VL_iod_request_cancel(H5VL_iod_file_t *file, H5VL_iod_request_t *req) break; } case HG_OBJECT_OPEN: + case HG_LINK_GET_INFO: + case HG_OBJECT_GET_INFO: req->data = NULL; H5VL_iod_request_delete(file, req); break; + case HG_LINK_GET_VAL: + { + link_get_val_out_t *result = (link_get_val_out_t *)req->data; + + free(result); + req->data = NULL; + H5VL_iod_request_delete(file, req); + break; + } + case HG_RC_ACQUIRE: + { + H5VL_iod_rc_info_t *rc_info = (H5VL_iod_rc_info_t *)req->data; + + rc_info = (H5VL_iod_rc_info_t *)H5MM_xfree(rc_info); + req->data = NULL; + H5VL_iod_request_delete(file, req); + break; + } + case HG_RC_RELEASE: + case HG_TR_START: + case HG_TR_FINISH: + case HG_TR_SET_DEPEND: + case HG_TR_SKIP: + case HG_TR_ABORT: + { + int *status = (int *)req->data; + + free(status); + req->data = NULL; + H5VL_iod_request_delete(file, req); + break; + } case HG_LINK_ITERATE: case HG_OBJECT_VISIT: + case HG_MAP_ITERATE: default: H5VL_iod_request_delete(file, req); HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "Request Type not supported"); @@ -1455,7 +1545,7 @@ H5VL_iod_get_axe_parents(H5VL_iod_object_t *obj, /*IN/OUT*/ size_t *count, } if(NULL != parent_reqs) { parent_reqs[size] = cur_req; - cur_req->rc ++; + cur_req->ref_count ++; } size ++; } @@ -1611,7 +1701,7 @@ H5VL_iod_get_parent_info(H5VL_iod_object_t *obj, H5VL_loc_params_t loc_params, if(cur_obj->request && cur_obj->request->status == H5AO_PENDING) { *parent_req = cur_obj->request; - cur_obj->request->rc ++; + cur_obj->request->ref_count ++; } else { *parent_req = NULL; diff --git a/src/H5VLiod_client.h b/src/H5VLiod_client.h index a3e34df..cc6edc2 100644 --- a/src/H5VLiod_client.h +++ b/src/H5VLiod_client.h @@ -21,6 +21,8 @@ #include "H5FFprivate.h" /* FastForward wrappers */ #include "H5Mpublic.h" +#include "H5RCprivate.h" /* Read contexts */ +#include "H5TRprivate.h" /* Transactions */ #include "H5VLiod_common.h" #ifdef H5_HAVE_EFF @@ -78,7 +80,16 @@ typedef enum H5RQ_type_t { HG_OBJECT_EXISTS, HG_OBJECT_SET_COMMENT, HG_OBJECT_GET_COMMENT, - HG_OBJECT_GET_INFO + HG_OBJECT_GET_INFO, + HG_RC_ACQUIRE, + HG_RC_RELEASE, + HG_RC_PERSIST, + HG_RC_SNAPSHOT, + HG_TR_START, + HG_TR_FINISH, + HG_TR_SET_DEPEND, + HG_TR_SKIP, + HG_TR_ABORT } H5RQ_type_t; /* the client IOD VOL request struct */ @@ -96,7 +107,7 @@ typedef struct H5VL_iod_request_t { struct H5VL_iod_request_t *next; struct H5VL_iod_request_t *global_prev; struct H5VL_iod_request_t *global_next; - unsigned rc; + unsigned ref_count; } H5VL_iod_request_t; /* struct that contains the information about the IOD container */ @@ -252,6 +263,13 @@ typedef struct H5VL_iod_io_info_t { } H5VL_iod_io_info_t; +/* information about a read context acquire request*/ +typedef struct H5VL_iod_rc_info_t { + rc_acquire_out_t result; + H5RC_t *read_cxt; + uint64_t *c_version_ptr; +} H5VL_iod_rc_info_t; + H5_DLL herr_t H5VL_iod_request_delete(H5VL_iod_file_t *file, H5VL_iod_request_t *request); H5_DLL herr_t H5VL_iod_request_add(H5VL_iod_file_t *file, H5VL_iod_request_t *request); H5_DLL herr_t H5VL_iod_request_wait(H5VL_iod_file_t *file, H5VL_iod_request_t *request); @@ -287,25 +305,40 @@ H5_DLL herr_t H5VL_iod_pre_read(hid_t type_id, hid_t space_id, const void *buf, H5_DLL herr_t H5M_init(void); H5_DLL void *H5VL_iod_map_create(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t keytype, hid_t valtype, hid_t lcpl_id, hid_t mcpl_id, - hid_t mapl_id, uint64_t trans, void **req); + hid_t mapl_id, hid_t trans_id, void **req); H5_DLL void *H5VL_iod_map_open(void *obj, H5VL_loc_params_t loc_params, - const char *name, hid_t mapl_id, uint64_t trans, void **req); + const char *name, hid_t mapl_id, hid_t rcxt_id, void **req); H5_DLL herr_t H5VL_iod_map_set(void *map, hid_t key_mem_type_id, const void *key, hid_t val_mem_type_id, const void *value, hid_t dxpl_id, - uint64_t trans, void **req); + hid_t trans_id, void **req); H5_DLL herr_t H5VL_iod_map_get(void *map, hid_t key_mem_type_id, const void *key, hid_t val_mem_type_id, void *value, hid_t dxpl_id, - uint64_t trans, void **req); + hid_t rcxt_id, void **req); H5_DLL herr_t H5VL_iod_map_get_types(void *map, hid_t *key_type_id, hid_t *val_type_id, - uint64_t trans, void **req); -H5_DLL herr_t H5VL_iod_map_get_count(void *map, hsize_t *count, uint64_t trans, void **req); + hid_t rcxt_id, void **req); +H5_DLL herr_t H5VL_iod_map_get_count(void *map, hsize_t *count, hid_t rcxt_id, void **req); H5_DLL herr_t H5VL_iod_map_exists(void *map, hid_t key_mem_type_id, const void *key, - htri_t *exists, uint64_t trans, void **req); + htri_t *exists, hid_t rcxt_id, void **req); H5_DLL herr_t H5VL_iod_map_iterate(void *map, hid_t key_mem_type_id, hid_t value_mem_type_id, H5M_iterate_func_t callback_func, void *context); H5_DLL herr_t H5VL_iod_map_delete(void *map, hid_t key_mem_type_id, const void *key, - uint64_t trans, void **req); + hid_t trans_id, void **req); H5_DLL herr_t H5VL_iod_map_close(void *map, void **req); +/* private routines for RC */ +H5_DLL herr_t H5VL_iod_rc_acquire(H5VL_iod_file_t *file, H5RC_t *rc, + uint64_t *c_version, hid_t rcapl_id, void **req); +H5_DLL herr_t H5VL_iod_rc_release(H5RC_t *rc, void **req); +H5_DLL herr_t H5VL_iod_rc_persist(H5RC_t *rc, void **req); +H5_DLL herr_t H5VL_iod_rc_snapshot(H5RC_t *rc, const char *snapshot_name, void **req); + +/* private routines for TR */ +H5_DLL herr_t H5VL_iod_tr_start(H5TR_t *tr, hid_t trspl_id, void **req); +H5_DLL herr_t H5VL_iod_tr_finish(H5TR_t *tr, hbool_t acquire, hid_t trfpl_id, void **req); +H5_DLL herr_t H5VL_iod_tr_set_dependency(H5TR_t *tr, uint64_t trans_num, void **req); +H5_DLL herr_t H5VL_iod_tr_skip(H5VL_iod_file_t *file, uint64_t start_trans_num, + uint64_t count, void **req); +H5_DLL herr_t H5VL_iod_tr_abort(H5TR_t *tr, void **req); + #endif /* H5_HAVE_EFF */ #endif /* _H5VLiod_client_H */ diff --git a/src/H5VLiod_common.h b/src/H5VLiod_common.h index 302e9ea..aa92625 100644 --- a/src/H5VLiod_common.h +++ b/src/H5VLiod_common.h @@ -287,5 +287,31 @@ MERCURY_GEN_PROC(object_get_comment_in_t, ((axe_t)(axe_info)) ((hg_string_t)(path)) ((uint64_t)(length))) MERCURY_GEN_PROC(object_get_comment_out_t, ((int32_t)(ret)) ((name_t)(name))) +MERCURY_GEN_PROC(rc_acquire_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((uint64_t)(c_version)) + ((hid_t)(rcapl_id))) +MERCURY_GEN_PROC(rc_acquire_out_t, ((int32_t)(ret)) ((uint64_t)(c_version))) +MERCURY_GEN_PROC(rc_release_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((uint64_t)(c_version))) +MERCURY_GEN_PROC(rc_persist_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((uint64_t)(c_version))) +MERCURY_GEN_PROC(rc_snapshot_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((hg_string_t)(snapshot_name)) + ((uint64_t)(c_version))) + +MERCURY_GEN_PROC(tr_start_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((uint64_t)(trans_num)) + ((hid_t)(trspl_id))) +MERCURY_GEN_PROC(tr_finish_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((uint64_t)(trans_num)) + ((hbool_t)(acquire)) ((hid_t)(trfpl_id))) +MERCURY_GEN_PROC(tr_set_depend_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((uint64_t)(child_trans_num)) + ((uint64_t)(parent_trans_num))) +MERCURY_GEN_PROC(tr_skip_in_t, ((axe_t)(axe_info)) ((iod_handle_t)(coh)) + ((uint64_t)(start_trans_num)) ((uint64_t)(count))) +MERCURY_GEN_PROC(tr_abort_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((uint64_t)(trans_num))) + #endif /* H5_HAVE_EFF */ #endif /* _H5VLiod_common_H */ diff --git a/src/H5VLiod_encdec.c b/src/H5VLiod_encdec.c index 8fc807c..6cf4d75 100644 --- a/src/H5VLiod_encdec.c +++ b/src/H5VLiod_encdec.c @@ -447,7 +447,8 @@ static int hg_proc_plist_t(hg_proc_t proc, hid_t *data) H5P_ATTRIBUTE_CREATE_DEFAULT != plist_id && H5P_OBJECT_COPY_DEFAULT != plist_id && H5P_DATASET_ACCESS_DEFAULT != plist_id && H5P_DATASET_XFER_DEFAULT != plist_id && H5P_DATATYPE_CREATE_DEFAULT != plist_id && H5P_DATATYPE_ACCESS_DEFAULT != plist_id && - H5P_LINK_ACCESS_DEFAULT != plist_id) { + H5P_LINK_ACCESS_DEFAULT != plist_id && H5P_RC_ACQUIRE_DEFAULT != plist_id && + H5P_TR_START_DEFAULT != plist_id && H5P_TR_FINISH_DEFAULT != plist_id) { if(H5Pencode(plist_id, NULL, &plist_size) < 0) { HG_ERROR_DEFAULT("PLIST encode Proc error"); return HG_FAIL; diff --git a/src/H5VLiod_server.c b/src/H5VLiod_server.c index 3fb3dc1..77fba12 100644 --- a/src/H5VLiod_server.c +++ b/src/H5VLiod_server.c @@ -158,6 +158,26 @@ H5VLiod_start_handler(MPI_Comm comm, MPI_Info UNUSED info) MERCURY_HANDLER_REGISTER("object_get_info", H5VL_iod_server_object_get_info, object_op_in_t, oinfo_t); + MERCURY_HANDLER_REGISTER("read_context_acquire", H5VL_iod_server_rcxt_acquire, + rc_acquire_in_t, rc_acquire_out_t); + MERCURY_HANDLER_REGISTER("read_context_release", H5VL_iod_server_rcxt_release, + rc_release_in_t, ret_t); + MERCURY_HANDLER_REGISTER("read_context_persist", H5VL_iod_server_rcxt_persist, + rc_persist_in_t, ret_t); + MERCURY_HANDLER_REGISTER("read_context_snapshot", H5VL_iod_server_rcxt_snapshot, + rc_snapshot_in_t, ret_t); + + MERCURY_HANDLER_REGISTER("transaction_start", H5VL_iod_server_trans_start, + tr_start_in_t, ret_t); + MERCURY_HANDLER_REGISTER("transaction_finish", H5VL_iod_server_trans_finish, + tr_finish_in_t, ret_t); + MERCURY_HANDLER_REGISTER("transaction_set_depend", H5VL_iod_server_trans_set_dependency, + tr_set_depend_in_t, ret_t); + MERCURY_HANDLER_REGISTER("transaction_skip", H5VL_iod_server_trans_skip, + tr_skip_in_t, ret_t); + MERCURY_HANDLER_REGISTER("transaction_abort", H5VL_iod_server_trans_abort, + tr_abort_in_t, ret_t); + MERCURY_HANDLER_REGISTER("cancel_op", H5VL_iod_server_cancel_op, uint64_t, uint8_t); /* Initialize engine attribute */ @@ -2825,4 +2845,481 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_server_map_close() */ + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_rcxt_acquire + * + * Purpose: Function shipper registered call for Read Context Acquire. + * Inserts the real worker routine into the Async Engine. + * + * Return: Success: HG_SUCCESS + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +int +H5VL_iod_server_rcxt_acquire(hg_handle_t handle) +{ + op_data_t *op_data = NULL; + rc_acquire_in_t *input; + int ret_value = HG_SUCCESS; + + FUNC_ENTER_NOAPI_NOINIT + + if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(NULL == (input = (rc_acquire_in_t *)H5MM_malloc(sizeof(rc_acquire_in_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(HG_FAIL == HG_Handler_get_input(handle, input)) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, HG_FAIL, "can't get input parameters"); + + if(NULL == engine) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "AXE engine not started"); + + if(input->axe_info.count && + H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, + input->axe_info.count) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "Unable to cleanup AXE tasks"); + + op_data->hg_handle = handle; + op_data->input = (void *)input; + + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, + input->axe_info.num_parents, input->axe_info.parent_axe_ids, + 0, NULL, H5VL_iod_server_rcxt_acquire_cb, op_data, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_server_rcxt_acquire() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_rcxt_release + * + * Purpose: Function shipper registered call for read context release. + * Inserts the real worker routine into the Async Engine. + * + * Return: Success: HG_SUCCESS + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +int +H5VL_iod_server_rcxt_release(hg_handle_t handle) +{ + op_data_t *op_data = NULL; + rc_release_in_t *input; + int ret_value = HG_SUCCESS; + + FUNC_ENTER_NOAPI_NOINIT + + if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(NULL == (input = (rc_release_in_t *)H5MM_malloc(sizeof(rc_release_in_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(HG_FAIL == HG_Handler_get_input(handle, input)) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, HG_FAIL, "can't get input parameters"); + + if(NULL == engine) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "AXE engine not started"); + + if(input->axe_info.count && + H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, + input->axe_info.count) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "Unable to cleanup AXE tasks"); + + op_data->hg_handle = handle; + op_data->input = (void *)input; + + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, + input->axe_info.num_parents, input->axe_info.parent_axe_ids, + 0, NULL, H5VL_iod_server_rcxt_release_cb, op_data, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_server_rcxt_release() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_rcxt_persist + * + * Purpose: Function shipper registered call for read context persist. + * Inserts the real worker routine into the Async Engine. + * + * Return: Success: HG_SUCCESS + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +int +H5VL_iod_server_rcxt_persist(hg_handle_t handle) +{ + op_data_t *op_data = NULL; + rc_persist_in_t *input; + int ret_value = HG_SUCCESS; + + FUNC_ENTER_NOAPI_NOINIT + + if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(NULL == (input = (rc_persist_in_t *)H5MM_malloc(sizeof(rc_persist_in_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(HG_FAIL == HG_Handler_get_input(handle, input)) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, HG_FAIL, "can't get input parameters"); + + if(NULL == engine) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "AXE engine not started"); + + if(input->axe_info.count && + H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, + input->axe_info.count) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "Unable to cleanup AXE tasks"); + + op_data->hg_handle = handle; + op_data->input = (void *)input; + + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, + input->axe_info.num_parents, input->axe_info.parent_axe_ids, + 0, NULL, H5VL_iod_server_rcxt_persist_cb, op_data, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_server_rcxt_persist() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_rcxt_snapshot + * + * Purpose: Function shipper registered call for read context snapshot. + * Inserts the real worker routine into the Async Engine. + * + * Return: Success: HG_SUCCESS + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +int +H5VL_iod_server_rcxt_snapshot(hg_handle_t handle) +{ + op_data_t *op_data = NULL; + rc_snapshot_in_t *input; + int ret_value = HG_SUCCESS; + + FUNC_ENTER_NOAPI_NOINIT + + if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(NULL == (input = (rc_snapshot_in_t *)H5MM_malloc(sizeof(rc_snapshot_in_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(HG_FAIL == HG_Handler_get_input(handle, input)) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, HG_FAIL, "can't get input parameters"); + + if(NULL == engine) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "AXE engine not started"); + + if(input->axe_info.count && + H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, + input->axe_info.count) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "Unable to cleanup AXE tasks"); + + op_data->hg_handle = handle; + op_data->input = (void *)input; + + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, + input->axe_info.num_parents, input->axe_info.parent_axe_ids, + 0, NULL, H5VL_iod_server_rcxt_snapshot_cb, op_data, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_server_rcxt_snapshot() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_trans_start + * + * Purpose: Function shipper registered call for transaction start. + * Inserts the real worker routine into the Async Engine. + * + * Return: Success: HG_SUCCESS + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +int +H5VL_iod_server_trans_start(hg_handle_t handle) +{ + op_data_t *op_data = NULL; + tr_start_in_t *input; + int ret_value = HG_SUCCESS; + + FUNC_ENTER_NOAPI_NOINIT + + if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(NULL == (input = (tr_start_in_t *)H5MM_malloc(sizeof(tr_start_in_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(HG_FAIL == HG_Handler_get_input(handle, input)) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, HG_FAIL, "can't get input parameters"); + + if(NULL == engine) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "AXE engine not started"); + + if(input->axe_info.count && + H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, + input->axe_info.count) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "Unable to cleanup AXE tasks"); + + op_data->hg_handle = handle; + op_data->input = (void *)input; + + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, + input->axe_info.num_parents, input->axe_info.parent_axe_ids, + 0, NULL, H5VL_iod_server_trans_start_cb, op_data, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_server_trans_start() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_trans_finish + * + * Purpose: Function shipper registered call for transaction finish. + * Inserts the real worker routine into the Async Engine. + * + * Return: Success: HG_SUCCESS + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +int +H5VL_iod_server_trans_finish(hg_handle_t handle) +{ + op_data_t *op_data = NULL; + tr_finish_in_t *input; + int ret_value = HG_SUCCESS; + + FUNC_ENTER_NOAPI_NOINIT + + if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(NULL == (input = (tr_finish_in_t *)H5MM_malloc(sizeof(tr_finish_in_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(HG_FAIL == HG_Handler_get_input(handle, input)) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, HG_FAIL, "can't get input parameters"); + + if(NULL == engine) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "AXE engine not started"); + + if(input->axe_info.count && + H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, + input->axe_info.count) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "Unable to cleanup AXE tasks"); + + op_data->hg_handle = handle; + op_data->input = (void *)input; + + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, + input->axe_info.num_parents, input->axe_info.parent_axe_ids, + 0, NULL, H5VL_iod_server_trans_finish_cb, op_data, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_server_trans_finish() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_trans_set_dependency + * + * Purpose: Function shipper registered call for transaction set_dependency. + * Inserts the real worker routine into the Async Engine. + * + * Return: Success: HG_SUCCESS + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +int +H5VL_iod_server_trans_set_dependency(hg_handle_t handle) +{ + op_data_t *op_data = NULL; + tr_set_depend_in_t *input; + int ret_value = HG_SUCCESS; + + FUNC_ENTER_NOAPI_NOINIT + + if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(NULL == (input = (tr_set_depend_in_t *)H5MM_malloc(sizeof(tr_set_depend_in_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(HG_FAIL == HG_Handler_get_input(handle, input)) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, HG_FAIL, "can't get input parameters"); + + if(NULL == engine) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "AXE engine not started"); + + if(input->axe_info.count && + H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, + input->axe_info.count) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "Unable to cleanup AXE tasks"); + + op_data->hg_handle = handle; + op_data->input = (void *)input; + + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, + input->axe_info.num_parents, input->axe_info.parent_axe_ids, + 0, NULL, H5VL_iod_server_trans_set_dependency_cb, op_data, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_server_trans_set_dependency() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_trans_skip + * + * Purpose: Function shipper registered call for transaction skip. + * Inserts the real worker routine into the Async Engine. + * + * Return: Success: HG_SUCCESS + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +int +H5VL_iod_server_trans_skip(hg_handle_t handle) +{ + op_data_t *op_data = NULL; + tr_skip_in_t *input; + int ret_value = HG_SUCCESS; + + FUNC_ENTER_NOAPI_NOINIT + + if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(NULL == (input = (tr_skip_in_t *)H5MM_malloc(sizeof(tr_skip_in_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(HG_FAIL == HG_Handler_get_input(handle, input)) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, HG_FAIL, "can't get input parameters"); + + if(NULL == engine) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "AXE engine not started"); + + if(input->axe_info.count && + H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, + input->axe_info.count) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "Unable to cleanup AXE tasks"); + + op_data->hg_handle = handle; + op_data->input = (void *)input; + + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, + input->axe_info.num_parents, input->axe_info.parent_axe_ids, + 0, NULL, H5VL_iod_server_trans_skip_cb, op_data, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_server_trans_skip() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_trans_abort + * + * Purpose: Function shipper registered call for transaction abort. + * Inserts the real worker routine into the Async Engine. + * + * Return: Success: HG_SUCCESS + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +int +H5VL_iod_server_trans_abort(hg_handle_t handle) +{ + op_data_t *op_data = NULL; + tr_abort_in_t *input; + int ret_value = HG_SUCCESS; + + FUNC_ENTER_NOAPI_NOINIT + + if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(NULL == (input = (tr_abort_in_t *)H5MM_malloc(sizeof(tr_abort_in_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); + + if(HG_FAIL == HG_Handler_get_input(handle, input)) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, HG_FAIL, "can't get input parameters"); + + if(NULL == engine) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "AXE engine not started"); + + if(input->axe_info.count && + H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, + input->axe_info.count) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "Unable to cleanup AXE tasks"); + + op_data->hg_handle = handle; + op_data->input = (void *)input; + + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, + input->axe_info.num_parents, input->axe_info.parent_axe_ids, + 0, NULL, H5VL_iod_server_trans_abort_cb, op_data, NULL)) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_server_trans_abort() */ + #endif /* H5_HAVE_EFF */ diff --git a/src/H5VLiod_server.h b/src/H5VLiod_server.h index d20ab97..435b0e5 100644 --- a/src/H5VLiod_server.h +++ b/src/H5VLiod_server.h @@ -127,6 +127,15 @@ H5_DLL int H5VL_iod_server_object_exists(hg_handle_t handle); H5_DLL int H5VL_iod_server_object_set_comment(hg_handle_t handle); H5_DLL int H5VL_iod_server_object_get_comment(hg_handle_t handle); H5_DLL int H5VL_iod_server_object_get_info(hg_handle_t handle); +H5_DLL int H5VL_iod_server_rcxt_acquire(hg_handle_t handle); +H5_DLL int H5VL_iod_server_rcxt_release(hg_handle_t handle); +H5_DLL int H5VL_iod_server_rcxt_persist(hg_handle_t handle); +H5_DLL int H5VL_iod_server_rcxt_snapshot(hg_handle_t handle); +H5_DLL int H5VL_iod_server_trans_start(hg_handle_t handle); +H5_DLL int H5VL_iod_server_trans_finish(hg_handle_t handle); +H5_DLL int H5VL_iod_server_trans_set_dependency(hg_handle_t handle); +H5_DLL int H5VL_iod_server_trans_skip(hg_handle_t handle); +H5_DLL int H5VL_iod_server_trans_abort(hg_handle_t handle); H5_DLL void H5VL_iod_server_file_create_cb(AXE_engine_t axe_engine, size_t num_n_parents, AXE_task_t n_parents[], @@ -310,6 +319,43 @@ H5_DLL void H5VL_iod_server_object_get_info_cb(AXE_engine_t axe_engine, size_t num_s_parents, AXE_task_t s_parents[], void *op_data); +H5_DLL void H5VL_iod_server_rcxt_acquire_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_rcxt_release_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_rcxt_persist_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_rcxt_snapshot_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_trans_start_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_trans_finish_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_trans_set_dependency_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_trans_skip_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); +H5_DLL void H5VL_iod_server_trans_abort_cb(AXE_engine_t axe_engine, + size_t num_n_parents, AXE_task_t n_parents[], + size_t num_s_parents, AXE_task_t s_parents[], + void *op_data); + /* Helper routines used several times in different places */ H5_DLL herr_t H5VL_iod_server_traverse(iod_handle_t coh, iod_obj_id_t loc_id, iod_handle_t loc_handle, const char *path, hbool_t create_interm_grps, diff --git a/src/H5VLiod_trans.c b/src/H5VLiod_trans.c new file mode 100644 index 0000000..49c87bc --- /dev/null +++ b/src/H5VLiod_trans.c @@ -0,0 +1,536 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "H5VLiod_server.h" +#include "H5RCpublic.h" +#include "H5TRpublic.h" + +#ifdef H5_HAVE_EFF + +/* + * Programmer: Mohamad Chaarawi + * July, 2013 + * + * Purpose: The IOD plugin server side transaction and read context routines. + */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_rcxt_acquire_cb + * + * Purpose: Acquire a read context of a container using a version number. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_rcxt_acquire_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + rc_acquire_in_t *input = (rc_acquire_in_t *)op_data->input; + rc_acquire_out_t output; + iod_handle_t coh = input->coh; /* the container handle */ + iod_trans_id_t c_version = input->c_version; + iod_trans_id_t acquired_version; + hid_t rcapl_id; + H5RC_request_t acquire_req; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + if(H5P_DEFAULT == input->rcapl_id) + input->rcapl_id = H5Pcopy(H5P_RC_ACQUIRE_DEFAULT); + rcapl_id = input->rcapl_id; + + if(H5Pget_rcapl_version_request(rcapl_id, &acquire_req) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't get acquire request property"); + + switch(acquire_req) { + case H5RC_EXACT: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Exact Acquire Read Context %llu\n", input->c_version); +#endif + if(iod_trans_start(coh, &c_version, NULL, 0, IOD_TRANS_RD, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't acquire read context"); + acquired_version = c_version; + break; + case H5RC_LAST: +#if H5VL_IOD_DEBUG + fprintf(stderr, "Acquire LAST Read Context\n"); +#endif + c_version = IOD_TID_UNKNOWN; + if(iod_trans_start(coh, &c_version, NULL, 0, IOD_TRANS_RD, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't acquire read context"); + acquired_version = c_version; + break; + case H5RC_NEXT: + { + iod_container_tids_t tids; + uint64_t u; + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Next Acquire Read Context %llu\n", input->c_version); +#endif + if(iod_container_query_tids(coh, &tids, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get container tids status"); + + acquired_version = IOD_TID_UNKNOWN; + + for(u=c_version; uhg_handle, &output); + +done: + /* return an UNDEFINED oh to the client if the operation failed */ + if(ret_value < 0) { + fprintf(stderr, "Failed to Acquire Read context\n"); + output.ret = FAIL; + HG_Handler_start_output(op_data->hg_handle, &output); + } + + input = (rc_acquire_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_rcxt_acquire_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_rcxt_release_cb + * + * Purpose: Release a read context of a container using a version number. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_rcxt_release_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + rc_release_in_t *input = (rc_release_in_t *)op_data->input; + iod_handle_t coh = input->coh; /* the container handle */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Release Read Context %llu\n", input->c_version); +#endif + + if(iod_trans_finish(coh, input->c_version, NULL, 0, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't release Read Context %llu", input->c_version); + +done: + if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) + fprintf(stderr, "Failed to Release Read context\n"); + + input = (rc_release_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_rcxt_release_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_rcxt_persist_cb + * + * Purpose: Persist a read context of a container using a version number. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_rcxt_persist_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + rc_persist_in_t *input = (rc_persist_in_t *)op_data->input; + iod_handle_t coh = input->coh; /* the container handle */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Persist Read Context %llu\n", input->c_version); +#endif + + if(iod_trans_persist(coh, input->c_version, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't persist Read Context %llu", input->c_version); + +done: + if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) + fprintf(stderr, "Failed to Persist Read context\n"); + + input = (rc_persist_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_rcxt_persist_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_rcxt_snapshot_cb + * + * Purpose: Snapshot a read context of a container using a version number. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_rcxt_snapshot_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + rc_snapshot_in_t *input = (rc_snapshot_in_t *)op_data->input; + iod_handle_t coh = input->coh; /* the container handle */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Snapshot %s with Read Context %llu\n", input->snapshot_name, input->c_version); +#endif + + /* MSC - can only snapshot latest version */ + if(iod_container_snapshot(coh, input->snapshot_name, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't snapshot Read Context %llu", input->c_version); + +done: + if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) + fprintf(stderr, "Failed to Snapshot Read context\n"); + + input = (rc_snapshot_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_rcxt_snapshot_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_trans_start_cb + * + * Purpose: Start a transaction on a container. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_trans_start_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + tr_start_in_t *input = (tr_start_in_t *)op_data->input; + iod_handle_t coh = input->coh; /* the container handle */ + hid_t trspl_id; + iod_trans_id_t trans_num = input->trans_num; + unsigned num_peers; /* the number of peers starting this transaction */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Transaction Start %llu\n", input->trans_num); +#endif + + if(H5P_DEFAULT == input->trspl_id) + input->trspl_id = H5Pcopy(H5P_TR_START_DEFAULT); + trspl_id = input->trspl_id; + + if(H5Pget_trspl_num_peers(trspl_id, &num_peers) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get acquire request property"); + + if(iod_trans_start(coh, &trans_num, NULL, num_peers, IOD_TRANS_WR, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't start transaction"); + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with Transaction Start\n"); +#endif + +done: + if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) + fprintf(stderr, "Failed to Start Transaction\n"); + + input = (tr_start_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_trans_start_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_trans_finish_cb + * + * Purpose: Finish a transaction on a container. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_trans_finish_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + tr_finish_in_t *input = (tr_finish_in_t *)op_data->input; + iod_handle_t coh = input->coh; /* the container handle */ + hid_t trfpl_id; + iod_trans_id_t trans_num = input->trans_num; + hbool_t acquire = input->acquire; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Transaction Finish %llu\n", input->trans_num); +#endif + + /* Finish the transaction */ + if(iod_trans_finish(coh, trans_num, NULL, 0, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't finish transaction"); + + /* if the flag is true, acquire a read context on the finished transaction */ + if(TRUE == acquire) { + fprintf(stderr, "Transaction Acquire after Finish %llu\n", trans_num); + + if(iod_trans_start(coh, &trans_num, NULL, 0, IOD_TRANS_RD, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't acquire read context"); + } + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with Transaction Finish\n"); +#endif + +done: + if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) + fprintf(stderr, "Failed to Finish Transaction\n"); + + input = (tr_finish_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_trans_finish_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_trans_set_dependency_cb + * + * Purpose: Set Dependency between 2 transactions on a container. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_trans_set_dependency_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + 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 */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Transaction Set_Dependency %llu on %llu\n", + input->child_trans_num, input->parent_trans_num); +#endif + + fprintf(stderr, "Can't do Set_Dependency with Current IOD\n"); + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with Transaction Set_Dependency\n"); +#endif + +done: + if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) + fprintf(stderr, "Failed to Set_Dependency between Transactions\n"); + + input = (tr_set_depend_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_trans_set_dependency_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_trans_skip_cb + * + * Purpose: Skip a number of transactions on a container. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_trans_skip_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + tr_skip_in_t *input = (tr_skip_in_t *)op_data->input; + iod_handle_t coh = input->coh; /* the container handle */ + iod_trans_id_t start_trans_num = input->start_trans_num; + uint64_t count = input->count; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Transaction Skip %llu starting at %llu\n", count, start_trans_num); +#endif + + fprintf(stderr, "NO IOD Transaction Skip at the moment\n"); + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with Transaction Skip\n"); +#endif + +done: + if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) + fprintf(stderr, "Failed to Skip Transaction\n"); + + input = (tr_skip_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_trans_skip_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_server_trans_abort_cb + * + * Purpose: Abort a transaction on a container. + * + * Return: Success: SUCCEED + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * September, 2013 + * + *------------------------------------------------------------------------- + */ +void +H5VL_iod_server_trans_abort_cb(AXE_engine_t UNUSED axe_engine, + size_t UNUSED num_n_parents, AXE_task_t UNUSED n_parents[], + size_t UNUSED num_s_parents, AXE_task_t UNUSED s_parents[], + void *_op_data) +{ + op_data_t *op_data = (op_data_t *)_op_data; + tr_abort_in_t *input = (tr_abort_in_t *)op_data->input; + iod_handle_t coh = input->coh; /* the container handle */ + iod_trans_id_t trans_num = input->trans_num; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Transaction Abort %llu\n", input->trans_num); +#endif + + if(iod_trans_finish(coh, trans_num, NULL, IOD_TRANS_ABORT_SINGLE, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't abort transaction"); + +#if H5VL_IOD_DEBUG + fprintf(stderr, "Done with Transaction Abort\n"); +#endif + +done: + if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) + fprintf(stderr, "Failed to Abort Transaction\n"); + + input = (tr_abort_in_t *)H5MM_xfree(input); + op_data = (op_data_t *)H5MM_xfree(op_data); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5VL_iod_server_trans_abort_cb() */ + +#endif /* H5_HAVE_EFF */ diff --git a/src/H5private.h b/src/H5private.h index 2f90c45..cb5c7d3 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2365,6 +2365,8 @@ H5_DLL int H5AC_term_interface(void); H5_DLL int H5D_term_interface(void); H5_DLL int H5E_term_interface(void); H5_DLL int H5EQ_term_interface(void); +H5_DLL int H5RC_term_interface(void); +H5_DLL int H5TR_term_interface(void); H5_DLL int H5F_term_interface(void); H5_DLL int H5FS_term_interface(void); H5_DLL int H5G_term_interface(void); diff --git a/src/Makefile.am b/src/Makefile.am index dedf109..427bed9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -60,13 +60,13 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5FA.c H5FAcache.c H5FAdbg.c H5FAdblock.c H5FAdblkpage.c H5FAhdr.c \ H5FAstat.c H5FAtest.c \ H5VL.c H5VLint.c H5VLnative.c \ - H5VLiod.c H5VLiod_client.c H5VLiod_server.c H5VLiod_encdec.c H5VLiod_util.c\ - H5VLiod_file.c H5VLiod_group.c H5VLiod_dset.c H5VLiod_dtype.c \ + H5VLiod.c H5VLiod_client.c H5VLiod_server.c H5VLiod_encdec.c H5VLiod_util.c \ + H5VLiod_file.c H5VLiod_group.c H5VLiod_dset.c H5VLiod_dtype.c H5VLiod_trans.c \ H5VLiod_attr.c H5VLiod_link.c H5VLiod_obj.c H5VLiod_map.c \ H5FD.c H5FDcore.c \ H5FDdirect.c H5FDfamily.c H5FDint.c H5FDlog.c H5FDmpi.c H5FDmpio.c \ H5FDmpiposix.c H5FDmulti.c H5FDsec2.c H5FDspace.c H5FDstdio.c \ - H5FF.c H5EQ.c H5M.c\ + H5FF.c H5EQ.c H5RC.c H5TR.c H5M.c\ H5FL.c H5FO.c H5FS.c H5FScache.c H5FSdbg.c H5FSsection.c H5FSstat.c H5FStest.c \ H5G.c H5Gbtree2.c H5Gcache.c \ H5Gcompact.c H5Gdense.c H5Gdeprec.c H5Gent.c \ @@ -93,7 +93,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5P.c H5Pacpl.c H5Pdapl.c H5Pdcpl.c \ H5Pdeprec.c H5Pdxpl.c H5Pencdec.c \ H5Pfapl.c H5Pfcpl.c H5Pfmpl.c \ - H5Pgcpl.c H5Pint.c H5Prcapl.c H5Ptrspl.c \ + H5Pgcpl.c H5Pint.c H5Prcapl.c H5Ptrspl.c H5Ptrfpl.c \ H5Plapl.c H5Plcpl.c H5Pocpl.c H5Pocpypl.c H5Pstrcpl.c H5Ptest.c \ H5PL.c \ H5R.c H5Rdeprec.c \ @@ -122,7 +122,8 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers H5Epubgen.h H5Epublic.h H5Fpublic.h H5FDpublic.h H5FDcore.h H5FDdirect.h \ H5FDfamily.h H5FDlog.h H5FDmpi.h H5FDmpio.h H5FDmpiposix.h \ H5FDmulti.h H5FDsec2.h H5FDstdio.h \ - H5VLpublic.h H5VLnative.h H5VLiod.h H5FFpublic.h H5EQpublic.h H5Mpublic.h\ + H5VLpublic.h H5VLnative.h H5VLiod.h \ + H5FFpublic.h H5EQpublic.h H5RCpublic.h H5TRpublic.h H5Mpublic.h\ H5Gpublic.h H5Ipublic.h H5Lpublic.h \ H5MMpublic.h H5Opublic.h H5Ppublic.h \ H5PLextern.h \ diff --git a/src/Makefile.in b/src/Makefile.in index 11c754c..acb4276 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -138,17 +138,17 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \ H5VLint.lo H5VLnative.lo H5VLiod.lo H5VLiod_client.lo \ H5VLiod_server.lo H5VLiod_encdec.lo H5VLiod_util.lo \ H5VLiod_file.lo H5VLiod_group.lo H5VLiod_dset.lo \ - H5VLiod_dtype.lo H5VLiod_attr.lo H5VLiod_link.lo \ - H5VLiod_obj.lo H5VLiod_map.lo H5FD.lo H5FDcore.lo \ - H5FDdirect.lo H5FDfamily.lo H5FDint.lo H5FDlog.lo H5FDmpi.lo \ - H5FDmpio.lo H5FDmpiposix.lo H5FDmulti.lo H5FDsec2.lo \ - H5FDspace.lo H5FDstdio.lo H5FF.lo H5EQ.lo H5M.lo H5FL.lo \ - H5FO.lo H5FS.lo H5FScache.lo H5FSdbg.lo H5FSsection.lo \ - H5FSstat.lo H5FStest.lo H5G.lo H5Gbtree2.lo H5Gcache.lo \ - H5Gcompact.lo H5Gdense.lo H5Gdeprec.lo H5Gent.lo H5Gint.lo \ - H5Glink.lo H5Gloc.lo H5Gname.lo H5Gnode.lo H5Gobj.lo H5Goh.lo \ - H5Groot.lo H5Gstab.lo H5Gtest.lo H5Gtraverse.lo H5HF.lo \ - H5HFbtree2.lo H5HFcache.lo H5HFdbg.lo H5HFdblock.lo \ + H5VLiod_dtype.lo H5VLiod_trans.lo H5VLiod_attr.lo \ + H5VLiod_link.lo H5VLiod_obj.lo H5VLiod_map.lo H5FD.lo \ + H5FDcore.lo H5FDdirect.lo H5FDfamily.lo H5FDint.lo H5FDlog.lo \ + H5FDmpi.lo H5FDmpio.lo H5FDmpiposix.lo H5FDmulti.lo \ + H5FDsec2.lo H5FDspace.lo H5FDstdio.lo H5FF.lo H5EQ.lo H5RC.lo \ + H5TR.lo H5M.lo H5FL.lo H5FO.lo H5FS.lo H5FScache.lo H5FSdbg.lo \ + H5FSsection.lo H5FSstat.lo H5FStest.lo H5G.lo H5Gbtree2.lo \ + H5Gcache.lo H5Gcompact.lo H5Gdense.lo H5Gdeprec.lo H5Gent.lo \ + H5Gint.lo H5Glink.lo H5Gloc.lo H5Gname.lo H5Gnode.lo H5Gobj.lo \ + H5Goh.lo H5Groot.lo H5Gstab.lo H5Gtest.lo H5Gtraverse.lo \ + H5HF.lo H5HFbtree2.lo H5HFcache.lo H5HFdbg.lo H5HFdblock.lo \ H5HFdtable.lo H5HFhdr.lo H5HFhuge.lo H5HFiblock.lo H5HFiter.lo \ H5HFman.lo H5HFsection.lo H5HFspace.lo H5HFstat.lo H5HFtest.lo \ H5HFtiny.lo H5HG.lo H5HGcache.lo H5HGdbg.lo H5HGquery.lo \ @@ -164,19 +164,20 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \ H5Oshared.lo H5Ostab.lo H5Oshmesg.lo H5Otest.lo H5Ounknown.lo \ H5P.lo H5Pacpl.lo H5Pdapl.lo H5Pdcpl.lo H5Pdeprec.lo \ H5Pdxpl.lo H5Pencdec.lo H5Pfapl.lo H5Pfcpl.lo H5Pfmpl.lo \ - H5Pgcpl.lo H5Pint.lo H5Prcapl.lo H5Ptrspl.lo H5Plapl.lo \ - H5Plcpl.lo H5Pocpl.lo H5Pocpypl.lo H5Pstrcpl.lo H5Ptest.lo \ - H5PL.lo H5R.lo H5Rdeprec.lo H5UC.lo H5RS.lo H5S.lo H5Sall.lo \ - H5Sdbg.lo H5Shyper.lo H5Smpio.lo H5Snone.lo H5Spoint.lo \ - H5Sselect.lo H5Stest.lo H5SL.lo H5SM.lo H5SMbtree2.lo \ - H5SMcache.lo H5SMmessage.lo H5SMtest.lo H5ST.lo H5T.lo \ - H5Tarray.lo H5Tbit.lo H5Tcommit.lo H5Tcompound.lo H5Tconv.lo \ - H5Tcset.lo H5Tdbg.lo H5Tdeprec.lo H5Tenum.lo H5Tfields.lo \ - H5Tfixed.lo H5Tfloat.lo H5Tinit.lo H5Tnative.lo H5Toffset.lo \ - H5Toh.lo H5Topaque.lo H5Torder.lo H5Tpad.lo H5Tprecis.lo \ - H5Tstrpad.lo H5Tvisit.lo H5Tvlen.lo H5TS.lo H5V.lo H5WB.lo \ - H5Z.lo H5Zdeflate.lo H5Zfletcher32.lo H5Znbit.lo H5Zshuffle.lo \ - H5Zszip.lo H5Zscaleoffset.lo H5Ztrans.lo + H5Pgcpl.lo H5Pint.lo H5Prcapl.lo H5Ptrspl.lo H5Ptrfpl.lo \ + H5Plapl.lo H5Plcpl.lo H5Pocpl.lo H5Pocpypl.lo H5Pstrcpl.lo \ + H5Ptest.lo H5PL.lo H5R.lo H5Rdeprec.lo H5UC.lo H5RS.lo H5S.lo \ + H5Sall.lo H5Sdbg.lo H5Shyper.lo H5Smpio.lo H5Snone.lo \ + H5Spoint.lo H5Sselect.lo H5Stest.lo H5SL.lo H5SM.lo \ + H5SMbtree2.lo H5SMcache.lo H5SMmessage.lo H5SMtest.lo H5ST.lo \ + H5T.lo H5Tarray.lo H5Tbit.lo H5Tcommit.lo H5Tcompound.lo \ + H5Tconv.lo H5Tcset.lo H5Tdbg.lo H5Tdeprec.lo H5Tenum.lo \ + H5Tfields.lo H5Tfixed.lo H5Tfloat.lo H5Tinit.lo H5Tnative.lo \ + H5Toffset.lo H5Toh.lo H5Topaque.lo H5Torder.lo H5Tpad.lo \ + H5Tprecis.lo H5Tstrpad.lo H5Tvisit.lo H5Tvlen.lo H5TS.lo \ + H5V.lo H5WB.lo H5Z.lo H5Zdeflate.lo H5Zfletcher32.lo \ + H5Znbit.lo H5Zshuffle.lo H5Zszip.lo H5Zscaleoffset.lo \ + H5Ztrans.lo libhdf5_la_OBJECTS = $(am_libhdf5_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -570,13 +571,13 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5FA.c H5FAcache.c H5FAdbg.c H5FAdblock.c H5FAdblkpage.c H5FAhdr.c \ H5FAstat.c H5FAtest.c \ H5VL.c H5VLint.c H5VLnative.c \ - H5VLiod.c H5VLiod_client.c H5VLiod_server.c H5VLiod_encdec.c H5VLiod_util.c\ - H5VLiod_file.c H5VLiod_group.c H5VLiod_dset.c H5VLiod_dtype.c \ + H5VLiod.c H5VLiod_client.c H5VLiod_server.c H5VLiod_encdec.c H5VLiod_util.c \ + H5VLiod_file.c H5VLiod_group.c H5VLiod_dset.c H5VLiod_dtype.c H5VLiod_trans.c \ H5VLiod_attr.c H5VLiod_link.c H5VLiod_obj.c H5VLiod_map.c \ H5FD.c H5FDcore.c \ H5FDdirect.c H5FDfamily.c H5FDint.c H5FDlog.c H5FDmpi.c H5FDmpio.c \ H5FDmpiposix.c H5FDmulti.c H5FDsec2.c H5FDspace.c H5FDstdio.c \ - H5FF.c H5EQ.c H5M.c\ + H5FF.c H5EQ.c H5RC.c H5TR.c H5M.c\ H5FL.c H5FO.c H5FS.c H5FScache.c H5FSdbg.c H5FSsection.c H5FSstat.c H5FStest.c \ H5G.c H5Gbtree2.c H5Gcache.c \ H5Gcompact.c H5Gdense.c H5Gdeprec.c H5Gent.c \ @@ -603,7 +604,7 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5P.c H5Pacpl.c H5Pdapl.c H5Pdcpl.c \ H5Pdeprec.c H5Pdxpl.c H5Pencdec.c \ H5Pfapl.c H5Pfcpl.c H5Pfmpl.c \ - H5Pgcpl.c H5Pint.c H5Prcapl.c H5Ptrspl.c \ + H5Pgcpl.c H5Pint.c H5Prcapl.c H5Ptrspl.c H5Ptrfpl.c \ H5Plapl.c H5Plcpl.c H5Pocpl.c H5Pocpypl.c H5Pstrcpl.c H5Ptest.c \ H5PL.c \ H5R.c H5Rdeprec.c \ @@ -632,7 +633,8 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers H5Epubgen.h H5Epublic.h H5Fpublic.h H5FDpublic.h H5FDcore.h H5FDdirect.h \ H5FDfamily.h H5FDlog.h H5FDmpi.h H5FDmpio.h H5FDmpiposix.h \ H5FDmulti.h H5FDsec2.h H5FDstdio.h \ - H5VLpublic.h H5VLnative.h H5VLiod.h H5FFpublic.h H5EQpublic.h H5Mpublic.h\ + H5VLpublic.h H5VLnative.h H5VLiod.h \ + H5FFpublic.h H5EQpublic.h H5RCpublic.h H5TRpublic.h H5Mpublic.h\ H5Gpublic.h H5Ipublic.h H5Lpublic.h \ H5MMpublic.h H5Opublic.h H5Ppublic.h \ H5PLextern.h \ @@ -980,8 +982,10 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Prcapl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Pstrcpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Ptest.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Ptrfpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Ptrspl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5R.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5RC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5RS.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Rdeprec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5S.Plo@am__quote@ @@ -1001,6 +1005,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Sselect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Stest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5T.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5TR.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5TS.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Tarray.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Tbit.Plo@am__quote@ @@ -1041,6 +1046,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_map.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_obj.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_server.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_trans.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLiod_util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VLnative.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5WB.Plo@am__quote@ -- cgit v0.12