<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div>You need to use disp[]</div><div><     MPI_Scatterv(&a, rcounts, 0, MPI_INT, &b, 100, MPI_INT, 0, MPI_COMM_WORLD);</div><div>---</div><div>>     MPI_Scatterv(&a, rcounts, disp, MPI_INT, &b, 100, MPI_INT, 0, MPI_COMM_WORLD);</div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr">--Junchao Zhang</div></div></div>
<br><div class="gmail_quote">On Wed, Nov 12, 2014 at 5:23 AM, Chafik sanaa <span dir="ltr"><<a href="mailto:san.chafik@gmail.com" target="_blank">san.chafik@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">when i running the following program, i have this error (Exception non gérée à 0x00B54BE2 (mpich2nemesis.dll) dans samedi1.exe : 0xC0000005 : Violation d'accès lors de la lecture de l'emplacement 0x00000000.)<div>program :</div><div><div>#include <stdio.h></div><div>#include "mpi.h"</div><div><br></div><div>int main(int argc, char *argv[])</div><div>{</div><div><br></div><div><span style="white-space:pre-wrap">      </span>int a[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };</div><div><span style="white-space:pre-wrap">   </span>int rcounts[4] = { 2, 2, 2, 2 };</div><div><span style="white-space:pre-wrap"> </span>int disp[4] = { 0, 2, 4, 6 };</div><div><span style="white-space:pre-wrap">    </span>int b[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };</div><div><span style="white-space:pre-wrap">   </span>int procid;</div><div><span style="white-space:pre-wrap">      </span>MPI_Init(&argc, &argv);</div><div><span style="white-space:pre-wrap">  </span>MPI_Comm_rank(MPI_COMM_WORLD, &procid);</div><div><span style="white-space:pre-wrap">      </span></div><div><span style="white-space:pre-wrap"> </span>MPI_Scatterv(&a, rcounts, 0, MPI_INT, &b, 100, MPI_INT, 0, MPI_COMM_WORLD);</div><div><span style="white-space:pre-wrap">      </span>printf("%d", b[0]);</div><div><span style="white-space:pre-wrap">    </span>printf("sanaa");</div><div><span style="white-space:pre-wrap">       </span>MPI_Finalize();</div><div><span style="white-space:pre-wrap">  </span>return 0;</div><div>}</div></div></div>
<br>_______________________________________________<br>
discuss mailing list     <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br></blockquote></div><br></div></div>