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

Method ReceiveDataObject

Parallel/Core/vtkCommunicator.cxx:291–329  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

289
290//------------------------------------------------------------------------------
291vtkDataObject* vtkCommunicator::ReceiveDataObject(int remoteHandle, int tag)
292{
293 // If we are receiving with ANY_SOURCE, we have a problem because some
294 // versions of MPI might deliver the multiple data objects require out of
295 // order. To get around this, on the first message we receive the actual
296 // source and a mangled tag. We then receive the rest of the messages with
297 // the specific source and mangled tag, which we are guaranteed to receive in
298 // the correct order.
299 int header[2];
300 this->Receive(header, 2, remoteHandle, tag);
301 // Use the specific source and tag.
302 if (remoteHandle == vtkMultiProcessController::ANY_SOURCE)
303 {
304 remoteHandle = header[0];
305 }
306 tag = header[1];
307
308 int data_type = 0;
309 this->Receive(&data_type, 1, remoteHandle, tag);
310 if (data_type < 0)
311 {
312 // nullptr data object.
313 return nullptr;
314 }
315 // manufacture a data object of the proper type to fill
316 vtkDataObject* dObj = vtkDataObjectTypes::NewDataObject(data_type);
317 if (dObj != nullptr)
318 {
319 if (this->ReceiveDataObject(dObj, remoteHandle, tag, data_type) == 1)
320 {
321 return dObj;
322 }
323 }
324 if (dObj)
325 {
326 dObj->Delete();
327 }
328 return nullptr;
329}
330
331//------------------------------------------------------------------------------
332int vtkCommunicator::ReceiveDataObject(vtkDataObject* data, int remoteHandle, int tag, int dataType)

Callers 3

ReceiveMethod · 0.95
RequestDataMethod · 0.45
RequestDataMethod · 0.45

Calls 4

ReceiveMethod · 0.95
GetDataObjectTypeMethod · 0.80
DeleteMethod · 0.65

Tested by

no test coverage detected