Skip to content
Snippets Groups Projects
Commit b059e455 authored by David Gobbi's avatar David Gobbi Committed by Lucas Givord
Browse files

Set MaxId of all output arrays before threading

When vtkDataSetAttributes::CopyData() inserts a tuple, it will
adjust MaxId if MaxId is less than the tuple index.  We must
ensure this doesn't happen when multithreading, or the threads
will fight over MaxId.

(cherry picked from commit a180e106)
parent 96f43795
No related branches found
No related tags found
No related merge requests found
......@@ -168,6 +168,11 @@ int vtkPolyDataTangents::RequestData(vtkInformation* vtkNotUsed(request),
cellTangents->SetNumberOfTuples(outNumCell);
outCD->CopyAllocate(inCD, outNumCell);
// Threads will fight over array MaxId unless we set it beforehand
for (int i = 0; i < outCD->GetNumberOfArrays(); ++i)
{
outCD->GetArray(i)->SetNumberOfTuples(outNumCell);
}
TangentComputation functor(numVerts, inPts, inPolys, tcoords, cellTangents, inCD, outCD, this);
vtkSMPTools::For(0, numVerts + numPolys, functor);
......
......@@ -1525,6 +1525,11 @@ struct TracerIntegrator
vtkPointData* threadPD = this->LocalThreadOutput.begin()->OutputPD;
vtkPointData* outputPD = this->Output->GetPointData();
outputPD->CopyAllocate(threadPD, numPts);
// Threads will fight over array MaxId unless we set it beforehand
for (int i = 0; i < outputPD->GetNumberOfArrays(); ++i)
{
outputPD->GetArray(i)->SetNumberOfTuples(numPts);
}
// Allocate streamer cell data: seed ids and streamer termination return
// values. Only add this information if the number of output cells
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment