<div dir="ltr"><div>> The CUSP case wouldn't help because chances are you are not holding memory in CUSP format living on the device.</div>That makes sense.<div><br></div><div>Thanks for the help, Jed.<br><br><div class="gmail_quote">
On Thu, Aug 23, 2012 at 11:40 AM, 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 class="im">On Thu, Aug 23, 2012 at 1:25 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">Hi guys,<div><br></div><div>I've added a small function to only solve the linear system in parallel for problems that are not big enough to justify parallelizing the whole thing but would still take some time to solve in serial -- so far It's been handy. To prevent extra copy from my own format to petsc's, I'm using VecCreateMPIWithArray and MatCreateMPIWithSplitArray functions and they work with MPI on very few processes (like 4 or so). I have a couple of questions:</div>
<div><br></div><div>1) Is it worth considering using pThread and/or CUSP versions of the matrices for such problems?</div></div></blockquote></div><div><br>The old pthread types are being removed in favor of threading support for normal formats.<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>2) If so, what would be a better approach. Using hardwired vector types in the code or using generic VecCreate functions to be able to change the type at run-time?</div>
</div></blockquote><div><br></div></div><div>Just use VecSetType()/MatSetType() to switch. You should really profile just using MatSetValues() to assemble. It's very likely that you are needlessly complicating your code by trying to skip a copy.</div>
<div class="im">
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<div>3) Are there equivalent versions of XXXWithArray functions for CUSP and pThread types? I don't seem to find them in manual page.</div></div></blockquote><div><br></div></div><div>The CUSP case wouldn't help because chances are you are not holding memory in CUSP format living on the device.</div>
<div><br></div></div>
</blockquote></div><br></div></div>