<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">thank you very much<br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-11-12 14:11 GMT+01:00 Junchao Zhang <span dir="ltr"><<a href="mailto:jczhang@mcs.anl.gov" target="_blank">jczhang@mcs.anl.gov</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>You need to use disp[]</div><span class=""><div>< MPI_Scatterv(&a, rcounts, 0, MPI_INT, &b, 100, MPI_INT, 0, MPI_COMM_WORLD);</div></span><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"><div><div class="h5">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></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><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></div></div>_______________________________________________<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>
<br>_______________________________________________<br>
discuss mailing list <a href="mailto:discuss@mpich.org">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>