<div>Jayesh,</div><div> Thanks for the immediate response. The example MPI application ran fine in the Debug mode. MPI_BCast did not hang for the example application. To answer your question as to why i'm reading the same file from all MPI processes, I couldn't figure out how to use MPI_Byte(s) / MPI_Send() to send data from root node to all the child nodes. Once I figure that out I'll ask my code to read the data on the root node and then broadcast it to child nodes.</div>
<div> I'm not sure if can attach documents to this mailing list and hence 'am just pasting the snippet of my code containing the MPI call. If you need the entire code, please let me know how to send it to you and i'll send it to you. The code hangs at the MPI_BCast command in the Debug mode. FYI, I'm using another toolkit VTK - visualization toolkit - to format my data. Output1 from class1 is in the vtk data format and translates to a double array in C++.</div>
<div><br></div><div>int main( int argc, char * argv[] )</div><div>{</div><div><br></div><div> MPI_Init(&argc,&argv);</div><div> int rank, number_of_processors;</div><div> MPI_Comm_size(MPI_COMM_WORLD,& number_of_processors);</div>
<div> MPI_Comm_rank(MPI_COMM_WORLD,&rank);</div><div><br></div><div> // read inputs on all processors</div><div> // snipped for brevity</div><div><br></div><div> // class1 - read the inputs and generate output1: need not be parallelized</div>
<div> vtkSmartPointer<vtkGetSignedClosestPointDistances> ComputeSignedClosestPointDistances = </div><div> vtkSmartPointer<vtkGetSignedClosestPointDistances>::New();</div>
<div> if ( rank == 0 )</div><div> { </div><div> ComputeSignedClosestPointDistances->SetInput( inputs i just read );</div><div> ComputeSignedClosestPointDistances->Update();</div><div> }</div>
<div> // get output1 from class1 </div><div> vtkSmartPointer<vtkDoubleArray> signedclosestpointdistancesbefore = vtkSmartPointer<vtkDoubleArray>::New();<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><div> signedclosestpointdistancesbefore->DeepCopy( ComputeSignedClosestPointDistances->GetSignedClosestPointDistances() );</div><div> </div><div> // GetVoidPointer(0) returns the void pointer at 0th element</div>
<div> // GetNumberOfTuples - size of the array </div><div> MPI_Bcast( signedclosestpointdistancesbefore->GetVoidPointer(0), signedclosestpointdistancesbefore->GetNumberOfTuples(), MPI_DOUBLE, 0, MPI_COMM_WORLD );</div>
</div><div><br></div><div> // code snipped for brevity</div><div><br></div><div> MPI_Finalize();</div><div><br></div><div> return 0;</div><div>}</div><div><br></div><div>Thanks again for all your help</div><div>Prashanth</div>
<div><br></div>