aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Carpet/src/CallFunction.cc
diff options
context:
space:
mode:
authorThomas Radke <tradke@aei.mpg.de>2005-08-15 15:00:00 +0000
committerThomas Radke <tradke@aei.mpg.de>2005-08-15 15:00:00 +0000
commitb3405326ebf651b20b4c44423df62ef23a1bf8f2 (patch)
tree3f28fb7697589ff69ab3ac283cd0064dba340522 /Carpet/Carpet/src/CallFunction.cc
parent8493c61f465169c3d52b53b5023680a0d33f898c (diff)
Carpet*: generalise the comm_state class for collective buffer communications
CarpetLib's comm_state class (actually, it's still just a struct) has been extended to handle collective buffer communications for all possible C datatypes at the same time. This makes it unnecessary for the higher-level communication routines to loop over each individual datatype separately. darcs-hash:20050815150023-776a0-dddc1aca7ccaebae872f9f451b2c3595cd951fed.gz
Diffstat (limited to 'Carpet/Carpet/src/CallFunction.cc')
-rw-r--r--Carpet/Carpet/src/CallFunction.cc27
1 files changed, 5 insertions, 22 deletions
diff --git a/Carpet/Carpet/src/CallFunction.cc b/Carpet/Carpet/src/CallFunction.cc
index 87b909bc1..9b0e416d3 100644
--- a/Carpet/Carpet/src/CallFunction.cc
+++ b/Carpet/Carpet/src/CallFunction.cc
@@ -252,33 +252,16 @@ namespace Carpet {
// check if there is anything to do
if (attribute->n_SyncGroups <= 0) return;
- vector<group_set> groups;
-
- // sort all grid variables into sets of the same vartype
+ // remove all empty groups from the list
+ vector<int> groups;
for (int g = 0; g < attribute->n_SyncGroups; g++) {
- // skip empty groups
const int group = attribute->SyncGroups[g];
- if (CCTK_NumVarsInGroupI (group) <= 0) continue;
-
- group_set newset;
- const int firstvar = CCTK_FirstVarIndexI (group);
- newset.vartype = CCTK_VarTypeI (firstvar);
- assert (newset.vartype >= 0);
- int c;
- for (c = 0; c < groups.size(); c++) {
- if (newset.vartype == groups[c].vartype) {
- break;
- }
+ if (CCTK_NumVarsInGroupI (group) > 0) {
+ groups.push_back (group);
}
- if (c == groups.size()) {
- groups.push_back (newset);
- }
- groups[c].members.push_back (group);
}
- for (int c = 0; c < groups.size(); c++) {
- SyncProlongateGroups (cgh, groups[c]);
- }
+ SyncProlongateGroups (cgh, groups);
}
} // namespace Carpet