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

Function Process1

Parallel/MPI/Testing/Cxx/TestGenericCommunicator.cxx:183–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183void Process1(vtkMultiProcessController* contr, void* arg)
184{
185 GenericCommunicatorArgs_tmp* args = reinterpret_cast<GenericCommunicatorArgs_tmp*>(arg);
186
187 vtkCommunicator* comm = contr->GetCommunicator();
188
189 int i;
190
191 // Test sending all supported types of arrays
192 int datai[scMsgLength];
193 for (i = 0; i < scMsgLength; i++)
194 {
195 datai[i] = i;
196 }
197 vtkIntArray* ia = vtkIntArray::New();
198 ia->SetArray(datai, 10, 1);
199 if (!comm->Send(ia, 1, 11))
200 {
201 std::cerr << "Client error: Error sending data." << std::endl;
202 *(args->retVal) = 0;
203 }
204 ia->Delete();
205
206 unsigned long dataul[scMsgLength];
207 for (i = 0; i < scMsgLength; i++)
208 {
209 dataul[i] = static_cast<unsigned long>(i);
210 }
211 vtkUnsignedLongArray* ula = vtkUnsignedLongArray::New();
212 ula->SetArray(dataul, 10, 1);
213 if (!comm->Send(ula, 1, 22))
214 {
215 std::cerr << "Client error: Error sending data." << std::endl;
216 *(args->retVal) = 0;
217 }
218 ula->Delete();
219
220 char datac[scMsgLength];
221 for (i = 0; i < scMsgLength; i++)
222 {
223 datac[i] = static_cast<char>(i);
224 }
225 vtkCharArray* ca = vtkCharArray::New();
226 ca->SetArray(datac, 10, 1);
227 if (!comm->Send(ca, 1, 33))
228 {
229 std::cerr << "Client error: Error sending data." << std::endl;
230 *(args->retVal) = 0;
231 }
232 ca->Delete();
233
234 unsigned char datauc[scMsgLength];
235 for (i = 0; i < scMsgLength; i++)
236 {
237 datauc[i] = static_cast<unsigned char>(i);
238 }
239 vtkUnsignedCharArray* uca = vtkUnsignedCharArray::New();
240 uca->SetArray(datauc, 10, 1);

Callers

nothing calls this directly

Calls 11

DeleteMethod · 0.65
NewFunction · 0.50
GetCommunicatorMethod · 0.45
SetArrayMethod · 0.45
SendMethod · 0.45
UpdateMethod · 0.45
GatherMethod · 0.45
GetOutputDataObjectMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45
ReceiveMethod · 0.45

Tested by

no test coverage detected