summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-02-02 03:32:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-02-02 03:32:41 (GMT)
commit233319898db1bc7e8e28c150e55c9dcc7f068d82 (patch)
treed43f20aab2c9716e9756360ffc1adc2ea888ab71 /tools/lib
parent0ce42d9ed905b0d28c8afa1e33c67fb1cdaaab8b (diff)
downloadhdf5-233319898db1bc7e8e28c150e55c9dcc7f068d82.zip
hdf5-233319898db1bc7e8e28c150e55c9dcc7f068d82.tar.gz
hdf5-233319898db1bc7e8e28c150e55c9dcc7f068d82.tar.bz2
[svn-r8143] Purpose:
New Feature. (Contributed by Robb) Description: Allow h5ls to specify a VFL with the '--vfl=' command line flag. Add MPI-I/O & MPI-POSIX VFL drivers to list of drivers available for h5ls and h5dump. Platforms tested: FreeBSD 4.9 (sleipnir) w/parallel h5committested
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5tools.c40
-rw-r--r--tools/lib/h5tools.h4
2 files changed, 36 insertions, 8 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index d2be237..95d64e4 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -181,6 +181,10 @@ h5tools_fopen(const char *fname, const char *driver, char *drivername,
#ifdef H5_HAVE_STREAM
,{ "stream", FAIL }
#endif /* H5_HAVE_STREAM */
+#ifdef H5_HAVE_PARALLEL
+ ,{ "mpio", FAIL }
+ ,{ "mpiposix", FAIL }
+#endif /* H5_HAVE_PARALLEL */
};
/* This enum should match the entries in the above drivers_list since they
* are indexes into the drivers_list array. */
@@ -192,15 +196,17 @@ h5tools_fopen(const char *fname, const char *driver, char *drivername,
#ifdef H5_HAVE_STREAM
,STREAM_IDX
#endif /* H5_HAVE_STREAM */
+#ifdef H5_HAVE_PARALLEL
+ ,MPIO_IDX
+ ,MPIPOSIX_IDX
+#endif /* H5_HAVE_PARALLEL */
};
#define NUM_DRIVERS (sizeof(drivers_list) / sizeof(struct d_list))
static int initialized = 0;
register unsigned drivernum;
hid_t fid = FAIL;
-#ifndef VERSION12
hid_t fapl = H5P_DEFAULT;
-#endif /* !VERSION12 */
if (!initialized) {
/* Build a list of file access property lists which we should try
@@ -211,7 +217,6 @@ h5tools_fopen(const char *fname, const char *driver, char *drivername,
/* SEC2 Driver */
drivers_list[SEC2_IDX].fapl = H5P_DEFAULT;
-#ifndef VERSION12
/* FAMILY Driver */
drivers_list[FAMILY_IDX].fapl = fapl = H5Pcreate(H5P_FILE_ACCESS);
H5Pset_fapl_family(fapl, (hsize_t)0, H5P_DEFAULT);
@@ -229,7 +234,16 @@ h5tools_fopen(const char *fname, const char *driver, char *drivername,
drivers_list[STREAM_IDX].fapl = fapl = H5Pcreate(H5P_FILE_ACCESS);
H5Pset_fapl_stream(fapl, NULL);
#endif /* H5_HAVE_STREAM */
-#endif /* !VERSION12 */
+
+#ifdef H5_HAVE_PARALLEL
+ /* MPI-IO Driver */
+ drivers_list[MPIO_IDX].fapl = fapl = H5Pcreate(H5P_FILE_ACCESS);
+ H5Pset_fapl_mpio(fapl, MPI_COMM_WORLD, MPI_INFO_NULL);
+
+ /* MPI-POSIX Driver */
+ drivers_list[MPIPOSIX_IDX].fapl = fapl = H5Pcreate(H5P_FILE_ACCESS);
+ H5Pset_fapl_mpiposix(fapl, MPI_COMM_WORLD, TRUE);
+#endif /* H5_HAVE_PARALLEL */
}
if (driver && *driver) {
@@ -287,6 +301,24 @@ h5tools_fopen(const char *fname, const char *driver, char *drivername,
drivernum = STREAM_IDX;
#endif /* H5_HAVE_STREAM */
+#ifdef H5_HAVE_PARALLEL
+ } else if (!strcmp(driver, drivers_list[MPIO_IDX].name)) {
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(fname, H5F_ACC_RDONLY,
+ drivers_list[MPIO_IDX].fapl);
+ } H5E_END_TRY;
+ if (fid == FAIL)
+ goto done;
+ drivernum = MPIO_IDX;
+ } else if (!strcmp(driver, drivers_list[MPIPOSIX_IDX].name)) {
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(fname, H5F_ACC_RDONLY,
+ drivers_list[MPIO_IDX].fapl);
+ } H5E_END_TRY;
+ if (fid == FAIL)
+ goto done;
+ drivernum = MPIPOSIX_IDX;
+#endif /* H5_HAVE_PARALLEL */
} else {
goto done;
}
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index 96e2bd1..5ba9798 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -23,10 +23,6 @@
#include "hdf5.h"
-#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 2
-#define VERSION12
-#endif /* H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 2 */
-
#define ESCAPE_HTML 1
#define OPT(X,S) ((X) ? (X) : (S))
#define OPTIONAL_LINE_BREAK "\001" /* Special strings embedded in the output */