diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2016-03-21 15:39:34 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2016-03-21 15:39:34 (GMT) |
commit | ab049e2cae45044ee4be3de32e6c5e8f07bcfa07 (patch) | |
tree | a82ab70d10a7e2c1907076474769ef59cd315890 | |
parent | 6ed5bbe2ba7e084233933bab149a1d1ce50a3146 (diff) | |
download | hdf5-ab049e2cae45044ee4be3de32e6c5e8f07bcfa07.zip hdf5-ab049e2cae45044ee4be3de32e6c5e8f07bcfa07.tar.gz hdf5-ab049e2cae45044ee4be3de32e6c5e8f07bcfa07.tar.bz2 |
[svn-r29479] fix bugs for H5Lvisit and soft links.
-rw-r--r-- | examples/h5ff_client_links.c | 37 | ||||
-rw-r--r-- | src/H5VLiod_link.c | 17 |
2 files changed, 23 insertions, 31 deletions
diff --git a/examples/h5ff_client_links.c b/examples/h5ff_client_links.c index 4a4d342..c6ddf61 100644 --- a/examples/h5ff_client_links.c +++ b/examples/h5ff_client_links.c @@ -15,8 +15,8 @@ iterate_cb(hid_t oid, const char *name, { hid_t obj_id; - printf("----------------------------------------\n"); - printf("Link Name %s\n", name); + fprintf(stderr, "----------------------------------------\n"); + fprintf(stderr, "Link Name %s\n", name); switch(linfo->type) { case H5L_TYPE_HARD: @@ -36,7 +36,7 @@ iterate_cb(hid_t oid, const char *name, assert(H5Oclose_ff(obj_id, H5_EVENT_STACK_NULL) == 0); } - printf("----------------------------------------\n"); + fprintf(stderr, "----------------------------------------\n"); return 0; } @@ -208,9 +208,12 @@ int main(int argc, char **argv) { } H5E_END_TRY; assert(did2 < 0); - /* release container version 1. This is async. */ + /* release container version 2. This is async. */ ret = H5RCrelease(rid2, e_stack); assert(0 == ret); + /* release container version 1. This is async. */ + ret = H5RCrelease(rid1, e_stack); + assert(0 == ret); /* wait on all requests and print completion status */ H5ESget_count(e_stack, &num_events); @@ -232,10 +235,6 @@ int main(int argc, char **argv) { assert(H5Dclose_ff(did3, e_stack) == 0); version = 3; - /* release container version 1. This is async. */ - ret = H5RCrelease(rid1, e_stack); - assert(0 == ret); - /* wait on all requests and print completion status */ H5ESget_count(e_stack, &num_events); H5ESwait_all(e_stack, &status); @@ -244,7 +243,7 @@ int main(int argc, char **argv) { assert(status == H5ES_STATUS_SUCCEED); } - /* Leader tells other procs that container version 2 is acquired */ + /* Leader tells other procs that container version 3 is acquired */ MPI_Bcast(&version, 1, MPI_UINT64_T, 0, MPI_COMM_WORLD); /* other processes just create a read context object; no need to @@ -255,12 +254,17 @@ int main(int argc, char **argv) { assert(rid3 > 0); } - printf("H5Lvisit on /: \n"); - ret = H5Lvisit_ff(file_id, 0, H5_ITER_NATIVE, iterate_cb, NULL, rid2, H5_EVENT_STACK_NULL); + fprintf(stderr, "H5Lvisit on /: \n"); + ret = H5Lvisit_ff(file_id, 0, H5_ITER_NATIVE, iterate_cb, NULL, rid3, H5_EVENT_STACK_NULL); assert(ret == 0); - - printf("H5Literate on /: \n"); - ret = H5Literate_ff(file_id, 0, H5_ITER_NATIVE, NULL, iterate_cb, NULL, rid2, H5_EVENT_STACK_NULL); + MPI_Barrier(MPI_COMM_WORLD); + fprintf(stderr, "H5Literate on /: \n"); + ret = H5Literate_ff(file_id, 0, H5_ITER_NATIVE, NULL, iterate_cb, NULL, rid3, H5_EVENT_STACK_NULL); + assert(ret == 0); + MPI_Barrier(MPI_COMM_WORLD); + fprintf(stderr, "H5Literate_by_name on : /G1/G2/G3\n"); + ret = H5Literate_by_name_ff(file_id, "/G1/G2/G3", 0, H5_ITER_NATIVE, NULL, iterate_cb, NULL, + H5P_DEFAULT, rid3, H5_EVENT_STACK_NULL); assert(ret == 0); /* Try and open the dataset. This is asynchronous. */ @@ -270,11 +274,6 @@ int main(int argc, char **argv) { gid4 = H5Gopen_ff(file_id, "G4", H5P_DEFAULT, rid3, e_stack); assert(gid4); - printf("H5Literate_by_name on : /G1/G2/G3\n"); - ret = H5Literate_by_name_ff(file_id, "/G1/G2/G3", 0, H5_ITER_NATIVE, NULL, iterate_cb, NULL, - H5P_DEFAULT, rid2, H5_EVENT_STACK_NULL); - assert(ret == 0); - { H5L_ff_info_t linfo; char *link_buf; diff --git a/src/H5VLiod_link.c b/src/H5VLiod_link.c index 35c64da..43cf5ec 100644 --- a/src/H5VLiod_link.c +++ b/src/H5VLiod_link.c @@ -987,11 +987,6 @@ H5VL_iod_server_link_iterate_cb(AXE_engine_t H5_ATTR_UNUSED axe_engine, ret = H5VL__iod_link_iterate(coh, obj_id, obj_oh.rd_oh, ".", cs_scope, rtid, input->recursive, &output); if(ret != SUCCEED) HGOTO_ERROR_FF(ret, "iterate objects failed"); - { - int i ; - for(i=0 ; i<output.num_objs; i++) - printf("%d: type = %d\n", i, output.linfos[i].type); - } if(loc_oh.rd_oh.cookie != obj_oh.rd_oh.cookie && iod_obj_close(obj_oh.rd_oh, NULL, NULL) < 0) @@ -1106,7 +1101,7 @@ H5VL__iod_link_iterate(iod_handle_t coh, iod_obj_id_t obj_id, iod_handle_t obj_o HGOTO_ERROR_FF(FAIL, "unsuppored link type"); } - if(recursive) { + if(recursive && H5L_TYPE_HARD == out->linfos[u].type) { ret = iod_obj_open_read(coh, value.u.iod_id, rtid, NULL, &oh, NULL); if(ret < 0) HGOTO_ERROR_FF(ret, "can't open object for read"); @@ -1116,12 +1111,10 @@ H5VL__iod_link_iterate(iod_handle_t coh, iod_obj_id_t obj_id, iod_handle_t obj_o else sprintf(cur_path, "%s", ((char *)kv[i].key)); - if(recursive) { - ret = H5VL__iod_link_iterate(coh, value.u.iod_id, oh, cur_path, cs_scope, - rtid, recursive, udata); - if(ret != SUCCEED) - HGOTO_ERROR_FF(ret, "visit objects failed"); - } + ret = H5VL__iod_link_iterate(coh, value.u.iod_id, oh, cur_path, cs_scope, + rtid, recursive, udata); + if(ret != SUCCEED) + HGOTO_ERROR_FF(ret, "visit objects failed"); if(iod_obj_close(oh, NULL, NULL) < 0) HGOTO_ERROR_FF(FAIL, "can't close object"); |