summaryrefslogtreecommitdiffstats
path: root/tools/h5ls
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-02-04 22:43:00 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-02-04 22:43:00 (GMT)
commit1b147875db41924cc04bd2cd577676b197ae34ab (patch)
treedad62fe010c89dfc1db13202aa24fe03d936c3fb /tools/h5ls
parentc238a6c13cdd0107fdf2c5ee0145a9b3d773fc92 (diff)
downloadhdf5-1b147875db41924cc04bd2cd577676b197ae34ab.zip
hdf5-1b147875db41924cc04bd2cd577676b197ae34ab.tar.gz
hdf5-1b147875db41924cc04bd2cd577676b197ae34ab.tar.bz2
[svn-r8151] Purpose:
Bug fix Description: Fix h5tools routines to not try to call MPI_Init() unless an MPI-based VFD is actually used. Platforms tested: FreeBSD 4.9 (sleipnir) w/parallel Linux 2.4 (verbena) w/parallel
Diffstat (limited to 'tools/h5ls')
-rw-r--r--tools/h5ls/h5ls.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index 9302ca8..447119e 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -1974,10 +1974,8 @@ get_width(void)
static void
leave(int ret)
{
- H5close();
-#ifdef H5_HAVE_PARALLEL
- MPI_Finalize();
-#endif
+ h5tools_close();
+
exit(ret);
}
@@ -1999,7 +1997,7 @@ leave(int ret)
*-------------------------------------------------------------------------
*/
int
-main (int argc, char *argv[])
+main (int argc, const char *argv[])
{
hid_t file=-1, root=-1;
char *fname=NULL, *oname=NULL, *x;
@@ -2013,10 +2011,6 @@ main (int argc, char *argv[])
char drivername[50];
char *preferred_driver=NULL;
-#ifdef H5_HAVE_PARALLEL
- MPI_Init(&argc, &argv);
-#endif
-
/* Initialize h5tools lib */
h5tools_init();
@@ -2198,7 +2192,7 @@ main (int argc, char *argv[])
file = -1;
while (fname && *fname) {
- file = h5tools_fopen(fname, preferred_driver, drivername, sizeof drivername);
+ file = h5tools_fopen(fname, preferred_driver, drivername, sizeof drivername, argc, argv);
if (file>=0) {
if (verbose_g) {
@@ -2244,11 +2238,5 @@ main (int argc, char *argv[])
}
H5Fclose(file);
}
- h5tools_close();
-
- H5close();
-#ifdef H5_HAVE_PARALLEL
- MPI_Finalize();
-#endif
- return 0;
+ leave(0);
}