summaryrefslogtreecommitdiffstats
path: root/src/H5Psimp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Psimp.c')
-rw-r--r--src/H5Psimp.c87
1 files changed, 85 insertions, 2 deletions
diff --git a/src/H5Psimp.c b/src/H5Psimp.c
index 89e576c..db51bb5 100644
--- a/src/H5Psimp.c
+++ b/src/H5Psimp.c
@@ -93,6 +93,11 @@ H5P_simp_fgath (H5F_t *f, const struct H5O_layout_t *layout,
size_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */
size_t zero[H5O_LAYOUT_NDIMS]; /*zero */
size_t sample[H5O_LAYOUT_NDIMS]; /*hyperslab sampling */
+#ifndef LATER
+ intn file_offset_signed[H5O_LAYOUT_NDIMS];
+ intn hsize_signed[H5O_LAYOUT_NDIMS];
+ intn sample_signed[H5O_LAYOUT_NDIMS];
+#endif
intn space_ndims; /*dimensionality of space*/
intn i; /*counters */
@@ -120,12 +125,27 @@ H5P_simp_fgath (H5F_t *f, const struct H5O_layout_t *layout,
* currently pass sample information into H5F_arr_read() much less
* H5F_istore_read().
*/
- if ((space_ndims=H5P_get_hyperslab (file_space, file_offset, hsize,
- sample))<0) {
+#ifdef LATER
+ if ((space_ndims=H5P_get_hyperslab (file_space, file_offset,
+ hsize, sample))<0) {
+ HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, 0,
+ "unable to retrieve hyperslab parameters");
+#else
+ if ((space_ndims=H5P_get_hyperslab (file_space, file_offset_signed,
+ hsize_signed, sample_signed))<0) {
HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, 0,
"unable to retrieve hyperslab parameters");
}
for (i=0; i<space_ndims; i++) {
+ assert (file_offset_signed[i]>=0);
+ file_offset[i] = file_offset_signed[i];
+ assert (hsize_signed[i]>0);
+ hsize[i] = hsize_signed[i];
+ assert (sample_signed[i]>0);
+ sample[i] = sample_signed[i];
+ }
+#endif
+ for (i=0; i<space_ndims; i++) {
if (sample[i]!=1) {
HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, 0,
"hyperslab sampling is not implemented yet");
@@ -177,6 +197,11 @@ H5P_simp_mscat (const void *tconv_buf, size_t elmt_size,
size_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */
size_t zero[H5O_LAYOUT_NDIMS]; /*zero */
size_t sample[H5O_LAYOUT_NDIMS]; /*hyperslab sampling */
+#ifndef LATER
+ intn mem_offset_signed[H5O_LAYOUT_NDIMS];
+ intn hsize_signed[H5O_LAYOUT_NDIMS];
+ intn sample_signed[H5O_LAYOUT_NDIMS];
+#endif
intn space_ndims; /*dimensionality of space*/
intn i; /*counters */
@@ -202,11 +227,27 @@ H5P_simp_mscat (const void *tconv_buf, size_t elmt_size,
* only handle hyperslabs with unit sample because there's currently no
* way to pass sample information to H5V_hyper_copy().
*/
+#ifdef LATER
if ((space_ndims=H5P_get_hyperslab (mem_space, mem_offset, hsize,
sample))<0) {
HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL,
"unable to retrieve hyperslab parameters");
}
+#else
+ if ((space_ndims=H5P_get_hyperslab (mem_space, mem_offset_signed,
+ hsize_signed, sample_signed))<0) {
+ HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL,
+ "unable to retrieve hyperslab parameters");
+ }
+ for (i=0; i<space_ndims; i++) {
+ assert (mem_offset_signed[i]>=0);
+ mem_offset[i] = mem_offset_signed[i];
+ assert (hsize_signed[i]>0);
+ hsize[i] = hsize_signed[i];
+ assert (sample_signed[i]>0);
+ sample[i] = sample_signed[i];
+ }
+#endif
for (i=0; i<space_ndims; i++) {
if (sample[i]!=1) {
HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL,
@@ -267,6 +308,11 @@ H5P_simp_mgath (const void *buf, size_t elmt_size,
size_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */
size_t zero[H5O_LAYOUT_NDIMS]; /*zero */
size_t sample[H5O_LAYOUT_NDIMS]; /*hyperslab sampling */
+#ifndef LATER
+ intn mem_offset_signed[H5O_LAYOUT_NDIMS];
+ intn hsize_signed[H5O_LAYOUT_NDIMS];
+ intn sample_signed[H5O_LAYOUT_NDIMS];
+#endif
intn space_ndims; /*dimensionality of space*/
intn i; /*counters */
@@ -292,11 +338,27 @@ H5P_simp_mgath (const void *buf, size_t elmt_size,
* only handle hyperslabs with unit sample because there's currently no
* way to pass sample information to H5V_hyper_copy().
*/
+#ifdef LATER
if ((space_ndims=H5P_get_hyperslab (mem_space, mem_offset, hsize,
sample))<0) {
HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, 0,
"unable to retrieve hyperslab parameters");
}
+#else
+ if ((space_ndims=H5P_get_hyperslab (mem_space, mem_offset_signed,
+ hsize_signed, sample_signed))<0) {
+ HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL,
+ "unable to retrieve hyperslab parameters");
+ }
+ for (i=0; i<space_ndims; i++) {
+ assert (mem_offset_signed[i]>=0);
+ mem_offset[i] = mem_offset_signed[i];
+ assert (hsize_signed[i]>0);
+ hsize[i] = hsize_signed[i];
+ assert (sample_signed[i]>0);
+ sample[i] = sample_signed[i];
+ }
+#endif
for (i=0; i<space_ndims; i++) {
if (sample[i]!=1) {
HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, 0,
@@ -356,6 +418,11 @@ H5P_simp_fscat (H5F_t *f, const struct H5O_layout_t *layout,
size_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */
size_t zero[H5O_LAYOUT_NDIMS]; /*zero vector */
size_t sample[H5O_LAYOUT_NDIMS]; /*hyperslab sampling */
+#ifndef LATER
+ intn file_offset_signed[H5O_LAYOUT_NDIMS];
+ intn hsize_signed[H5O_LAYOUT_NDIMS];
+ intn sample_signed[H5O_LAYOUT_NDIMS];
+#endif
intn space_ndims; /*space dimensionality */
intn i; /*counters */
@@ -383,11 +450,27 @@ H5P_simp_fscat (H5F_t *f, const struct H5O_layout_t *layout,
* currently pass sample information into H5F_arr_read() much less
* H5F_istore_read().
*/
+#ifdef LATER
if ((space_ndims=H5P_get_hyperslab (file_space, file_offset, hsize,
sample))<0) {
HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL,
"unable to retrieve hyperslab parameters");
}
+#else
+ if ((space_ndims=H5P_get_hyperslab (file_space, file_offset_signed,
+ hsize_signed, sample_signed))<0) {
+ HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL,
+ "unable to retrieve hyperslab parameters");
+ }
+ for (i=0; i<space_ndims; i++) {
+ assert (file_offset_signed[i]>=0);
+ file_offset[i] = file_offset_signed[i];
+ assert (hsize_signed[i]>0);
+ hsize[i] = hsize_signed[i];
+ assert (sample_signed[i]>0);
+ sample[i] = sample_signed[i];
+ }
+#endif
for (i=0; i<space_ndims; i++) {
if (sample[i]!=1) {
HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL,