diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2016-04-20 18:16:51 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2016-04-20 18:16:51 (GMT) |
commit | 9ddf2090df0aaadd3368d2ef92d486129265952e (patch) | |
tree | 4f0990b7b6f089b1197ca1dd07e027fd39360c4d /tools/perform | |
parent | b38491a7c2580661ea7117b093799d49c93e34c7 (diff) | |
download | hdf5-9ddf2090df0aaadd3368d2ef92d486129265952e.zip hdf5-9ddf2090df0aaadd3368d2ef92d486129265952e.tar.gz hdf5-9ddf2090df0aaadd3368d2ef92d486129265952e.tar.bz2 |
[svn-r29753] HDFFV-9770: Fix Windows compile errors.
Diffstat (limited to 'tools/perform')
-rw-r--r-- | tools/perform/overhead.c | 4 | ||||
-rw-r--r-- | tools/perform/perf.c | 94 | ||||
-rw-r--r-- | tools/perform/pio_engine.c | 22 | ||||
-rw-r--r-- | tools/perform/pio_perf.c | 2 | ||||
-rw-r--r-- | tools/perform/sio_engine.c | 36 |
5 files changed, 89 insertions, 69 deletions
diff --git a/tools/perform/overhead.c b/tools/perform/overhead.c index feabd3a..277f7a4 100644 --- a/tools/perform/overhead.c +++ b/tools/perform/overhead.c @@ -42,10 +42,6 @@ # include <unistd.h> #endif -#ifdef H5_HAVE_IO_H -# include <io.h> -#endif - /* Solaris Studio defines attribute, but for the attributes we need */ #if !defined(H5_HAVE_ATTRIBUTE) || defined __cplusplus || defined(__SUNPRO_C) # undef __attribute__ diff --git a/tools/perform/perf.c b/tools/perform/perf.c index afd13c0..5835727 100644 --- a/tools/perform/perf.c +++ b/tools/perform/perf.c @@ -24,15 +24,26 @@ #include "hdf5.h" #include "H5private.h" + #ifdef H5_HAVE_PARALLEL -#include <stdio.h> -#include <stdlib.h> -#include <fcntl.h> + +#ifdef H5_STDC_HEADERS +# include <errno.h> +# include <fcntl.h> +# include <stdio.h> +# include <stdlib.h> +# include <string.h> +#endif + #ifdef H5_HAVE_UNISTD_H -#include <unistd.h> +# include <sys/types.h> +# include <unistd.h> #endif -#include <errno.h> -#include <string.h> + +#ifdef H5_HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif + #if defined(H5_TIME_WITH_SYS_TIME) # include <sys/time.h> # include <time.h> @@ -41,6 +52,7 @@ #else # include <time.h> #endif + #include <mpi.h> #ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ # include <mpio.h> @@ -53,13 +65,13 @@ #define H5FATAL 1 #define VRFY(val, mesg, fatal) do { \ if (!val) { \ - printf("Proc %d: ", mynod); \ + printf("Proc %d: ", mynod); \ printf("*** Assertion failed (%s) at line %4d in %s\n", \ mesg, (int)__LINE__, __FILE__); \ - if (fatal){ \ + if (fatal){ \ fflush(stdout); \ goto die_jar_jar_die; \ - } \ + } \ } \ } while(0) #define RANK 1 @@ -170,38 +182,38 @@ int main(int argc, char **argv) /* setup file access template with parallel IO access. */ if (opt_split_vfd){ - hid_t mpio_pl; - - mpio_pl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((acc_tpl >= 0), "", H5FATAL); - ret = H5Pset_fapl_mpio(mpio_pl, MPI_COMM_WORLD, MPI_INFO_NULL); - VRFY((ret >= 0), "", H5FATAL); - - /* set optional allocation alignment */ - if (opt_alignment*opt_threshold != 1){ - ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment ); - VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL); - } - - /* setup file access template */ - acc_tpl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((acc_tpl >= 0), "", H5FATAL); - ret = H5Pset_fapl_split(acc_tpl, meta_ext, mpio_pl, raw_ext, mpio_pl); - VRFY((ret >= 0), "H5Pset_fapl_split succeeded", H5FATAL); - ret = H5Pclose(mpio_pl); - VRFY((ret >= 0), "H5Pclose mpio_pl succeeded", H5FATAL); + hid_t mpio_pl; + + mpio_pl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((acc_tpl >= 0), "", H5FATAL); + ret = H5Pset_fapl_mpio(mpio_pl, MPI_COMM_WORLD, MPI_INFO_NULL); + VRFY((ret >= 0), "", H5FATAL); + + /* set optional allocation alignment */ + if (opt_alignment*opt_threshold != 1){ + ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment ); + VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL); + } + + /* setup file access template */ + acc_tpl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((acc_tpl >= 0), "", H5FATAL); + ret = H5Pset_fapl_split(acc_tpl, meta_ext, mpio_pl, raw_ext, mpio_pl); + VRFY((ret >= 0), "H5Pset_fapl_split succeeded", H5FATAL); + ret = H5Pclose(mpio_pl); + VRFY((ret >= 0), "H5Pclose mpio_pl succeeded", H5FATAL); }else{ - /* setup file access template */ - acc_tpl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((acc_tpl >= 0), "", H5FATAL); - ret = H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); - VRFY((ret >= 0), "", H5FATAL); - - /* set optional allocation alignment */ - if (opt_alignment*opt_threshold != 1){ - ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment ); - VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL); - } + /* setup file access template */ + acc_tpl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((acc_tpl >= 0), "", H5FATAL); + ret = H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); + VRFY((ret >= 0), "", H5FATAL); + + /* set optional allocation alignment */ + if (opt_alignment*opt_threshold != 1){ + ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment ); + VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL); + } } h5_fixname_no_suffix(FILENAME[0], acc_tpl, filename, sizeof filename); @@ -215,7 +227,7 @@ int main(int argc, char **argv) sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded", H5FATAL); dataset = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_CHAR, sid, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VRFY((dataset >= 0), "H5Dcreate2 succeeded", H5FATAL); /* create the memory dataspace and the file dataspace */ diff --git a/tools/perform/pio_engine.c b/tools/perform/pio_engine.c index 96cfcc2..ad33fa5 100644 --- a/tools/perform/pio_engine.c +++ b/tools/perform/pio_engine.c @@ -17,17 +17,23 @@ * Author: Albert Cheng of NCSA, Oct 24, 2001. */ -#include <sys/types.h> -#include <sys/stat.h> -#include <stdio.h> -#include <stdlib.h> -#include <fcntl.h> +#include "hdf5.h" + +#ifdef H5_STDC_HEADERS +# include <errno.h> +# include <fcntl.h> +# include <stdio.h> +# include <stdlib.h> +#endif + #ifdef H5_HAVE_UNISTD_H -#include <unistd.h> +# include <sys/types.h> +# include <unistd.h> #endif -#include <errno.h> -#include "hdf5.h" +#ifdef H5_HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif #ifdef H5_HAVE_PARALLEL diff --git a/tools/perform/pio_perf.c b/tools/perform/pio_perf.c index 509513b..e2ec453 100644 --- a/tools/perform/pio_perf.c +++ b/tools/perform/pio_perf.c @@ -482,7 +482,7 @@ run_test_loop(struct options *opts) buf_size,((double)parms.num_dsets * (double)parms.num_bytes) / ONE_MB); print_indent(1); - output_report(" # of files: %ld, # of datasets: %ld, dataset size: %.2f MBs\n", + output_report(" # of files: %ld, # of datasets: %ld, dataset size: %.2f MB\n", parms.num_files, parms.num_dsets, (double)(opts->num_bpp*parms.num_procs)/ONE_MB); } diff --git a/tools/perform/sio_engine.c b/tools/perform/sio_engine.c index 5622810..ee340e5 100644 --- a/tools/perform/sio_engine.c +++ b/tools/perform/sio_engine.c @@ -16,17 +16,23 @@ * Author: Christian Chilan, April 2008 */ -#include <sys/types.h> -#include <sys/stat.h> -#include <stdio.h> -#include <stdlib.h> -#include <fcntl.h> +#include "hdf5.h" + +#ifdef H5_STDC_HEADERS +# include <errno.h> +# include <fcntl.h> +# include <stdio.h> +# include <stdlib.h> +#endif + #ifdef H5_HAVE_UNISTD_H -# include <unistd.h> +# include <sys/types.h> +# include <unistd.h> #endif -#include <errno.h> -#include "hdf5.h" +#ifdef H5_HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif #include "sio_perf.h" @@ -255,7 +261,7 @@ done: case HDF5: if (fd.h5fd != -1) hrc = do_fclose(iot, &fd); - break; + break; default: /* unknown request */ HDassert(0 && "Unknown IO type"); @@ -675,7 +681,7 @@ static herr_t dset_write(int local_dim, file_descr *fd, parameters *parms, void VRFY((hrc >= 0), "H5Dwrite"); break; - + default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); @@ -851,7 +857,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) GOTOERROR(FAIL); } break; - + default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); @@ -979,7 +985,7 @@ static herr_t dset_read(int local_dim, file_descr *fd, parameters *parms, } #endif break; - + default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); @@ -1097,7 +1103,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) GOTOERROR(FAIL); } break; - + default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)param->io_type); @@ -1225,7 +1231,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/) fd->h5fd = -1; break; - + default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); @@ -1297,7 +1303,7 @@ do_cleanupfile(iotype iot, char *filename) } H5Pclose(fapl); break; - + default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); |