diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-06-18 21:34:28 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-06-18 21:34:28 (GMT) |
commit | 730ca41e9a48de89679391301c4a28cdf4bd1c43 (patch) | |
tree | cdc66c1957f1f1cb67794c21bc2f8bcc3762bfa7 /src | |
parent | 4edeaf0c13c0bfee62c68b0c547719badb17a909 (diff) | |
download | hdf5-730ca41e9a48de89679391301c4a28cdf4bd1c43.zip hdf5-730ca41e9a48de89679391301c4a28cdf4bd1c43.tar.gz hdf5-730ca41e9a48de89679391301c4a28cdf4bd1c43.tar.bz2 |
[svn-r25325] - fix bugs in analysis shipping
- move ship_analysis to after fclose in example
Diffstat (limited to 'src')
-rw-r--r-- | src/H5VLiod_analysis.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/H5VLiod_analysis.c b/src/H5VLiod_analysis.c index 35666a3..62a919b 100644 --- a/src/H5VLiod_analysis.c +++ b/src/H5VLiod_analysis.c @@ -905,24 +905,24 @@ H5VL__iod_farm_work(iod_obj_map_t *obj_map, iod_handle_t *cohs, size_t *split_num_elmts; hid_t split_type_id = FAIL; hg_request_t *hg_reqs = NULL; - uint32_t u, i; + uint32_t u, i, processed = 0; unsigned int num_targets = num_ions_g;//obj_map->u_map.array_map.n_range; coords_t coords; analysis_farm_in_t farm_input; analysis_farm_out_t *farm_output = NULL; /* function shipper requests */ - if(NULL == (hg_reqs = (hg_request_t *) malloc(sizeof(hg_request_t) * num_targets))) + if(NULL == (hg_reqs = (hg_request_t *)calloc(num_targets, sizeof(hg_request_t)))) HGOTO_ERROR_FF(FAIL, "can't allocate HG requests"); - if(NULL == (farm_output = (analysis_farm_out_t *) malloc - (sizeof(analysis_farm_out_t) * num_targets))) + if(NULL == (farm_output = (analysis_farm_out_t *)calloc + (num_targets, sizeof(analysis_farm_out_t)))) HGOTO_ERROR_FF(FAIL, "can't allocate HG requests"); - if(NULL == (split_data = (void **) malloc(sizeof(void *) * num_targets))) + if(NULL == (split_data = (void **)calloc(num_targets, sizeof(void *)))) HGOTO_ERROR_FF(FAIL, "can't allocate array for split data"); - if(NULL == (split_num_elmts = (size_t *) malloc(sizeof(size_t) * num_targets))) + if(NULL == (split_num_elmts = (size_t *)calloc(num_targets, sizeof(size_t)))) HGOTO_ERROR_FF(FAIL, "can't allocate array for num elmts"); farm_input.obj_id = obj_map->oid; @@ -935,9 +935,13 @@ H5VL__iod_farm_work(iod_obj_map_t *obj_map, iod_handle_t *cohs, #if 1 /* Farm work to the IONs and combine the result */ for(i=0 ; i<num_ions_g ; i++) { - hid_t space_id; + hid_t space_id = FAIL; hbool_t first_space = TRUE; + /* no more ranges to process */ + if(obj_map->u_map.array_map.n_range == processed) + break; + /* Get all ranges that are on Node i into a dataspace */ for(u = 0; u < obj_map->u_map.array_map.n_range ; u++) { uint32_t worker = obj_map->u_map.array_map.array_range[u].nearest_rank; @@ -964,9 +968,15 @@ H5VL__iod_farm_work(iod_obj_map_t *obj_map, iod_handle_t *cohs, if(H5Sclose(space_layout) < 0) HGOTO_ERROR_FF(FAIL, "cannot close region"); + + processed ++; } } + /* no data is local to this ION */ + if(space_id == FAIL) + continue; + if(H5Smodify_select(space_id, H5S_SELECT_AND, region) < 0) HGOTO_ERROR_FF(FAIL, "Unable to AND 2 dataspace selections"); |