diff options
-rw-r--r-- | src/Comm.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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)); |