title: Error when try to use Mpi recv : signal segmentation fault
body: <p>:)</p>
  
  <p>I got a disturbing question concerning a mpi program. The idea is : each process(slave) send data to master in order to compute the mandelbrot fractal.</p>
  
  <p>Firstly, each slave sent point and it worker. Then they sent line and it worked !</p>
  
  <p>But now, i try to make them sending a block of line(let's suppose 5 lines, so a submatrix).</p>
  
  <p>My idea is to make these five lines into a single line. The master receive the first "new" line but doesn't for the others O_o. I'm disturbed. </p>
  
  <p>I receive for the others(>1) :
  signal segmentation fault
  signal code : adress not mapped
  failing at adress</p>
  
  <p>Please Help me ! Because it's a long time , i'have been looking for :(</p>
  
  <p>Ps : i'm french (so that's why my english is bad )</p>
  
  <p><pre></p>
  
  <code>  //the whole table to be used in a master
  
    //int table[NX*NY];
    //int count =0;
  
    if (rank == 0) {
  
      int res;
      int line[MAXY+MAXY+1];
      int block[5*(MAXY+MAXY+1)];
      int count = 0;    
  
      /* Begin User Program  - the master */
  
     //MPI_Recv(&amp;line, MAXY+MAXY+1, MPI_INT,MPI_ANY_SOURCE, DATATAG, MPI_COMM_WORLD, &amp;status);
     MPI_Recv(&amp;block, 5*(MAXY+MAXY+1), MPI_INT,MPI_ANY_SOURCE, DATATAG, MPI_COMM_WORLD, &amp;status);
     printf("sizeof of datablock received is = %d \n",sizeof(block)/sizeof(block[0]));
     recvd = status.MPI_SOURCE;
     printf("i have received blockdata from %d \n",recvd);
     /* remplissage du case */
  
     for(i = -MAXX; i &lt;= MAXX; i++) { 
        for(j = -MAXY; j &lt;= MAXY; j++) { 
          cases[i + MAXX][j + MAXY] = block[count%(MAXY+MAXY+1)];
          //printf("j'ai fait un bloc[count], pas credible\n"); 
          count++;
          }
      } 
  
      dump_ppm("mandel.ppm", cases);
      printf("Fini.\n");
    }
  
    else {
  
      /* On est l'un des fils */
      /* for the block;let's suppose each son send 5 rows*/ 
      double x, y;
      int i, j, res, rc, rank,count;
      //int line[MAXY + MAXY + 1];
      int block[5*(MAXY+MAXY+1)];
      count = 0;
      MPI_Comm_rank(MPI_COMM_WORLD, &amp;rank);
      for(i = -MAXX; i &lt;= MAXX; i++) {
        for(j = -MAXY; j &lt;= MAXY; j++) {
          x = 2 * i / (double)MAXX;
          y = 1.5 * j / (double)MAXY;
          res = mandel(x, y);
          //line[j+MAXY] = res;
          block[count] =res;
          if (count % (5*(MAXY+MAXY+1)) == 0){ //we send each five rows
              MPI_Send(&amp;block,5*(MAXY+MAXY+1), MPI_INT, 0, DATATAG, MPI_COMM_WORLD);
              printf("me slave %d, have sent datablock to master\n",rank);
              printf("sizeof of datablock sent is = %d\n",sizeof(block)/sizeof(block[0]));
              }
          count++;
          }
      //MPI_Send(&amp;line, MAXY+MAXY+1 , MPI_INT, 0, DATATAG, MPI_COMM_WORLD);
      }
    }
  
    MPI_Finalize();
    return 0;
  }
  </code></pre>
  
  <p></p>