summaryrefslogtreecommitdiffstats
path: root/tools/perform/perf.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-04-20 18:16:51 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-04-20 18:16:51 (GMT)
commit9ddf2090df0aaadd3368d2ef92d486129265952e (patch)
tree4f0990b7b6f089b1197ca1dd07e027fd39360c4d /tools/perform/perf.c
parentb38491a7c2580661ea7117b093799d49c93e34c7 (diff)
downloadhdf5-9ddf2090df0aaadd3368d2ef92d486129265952e.zip
hdf5-9ddf2090df0aaadd3368d2ef92d486129265952e.tar.gz
hdf5-9ddf2090df0aaadd3368d2ef92d486129265952e.tar.bz2
[svn-r29753] HDFFV-9770: Fix Windows compile errors.
Diffstat (limited to 'tools/perform/perf.c')
-rw-r--r--tools/perform/perf.c94
1 files changed, 53 insertions, 41 deletions
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 */