diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-09-23 20:43:22 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-09-23 20:43:22 (GMT) |
commit | 82c6eab1814e1e06ef9472f6f4bbc8522064e0bc (patch) | |
tree | 8b2cd87ac76865c95e4f58ed4f45766a12d8d738 /src/H5Defl.c | |
parent | 6ff8aac3a760ea8b69b5fad866b1d06cc41c6b14 (diff) | |
download | hdf5-82c6eab1814e1e06ef9472f6f4bbc8522064e0bc.zip hdf5-82c6eab1814e1e06ef9472f6f4bbc8522064e0bc.tar.gz hdf5-82c6eab1814e1e06ef9472f6f4bbc8522064e0bc.tar.bz2 |
[svn-r19476] Description:
Polish the vectorized memory <-> memory and memory <-> file I/O
routines to speed them up a little bit (~10%)
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
Diffstat (limited to 'src/H5Defl.c')
-rw-r--r-- | src/H5Defl.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/src/H5Defl.c b/src/H5Defl.c index b0233d4..87471f1 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -420,11 +420,9 @@ H5D_efl_readvv(const H5D_io_info_t *io_info, const H5O_efl_t *efl = &(io_info->store->efl); /* Pointer to efl info */ unsigned char *buf; /* Pointer to buffer to write */ haddr_t addr; /* Actual address to read */ - size_t total_size = 0; /* Total size of sequence in bytes */ size_t size; /* Size of sequence in bytes */ - size_t u; /* Counting variable */ - size_t v; /* Counting variable */ - ssize_t ret_value; /* Return value */ + size_t u, v; /* Counting variables */ + ssize_t ret_value = 0; /* Return value (Total size of sequence in bytes) */ FUNC_ENTER_NOAPI_NOINIT(H5D_efl_readvv) @@ -452,27 +450,26 @@ H5D_efl_readvv(const H5D_io_info_t *io_info, /* Update memory information */ mem_len_arr[v] -= size; - mem_offset_arr[v] += size; if(mem_len_arr[v] == 0) v++; + else + mem_offset_arr[v] += size; /* Update file information */ dset_len_arr[u] -= size; - dset_offset_arr[u] += size; if(dset_len_arr[u] == 0) u++; + else + dset_offset_arr[u] += size; /* Increment number of bytes copied */ - total_size += size; + ret_value += (ssize_t)size; } /* end for */ /* Update current sequence vectors */ *dset_curr_seq = u; *mem_curr_seq = v; - /* Set return value */ - H5_ASSIGN_OVERFLOW(ret_value, total_size, size_t, ssize_t); - done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_efl_readvv() */ @@ -501,11 +498,9 @@ H5D_efl_writevv(const H5D_io_info_t *io_info, const H5O_efl_t *efl = &(io_info->store->efl); /* Pointer to efl info */ const unsigned char *buf; /* Pointer to buffer to write */ haddr_t addr; /* Actual address to read */ - size_t total_size = 0; /* Total size of sequence in bytes */ size_t size; /* Size of sequence in bytes */ - size_t u; /* Counting variable */ - size_t v; /* Counting variable */ - ssize_t ret_value; /* Return value */ + size_t u, v; /* Counting variables */ + ssize_t ret_value = 0; /* Return value (Total size of sequence in bytes) */ FUNC_ENTER_NOAPI_NOINIT(H5D_efl_writevv) @@ -533,27 +528,26 @@ H5D_efl_writevv(const H5D_io_info_t *io_info, /* Update memory information */ mem_len_arr[v] -= size; - mem_offset_arr[v] += size; if(mem_len_arr[v] == 0) v++; + else + mem_offset_arr[v] += size; /* Update file information */ dset_len_arr[u] -= size; - dset_offset_arr[u] += size; if(dset_len_arr[u] == 0) u++; + else + dset_offset_arr[u] += size; /* Increment number of bytes copied */ - total_size += size; + ret_value += (ssize_t)size; } /* end for */ /* Update current sequence vectors */ *dset_curr_seq = u; *mem_curr_seq = v; - /* Set return value */ - H5_ASSIGN_OVERFLOW(ret_value, total_size, size_t, ssize_t); - done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_efl_writevv() */ |