diff options
author | Leon Arber <larber@ncsa.uiuc.edu> | 2005-02-13 23:47:54 (GMT) |
---|---|---|
committer | Leon Arber <larber@ncsa.uiuc.edu> | 2005-02-13 23:47:54 (GMT) |
commit | e1ffee4e4e420cdeb276778c42a2a9612d79dcd5 (patch) | |
tree | 63223ce2a14ece000046e4cb739adcc29009e654 /tools | |
parent | 3eec63782bef2e16a6db3a9356542e15f2d0c9a2 (diff) | |
download | hdf5-e1ffee4e4e420cdeb276778c42a2a9612d79dcd5.zip hdf5-e1ffee4e4e420cdeb276778c42a2a9612d79dcd5.tar.gz hdf5-e1ffee4e4e420cdeb276778c42a2a9612d79dcd5.tar.bz2 |
[svn-r9998]
Purpose:
Bug fix
Description:
Fixed the error on copper where output would match, except the worker tasks are forcefuly terminated at the end.
Solution:
If an exit code other than 0 was returned, the
parallel environment would assume that there
was an error and would terminate all other
tasks. Because h5repack relies on the return
value of h5diff, it was necessary to return
values other than 0. Fixed by having parallel
runs of h5diff always return 0, whereas the
return value of serial runs is unchanged.
Platforms tested:
copper
Misc. update:
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5diff/h5diff_main.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 1c1823a..32061b7 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -22,7 +22,7 @@ static int check_n_input( const char* ); static int check_f_input( const char* ); void h5diff_exit(int status); #ifdef H5_HAVE_PARALLEL -static void ph5diff_worker( void ); +static void ph5diff_worker(int ); #endif /*------------------------------------------------------------------------- @@ -55,11 +55,11 @@ static void ph5diff_worker( void ); *------------------------------------------------------------------------- */ - int nID = 0; int main(int argc, const char *argv[]) { int i; + int nID = 0; const char *s = NULL; const char *fname1 = NULL; const char *fname2 = NULL; @@ -72,6 +72,7 @@ int main(int argc, const char *argv[]) #ifdef H5_HAVE_PARALLEL MPI_Status Status; outBuffOffset = 0; + #endif /* See what we were called as to determine whether to run serial or parallel version @@ -100,6 +101,12 @@ int main(int argc, const char *argv[]) else g_nTasks = 1; + if(g_Parallel && (g_nTasks == 1)) + { + printf("Need at least 2 tasks to run parallel diff\n"); + h5diff_exit(1); + } + /* Have the manager process the command-line */ if(nID == 0) { @@ -288,12 +295,15 @@ int main(int argc, const char *argv[]) ret= (nfound==0 ? 0 : 1 ); if (options.err_stat) ret=-1; - return ret; + if(g_Parallel) + return 0; + else + return ret; } #ifdef H5_HAVE_PARALLEL /* All other tasks become workers and wait for assignments. */ else - ph5diff_worker(); + ph5diff_worker(nID); #endif } @@ -315,13 +325,12 @@ int main(int argc, const char *argv[]) *------------------------------------------------------------------------- */ static void -ph5diff_worker(void) +ph5diff_worker(int nID) { struct diff_args args; hid_t file1_id, file2_id; char filenames[2][1024]; hsize_t nfound=0; - int nID; MPI_Status Status; MPI_Comm_rank(MPI_COMM_WORLD, &nID); |