<div dir="ltr"><div dir="ltr">On Wed, Jun 12, 2019 at 12:38 PM Mills, Richard Tran via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov">petsc-dev@mcs.anl.gov</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
Colleagues,<br>
<br>
I think we ought to have a way to control which levels of a PETSc multigrid solve happen on the GPU vs. the CPU, as I'd like to keep coarse levels on the CPU, but run the calculations for finer levels on the GPU. Currently, for a code that is using a DM to
manage its grid, one can use GPUs inside the application of PCMG by doing putting something like<br>
<br>
-dm_mat_type aijcusparse -dm_vec_type cuda<br>
<br>
on the command line. What I'd like to be able to do is to also control which levels get plain AIJ matrices and which get a GPU type, maybe via something like<br>
<br>
-mg_levels_N_dm_mat_type aijcusparse -mg_levels_N_dm_mat_type cuda<br>
<br>
for level N. (Being able to specify a range of levels would be even nicer, but let's start simple.)<br>
<br>
Maybe doing the above is as simple as making sure that DMSetFromOptions() gets called for the DM for each level. But I think I may be not understanding some sort of additional complications. Can someone who knows the PCMG framework better chime in? Or do others
have ideas for a more elegant way of giving this sort of control to the user?<br></div></blockquote><div><br></div><div>PCMG does not call SetFromOptions() on the dms it creates with DMCoarsen(). It should. We just check the flag for the original</div><div>DM to see if it was set from options first. Search for DMCoarsen() in mg.c and stick it in.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF">
Best regards,<br>
Richard<br>
</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>