summaryrefslogtreecommitdiffstats
path: root/test/vfd.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2006-11-06 22:17:46 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2006-11-06 22:17:46 (GMT)
commit8e0a4a03c0a7923057eeb2b8b2ac16338fc87e76 (patch)
treee95317e9f70ba1bcfaab80b88e1368038ba1b2b1 /test/vfd.c
parent2e8e42d6c9a229d0490cd97e9711fb707ad67578 (diff)
downloadhdf5-8e0a4a03c0a7923057eeb2b8b2ac16338fc87e76.zip
hdf5-8e0a4a03c0a7923057eeb2b8b2ac16338fc87e76.tar.gz
hdf5-8e0a4a03c0a7923057eeb2b8b2ac16338fc87e76.tar.bz2
[svn-r12870] Add a new macro H5_HAVE_DIRECT_ALIGN in configure.in. Some systems like copper and sleipnir
doesn't require alignment for Direct I/O. If this's true, write or read data just like sec2 does.
Diffstat (limited to 'test/vfd.c')
-rw-r--r--test/vfd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/vfd.c b/test/vfd.c
index fdd710d..c8b67f7 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -214,6 +214,7 @@ test_direct(void)
if(file_size<1*KB || file_size>4*KB)
TEST_ERROR;
+#ifdef H5_HAVE_DIRECT_ALIGN
/* Allocate aligned memory for data set 1. For data set 1, everything is aligned including
* memory address, size of data, and file address. */
if(posix_memalign(&points, (size_t)FBSIZE, (size_t)(DSET1_DIM1*DSET1_DIM2*sizeof(int)))!=0)
@@ -221,6 +222,11 @@ test_direct(void)
if(posix_memalign(&check, (size_t)FBSIZE, (size_t)(DSET1_DIM1*DSET1_DIM2*sizeof(int)))!=0)
TEST_ERROR;
+#else
+ /* Allocate aligned memory for data set 1. No need for alignment. */
+ points=(int*)malloc(DSET1_DIM1*DSET1_DIM2*sizeof(int));
+ check=(int*)malloc(DSET1_DIM1*DSET1_DIM2*sizeof(int));
+#endif
/* Initialize the dset1 */
p1 = points;