aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/InterpGridArrays.c45
1 files changed, 36 insertions, 9 deletions
diff --git a/src/InterpGridArrays.c b/src/InterpGridArrays.c
index 66f6ebb..23e851c 100644
--- a/src/InterpGridArrays.c
+++ b/src/InterpGridArrays.c
@@ -653,19 +653,14 @@ int PUGHInterp_InterpGridArrays (const cGH *GH,
free (bbox_interp_coords);
free (range_min);
+ /* flag an error condition on this processor's error code in the
+ N_points_from[] array which then gets communicated to all processors */
if (retval)
{
- if (myGH->whichproc)
+ for (proc = 0; proc < pughGH->nprocs; proc++)
{
- free (myGH->whichproc);
- myGH->whichproc = NULL;
+ myGH->N_points_from[proc] = retval;
}
- free (origin_local);
- free (input_arrays);
- free (input_array_dims);
- free (type_desc);
-
- return (retval);
}
/* Now we want to resolve the N_points_from[]. Currently this is
@@ -693,6 +688,38 @@ int PUGHInterp_InterpGridArrays (const cGH *GH,
}
#endif
+ /* check if there was an error condition on a remote processor
+ different processors may flag different error codes - the first one wins */
+ for (proc = 0; proc < pughGH->nprocs; proc++)
+ {
+ if (myGH->N_points_to[proc] < 0)
+ {
+ retval = myGH->N_points_to[proc];
+ break;
+ }
+ }
+ /* collectively return in case of an error */
+ if (retval)
+ {
+ if (myGH->whichproc)
+ {
+ free (myGH->whichproc);
+ myGH->whichproc = NULL;
+ }
+ free (origin_local);
+ free (input_arrays);
+ free (input_array_dims);
+ free (type_desc);
+
+ /* store this processor's interpolator status in the parameter table */
+ if (param_table_handle >= 0)
+ {
+ Util_TableSetInt (param_table_handle, myGH->N_points_to[pughGH->myproc],
+ "local_interpolator_status");
+ }
+ return (retval);
+ }
+
/* Great. Now we know how many to expect from each processor,
and how many to send to each processor. So first we have
to send the locations to the processors which hold our data.