<div dir="ltr"> <div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
</span>OK, I was not aware of PCShell (I'm new to PETSc). I don't know Trilinos well<br>
enough to judge whether it's good from software engineering point of view or<br>
not, but allow me one last question. What would happen if I wrap all 'other'<br>
solvers in PCShell and then for some reason, PETSc is not available. </blockquote><div><br></div><div>This is a fair comment. However, in my experience PETSc builds everywhere.<br></div><div>If PETSc isn't provided as a module on the resource you have access to, it is relatively<br></div><div>straight forward to built the entire library yourself. The --download-XXX feature of<br></div><div>PETSc's configure is pretty damn good and also will on most (if not all) machines.<br><br></div><div>If configure does fail on your machine of choice, send the configure.log file to <br><a href="mailto:petsc-maint@mcs.anl.gov">petsc-maint@mcs.anl.gov</a>. The PETSc guys will sort out the problem. <br>In 12 years, I haven't found a single machine which I couldn't get petsc compiled on.<br></div><div><br></div><div>I think you are safe if you wrap everything within PETSc. :D<br><br></div><div>Cheers<br></div><div>  Dave<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">None of<br>
the other solvers would be accessible (unless I modify the source code), so<br>
wrapping everything using PCShell creates a strong dependency on one<br>
particular library (PETSc), doesn't it?<br>
<span class="HOEnZb"><font color="#888888"><br>
Martin<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
><br>
> > Best regards,<br>
> ><br>
> >  Martin Vymazal<br>
> ><br>
> > On Tuesday, August 04, 2015 12:24:14 PM Matthew Knepley wrote:<br>
> > > On Tue, Aug 4, 2015 at 12:15 PM, Martin Vymazal <<br>
> ><br>
> > <a href="mailto:martin.vymazal@vki.ac.be">martin.vymazal@vki.ac.be</a>><br>
> ><br>
> > > wrote:<br>
> > > > Hello,<br>
> > > ><br>
> > > >  I'm trying to create a small C++ class to wrap the 'Vec' object. This<br>
> > > ><br>
> > > > class<br>
> > > > has an internal pointer to a member variable of type Vec, and in its<br>
> > > > destructor, it calls VecDestroy. Unfortunately, my test program<br>
> ><br>
> > segfaults<br>
> ><br>
> > > > and<br>
> > > > this seems to be due to the fact that the destructor of the wrapper<br>
> ><br>
> > class<br>
> ><br>
> > > > is<br>
> > > > called after main() calls PetscFinalize(). Apparently VecDestroy<br>
> ><br>
> > performs<br>
> ><br>
> > > > some<br>
> > > > collective communication, so calling it after PetscFinalize() is too<br>
> ><br>
> > late.<br>
> ><br>
> > > > How<br>
> > > > can I fix this?<br>
> > ><br>
> > > 1) Declare your C++ in a scope, so that it goes out of scope before<br>
> > > PetscFinalize()<br>
> > ><br>
> > > 2) Is there any utility to this wrapper since everything can be called<br>
> > > directly from C++?<br>
> > ><br>
> > >   Thanks,<br>
> > ><br>
> > >      Matt<br>
> > > ><br>
> > > > Thank you,<br>
> > > ><br>
> > > >  Martin Vymazal<br>
<br>
</div></div></blockquote></div><br></div></div>