summaryrefslogtreecommitdiffstats
path: root/tools/h5diff
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2011-08-08 21:59:09 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2011-08-08 21:59:09 (GMT)
commitdd7693bde03b81f05dbde5a7e6c866951326946f (patch)
tree73a6106ceaa51ca1b7c88c9b9749082678ab5d6f /tools/h5diff
parent13beaa1a6fa80a2d1f4aab42f9c5e1740853bbf0 (diff)
downloadhdf5-dd7693bde03b81f05dbde5a7e6c866951326946f.zip
hdf5-dd7693bde03b81f05dbde5a7e6c866951326946f.tar.gz
hdf5-dd7693bde03b81f05dbde5a7e6c866951326946f.tar.bz2
[svn-r21195] Correct windows exports for h5diff.
Diffstat (limited to 'tools/h5diff')
-rw-r--r--tools/h5diff/CMakeLists.txt65
-rw-r--r--tools/h5diff/h5diff_common.c48
-rw-r--r--tools/h5diff/h5diff_common.h3
-rw-r--r--tools/h5diff/h5diff_main.c22
-rw-r--r--tools/h5diff/ph5diff_main.c29
5 files changed, 110 insertions, 57 deletions
diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt
index f0e0695..4cc140a 100644
--- a/tools/h5diff/CMakeLists.txt
+++ b/tools/h5diff/CMakeLists.txt
@@ -19,6 +19,15 @@ TARGET_LINK_LIBRARIES (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
SET (H5_DEP_EXECUTABLES h5diff)
+IF (H5_HAVE_PARALLEL)
+ ADD_EXECUTABLE (ph5diff
+ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c
+ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/ph5diff_main.c
+ )
+ TARGET_NAMING (ph5diff ${LIB_TYPE})
+ TARGET_LINK_LIBRARIES (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ENDIF (H5_HAVE_PARALLEL)
+
##############################################################################
##############################################################################
### T E S T I N G ###
@@ -351,8 +360,38 @@ IF (BUILD_TESTING)
)
SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-clear-${resultfile}-objects")
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
+ IF (H5_HAVE_PARALLEL)
+ ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN})
+ ENDIF (H5_HAVE_PARALLEL)
ENDMACRO (ADD_H5_TEST file)
+ MACRO (ADD_PH5_TEST resultfile resultcode)
+ # If using memchecker add tests without using scripts
+ IF (HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (NAME PH5DIFF-${resultfile} COMMAND $<TARGET_FILE:ph5diff> ${ARGN})
+ IF (NOT ${resultcode} STREQUAL "0")
+ SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true")
+ ENDIF (NOT ${resultcode} STREQUAL "0")
+ ELSE (HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (
+ NAME PH5DIFF-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:ph5diff>"
+ -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.txt"
+ -D "TEST_APPEND=EXIT CODE:"
+ -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ )
+ ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
+ IF (NOT "${last_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
+ ENDIF (NOT "${last_test}" STREQUAL "")
+ SET (last_test "PH5DIFF-${resultfile}")
+ ENDMACRO (ADD_PH5_TEST file)
+
##############################################################################
##############################################################################
### T H E T E S T S ###
@@ -774,7 +813,6 @@ ADD_H5_TEST (h5diff_18 1 -q ${FILE1} ${FILE2})
# 1.8 -v and -q
ADD_H5_TEST (h5diff_18_1 2 -v -q ${FILE1} ${FILE2})
-
# ##############################################################################
# # not comparable types
# ##############################################################################
@@ -810,8 +848,6 @@ ADD_H5_TEST (h5diff_27 1 -v ${FILE3} ${FILE3} t1 t2)
# 2.8
ADD_H5_TEST (h5diff_28 1 -v ${FILE3} ${FILE3} l1 l2)
-
-
# ##############################################################################
# # Dataset datatypes
# ##############################################################################
@@ -847,19 +883,16 @@ ADD_H5_TEST (h5diff_58 1 -v ${FILE7} ${FILE8} refreg)
# # Error messages
# ##############################################################################
-
# 6.0: Check if the command line number of arguments is less than 3
ADD_H5_TEST (h5diff_600 1 ${FILE1})
# 6.1: Check if non-exist object name is specified
ADD_H5_TEST (h5diff_601 2 ${FILE1} ${FILE1} nono_obj)
-
# ##############################################################################
# # -d
# ##############################################################################
-
# 6.3: negative value
ADD_H5_TEST (h5diff_603 1 -d -4 ${FILE1} ${FILE2} g1/dset3 g1/dset4)
@@ -912,7 +945,6 @@ ADD_H5_TEST (h5diff_618 0 -p 2 ${FILE1} ${FILE2} g1/dset3 g1/dset4)
# 6.19: number smaller than smallest difference
ADD_H5_TEST (h5diff_619 1 -p 0.005 ${FILE1} ${FILE2} g1/dset3 g1/dset4)
-
# ##############################################################################
# # -n
# ##############################################################################
@@ -979,8 +1011,6 @@ ADD_H5_TEST (h5diff_709 0 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_F
# file vs file
ADD_H5_TEST (h5diff_710 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2})
-
-
# ##############################################################################
# 8. all dataset datatypes
# ##############################################################################
@@ -1023,7 +1053,6 @@ ADD_H5_TEST (h5diff_204 0 -c ${FILE2} ${FILE2} g2/dset4 g2/dset5)
ADD_H5_TEST (h5diff_205 0 -c ${FILE2} ${FILE2} g2/dset5 g2/dset6)
-
# not comparable in compound
ADD_H5_TEST (h5diff_206 0 -c ${FILE2} ${FILE2} g2/dset7 g2/dset8)
@@ -1119,7 +1148,6 @@ ADD_H5_TEST (h5diff_424 1 --follow-symlinks -v ${FILE18} ${FILE17} /dset2 /ext_l
# extlink_to_softlink_to_dset1 vs extlink_to_softlink_to_dset2"
ADD_H5_TEST (h5diff_425 1 --follow-symlinks -v ${FILE17} ${FILE17} /ext_link_to_slink1 /ext_link_to_slink2)
-
# ##############################################################################
# # Dangling links compare (--follow-symlinks and --no-dangling-links)
# ##############################################################################
@@ -1201,7 +1229,6 @@ ADD_H5_TEST (h5diff_516 0 -v --follow-symlinks ${GRP_RECURSE1_EXT} ${GRP_RECURSE
ADD_H5_TEST (h5diff_517 1 -v ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1} /g1)
ADD_H5_TEST (h5diff_518 0 -v --follow-symlinks ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1} /g1)
-
# ##############################################################################
# # Exclude path (--exclude-path)
# ##############################################################################
@@ -1241,8 +1268,7 @@ ADD_H5_TEST (h5diff_643 1 -v -d 5 --use-system-epsilon ${FILE1} ${FILE2} /g1/dse
ADD_H5_TEST (h5diff_644 1 -v --use-system-epsilon -d 5 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4)
ADD_H5_TEST (h5diff_645 1 -v -p 0.05 --use-system-epsilon ${FILE1} ${FILE2} /g1/dset3 /g1/dset4)
ADD_H5_TEST (h5diff_646 1 -v --use-system-epsilon -p 0.05 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4)
-
-
+
ENDIF (BUILD_TESTING)
##############################################################################
@@ -1262,3 +1288,14 @@ INSTALL (
COMPONENT
toolsapplications
)
+
+IF (H5_HAVE_PARALLEL)
+ INSTALL (
+ TARGETS
+ ph5diff
+ RUNTIME DESTINATION
+ ${HDF5_INSTALL_BIN_DIR}/tools
+ COMPONENT
+ toolsapplications
+ )
+ENDIF (H5_HAVE_PARALLEL)
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c
index 141e81d..3427fbc 100644
--- a/tools/h5diff/h5diff_common.c
+++ b/tools/h5diff/h5diff_common.c
@@ -129,27 +129,27 @@ void parse_command_line(int argc,
* short opt
*/
if (!strcmp (argv[i], "-v")) /* no arg */
- {
+ {
opt_ind--;
options->m_verbose_level = 0;
break;
- }
+ }
else if (!strncmp (argv[i], "-v", 2))
- {
+ {
options->m_verbose_level = atoi(&argv[i][2]);
break;
- }
+ }
/*
* long opt
*/
if (!strcmp (argv[i], "--verbose")) /* no arg */
- {
+ {
options->m_verbose_level = 0;
break;
- }
- else if ( !strncmp (argv[i], "--verbose", 9) && argv[i][9]=='=')
- {
+ }
+ else if ( !strncmp (argv[i], "--verbose", 9) && argv[i][9]=='=')
+ {
options->m_verbose_level = atoi(&argv[i][10]);
break;
}
@@ -592,35 +592,3 @@ void usage(void)
printf(" '/g1/dset1' and '/g1/dset2' in the same file\n");
printf("\n");
}
-
-
-/*-------------------------------------------------------------------------
- * Function: h5diff_exit
- *
- * Purpose: dismiss phdiff worker processes and exit
- *
- * Return: none
- *
- * Programmer: Albert Cheng
- * Date: Feb 6, 2005
- *
- * Comments:
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-void h5diff_exit(int status)
-{
-#ifdef H5_HAVE_PARALLEL
- /* if in parallel mode, dismiss workers, close down MPI, then exit */
- if((g_nTasks > 1) && g_Parallel) {
- phdiff_dismiss_workers();
- MPI_Barrier(MPI_COMM_WORLD);
- }
- if(g_Parallel)
- MPI_Finalize();
-#endif
- exit(status);
-}
-
diff --git a/tools/h5diff/h5diff_common.h b/tools/h5diff/h5diff_common.h
index c4035a6..5b1317f 100644
--- a/tools/h5diff/h5diff_common.h
+++ b/tools/h5diff/h5diff_common.h
@@ -24,9 +24,6 @@
extern "C" {
#endif
-H5TOOLS_DLLVAR unsigned char g_Parallel;
-H5TOOLS_DLLVAR int g_nTasks;
-
void usage(void);
void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* options);
void h5diff_exit(int status);
diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c
index 824c529..a014a9e 100644
--- a/tools/h5diff/h5diff_main.c
+++ b/tools/h5diff/h5diff_main.c
@@ -15,6 +15,7 @@
#include <stdlib.h>
#include <assert.h>
+#include <memory.h>
#include "h5diff.h"
#include "h5diff_common.h"
#include "h5tools_utils.h"
@@ -116,3 +117,24 @@ out:
return ret;
}
+/*-------------------------------------------------------------------------
+ * Function: h5diff_exit
+ *
+ * Purpose: dismiss phdiff worker processes and exit
+ *
+ * Return: none
+ *
+ * Programmer: Albert Cheng
+ * Date: Feb 6, 2005
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+void h5diff_exit(int status)
+{
+ exit(status);
+}
+
diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c
index 871b93b..67b0c92 100644
--- a/tools/h5diff/ph5diff_main.c
+++ b/tools/h5diff/ph5diff_main.c
@@ -245,3 +245,32 @@ ph5diff_worker(int nID)
}
}
+/*-------------------------------------------------------------------------
+ * Function: h5diff_exit
+ *
+ * Purpose: dismiss phdiff worker processes and exit
+ *
+ * Return: none
+ *
+ * Programmer: Albert Cheng
+ * Date: Feb 6, 2005
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+void h5diff_exit(int status)
+{
+ /* if in parallel mode, dismiss workers, close down MPI, then exit */
+ if((g_nTasks > 1) && g_Parallel) {
+ phdiff_dismiss_workers();
+ MPI_Barrier(MPI_COMM_WORLD);
+ }
+ if(g_Parallel)
+ MPI_Finalize();
+
+ exit(status);
+}
+