On Thu, Jun 7, 2012 at 3:35 PM, TAY wee-beng <span dir="ltr"><<a href="mailto:zonexo@gmail.com" target="_blank">zonexo@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div class="im">
<br>
On 7/6/2012 4:33 AM, Jed Brown wrote:
<blockquote type="cite">
<div class="gmail_quote">On Wed, Jun 6, 2012 at 4:21 PM, TAY
wee-beng <span dir="ltr"><<a href="mailto:zonexo@gmail.com" target="_blank">zonexo@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<b>call PCMGSetLevels(pc,mg_lvl,MPI_COMM_WORLD,ierr)</b></blockquote>
<div><br>
</div>
<div>The third arguments is an array of length mg_lvl, not a
single communicator. You can pass PETSC_NULL_OBJECT just like
the man page says to use the default.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
</blockquote>
</div>
</blockquote></div>
I changed but the same Segmentation still occurs:<br></div></blockquote><div><br></div><div>Look, programming is a skill. It demands you learn to use certain tools. A message like "Segmentation still occurs"</div>
<div>is USELESS since we are not looking at your code or running it. Sending in a stack trace from gdb is much more</div><div>informative and means you will get help sooner.</div><div><br></div><div> Matt</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
call KSPCreate(MPI_COMM_WORLD,ksp,ierr)<br>
<br>
call KSPGetPC(ksp,pc,ierr)<br>
<br>
call PCSetType(pc_uv,PCMG,ierr) <br>
<br>
mg_lvl = 1 (or 2)<br>
<br>
call PCMGSetLevels(pc,mg_lvl,PETSC_NULL_OBJECT,ierr) <br>
<br>
call
DMDACreate2d(MPI_COMM_WORLD,DMDA_BOUNDARY_NONE,DMDA_BOUNDARY_NONE,DMDA_STENCIL_STAR,size_x,size_y,1,num_procs,i1,i1,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,da,ierr)<br>
<br>
...<br>
<br>
Btw, I tried to look at
<a href="http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex42.c.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex42.c.html</a>
but I think there's some error in the page formatting.<div class="im"><br>
<blockquote type="cite">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br>
However, I get the error:<br>
<br>
Caught signal number 11 SEGV: Segmentation Violation, probably
memory access out of range<br>
<br>
after calling <b>PCMGSetLevels</b><br>
<br>
What's the problem? Is there any examples which I can follow?<br>
</blockquote>
</div>
<br>
<div>I believe the other examples that use this routine are in C
or just tests (not tutorial-style) examples.</div>
</blockquote>
</div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>