diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-04-27 19:28:55 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-04-27 19:28:55 (GMT) |
commit | 451887585360c787dec42da3ffdb65c519e6ef02 (patch) | |
tree | cf7774916f692e2c433112361789491e13e2cd27 /test/swmr_reader.c | |
parent | 954c91c5517020bee4c09d3012544e70c7182529 (diff) | |
download | hdf5-451887585360c787dec42da3ffdb65c519e6ef02.zip hdf5-451887585360c787dec42da3ffdb65c519e6ef02.tar.gz hdf5-451887585360c787dec42da3ffdb65c519e6ef02.tar.bz2 |
[svn-r18638] Description:
Lock the dataspace message into object header chunk #0 (so that the
flush dependency between the extensible array and the object header works and
has the correct semantics).
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, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.3 (amazon) in debug mode
Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'test/swmr_reader.c')
-rw-r--r-- | test/swmr_reader.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/test/swmr_reader.c b/test/swmr_reader.c index 9c9cd1e..394a46e 100644 --- a/test/swmr_reader.c +++ b/test/swmr_reader.c @@ -214,19 +214,19 @@ static void usage(void)
{
printf("Usage error!\n");
- printf("Usage: swmr_reader [-q] [-s <# of seconds to sleep between polling>] [-h <# of common symbols to poll>] [-l <# of random symbols to poll>] <# of seconds to test>\n");
+ printf("Usage: swmr_reader [-q] [-s <# of seconds to sleep between polling>] [-h <# of common symbols to poll>] [-l <# of random symbols to poll>] [-r <random # seed>] <# of seconds to test>\n");
printf("Defaults to verbose (no '-q' given), 1 second between polling ('-s 1'), 5 common symbols to poll ('-h 5') and 10 random symbols to poll ('-l 10')\n");
exit(1);
}
int main(int argc, const char *argv[])
{
- time_t curr_time; /* Current time, for seeding random number generator */
long nseconds = 0; /* # of seconds to test */
int poll_time = 1; /* # of seconds between polling */
int ncommon = 5; /* # of common symbols to poll */
int nrandom = 10; /* # of random symbols to poll */
unsigned verbose = 1; /* Whether to emit some informational messages */
+ int random_seed = 0; /* Random # seed */
unsigned u; /* Local index variables */
/* Parse command line options */
@@ -237,14 +237,6 @@ int main(int argc, const char *argv[]) while(u < (unsigned)argc) {
if(argv[u][0] == '-') {
switch(argv[u][1]) {
- /* # of seconds between polling */
- case 's':
- poll_time = atoi(argv[u + 1]);
- if(poll_time < 0)
- usage();
- u += 2;
- break;
-
/* # of common symbols to poll */
case 'h':
ncommon = atoi(argv[u + 1]);
@@ -267,6 +259,22 @@ int main(int argc, const char *argv[]) u++;
break;
+ /* Random # seed */
+ case 'r':
+ random_seed = atoi(argv[u + 1]);
+ if(random_seed < 0)
+ usage();
+ u += 2;
+ break;
+
+ /* # of seconds between polling */
+ case 's':
+ poll_time = atoi(argv[u + 1]);
+ if(poll_time < 0)
+ usage();
+ u += 2;
+ break;
+
default:
usage();
break;
@@ -297,8 +305,8 @@ int main(int argc, const char *argv[]) } /* end if */
/* Create randomized set of numbers */
- curr_time = time(NULL);
- srandom((unsigned)curr_time);
+ random_seed += (int)time(NULL);
+ srandom((unsigned)random_seed);
/* Emit informational message */
if(verbose)
|