summaryrefslogtreecommitdiffstats
path: root/tools/test/perform
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-01-09 22:00:04 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-01-09 22:00:13 (GMT)
commit9b82f8c0ac010b019f1cfc98c638c7ec6770a844 (patch)
tree94ade8785903c149c014fa691067e654adb1973f /tools/test/perform
parent99fa2dbec3d707b47032c3ad4fb1b6cf80cec25e (diff)
downloadhdf5-9b82f8c0ac010b019f1cfc98c638c7ec6770a844.zip
hdf5-9b82f8c0ac010b019f1cfc98c638c7ec6770a844.tar.gz
hdf5-9b82f8c0ac010b019f1cfc98c638c7ec6770a844.tar.bz2
Fix standalone compile issues
Diffstat (limited to 'tools/test/perform')
-rw-r--r--tools/test/perform/pio_perf.h3
-rw-r--r--tools/test/perform/pio_standalone.c132
-rw-r--r--tools/test/perform/sio_perf.h4
3 files changed, 137 insertions, 2 deletions
diff --git a/tools/test/perform/pio_perf.h b/tools/test/perform/pio_perf.h
index 7605f20..55d721e 100644
--- a/tools/test/perform/pio_perf.h
+++ b/tools/test/perform/pio_perf.h
@@ -13,12 +13,13 @@
#ifndef PIO_PERF_H__
#define PIO_PERF_H__
-#include "io_timer.h"
#ifndef STANDALONE
+#include "io_timer.h"
#include "h5test.h"
#include "h5tools.h"
#include "h5tools_utils.h"
#else
+#include "io_timer.h"
#include "pio_standalone.h"
#endif
diff --git a/tools/test/perform/pio_standalone.c b/tools/test/perform/pio_standalone.c
index 0fba904..8cdca85 100644
--- a/tools/test/perform/pio_standalone.c
+++ b/tools/test/perform/pio_standalone.c
@@ -164,3 +164,135 @@ print_version(const char *progname)
progname, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE,
H5_VERS_SUBRELEASE[0] ? "-" : "", H5_VERS_SUBRELEASE);
}
+
+#ifdef STANDALONE
+/*
+ * Function: h5_set_info_object
+ * Purpose: Process environment variables setting to set up MPI Info
+ * object.
+ * Return: 0 if all is fine; otherwise non-zero.
+ * Programmer: Albert Cheng, 2002/05/21.
+ * Modifications:
+ * Bill Wendling, 2002/05/31
+ * Modified so that the HDF5_MPI_INFO environment variable can
+ * be a semicolon separated list of "key=value" pairings. Most
+ * of the code is to remove any whitespaces which might be
+ * surrounding the "key=value" pairs.
+ */
+int
+h5_set_info_object(void)
+{
+ char *envp; /* environment pointer */
+ int ret_value=0;
+
+ /* handle any MPI INFO hints via $HDF5_MPI_INFO */
+ if ((envp = HDgetenv("HDF5_MPI_INFO")) != NULL){
+ char *next, *valp;
+
+ valp = envp = next = HDstrdup(envp);
+
+ if (!valp) return 0;
+
+ /* create an INFO object if not created yet */
+ if (h5_io_info_g == MPI_INFO_NULL)
+ MPI_Info_create(&h5_io_info_g);
+
+ do {
+ size_t len;
+ char *key_val, *endp, *namep;
+
+ if (*valp == ';')
+ valp++;
+
+ /* copy key/value pair into temporary buffer */
+ len = strcspn(valp, ";");
+ next = &valp[len];
+ key_val = (char *)HDcalloc(1, len + 1);
+
+ /* increment the next pointer past the terminating semicolon */
+ if (*next == ';')
+ ++next;
+
+ namep = HDstrncpy(key_val, valp, len);
+
+ /* pass up any beginning whitespaces */
+ while (*namep && (*namep == ' ' || *namep == '\t'))
+ namep++;
+
+ if (!*namep) continue; /* was all white space, so move to next k/v pair */
+
+ /* eat up any ending white spaces */
+ endp = &namep[HDstrlen(namep) - 1];
+
+ while (endp && (*endp == ' ' || *endp == '\t'))
+ *endp-- = '\0';
+
+ /* find the '=' */
+ valp = HDstrchr(namep, '=');
+
+ if (valp != NULL) { /* it's a valid key/value pairing */
+ char *tmp_val = valp + 1;
+
+ /* change '=' to \0, move valp down one */
+ *valp-- = '\0';
+
+ /* eat up ending whitespace on the "key" part */
+ while (*valp == ' ' || *valp == '\t')
+ *valp-- = '\0';
+
+ valp = tmp_val;
+
+ /* eat up beginning whitespace on the "value" part */
+ while (*valp == ' ' || *valp == '\t')
+ *valp++ = '\0';
+
+ /* actually set the darned thing */
+ if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
+ HDprintf("MPI_Info_set failed\n");
+ ret_value = -1;
+ }
+ }
+
+ valp = next;
+ HDfree(key_val);
+ } while (next && *next);
+
+ HDfree(envp);
+ }
+
+ return ret_value;
+}
+
+
+/*
+ * Function: h5_dump_info_object
+ * Purpose: Display content of an MPI Info object
+ * Return: void
+ * Programmer: Albert Cheng 2002/05/21
+ * Modifications:
+ */
+void
+h5_dump_info_object(MPI_Info info)
+{
+ char key[MPI_MAX_INFO_KEY+1];
+ char value[MPI_MAX_INFO_VAL+1];
+ int flag;
+ int i, nkeys;
+
+ HDprintf("Dumping MPI Info Object (up to %d bytes per item):\n", MPI_MAX_INFO_VAL);
+ if (info==MPI_INFO_NULL){
+ HDprintf("object is MPI_INFO_NULL\n");
+ }
+ else {
+ MPI_Info_get_nkeys(info, &nkeys);
+ HDprintf("object has %d items\n", nkeys);
+ for (i=0; i<nkeys; i++){
+ MPI_Info_get_nthkey(info, i, key);
+ MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
+ HDprintf("%s=%s\n", key, value);
+ }
+
+ }
+}
+#endif /* STANDALONE */
+
diff --git a/tools/test/perform/sio_perf.h b/tools/test/perform/sio_perf.h
index 83caf54..ed4b13d 100644
--- a/tools/test/perform/sio_perf.h
+++ b/tools/test/perform/sio_perf.h
@@ -13,12 +13,14 @@
#ifndef SIO_PERF_H__
#define SIO_PERF_H__
-#include "io_timer.h"
#ifndef STANDALONE
+#include "io_timer.h"
#include "h5test.h"
#include "h5tools.h"
#include "h5tools_utils.h"
#else
+#undef H5_HAVE_PARALLEL
+#include "io_timer.h"
#include "sio_standalone.h"
#endif