What should I use?

Even the statement right after MPI_Sent doesn't execute. My code has something like this:
//////////////////////in the root process
 while(i<iWorldSize)
   {
cout << "executing send for the " << i << "th time" <<  endl;
  MPI_Send( A[i], n/iWorldSize * m, MPI_INT, i, itag, MPI_COMM_WORLD );
  sent++;
  cout << "executed send for the " << i << "th time, sending " <<
        n/iWorldSize * m << " bytes to processor " << i << endl;
  
  i+=n/iWorldSize;
  }//end while


////////////////////in the slave process    
      while(sent)
      {
 cout << "**********sent= " << sent << endl;
 cout << "\n\n\n**********Executing receive*******" << endl;
 MPI_Recv(&buffer, n/iWorldSize*m, MPI_INT, 0, itag, MPI_COMM_WORLD, &status);
 sent=0;
 cout << "**********receive executed***********" << endl;
  }


On Mon, Dec 2, 2013 at 5:21 PM, Pavan Balaji <balaji@mcs.anl.gov> wrote:

Did you try printing how many bytes you are receiving before calling MPI_Recv?

  — Pavan

On Dec 1, 2013, at 11:43 PM, Soheil Hooshdaran <shooshdaran577@gmail.com> wrote:

> Hello. Please tell me what is wrong with my program that it doesn't goes no further than  executing MPI_Send() for the first time.
> The file is attached
>
>
> On Sat, Nov 30, 2013 at 7:02 PM, Soheil Hooshdaran <shooshdaran577@gmail.com> wrote:
> So what do I have to do now, sir? Especially regarding my Bcast()s a,d Recv()s
>
>
> On Sat, Nov 30, 2013 at 1:05 AM, Pavan Balaji <balaji@mcs.anl.gov> wrote:
>
> Please keep discuss@mpich.org cc’ed.
>
> On Nov 29, 2013, at 2:19 PM, Soheil Hooshdaran <shooshdaran577@gmail.com> wrote:
> > executing send for the 3th time
> > executed send for the 3th time, sending 40 bytes
> > Fatal error in MPI_Recv: Message truncated, error stack:
> > MPI_Recv(184).....................: MPI_Recv(buf=0xbff95c98, count=0, MPI_INT, src=0, tag=1, MPI_COMM_WORLD, status=0xbff95c70) failed
> > MPIDI_CH3U_Receive_data_found(131): Message from rank 0 and tag 1 truncated; 160 bytes received but buffer size is 0
>
> I don’t think I can explain the error any better than what the message above already says.
>
> --
> Pavan Balaji
> http://www.mcs.anl.gov/~balaji
>
>
> <p1_Hooshdaran_static[debug].cpp>