<div dir="ltr">Hi Mark,<div><br></div><div>siz%size = 0 in my case because siz=362 and I use at most 2 processors.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Mark Adams <<a href="mailto:mfadams@lbl.gov">mfadams@lbl.gov</a>>, 2 Nis 2019 Sal, 15:12 tarihinde şunu yazdı:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 2, 2019 at 6:55 AM Eda Oktay via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi Barry,<div><br></div><div>I did what you said but now I get the error in ISSetPermutation that index set is not a permutation. ı think it is because since I selected indices on each process as you said. I did the following, did I understand you wrong:</div><div><br></div><div><div> PetscMPIInt rank,size;</div><div> MPI_Comm_rank(PETSC_COMM_WORLD, &rank);</div><div> MPI_Comm_size(PETSC_COMM_WORLD, &size);</div><div> </div><div> PetscInt *idxx,ss;</div><div> ss = siz/size;</div><div> PetscMalloc1(ss,&idxx);</div><div> if (rank != size-1) {</div><div> j =0;</div><div> for (i=rank*ss; i<(rank+1)*ss; i++) {</div><div> idxx[j] = idx[i];</div><div> j++;</div><div> }</div><div><br></div><div> } else {</div><div> </div><div> j =0;</div><div> for (i=rank*ss; i<siz; i++) {</div><div> idxx[j] = idx[i];</div></div></div></div></blockquote><div><br></div><div>if siz%size != 0, you will run off the end of idxx, that is you have a memory error.</div><div><br></div></div></div>
</blockquote></div>