summaryrefslogtreecommitdiffstats
path: root/perform
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-03-11 01:44:36 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-03-11 01:44:36 (GMT)
commit828e7e2416b3193b5964c0ab13b95a605088bd02 (patch)
treea9b7ab02a83f4df9c58444f7c6961da3b8d8aa6a /perform
parentddf384fb35052913970bcabd7b247f4280be08fc (diff)
downloadhdf5-828e7e2416b3193b5964c0ab13b95a605088bd02.zip
hdf5-828e7e2416b3193b5964c0ab13b95a605088bd02.tar.gz
hdf5-828e7e2416b3193b5964c0ab13b95a605088bd02.tar.bz2
[svn-r16566] Description:
Bring r16560 back from trunk. Tested on: Mac OS X/32 10.5.6 (amazon) debug & production (Following up with tests on more platforms)
Diffstat (limited to 'perform')
-rw-r--r--perform/mpi-perf.c502
-rw-r--r--perform/perf.c322
-rw-r--r--perform/pio_perf.c1
-rw-r--r--perform/sio_engine.c19
-rw-r--r--perform/sio_perf.c9
5 files changed, 404 insertions, 449 deletions
diff --git a/perform/mpi-perf.c b/perform/mpi-perf.c
index 1e0150e..c0fe794 100644
--- a/perform/mpi-perf.c
+++ b/perform/mpi-perf.c
@@ -77,282 +77,271 @@ char opt_pvfstab[256] = "notset\0";
int opt_pvfstab_set = 0;
/* function prototypes */
-int parse_args(int argc, char **argv);
-double Wtime(void);
+static int parse_args(int argc, char **argv);
extern int errno;
-extern int debug_on;
/* globals needed for getopt */
extern char *optarg;
-extern int optind, opterr;
int main(int argc, char **argv)
{
- char *buf, *tmp, *buf2, *tmp2, *check;
- int i, j, mynod=0, nprocs=1, err, my_correct = 1, correct, myerrno;
- double stim, etim;
- double write_tim = 0;
- double read_tim = 0;
- double read_bw, write_bw;
- double max_read_tim, max_write_tim;
- double min_read_tim, min_write_tim;
- double ave_read_tim, ave_write_tim;
- int64_t iter_jump = 0;
- int64_t seek_position = 0;
- MPI_File fh;
- MPI_Status status;
- int nchars;
-
- /* startup MPI and determine the rank of this process */
- MPI_Init(&argc,&argv);
- MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
- MPI_Comm_rank(MPI_COMM_WORLD, &mynod);
-
- /* parse the command line arguments */
- parse_args(argc, argv);
-
- if (mynod == 0) printf("# Using mpi-io calls.\n");
-
-
- /* kindof a weird hack- if the location of the pvfstab file was
- * specified on the command line, then spit out this location into
- * the appropriate environment variable: */
+ char *buf, *tmp, *buf2, *tmp2, *check;
+ int i, j, mynod=0, nprocs=1, err, my_correct = 1, correct, myerrno;
+ double stim, etim;
+ double write_tim = 0;
+ double read_tim = 0;
+ double read_bw, write_bw;
+ double max_read_tim, max_write_tim;
+ double min_read_tim, min_write_tim;
+ double ave_read_tim, ave_write_tim;
+ int64_t iter_jump = 0;
+ int64_t seek_position = 0;
+ MPI_File fh;
+ MPI_Status status;
+ int nchars;
+
+ /* startup MPI and determine the rank of this process */
+ MPI_Init(&argc,&argv);
+ MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mynod);
+
+ /* parse the command line arguments */
+ parse_args(argc, argv);
+
+ if (mynod == 0) printf("# Using mpi-io calls.\n");
+
+
+ /* kindof a weird hack- if the location of the pvfstab file was
+ * specified on the command line, then spit out this location into
+ * the appropriate environment variable: */
#if H5_HAVE_SETENV
/* no setenv or unsetenv */
- if (opt_pvfstab_set) {
- if((setenv("PVFSTAB_FILE", opt_pvfstab, 1)) < 0){
- perror("setenv");
- goto die_jar_jar_die;
- }
- }
+ if (opt_pvfstab_set) {
+ if((setenv("PVFSTAB_FILE", opt_pvfstab, 1)) < 0){
+ perror("setenv");
+ goto die_jar_jar_die;
+ }
+ }
#endif
- /* this is how much of the file data is covered on each iteration of
- * the test. used to help determine the seek offset on each
- * iteration */
- iter_jump = nprocs * opt_block;
-
- /* setup a buffer of data to write */
- if (!(tmp = (char *) malloc(opt_block + 256))) {
- perror("malloc");
- goto die_jar_jar_die;
- }
- buf = tmp + 128 - (((long)tmp) % 128); /* align buffer */
-
- if (opt_correct) {
- /* do the same buffer setup for verifiable data */
- if (!(tmp2 = (char *) malloc(opt_block + 256))) {
- perror("malloc2");
- goto die_jar_jar_die;
- }
- buf2 = tmp + 128 - (((long)tmp) % 128);
- }
-
- /* open the file for writing */
- err = MPI_File_open(MPI_COMM_WORLD, opt_file,
- MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh);
- if (err < 0) {
- fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno));
- goto die_jar_jar_die;
- }
-
- /* now repeat the write operations the number of times
- * specified on the command line */
- for (j=0; j < opt_iter; j++) {
-
- /* calculate the appropriate position depending on the iteration
- * and rank of the current process */
- seek_position = (j*iter_jump)+(mynod*opt_block);
-
- if (opt_correct) /* fill in buffer for iteration */ {
- for (i=mynod+j, check=buf; i<opt_block; i++,check++) *check=(char)i;
- }
-
- /* discover the starting time of the operation */
- MPI_Barrier(MPI_COMM_WORLD);
- stim = MPI_Wtime();
-
- /* write out the data */
- nchars = opt_block/sizeof(char);
- err = MPI_File_write_at(fh, seek_position, buf, nchars, MPI_CHAR, &status);
- if(err){
- fprintf(stderr, "node %d, write error: %s\n", mynod,
- strerror(errno));
- }
-
- /* discover the ending time of the operation */
- etim = MPI_Wtime();
-
- write_tim += (etim - stim);
-
- /* we are done with this "write" iteration */
- }
-
- err = MPI_File_close(&fh);
- if(err){
- fprintf(stderr, "node %d, close error after write\n", mynod);
- }
-
- /* wait for everyone to synchronize at this point */
- MPI_Barrier(MPI_COMM_WORLD);
-
- /* reopen the file to read the data back out */
- err = MPI_File_open(MPI_COMM_WORLD, opt_file,
- MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh);
- if (err < 0) {
- fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno));
- goto die_jar_jar_die;
- }
-
-
- /* we are going to repeat the read operation the number of iterations
- * specified */
- for (j=0; j < opt_iter; j++) {
- /* calculate the appropriate spot give the current iteration and
- * rank within the MPI processes */
- seek_position = (j*iter_jump)+(mynod*opt_block);
-
- /* discover the start time */
- MPI_Barrier(MPI_COMM_WORLD);
- stim = MPI_Wtime();
-
- /* read in the file data */
- if (!opt_correct){
- err = MPI_File_read_at(fh, seek_position, buf, nchars, MPI_CHAR, &status);
- }
- else{
- err = MPI_File_read_at(fh, seek_position, buf2, nchars, MPI_CHAR, &status);
- }
- myerrno = errno;
-
- /* discover the end time */
- etim = MPI_Wtime();
- read_tim += (etim - stim);
-
- if (err < 0) fprintf(stderr, "node %d, read error, loc = %Ld: %s\n",
- mynod, mynod*opt_block, strerror(myerrno));
-
- /* if the user wanted to check correctness, compare the write
- * buffer to the read buffer */
- if (opt_correct && memcmp(buf, buf2, opt_block)) {
- fprintf(stderr, "node %d, correctness test failed\n", mynod);
- my_correct = 0;
- MPI_Allreduce(&my_correct, &correct, 1, MPI_INT, MPI_MIN,
- MPI_COMM_WORLD);
- }
-
- /* we are done with this read iteration */
- }
-
- /* close the file */
- err = MPI_File_close(&fh);
- if(err){
- fprintf(stderr, "node %d, close error after write\n", mynod);
- }
-
- /* compute the read and write times */
- MPI_Allreduce(&read_tim, &max_read_tim, 1, MPI_DOUBLE, MPI_MAX,
- MPI_COMM_WORLD);
- MPI_Allreduce(&read_tim, &min_read_tim, 1, MPI_DOUBLE, MPI_MIN,
- MPI_COMM_WORLD);
- MPI_Allreduce(&read_tim, &ave_read_tim, 1, MPI_DOUBLE, MPI_SUM,
- MPI_COMM_WORLD);
-
- /* calculate the average from the sum */
- ave_read_tim = ave_read_tim / nprocs;
-
- MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX,
- MPI_COMM_WORLD);
- MPI_Allreduce(&write_tim, &min_write_tim, 1, MPI_DOUBLE, MPI_MIN,
- MPI_COMM_WORLD);
- MPI_Allreduce(&write_tim, &ave_write_tim, 1, MPI_DOUBLE, MPI_SUM,
- MPI_COMM_WORLD);
-
- /* calculate the average from the sum */
- ave_write_tim = ave_write_tim / nprocs;
-
- /* print out the results on one node */
- if (mynod == 0) {
- read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0);
- write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0);
-
- printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs,
- opt_iter, (long)opt_block);
-
- printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter));
-
- printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n",
- min_write_tim, max_write_tim, ave_write_tim);
- printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n",
- min_read_tim, max_read_tim, ave_read_tim);
-
- printf("Write bandwidth = %f Mbytes/sec\n", write_bw);
- printf("Read bandwidth = %f Mbytes/sec\n", read_bw);
-
- if (opt_correct) {
- printf("Correctness test %s.\n", correct ? "passed" : "failed");
- }
- }
+ /* this is how much of the file data is covered on each iteration of
+ * the test. used to help determine the seek offset on each
+ * iteration */
+ iter_jump = nprocs * opt_block;
+
+ /* setup a buffer of data to write */
+ if (!(tmp = (char *) malloc(opt_block + 256))) {
+ perror("malloc");
+ goto die_jar_jar_die;
+ }
+ buf = tmp + 128 - (((long)tmp) % 128); /* align buffer */
+
+ if (opt_correct) {
+ /* do the same buffer setup for verifiable data */
+ if (!(tmp2 = (char *) malloc(opt_block + 256))) {
+ perror("malloc2");
+ goto die_jar_jar_die;
+ }
+ buf2 = tmp + 128 - (((long)tmp) % 128);
+ }
+
+ /* open the file for writing */
+ err = MPI_File_open(MPI_COMM_WORLD, opt_file,
+ MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh);
+ if (err < 0) {
+ fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno));
+ goto die_jar_jar_die;
+ }
+
+ /* now repeat the write operations the number of times
+ * specified on the command line */
+ for (j=0; j < opt_iter; j++) {
+
+ /* calculate the appropriate position depending on the iteration
+ * and rank of the current process */
+ seek_position = (j*iter_jump)+(mynod*opt_block);
+
+ if (opt_correct) /* fill in buffer for iteration */ {
+ for (i=mynod+j, check=buf; i<opt_block; i++,check++) *check=(char)i;
+ }
+
+ /* discover the starting time of the operation */
+ MPI_Barrier(MPI_COMM_WORLD);
+ stim = MPI_Wtime();
+
+ /* write out the data */
+ nchars = opt_block/sizeof(char);
+ err = MPI_File_write_at(fh, seek_position, buf, nchars, MPI_CHAR, &status);
+ if(err){
+ fprintf(stderr, "node %d, write error: %s\n", mynod,
+ strerror(errno));
+ }
+
+ /* discover the ending time of the operation */
+ etim = MPI_Wtime();
+
+ write_tim += (etim - stim);
+
+ /* we are done with this "write" iteration */
+ }
+
+ err = MPI_File_close(&fh);
+ if(err){
+ fprintf(stderr, "node %d, close error after write\n", mynod);
+ }
+
+ /* wait for everyone to synchronize at this point */
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ /* reopen the file to read the data back out */
+ err = MPI_File_open(MPI_COMM_WORLD, opt_file,
+ MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh);
+ if (err < 0) {
+ fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno));
+ goto die_jar_jar_die;
+ }
+
+
+ /* we are going to repeat the read operation the number of iterations
+ * specified */
+ for (j=0; j < opt_iter; j++) {
+ /* calculate the appropriate spot give the current iteration and
+ * rank within the MPI processes */
+ seek_position = (j*iter_jump)+(mynod*opt_block);
+
+ /* discover the start time */
+ MPI_Barrier(MPI_COMM_WORLD);
+ stim = MPI_Wtime();
+
+ /* read in the file data */
+ if (!opt_correct){
+ err = MPI_File_read_at(fh, seek_position, buf, nchars, MPI_CHAR, &status);
+ }
+ else{
+ err = MPI_File_read_at(fh, seek_position, buf2, nchars, MPI_CHAR, &status);
+ }
+ myerrno = errno;
+
+ /* discover the end time */
+ etim = MPI_Wtime();
+ read_tim += (etim - stim);
+
+ if (err < 0) fprintf(stderr, "node %d, read error, loc = %Ld: %s\n",
+ mynod, mynod*opt_block, strerror(myerrno));
+
+ /* if the user wanted to check correctness, compare the write
+ * buffer to the read buffer */
+ if (opt_correct && memcmp(buf, buf2, opt_block)) {
+ fprintf(stderr, "node %d, correctness test failed\n", mynod);
+ my_correct = 0;
+ MPI_Allreduce(&my_correct, &correct, 1, MPI_INT, MPI_MIN,
+ MPI_COMM_WORLD);
+ }
+
+ /* we are done with this read iteration */
+ }
+
+ /* close the file */
+ err = MPI_File_close(&fh);
+ if(err){
+ fprintf(stderr, "node %d, close error after write\n", mynod);
+ }
+
+ /* compute the read and write times */
+ MPI_Allreduce(&read_tim, &max_read_tim, 1, MPI_DOUBLE, MPI_MAX,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&read_tim, &min_read_tim, 1, MPI_DOUBLE, MPI_MIN,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&read_tim, &ave_read_tim, 1, MPI_DOUBLE, MPI_SUM,
+ MPI_COMM_WORLD);
+
+ /* calculate the average from the sum */
+ ave_read_tim = ave_read_tim / nprocs;
+
+ MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&write_tim, &min_write_tim, 1, MPI_DOUBLE, MPI_MIN,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&write_tim, &ave_write_tim, 1, MPI_DOUBLE, MPI_SUM,
+ MPI_COMM_WORLD);
+
+ /* calculate the average from the sum */
+ ave_write_tim = ave_write_tim / nprocs;
+
+ /* print out the results on one node */
+ if (mynod == 0) {
+ read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0);
+ write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0);
+
+ printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs,
+ opt_iter, (long)opt_block);
+
+ printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter));
+
+ printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n",
+ min_write_tim, max_write_tim, ave_write_tim);
+ printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n",
+ min_read_tim, max_read_tim, ave_read_tim);
+
+ printf("Write bandwidth = %f Mbytes/sec\n", write_bw);
+ printf("Read bandwidth = %f Mbytes/sec\n", read_bw);
+
+ if (opt_correct) {
+ printf("Correctness test %s.\n", correct ? "passed" : "failed");
+ }
+ }
die_jar_jar_die:
#if H5_HAVE_SETENV
/* no setenv or unsetenv */
- /* clear the environment variable if it was set earlier */
- if (opt_pvfstab_set){
- unsetenv("PVFSTAB_FILE");
- }
+ /* clear the environment variable if it was set earlier */
+ if (opt_pvfstab_set){
+ unsetenv("PVFSTAB_FILE");
+ }
#endif
- free(tmp);
- if (opt_correct) free(tmp2);
- MPI_Finalize();
- return(0);
+ free(tmp);
+ if (opt_correct) free(tmp2);
+ MPI_Finalize();
+ return(0);
}
-int parse_args(int argc, char **argv)
+static int
+parse_args(int argc, char **argv)
{
- int c;
-
- while ((c = getopt(argc, argv, "s:b:i:f:p:c")) != EOF) {
- switch (c) {
- case 's': /* stripe */
- opt_stripe = atoi(optarg);
- break;
- case 'b': /* block size */
- opt_block = atoi(optarg);
- break;
- case 'i': /* iterations */
- opt_iter = atoi(optarg);
- break;
- case 'f': /* filename */
- strncpy(opt_file, optarg, 255);
- break;
- case 'p': /* pvfstab file */
- strncpy(opt_pvfstab, optarg, 255);
- opt_pvfstab_set = 1;
- break;
- case 'c': /* correctness */
- opt_correct = 1;
- break;
- case '?': /* unknown */
- default:
- break;
- }
- }
- return(0);
-}
-
-/* Wtime() - returns current time in sec., in a double */
-double Wtime()
-{
- struct timeval t;
-
- gettimeofday(&t, NULL);
- return((double)t.tv_sec + (double)t.tv_usec / 1000000);
+ int c;
+
+ while ((c = getopt(argc, argv, "s:b:i:f:p:c")) != EOF) {
+ switch (c) {
+ case 's': /* stripe */
+ opt_stripe = atoi(optarg);
+ break;
+ case 'b': /* block size */
+ opt_block = atoi(optarg);
+ break;
+ case 'i': /* iterations */
+ opt_iter = atoi(optarg);
+ break;
+ case 'f': /* filename */
+ strncpy(opt_file, optarg, 255);
+ break;
+ case 'p': /* pvfstab file */
+ strncpy(opt_pvfstab, optarg, 255);
+ opt_pvfstab_set = 1;
+ break;
+ case 'c': /* correctness */
+ opt_correct = 1;
+ break;
+ case '?': /* unknown */
+ default:
+ break;
+ }
+ }
+ return(0);
}
/*
@@ -364,11 +353,12 @@ double Wtime()
*/
#else /* H5_HAVE_PARALLEL */
-/* dummy program since H5_HAVE_PARALLE is not configured in */
+/* dummy program since H5_HAVE_PARALLEL is not configured in */
int
-main()
+main(int UNUSED argc, char UNUSED **argv)
{
-printf("No parallel performance because parallel is not configured in\n");
-return(0);
+ printf("No parallel performance because parallel is not configured in\n");
+ return(0);
}
#endif /* H5_HAVE_PARALLEL */
+
diff --git a/perform/perf.c b/perform/perf.c
index cebf50c..92b85bc 100644
--- a/perform/perf.c
+++ b/perform/perf.c
@@ -82,79 +82,76 @@ char opt_pvfstab[256] = "notset";
int opt_pvfstab_set = 0;
/* function prototypes */
-int parse_args(int argc, char **argv);
-double Wtime(void);
+static int parse_args(int argc, char **argv);
extern int errno;
-extern int debug_on;
/* globals needed for getopt */
extern char *optarg;
-extern int optind, opterr;
int main(int argc, char **argv)
{
- char *buf, *tmp, *buf2, *tmp2, *check;
- int i, j, mynod=0, nprocs=1, err, my_correct = 1, correct, myerrno;
- double stim, etim;
- double write_tim = 0;
- double read_tim = 0;
- double read_bw, write_bw;
- double max_read_tim, max_write_tim;
- double min_read_tim, min_write_tim;
- double ave_read_tim, ave_write_tim;
- int64_t iter_jump = 0;
- int64_t seek_position = 0;
- MPI_File fh;
- MPI_Status status;
- int nchars;
+ char *buf, *tmp, *buf2, *tmp2, *check;
+ int i, j, mynod=0, nprocs=1, err, my_correct = 1, correct, myerrno;
+ double stim, etim;
+ double write_tim = 0;
+ double read_tim = 0;
+ double read_bw, write_bw;
+ double max_read_tim, max_write_tim;
+ double min_read_tim, min_write_tim;
+ double ave_read_tim, ave_write_tim;
+ int64_t iter_jump = 0;
+ int64_t seek_position = 0;
+ MPI_File fh;
+ MPI_Status status;
+ int nchars;
herr_t ret; /* Generic return value */
- /* startup MPI and determine the rank of this process */
- MPI_Init(&argc,&argv);
- MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
- MPI_Comm_rank(MPI_COMM_WORLD, &mynod);
+ /* startup MPI and determine the rank of this process */
+ MPI_Init(&argc,&argv);
+ MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mynod);
- /* parse the command line arguments */
- parse_args(argc, argv);
+ /* parse the command line arguments */
+ parse_args(argc, argv);
- if (mynod == 0) printf("# Using hdf5-io calls.\n");
+ if (mynod == 0) printf("# Using hdf5-io calls.\n");
- /* kindof a weird hack- if the location of the pvfstab file was
- * specified on the command line, then spit out this location into
- * the appropriate environment variable: */
+ /* kindof a weird hack- if the location of the pvfstab file was
+ * specified on the command line, then spit out this location into
+ * the appropriate environment variable: */
#if H5_HAVE_SETENV
/* no setenv or unsetenv */
- if (opt_pvfstab_set) {
- if((setenv("PVFSTAB_FILE", opt_pvfstab, 1)) < 0){
- perror("setenv");
- goto die_jar_jar_die;
- }
- }
+ if (opt_pvfstab_set) {
+ if((setenv("PVFSTAB_FILE", opt_pvfstab, 1)) < 0){
+ perror("setenv");
+ goto die_jar_jar_die;
+ }
+ }
#endif
- /* this is how much of the file data is covered on each iteration of
- * the test. used to help determine the seek offset on each
- * iteration */
- iter_jump = nprocs * opt_block;
+ /* this is how much of the file data is covered on each iteration of
+ * the test. used to help determine the seek offset on each
+ * iteration */
+ iter_jump = nprocs * opt_block;
- /* setup a buffer of data to write */
- if (!(tmp = (char *) malloc(opt_block + 256))) {
- perror("malloc");
- goto die_jar_jar_die;
- }
- buf = tmp + 128 - (((long)tmp) % 128); /* align buffer */
-
- if (opt_correct) {
- /* do the same buffer setup for verifiable data */
- if (!(tmp2 = (char *) malloc(opt_block + 256))) {
- perror("malloc2");
- goto die_jar_jar_die;
- }
- buf2 = tmp + 128 - (((long)tmp) % 128);
- }
+ /* setup a buffer of data to write */
+ if (!(tmp = (char *) malloc(opt_block + 256))) {
+ perror("malloc");
+ goto die_jar_jar_die;
+ }
+ buf = tmp + 128 - (((long)tmp) % 128); /* align buffer */
+
+ if (opt_correct) {
+ /* do the same buffer setup for verifiable data */
+ if (!(tmp2 = (char *) malloc(opt_block + 256))) {
+ perror("malloc2");
+ goto die_jar_jar_die;
+ }
+ buf2 = tmp + 128 - (((long)tmp) % 128);
+ }
/* setup file access template with parallel IO access. */
if (opt_split_vfd){
@@ -319,137 +316,131 @@ int main(int argc, char **argv)
ret=H5Pclose(acc_tpl);
VRFY((ret >= 0), "H5Pclose succeeded", H5FATAL);
- /* compute the read and write times */
- MPI_Allreduce(&read_tim, &max_read_tim, 1, MPI_DOUBLE, MPI_MAX,
- MPI_COMM_WORLD);
- MPI_Allreduce(&read_tim, &min_read_tim, 1, MPI_DOUBLE, MPI_MIN,
- MPI_COMM_WORLD);
- MPI_Allreduce(&read_tim, &ave_read_tim, 1, MPI_DOUBLE, MPI_SUM,
- MPI_COMM_WORLD);
+ /* compute the read and write times */
+ MPI_Allreduce(&read_tim, &max_read_tim, 1, MPI_DOUBLE, MPI_MAX,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&read_tim, &min_read_tim, 1, MPI_DOUBLE, MPI_MIN,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&read_tim, &ave_read_tim, 1, MPI_DOUBLE, MPI_SUM,
+ MPI_COMM_WORLD);
- /* calculate the average from the sum */
- ave_read_tim = ave_read_tim / nprocs;
+ /* calculate the average from the sum */
+ ave_read_tim = ave_read_tim / nprocs;
- MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX,
- MPI_COMM_WORLD);
- MPI_Allreduce(&write_tim, &min_write_tim, 1, MPI_DOUBLE, MPI_MIN,
- MPI_COMM_WORLD);
- MPI_Allreduce(&write_tim, &ave_write_tim, 1, MPI_DOUBLE, MPI_SUM,
- MPI_COMM_WORLD);
+ MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&write_tim, &min_write_tim, 1, MPI_DOUBLE, MPI_MIN,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&write_tim, &ave_write_tim, 1, MPI_DOUBLE, MPI_SUM,
+ MPI_COMM_WORLD);
- /* calculate the average from the sum */
- ave_write_tim = ave_write_tim / nprocs;
+ /* calculate the average from the sum */
+ ave_write_tim = ave_write_tim / nprocs;
- /* print out the results on one node */
- if (mynod == 0) {
- read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0);
- write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0);
+ /* print out the results on one node */
+ if (mynod == 0) {
+ read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0);
+ write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0);
- printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs,
- opt_iter, (long)opt_block);
+ printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs,
+ opt_iter, (long)opt_block);
- printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter));
+ printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter));
- printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n",
- min_write_tim, max_write_tim, ave_write_tim);
- printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n",
- min_read_tim, max_read_tim, ave_read_tim);
+ printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n",
+ min_write_tim, max_write_tim, ave_write_tim);
+ printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n",
+ min_read_tim, max_read_tim, ave_read_tim);
- printf("Write bandwidth = %f Mbytes/sec\n", write_bw);
- printf("Read bandwidth = %f Mbytes/sec\n", read_bw);
+ printf("Write bandwidth = %f Mbytes/sec\n", write_bw);
+ printf("Read bandwidth = %f Mbytes/sec\n", read_bw);
- if (opt_correct) {
- printf("Correctness test %s.\n", correct ? "passed" : "failed");
- }
- }
+ if (opt_correct) {
+ printf("Correctness test %s.\n", correct ? "passed" : "failed");
+ }
+ }
die_jar_jar_die:
#if H5_HAVE_SETENV
/* no setenv or unsetenv */
- /* clear the environment variable if it was set earlier */
- if (opt_pvfstab_set){
- unsetenv("PVFSTAB_FILE");
- }
+ /* clear the environment variable if it was set earlier */
+ if (opt_pvfstab_set){
+ unsetenv("PVFSTAB_FILE");
+ }
#endif
- free(tmp);
- if (opt_correct) free(tmp2);
- MPI_Finalize();
- return(0);
-}
+ free(tmp);
+ if (opt_correct) free(tmp2);
+ MPI_Finalize();
-int parse_args(int argc, char **argv)
-{
- int c;
-
- while ((c = getopt(argc, argv, "s:b:i:f:p:a:2:c")) != EOF) {
- switch (c) {
- case 's': /* stripe */
- opt_stripe = atoi(optarg);
- break;
- case 'b': /* block size */
- opt_block = atoi(optarg);
- break;
- case 'i': /* iterations */
- opt_iter = atoi(optarg);
- break;
- case 'f': /* filename */
- strncpy(opt_file, optarg, 255);
- break;
- case 'p': /* pvfstab file */
- strncpy(opt_pvfstab, optarg, 255);
- opt_pvfstab_set = 1;
- break;
- case 'a': /* aligned allocation.
- * syntax: -a<alignment>/<threshold>
- * e.g., -a4096/512 allocate at 4096 bytes
- * boundary if request size >= 512.
- */
- {char *p;
- opt_alignment = atoi(optarg);
- if (p=(char*)strchr(optarg, '/'))
- opt_threshold = atoi(p+1);
- }
- HDfprintf(stdout,
- "alignment/threshold=%Hu/%Hu\n",
- opt_alignment, opt_threshold);
- break;
- case '2': /* use 2-files, i.e., split file driver */
- opt_split_vfd=1;
- /* get meta and raw file extension. */
- /* syntax is <raw_ext>,<meta_ext> */
- meta_ext = raw_ext = optarg;
- while (*raw_ext != '\0'){
- if (*raw_ext == ','){
- *raw_ext = '\0';
- raw_ext++;
- break;
- }
- raw_ext++;
- }
- printf("split-file-vfd used: %s,%s\n",
- meta_ext, raw_ext);
- break;
- case 'c': /* correctness */
- opt_correct = 1;
- break;
- case '?': /* unknown */
- default:
- break;
- }
- }
- return(0);
+ return(0);
}
-/* Wtime() - returns current time in sec., in a double */
-double Wtime()
+static int
+parse_args(int argc, char **argv)
{
- struct timeval t;
+ int c;
+
+ while ((c = getopt(argc, argv, "s:b:i:f:p:a:2:c")) != EOF) {
+ switch (c) {
+ case 's': /* stripe */
+ opt_stripe = atoi(optarg);
+ break;
+ case 'b': /* block size */
+ opt_block = atoi(optarg);
+ break;
+ case 'i': /* iterations */
+ opt_iter = atoi(optarg);
+ break;
+ case 'f': /* filename */
+ strncpy(opt_file, optarg, 255);
+ break;
+ case 'p': /* pvfstab file */
+ strncpy(opt_pvfstab, optarg, 255);
+ opt_pvfstab_set = 1;
+ break;
+ case 'a': /* aligned allocation.
+ * syntax: -a<alignment>/<threshold>
+ * e.g., -a4096/512 allocate at 4096 bytes
+ * boundary if request size >= 512.
+ */
+ {char *p;
+ opt_alignment = atoi(optarg);
+ if (p=(char*)strchr(optarg, '/'))
+ opt_threshold = atoi(p+1);
+ }
+ HDfprintf(stdout,
+ "alignment/threshold=%Hu/%Hu\n",
+ opt_alignment, opt_threshold);
+ break;
+ case '2': /* use 2-files, i.e., split file driver */
+ opt_split_vfd=1;
+ /* get meta and raw file extension. */
+ /* syntax is <raw_ext>,<meta_ext> */
+ meta_ext = raw_ext = optarg;
+ while (*raw_ext != '\0'){
+ if (*raw_ext == ','){
+ *raw_ext = '\0';
+ raw_ext++;
+ break;
+ }
+ raw_ext++;
+ }
+ printf("split-file-vfd used: %s,%s\n",
+ meta_ext, raw_ext);
+ break;
+ case 'c': /* correctness */
+ opt_correct = 1;
+ break;
+ case '?': /* unknown */
+ default:
+ break;
+ }
+ }
- gettimeofday(&t, NULL);
- return((double)t.tv_sec + (double)t.tv_usec / 1000000);
+ return(0);
}
/*
@@ -461,11 +452,12 @@ double Wtime()
*/
#else /* H5_HAVE_PARALLEL */
-/* dummy program since H5_HAVE_PARALLE is not configured in */
+/* dummy program since H5_HAVE_PARALLEL is not configured in */
int
main(int UNUSED argc, char UNUSED **argv)
{
-printf("No parallel performance because parallel is not configured in\n");
-return(0);
+ printf("No parallel performance because parallel is not configured in\n");
+ return(0);
}
#endif /* H5_HAVE_PARALLEL */
+
diff --git a/perform/pio_perf.c b/perform/pio_perf.c
index a6057b3..d3e2531 100644
--- a/perform/pio_perf.c
+++ b/perform/pio_perf.c
@@ -427,7 +427,6 @@ run_test_loop(struct options *opts)
parameters parms;
int num_procs;
int doing_pio; /* if this process is doing PIO */
- off_t snbytes;
parms.num_files = opts->num_files;
parms.num_dsets = opts->num_dsets;
diff --git a/perform/sio_engine.c b/perform/sio_engine.c
index 0fdfac5..d4e7ad3 100644
--- a/perform/sio_engine.c
+++ b/perform/sio_engine.c
@@ -127,7 +127,6 @@ static int cont_dim; /* lowest dimension for contiguous POSIX
static size_t cont_size; /* size of contiguous POSIX access */
static hid_t fapl; /* file access list */
static unsigned char *buf_p; /* buffer pointer */
-static unsigned char *buf2_p; /* buffer pointer */
static const char *multi_letters = "msbrglo"; /* string for multi driver */
static char *buffer2=NULL; /* buffer for data verification */
@@ -151,10 +150,7 @@ static hid_t h5dxpl = -1; /* Dataset transfer property list */
do_sio(parameters param)
{
char *buffer = NULL; /*data buffer pointer */
- off_t nbytes; /* dataset raw size */
- off_t dset_size[MAX_DIMS]; /* dataset size in bytes */
size_t buf_size[MAX_DIMS]; /* general buffer size in bytes */
- size_t chk_size[MAX_DIMS]; /* chunk size in bytes */
file_descr fd; /* file handles */
iotype iot; /* API type */
char base_name[256]; /* test file base name */
@@ -183,17 +179,14 @@ do_sio(parameters param)
break;
default:
/* unknown request */
- fprintf(stderr, "Unknown IO type request (%d)\n", iot);
+ fprintf(stderr, "Unknown IO type request (%d)\n", (int)iot);
GOTOERROR(FAIL);
}
- nbytes = param.num_bytes;
linear_buf_size = 1;
for (i=0; i<param.rank; i++){
- dset_size[i] = param.dset_size[i];
buf_size[i] = param.buf_size[i];
- chk_size[i] = param.chk_size[i];
order[i] = param.order[i];
linear_buf_size *= buf_size[i];
buf_offset[i] = 0;
@@ -777,7 +770,6 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
/* HDF5 variables */
herr_t hrc; /*HDF5 return code */
hsize_t h5dims[MAX_DIMS]; /*dataset dim sizes */
- hsize_t h5chunk[MAX_DIMS]; /*dataset dim sizes */
hsize_t h5block[MAX_DIMS]; /*dataspace selection */
hsize_t h5stride[MAX_DIMS]; /*selection stride */
hsize_t h5start[MAX_DIMS]; /*selection start */
@@ -816,7 +808,6 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
h5stride[i] = 1;
h5block[i] = 1;
h5count[i] = parms->buf_size[i];
- h5chunk[i] = parms->chk_size[i];
}
h5dset_space_id = H5Screate_simple(rank, h5dims, NULL);
@@ -955,7 +946,6 @@ static herr_t dset_read(int local_dim, file_descr *fd, parameters *parms, void *
buf_offset[j] = 0;
}
buf_p = (unsigned char*)buffer;
- buf2_p = (unsigned char*)buffer2;
posix_buffer_read(0, fd, parms, buffer);
break;
@@ -1028,13 +1018,6 @@ static herr_t posix_buffer_read(int local_dim, file_descr *fd, parameters *parms
rc = ((ssize_t)cont_size ==
POSIXREAD(fd->posixfd, buf_p, cont_size));
VRFY((rc != 0), "POSIXREAD");
-#if 0
- for (j=0; j<cont_size; j++) {
- if (buf_p[j]!=buf2_p[j])
- printf("Inconsistent data in %d\n", j);
- }
- buf2_p += cont_size;
-#endif
/* Advance location in buffer */
buf_p += cont_size;
diff --git a/perform/sio_perf.c b/perform/sio_perf.c
index 271bf20..5b97667 100644
--- a/perform/sio_perf.c
+++ b/perform/sio_perf.c
@@ -340,7 +340,6 @@ static void report_parameters(struct options *opts);
int
main(int argc, char **argv)
{
- int ret;
int exit_value = EXIT_SUCCESS;
struct options *opts = NULL;
@@ -396,7 +395,6 @@ run_test_loop(struct options *opts)
{
parameters parms;
int i;
- int doing_sio; /* if this process is doing SIO */
size_t buf_bytes;
/* load options into parameter structure */
parms.num_files = opts->num_files;
@@ -449,7 +447,6 @@ run_test(iotype iot, parameters parms, struct options *opts)
{
results res;
register int i, ret_value = SUCCESS;
- int comm_size;
off_t raw_size;
minmax *write_sys_mm_table=NULL;
minmax *write_mm_table=NULL;
@@ -988,7 +985,6 @@ parse_command_line(int argc, char *argv[])
const char *end = opt_arg;
while (end && *end != '\0') {
char buf[10];
- int i;
memset(buf, '\0', sizeof(buf));
@@ -1028,7 +1024,6 @@ parse_command_line(int argc, char *argv[])
while (end && *end != '\0') {
char buf[10];
- int i;
memset(buf, '\0', sizeof(buf));
@@ -1057,7 +1052,6 @@ parse_command_line(int argc, char *argv[])
while (end && *end != '\0') {
char buf[10];
- int i;
memset(buf, '\0', sizeof(buf));
@@ -1116,7 +1110,6 @@ parse_command_line(int argc, char *argv[])
while (end && *end != '\0') {
char buf[10];
- int i;
memset(buf, '\0', sizeof(buf));
@@ -1185,7 +1178,6 @@ parse_command_line(int argc, char *argv[])
while (end && *end != '\0') {
char buf[10];
- int i;
memset(buf, '\0', sizeof(buf));
@@ -1214,7 +1206,6 @@ parse_command_line(int argc, char *argv[])
while (end && *end != '\0') {
char buf[10];
- int i;
memset(buf, '\0', sizeof(buf));