Skip to content

Commit

Permalink
Re-fomartted debug information for --verbose or -V option
Browse files Browse the repository at this point in the history
  • Loading branch information
Fang Zheng committed Jun 13, 2008
1 parent 3129524 commit b7b98ef
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions utils/bp2h5/hw-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,6 @@ void hw_dset (hid_t root_id, char * dirstr, char * name, void * data
stride [reverse_i] = 1;

count [reverse_i] = dims [i].local_bound;

if(verbose >= DEBUG_INFO) {
fprintf(stderr, "rank = %d index = %d reverse index = %d local bound = %d global bound = %d start = %d\n",
rank, i, reverse_i, local_h5dims [reverse_i], global_h5dims [reverse_i], start [reverse_i]);
}
}
}
else if(array_dim_order_fortran == USE_C) {
Expand All @@ -347,6 +342,15 @@ void hw_dset (hid_t root_id, char * dirstr, char * name, void * data
}
}

if(verbose >= DEBUG_INFO) {
fprintf(stderr, " Hyperslab index = %d local bound = %d global bound = %d start = %d\n"
,i
,local_h5dims[i]
,global_h5dims[i]
,start[i]
);
}

dataspace = H5Screate_simple (rank, global_h5dims, NULL);

h5_status = H5Sselect_hyperslab (dataspace, H5S_SELECT_SET
Expand Down Expand Up @@ -381,15 +385,27 @@ void hw_dset (hid_t root_id, char * dirstr, char * name, void * data
{
hsize_t * h5dims;
h5dims = (hsize_t *) malloc (rank * sizeof (hsize_t));
for (int i = 0; i < rank; i++)
{
h5dims [rank-1-i] = dims [i].local_bound;
if(array_dim_order_fortran == USE_FORTRAN) {
// transpose dimension order for Fortran arrays
for (int i = 0; i < rank; i++)
{
h5dims [rank-1-i] = dims [i].local_bound;
}
}
else if(array_dim_order_fortran == USE_C) {
for (int i = 0; i < rank; i++)
{
h5dims [i] = dims [i].local_bound;
}
}

if(verbose >= DEBUG_INFO) {
// for (int i = 0; i < rank; i++) {
// fprintf(stderr,"%d ",h5dims[i]);
// }
for (int i = 0; i < rank; i++) {
fprintf(stderr, " Dataspace index = %d dimension = %d \n"
,i
,h5dims[i]
);
}
}

hw_dataset (grp_id [level], name, data, type, rank, h5dims);
Expand Down

0 comments on commit b7b98ef

Please sign in to comment.