MCPcopy Create free account
hub / github.com/Kitware/VTK / DoTransfer

Method DoTransfer

Filters/Parallel/vtkPKdTree.cxx:1136–1167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1134}
1135
1136void vtkPKdTree::DoTransfer(int from, int to, int fromIndex, int toIndex, int count)
1137{
1138 float *fromPt, *toPt;
1139
1140 vtkCommunicator* comm = this->Controller->GetCommunicator();
1141
1142 int nitems = count * 3;
1143
1144 int me = this->MyId;
1145
1146 int tag = this->SubGroup->tag;
1147
1148 if ((from == me) && (to == me))
1149 {
1150 fromPt = this->GetLocalVal(fromIndex);
1151 toPt = this->GetLocalValNext(toIndex);
1152
1153 memcpy(toPt, fromPt, nitems * sizeof(float));
1154 }
1155 else if (from == me)
1156 {
1157 fromPt = this->GetLocalVal(fromIndex);
1158
1159 comm->Send(fromPt, nitems, to, tag);
1160 }
1161 else if (to == me)
1162 {
1163 toPt = this->GetLocalValNext(toIndex);
1164
1165 comm->Receive(toPt, nitems, from, tag);
1166 }
1167}
1168
1169// Partition global array into three intervals, the first all values < T,
1170// the second all values = T, the third all values > T. Return two

Callers 1

PartitionSubArrayMethod · 0.95

Calls 5

GetLocalValMethod · 0.95
GetLocalValNextMethod · 0.95
GetCommunicatorMethod · 0.45
SendMethod · 0.45
ReceiveMethod · 0.45

Tested by

no test coverage detected