From a735b263d3c20ac4a1b66ab6070a1a539b523f84 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Fri, 16 Dec 2005 03:08:54 -0500 Subject: [svn-r11798] Purpose: Feature. Description: Modified it so that it can be compiled outside of HDF5 library as a standalone program. e.g., mpicc -DSTANDALONE prog.c. Platforms tested: Tested in Red storm and heping. --- testpar/t_posix_compliant.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/testpar/t_posix_compliant.c b/testpar/t_posix_compliant.c index 5965ff7..6a54cfd 100644 --- a/testpar/t_posix_compliant.c +++ b/testpar/t_posix_compliant.c @@ -32,12 +32,25 @@ * larber@ncsa.uiuc.edu */ +/* To compile this outside of the HDF5 library, you can do so by defining the + * macro STANDALONE. E.g., + * mpicc -DSTANDALONE t_posix_compliant.c -o t_posix_compliant + * then run it as an MPI application. E.g., + * mpirun -np 3 ./t_posix_compliant + */ + #include #include #include #include #include +#ifndef STANDALONE #include "h5test.h" +#else +#define HDmalloc(sz) malloc(sz) +#define HDfree(p) free(p) +#define getenv_all(comm, root, name) getenv(name) +#endif #define TESTFNAME "posix_test" /* test file name */ static char* testfile = NULL; @@ -753,8 +766,10 @@ int main(int argc, char* argv[]) inc = 2; } +#ifndef STANDALONE /* set alarm. */ ALARM_ON; +#endif for(write_size = lb; write_size <= ub; write_size*=inc) { @@ -823,8 +838,10 @@ int main(int argc, char* argv[]) } } +#ifndef STANDALONE /* turn off alarm */ ALARM_OFF; +#endif done: if (testfile) -- cgit v0.12