title: For some reason MPI_Waitall gets stuck (in a deadlock I believe) when I test my program with big numbers
body: <p>For some reason MPI_Waitall is waiting forever when I enter 10000 as the length for the sequence. Basically I create 4 lists of length n/4 where in this case n is 10000 and I an using non-blocking send so my process 0 does not wait for each list to be sent separately as they do not share any values so they are not overwritten.
  Keep in mind that the program works with smaller numbers like 1000 or 100 but I am not sure why it does not work with 10000+.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>#include "ore_header.h"
  
  int main(int argc, char** argv) {
  
      srand(time(NULL));
  
      int     my_rank, p;
      void    generate_sequence(int *arr, int n);
      int     subsequence_check(int *arr,int n, int m);
  
  
      MPI_Init(&amp;argc, &amp;argv);
      MPI_Comm_size(MPI_COMM_WORLD, &amp;p);
      MPI_Comm_rank(MPI_COMM_WORLD, &amp;my_rank);
      int     total;
      int     length;
      int     flag;
      int     seq_length;
      MPI_Status      stats[p];
      MPI_Request     reqs[p];
      int     p_length=0;
      int     *buf[p];
      if (my_rank == 0) {
          printf("Enter length and sequence length\n");
          scanf("%d %d",&amp;length, &amp;seq_length);
          p_length = length / p;
          for (int i = 0; i &lt; p; i++) {
              buf[i] = (int*)malloc(p_length*sizeof(int));
              generate_sequence(buf[i], p_length);
              MPI_Isend(buf[i], p_length, MPI_INT, i, 0, MPI_COMM_WORLD, &amp;reqs[i]);
              printf("Data sent to process %d\n", i);
          }
          MPI_Waitall(p, reqs, stats); //Program wont go past this line 
          printf("\n\n Data sent to all processes \n\n");
      }
  
      MPI_Bcast(&amp;p_length, 1, MPI_INT, 0, MPI_COMM_WORLD);
      MPI_Bcast(&amp;seq_length, 1, MPI_INT, 0, MPI_COMM_WORLD);
  
      buf[my_rank] = (int*)malloc(p_length*sizeof(int));
  
      MPI_Recv(buf[my_rank], p_length, MPI_INT, 0, 0, MPI_COMM_WORLD, &amp;stats[my_rank]);
      printf("\nData received on process: %d   Length: %d\n",my_rank,p_length);
      //for (int i = 0; i &lt; p_length; i++) {
      //  printf("%d",buf[my_rank][i]);
      //}
      //printf("\n");
  
      total = subsequence_check(buf[my_rank],p_length,seq_length);
      printf("\nI am process: %d\nTotal: %d\n",my_rank,total);
      MPI_Finalize();
  
      return (0);
  }
  </code></pre>