aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@b61c5cb5-eaca-4651-9a7a-d64986f99364>2004-03-09 20:36:11 +0000
committerschnetter <schnetter@b61c5cb5-eaca-4651-9a7a-d64986f99364>2004-03-09 20:36:11 +0000
commit6bfc7e019454cf7f372271ec0295714f3c947edc (patch)
tree2fe0cb50bc442583778d4867d14cafaa3a35f08d
parent8fa7b878422c5936603b618b560f7a7b31e89219 (diff)
Check for invalid arguments in PUGH_SyncGArrayGroup and abort on
error. Do not synchronise groups without storage when running on a single processor. (This happens only for periodic boundaries.) git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@432 b61c5cb5-eaca-4651-9a7a-d64986f99364
-rw-r--r--src/Comm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Comm.c b/src/Comm.c
index de81a2a..b601982 100644
--- a/src/Comm.c
+++ b/src/Comm.c
@@ -80,6 +80,10 @@ int PUGH_SyncGroup(const cGH *GH, const char *groupname)
"PUGH_SyncGroup: Unknown group: %s", groupname);
retval = -1;
}
+ else if (CCTK_NumVarsInGroupI(group) == 0)
+ {
+ /* do nothing */
+ }
else
{
CCTK_GroupData(group, &pgroup);
@@ -295,6 +299,8 @@ static int PUGH_SyncGArrayGroup(pGH *pughGH, int first_var)
pGA *firstGA;
+ if (first_var<0 || first_var>=CCTK_NumVars()) CCTK_WARN (0, "internal error");
+
firstGA = (pGA *) pughGH->variables [first_var][0];
#ifdef DEBUG_PUGH
@@ -971,6 +977,14 @@ static int PUGH_SyncSingleProc(pGH *pughGH, pComm *comm)
GA = (pGA *) pughGH->variables [comm->first_var][comm->sync_timelevel];
+ /* return if no storage assigned */
+ if (! GA->storage)
+ {
+ CCTK_VWarn(2, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Trying to synchronize variable '%s' with no storage", GA->name);
+ return;
+ }
+
/* since we need to iterators here we need to allocate one */
iterator_from = GA->extras->iterator;
iterator_to = (int *) malloc (GA->extras->dim * sizeof (int));