diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-08-29 03:08:46 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-08-29 03:08:46 (GMT) |
commit | 6d1b20cf3c2689e4d8d3d3bcd42be9cf3591789d (patch) | |
tree | efae47c5f785582d62f5620b35165b4ee210ba6e /src/H5VLiod_encdec.c | |
parent | 34837a0f9f6971d0fe36e9941976be8906c973f3 (diff) | |
download | hdf5-6d1b20cf3c2689e4d8d3d3bcd42be9cf3591789d.zip hdf5-6d1b20cf3c2689e4d8d3d3bcd42be9cf3591789d.tar.gz hdf5-6d1b20cf3c2689e4d8d3d3bcd42be9cf3591789d.tar.bz2 |
[svn-r24083] Build a request array for parent requests for every request.
Use this request array to determine when an AXE task can be requested to be finished at the server.
Diffstat (limited to 'src/H5VLiod_encdec.c')
-rw-r--r-- | src/H5VLiod_encdec.c | 97 |
1 files changed, 45 insertions, 52 deletions
diff --git a/src/H5VLiod_encdec.c b/src/H5VLiod_encdec.c index 8fbdf54..8fc807c 100644 --- a/src/H5VLiod_encdec.c +++ b/src/H5VLiod_encdec.c @@ -58,6 +58,8 @@ int hg_proc_ret_t(hg_proc_t proc, void *data) int hg_proc_axe_t(hg_proc_t proc, void *data) { int ret = HG_SUCCESS; + size_t u; + hg_proc_op_t op; axe_t *struct_data = (axe_t *) data; ret = hg_proc_uint64_t(proc, &struct_data->axe_id); @@ -72,13 +74,55 @@ int hg_proc_axe_t(hg_proc_t proc, void *data) ret = HG_FAIL; return ret; } - ret = hg_proc_uint64_t(proc, &struct_data->count); + ret = hg_proc_size_t(proc, &struct_data->count); if (ret != HG_SUCCESS) { HG_ERROR_DEFAULT("Proc error"); ret = HG_FAIL; return ret; } + ret = hg_proc_size_t(proc, &struct_data->num_parents); + if (ret != HG_SUCCESS) { + HG_ERROR_DEFAULT("Proc error"); + ret = HG_FAIL; + return ret; + } + + op = hg_proc_get_op(proc); + + switch(op) { + case HG_ENCODE: + for(u=0 ; u<struct_data->num_parents ; u++) { + ret = hg_proc_uint64_t(proc, &struct_data->parent_axe_ids[u]); + if (ret != HG_SUCCESS) { + HG_ERROR_DEFAULT("Proc error"); + ret = HG_FAIL; + return ret; + } + } + break; + case HG_DECODE: + if(struct_data->num_parents) + struct_data->parent_axe_ids = (uint64_t *)malloc (sizeof(hsize_t) * + struct_data->num_parents); + + for(u=0 ; u<struct_data->num_parents ; u++) { + ret = hg_proc_uint64_t(proc, &struct_data->parent_axe_ids[u]); + if (ret != HG_SUCCESS) { + HG_ERROR_DEFAULT("Proc error"); + ret = HG_FAIL; + return ret; + } + } + break; + case HG_FREE: + if(struct_data->num_parents) + free(struct_data->parent_axe_ids); + break; + default: + return HG_FAIL; + } + return ret; } /* Define hg_proc_htri_t */ @@ -140,57 +184,6 @@ int hg_proc_iod_obj_id_t(hg_proc_t proc, void *data) return ret; } -int hg_proc_axe_ids_t(hg_proc_t proc, void *data) -{ - int ret = HG_SUCCESS; - size_t i; - hg_proc_op_t op; - axe_ids_t *struct_data = (axe_ids_t *) data; - - ret = hg_proc_uint64_t(proc, &struct_data->count); - if (ret != HG_SUCCESS) { - HG_ERROR_DEFAULT("Proc error"); - ret = HG_FAIL; - return ret; - } - - op = hg_proc_get_op(proc); - - switch(op) { - case HG_ENCODE: - for(i=0 ; i<struct_data->count ; i++) { - ret = hg_proc_uint64_t(proc, &struct_data->ids[i]); - if (ret != HG_SUCCESS) { - HG_ERROR_DEFAULT("Proc error"); - ret = HG_FAIL; - return ret; - } - } - break; - case HG_DECODE: - if(struct_data->count) - struct_data->ids = (uint64_t *)malloc (sizeof(hsize_t) * struct_data->count); - - for(i=0 ; i<struct_data->count ; i++) { - ret = hg_proc_uint64_t(proc, &struct_data->ids[i]); - if (ret != HG_SUCCESS) { - HG_ERROR_DEFAULT("Proc error"); - ret = HG_FAIL; - return ret; - } - } - break; - case HG_FREE: - if(struct_data->count) - free(struct_data->ids); - break; - default: - return HG_FAIL; - } - - return ret; -} - int hg_proc_dims_t(hg_proc_t proc, void *data) { int ret = HG_SUCCESS; |