<div dir="ltr">Thanks Matt. If that is not against PETSc coding policies, it sounds reasonable to me. <div><br></div><div>Mohammad<br><br><div class="gmail_quote">On Mon, Feb 20, 2012 at 7:30 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">knepley@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 class="im">On Mon, Feb 20, 2012 at 6:30 PM, Mohammad Mirzadeh <span dir="ltr"><<a href="mailto:mirzadeh@gmail.com" target="_blank">mirzadeh@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Matt, I'm just trying to understand what is going on and why the things do what they do -- I'm not asking for anything in particular :). I just thought that the situation for VecCreateGhost and AOXXXXToYYYY are somewhat similar here and was surprised to see one crashes on NULL while the other one does not.<div>
<br></div><div>I have included a check on the pointer and size for AO calls and just wanted to check if I need the same thing with VecCreateGhost if there is such an internal check.</div></div></blockquote><div><br></div>
</div><div>I have no problem making that change. It is pushed to petsc-dev.</div><div><br></div><div> Matt</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>Mohammad<br><div>
<br></div><div><br><div class="gmail_quote">On Mon, Feb 20, 2012 at 4:10 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@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>On Mon, Feb 20, 2012 at 5:58 PM, Mohammad Mirzadeh <span dir="ltr"><<a href="mailto:mirzadeh@gmail.com" target="_blank">mirzadeh@gmail.com</a>></span> wrote:<br></div><div class="gmail_quote"><div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Just if wondering what the actual code is, here's the bit causing the trouble:<div><br></div><div>
AOApplicationToPetsc(ao, ghostNodes.size(), (int*)ghostNodes);<br>VecCreateGhost(comm, localNodes.size(), PETSC_DECIDE, ghostNodes.size(), (int*)ghostNodes, &v);<br>AOPetscToApplication(ao, ghostNodes.size(), (int*)ghostNodes);</div>
<div><br></div><div>when the code is in serial, ghostNodes.size() = 0 and (int*)ghostNodes = NULL.</div></div></blockquote><div><br></div></div><div>So you are asking us to give up checking for NULL if the size is 0?</div>
<div>
<br></div><div> Matt</div><div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div class="gmail_quote">On Mon, Feb 20, 2012 at 3:54 PM, Mohammad Mirzadeh <span dir="ltr"><<a href="mailto:mirzadeh@gmail.com" target="_blank">mirzadeh@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">Sure, Jed. My bad. Here's the whole message when the code is run in _serial_:<div><br></div><div><div>[0]PETSC ERROR: --------------------- Error Message ------------------------------------</div><div>
[0]PETSC ERROR: Invalid pointer!</div>
<div>[0]PETSC ERROR: Null Pointer: Parameter # 3!</div><div>[0]PETSC ERROR: ------------------------------------------------------------------------</div><div>[0]PETSC ERROR: Petsc Release Version 3.2.0, Patch 6, Wed Jan 11 09:28:45 CST 2012 </div>
<div>[0]PETSC ERROR: See docs/changes/index.html for recent updates.</div><div>[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.</div><div>[0]PETSC ERROR: See docs/index.html for manual pages.</div><div>
[0]PETSC ERROR: ------------------------------------------------------------------------</div><div>[0]PETSC ERROR: ./petsc on a arch-linu named mohammad-laptop by mohammad Mon Feb 20 15:52:25 2012</div><div>[0]PETSC ERROR: Libraries linked from /home/mohammad/soft/petsc-3.2-p6/arch-linux2-cxx-debug/lib</div>
<div>[0]PETSC ERROR: Configure run at Thu Feb 16 02:16:40 2012</div><div>[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --with-clanguage=cxx --download-f-blas-lapack=1 --download-mpich=1 --download-hypre=1 --download-ml=1 --with-parmetis-include=/home/mohammad/soft/parmetis/include --with-parmetis-lib="-L/home/mohammad/soft/parmetis/lib -lparmetis -lmetis" --download-superlu_dist=1</div>
<div>[0]PETSC ERROR: ------------------------------------------------------------------------</div><div>[0]PETSC ERROR: AOApplicationToPetsc() line 249 in /home/mohammad/soft/petsc-3.2-p6/src/dm/ao/interface/ao.c</div><div>
[0]PETSC ERROR: --------------------- Error Message ------------------------------------</div><div>[0]PETSC ERROR: Invalid pointer!</div><div>[0]PETSC ERROR: Null Pointer: Parameter # 3!</div><div>[0]PETSC ERROR: ------------------------------------------------------------------------</div>
<div>[0]PETSC ERROR: Petsc Release Version 3.2.0, Patch 6, Wed Jan 11 09:28:45 CST 2012 </div><div>[0]PETSC ERROR: See docs/changes/index.html for recent updates.</div><div>[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.</div>
<div>[0]PETSC ERROR: See docs/index.html for manual pages.</div><div>[0]PETSC ERROR: ------------------------------------------------------------------------</div><div>[0]PETSC ERROR: ./petsc on a arch-linu named mohammad-laptop by mohammad Mon Feb 20 15:52:25 2012</div>
<div>[0]PETSC ERROR: Libraries linked from /home/mohammad/soft/petsc-3.2-p6/arch-linux2-cxx-debug/lib</div><div>[0]PETSC ERROR: Configure run at Thu Feb 16 02:16:40 2012</div><div>[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --with-clanguage=cxx --download-f-blas-lapack=1 --download-mpich=1 --download-hypre=1 --download-ml=1 --with-parmetis-include=/home/mohammad/soft/parmetis/include --with-parmetis-lib="-L/home/mohammad/soft/parmetis/lib -lparmetis -lmetis" --download-superlu_dist=1</div>
<div>[0]PETSC ERROR: ------------------------------------------------------------------------</div><div>[0]PETSC ERROR: AOPetscToApplication() line 210 in /home/mohammad/soft/petsc-3.2-p6/src/dm/ao/interface/ao.c</div><div>
<br></div><div><br></div><div>It seems to complain about the 3rd parameter of AOApplicationToPetsc() and AOPetscToApplication(). VecCreateGhost, on the other hand, is fine.</div><div><div><br><div class="gmail_quote">
On Mon, Feb 20, 2012 at 3:47 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>On Mon, Feb 20, 2012 at 17:25, Mohammad Mirzadeh <span dir="ltr"><<a href="mailto:mirzadeh@gmail.com" target="_blank">mirzadeh@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">Hi,<div><br></div><div>Is there an internal check to see if the 'ghost' pointer in VecCreateGhost() is NULL ? This can happen, for example, if the code is run in serial and the there are no ghost points (hence n_ghost = 0 and ghost = NULL(implementation dependent of course) ). AOXXXXToYYYY functions seem to crash if the corresponding pointer is NULL.</div>
</div></blockquote><div><br></div></div><div>Always send the whole error message. </div></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div></div></div><span><font color="#888888"><br><br clear="all"><span><font color="#888888"><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>
</font></span></font></span></blockquote></div><br></div></div></div>
</blockquote></div></div></div><div class="HOEnZb"><div class="h5"><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>
</div></div></blockquote></div><br></div></div>