Commit f8d20c74 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by David C. Lonie

Fix issues with collaboration tests.

vtkPVDataDeliveryManager only needs to use the information about known
representations, and not necessarily ports since that info is no longer
available until a representation executes, which need not be similar on
all clients e.g. is the master changes active representation type and
a slave joins after this change, it will now know of the old
representation (e.g. pvcs-collab.VariableSelection1 test).

Fixed that.
parent d3ef2796
......@@ -512,6 +512,8 @@ void vtkPVDataDeliveryManager::Deliver(int use_lod, unsigned int size, unsigned
vtkDataObject* data = item ? item->GetDataObject() : NULL;
if (!data)
{
// ideally, we want to sync this info between all ranks some other rank
// doesn't deadlock (esp. in collaboration mode).
continue;
}
......@@ -799,13 +801,17 @@ void vtkPVDataDeliveryManager::PrintSelf(ostream& os, vtkIndent indent)
//----------------------------------------------------------------------------
int vtkPVDataDeliveryManager::GetSynchronizationMagicNumber()
{
// The synchronization magic number is used to ensure that both the server and
// the client know of have identical representations, because if they don't,
// there may be a mismatch between the states of the two processes and it's
// best to skip delivery to avoid deadlocks.
const int prime = 31;
int result = 1;
result = prime * result + static_cast<int>(this->Internals->ItemsMap.size());
vtkInternals::ItemsMapType::iterator iter = this->Internals->ItemsMap.begin();
for (; iter != this->Internals->ItemsMap.end(); iter++)
result = prime * result + static_cast<int>(this->Internals->RepresentationsMap.size());
for (auto iter = this->Internals->RepresentationsMap.begin();
iter != this->Internals->RepresentationsMap.end(); ++iter)
{
result = prime * result + static_cast<int>(iter->first.first) + iter->first.second;
result = prime * result + static_cast<int>(iter->first);
}
return result;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment