diff options
Diffstat (limited to 'src/WriteGF.c')
-rw-r--r-- | src/WriteGF.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/WriteGF.c b/src/WriteGF.c index 6f02c63..aa3a1d9 100644 --- a/src/WriteGF.c +++ b/src/WriteGF.c @@ -28,6 +28,7 @@ void IOBasic_WriteGF (cGH *GH, int index, const char *alias) { DECLARE_CCTK_PARAMETERS + int ierr; int i; ioGH *ioUtilGH; iobasicGH *myGH; @@ -92,7 +93,8 @@ void IOBasic_WriteGF (cGH *GH, int index, const char *alias) /* get the reduction handle from the reduction operator */ reduction_handle = CCTK_ReductionHandle (reductions [i].operator); - if (reduction_handle < 0) { + if (reduction_handle < 0) + { CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, "IOBasic_WriteGF: Invalid reduction operator '%s'", reductions [i].operator); @@ -100,11 +102,11 @@ void IOBasic_WriteGF (cGH *GH, int index, const char *alias) } /* do the reduction (all processors) */ - CCTK_Reduce (GH, 0, reduction_handle, 1, CCTK_VARIABLE_REAL, - &reduction_value, 1, index); + ierr = CCTK_Reduce (GH, 0, reduction_handle, 1, CCTK_VARIABLE_REAL, + &reduction_value, 1, index); /* dump the reduction value to file by processor 0 */ - if (CCTK_MyProc (GH) == 0) + if (ierr == 0 && CCTK_MyProc (GH) == 0) { /* build the filename */ |