summaryrefslogtreecommitdiffstats
path: root/tools/h5diff
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5diff')
-rw-r--r--tools/h5diff/h5diff_common.c62
-rw-r--r--tools/h5diff/h5diff_common.h3
-rw-r--r--tools/h5diff/ph5diff_main.c13
3 files changed, 37 insertions, 41 deletions
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c
index 48bcedb..5387f2a 100644
--- a/tools/h5diff/h5diff_common.c
+++ b/tools/h5diff/h5diff_common.c
@@ -17,9 +17,6 @@
#include "h5diff.h"
#include "h5diff_common.h"
-extern int g_Parallel;
-extern int g_nTasks;
-
/*-------------------------------------------------------------------------
* Function: parse_input
*
@@ -185,36 +182,35 @@ void parse_input(int argc, const char* argv[], const char** fname1, const char**
void print_results(hsize_t nfound, diff_opt_t* options)
{
-/*-------------------------------------------------------------------------
- * print how many differences were found
- *-------------------------------------------------------------------------
- */
- if (!options->m_quiet)
- {
- printf("----------------------------------------------------\n");
- printf("Summary\n");
- printf("----------------------------------------------------\n");
-
- if (options->cmn_objs==0 && !options->err_stat)
- {
- printf("No common objects found. Files are not comparable.\n");
- if (!options->m_verbose)
- printf("Use -v for a list of objects.\n");
- }
- else
- {
- /* no errors found */
- if (!options->err_stat)
- {
- /* objects were not compared */
- if (options->not_cmp==1)
- printf("Some objects are not comparable\n");
- else
- /* objects were compared, print the number of differences */
- print_found(nfound);
- }
- }
- }
+ /*-------------------------------------------------------------------------
+ * print how many differences were found
+ *-------------------------------------------------------------------------
+ */
+ if (!options->m_quiet)
+ {
+ printf("----------------------------------------------------\n");
+ printf("Summary\n");
+ printf("----------------------------------------------------\n");
+ if (options->cmn_objs==0 && !options->err_stat)
+ {
+ printf("No common objects found. Files are not comparable.\n");
+ if (!options->m_verbose)
+ printf("Use -v for a list of objects.\n");
+ }
+ else
+ {
+ /* no errors found */
+ if (!options->err_stat)
+ {
+ /* objects were not compared */
+ if (options->not_cmp==1)
+ printf("Some objects are not comparable\n");
+ else
+ /* objects were compared, print the number of differences */
+ print_found(nfound);
+ }
+ }
+ }
}
/*-------------------------------------------------------------------------
diff --git a/tools/h5diff/h5diff_common.h b/tools/h5diff/h5diff_common.h
index 3a6f01d..728b022 100644
--- a/tools/h5diff/h5diff_common.h
+++ b/tools/h5diff/h5diff_common.h
@@ -1,3 +1,6 @@
+extern unsigned char g_Parallel;
+extern int g_nTasks;
+
void usage(void);
int check_n_input( const char* );
int check_f_input( const char* );
diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c
index 082a6bd..3b6267d 100644
--- a/tools/h5diff/ph5diff_main.c
+++ b/tools/h5diff/ph5diff_main.c
@@ -131,6 +131,7 @@ ph5diff_worker(int nID)
char filenames[2][1024];
char out_data[PRINT_DATA_MAX_SIZE] = {0};
hsize_t nfound=0;
+ struct diffs_found diffs;
int i;
MPI_Status Status;
@@ -169,6 +170,8 @@ ph5diff_worker(int nID)
MPI_Recv(&args, sizeof(struct diff_args), MPI_BYTE, 0, MPI_TAG_ARGS, MPI_COMM_WORLD, &Status);
/*Do the diff */
nfound = diff(file1_id, args.name, file2_id, args.name, &(args.options), args.type);
+ diffs.nfound = nfound;
+ diffs.not_cmp = args.options.not_cmp;
/*If print buffer has something in it, request print token.*/
if(outBuffOffset>0)
@@ -213,16 +216,10 @@ ph5diff_worker(int nID)
memset(outBuff, 0, OUTBUFF_SIZE);
outBuffOffset = 0;
- /* Since the data type of diff value is hsize_t which can
- * be arbitary large such that there is no MPI type that
- * matches it, the value is passed between processes as
- * an array of bytes in order to be portable. But this
- * may not work in non-homogeneous MPI environments.
- */
- MPI_Send(&nfound, sizeof(nfound), MPI_BYTE, 0, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD);
+ MPI_Send(&diffs, sizeof(diffs), MPI_BYTE, 0, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD);
}
else
- MPI_Send(&nfound, sizeof(nfound), MPI_BYTE, 0, MPI_TAG_DONE, MPI_COMM_WORLD);
+ MPI_Send(&diffs, sizeof(diffs), MPI_BYTE, 0, MPI_TAG_DONE, MPI_COMM_WORLD);
}
else if(Status.MPI_TAG == MPI_TAG_END)
{