<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello,<br>
<br>
I would like to parallelize the vtk filter that I wrote using
OpenMP, and I just started learning OpenMP on a need basis. A part
of code is a <font face="Courier New, Courier, monospace">for</font>
loop over tuples of a <font face="Courier New, Courier, monospace">vtkDoubleArray</font>.
Each tuple is associated with a point on Data. The computation for
each point is totally independent and embarrassingly
parallelize-able. A short version of part of the code is<br>
<font face="Courier New, Courier, monospace"><br>
vtkDoubleArray *InputArray = ... // Get it from Input Data<br>
vtkDoubleArray *OutputArray = ... // Define new array</font><br>
<font face="Courier New, Courier, monospace"><br>
#pragma omp parallel for<br>
for(int PointId = 0; PointId <
InputArray->GetNumberOfTuples(); PointId++)<br>
{<br>
double InputValue = InputArray->GetTuple1(PointId);<br>
double OutputValue = DoSomething(InputValue,OtherParameters);<br>
OutputArray->SetTuple1(OutputValue);<br>
}</font><br>
<br>
However, I am getting the following error for <font face="Courier
New, Courier, monospace">GetTuple1()</font> method:<br>
<br>
<font face="Courier New, Courier, monospace">ERROR: In
/SomePath/paraview/ParaView-4.1.0-source/VTK/Common/Core/vtkDataArrayTemplate.txx,
line 598<br>
vtkDoubleArray (0x14bf6808): Unable to allocate 1 elements of size
8 bytes. </font><br>
<font face="Courier New, Courier, monospace"><br>
Aborted</font><br>
<br>
Could anyone help me to use OpenMP within my filter?<br>
<br>
Thank you,<br>
-Sia<br>
</body>
</html>