[mpich-discuss] MPICH2 hangs during debug

Prashanth prashanth.dumpuri at gmail.com
Thu Dec 9 13:33:08 CST 2010


Jayesh,
    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.
   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++.

int main(  int argc, char * argv[] )
{

    MPI_Init(&argc,&argv);
    int rank, number_of_processors;
    MPI_Comm_size(MPI_COMM_WORLD,& number_of_processors);
    MPI_Comm_rank(MPI_COMM_WORLD,&rank);

    // read inputs on all processors
    // snipped for brevity

   // class1 - read the inputs and generate output1: need not be
parallelized
  vtkSmartPointer<vtkGetSignedClosestPointDistances>
ComputeSignedClosestPointDistances =


 vtkSmartPointer<vtkGetSignedClosestPointDistances>::New();
  if ( rank == 0 )
  {
           ComputeSignedClosestPointDistances->SetInput( inputs i just read
);
           ComputeSignedClosestPointDistances->Update();
  }
   // get output1 from class1
   vtkSmartPointer<vtkDoubleArray> signedclosestpointdistancesbefore =
vtkSmartPointer<vtkDoubleArray>::New();

signedclosestpointdistancesbefore->DeepCopy(
ComputeSignedClosestPointDistances->GetSignedClosestPointDistances() );

    // GetVoidPointer(0) returns the void pointer at 0th element
    // GetNumberOfTuples - size of the array
    MPI_Bcast( signedclosestpointdistancesbefore->GetVoidPointer(0),
signedclosestpointdistancesbefore->GetNumberOfTuples(), MPI_DOUBLE, 0,
                                                 MPI_COMM_WORLD );

   // code snipped for brevity

   MPI_Finalize();

    return 0;
}

Thanks again for all your help
Prashanth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20101209/8086e6c6/attachment.htm>


More information about the mpich-discuss mailing list