<div dir="ltr">I think you would want to use 'cuda' vec_type, but I .<div>You might ask Hypre how one verifies that the GPU is used.</div><div>Mark</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 8, 2021 at 1:35 PM Karthikeyan Chockalingam - STFC UKRI <<a href="mailto:karthikeyan.chockalingam@stfc.ac.uk">karthikeyan.chockalingam@stfc.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-GB" style="overflow-wrap: break-word;">
<div class="gmail-m_-6278275758514210679WordSection1">
<p class="MsoNormal"><span>Yes, I used it for both cpu and gpu. Is that not okay?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Arial,sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:Arial,sans-serif">For gpu:
</span><span style="font-family:Arial,sans-serif;color:black">-dm_mat_type hypre -dm_vec_type mpicuda
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Arial,sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:Arial,sans-serif;color:black">For cpu: -dm_mat_type hypre -dm_vec_type mpi<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12pt;color:black">From: </span></b><span style="font-size:12pt;color:black">Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>><br>
<b>Date: </b>Friday, 8 October 2021 at 18:28<br>
<b>To: </b>"Chockalingam, Karthikeyan (STFC,DL,HC)" <<a href="mailto:karthikeyan.chockalingam@stfc.ac.uk" target="_blank">karthikeyan.chockalingam@stfc.ac.uk</a>><br>
<b>Cc: </b>"<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>" <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
<b>Subject: </b>Re: [petsc-users] hypre on gpus<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Did you use -dm_mat_type hypre on the GPU case ?<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Fri, Oct 8, 2021 at 12:19 PM Karthikeyan Chockalingam - STFC UKRI <<a href="mailto:karthikeyan.chockalingam@stfc.ac.uk" target="_blank">karthikeyan.chockalingam@stfc.ac.uk</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">I tried a different exercise ran the same problem on two cpu cores and on two gpu:<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">On gpu
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">PCApply 6 1.0 6.0335e+00 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 6.0e+00 15 0 0 0 1 15 0 0 0 1 0 0 0 0.00e+00 5 9.65e+01 0<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">and on cpu<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">PCApply 6 1.0 5.6348e+00 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 16 0 0 0 0 16 0 0 0 0 0<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">timings again are close but gpu version did a reduction 6.0e+00 but the cpu version did not 0.0e+00.
<u></u><u></u></p>
<p class="MsoNormal">I am not sure if that is any indication if hypre ran on gpus?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">Karthik.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12pt;color:black">From:
</span></b><span style="font-size:12pt;color:black">Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>><br>
<b>Date: </b>Friday, 8 October 2021 at 16:36<br>
<b>To: </b>"Chockalingam, Karthikeyan (STFC,DL,HC)" <<a href="mailto:karthikeyan.chockalingam@stfc.ac.uk" target="_blank">karthikeyan.chockalingam@stfc.ac.uk</a>><br>
<b>Cc: </b>"<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>" <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
<b>Subject: </b>Re: [petsc-users] hypre on gpus</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">On Fri, Oct 8, 2021 at 10:29 AM Karthikeyan Chockalingam - STFC UKRI <<a href="mailto:karthikeyan.chockalingam@stfc.ac.uk" target="_blank">karthikeyan.chockalingam@stfc.ac.uk</a>>
wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt">
<div>
<div>
<p class="MsoNormal">The PCApply timing on<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">gpu<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803p1"><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">PCApply</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">6 1.0 1.0235e+01 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 39</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">39</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0 </span>
<span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0 </span>
<span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0 0.00e+00</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0 0.00e+00</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><u></u><u></u></p>
<p class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803p1"><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1"> </span><u></u><u></u></p>
<p class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803p1"><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">and cpu
</span><u></u><u></u></p>
<p class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803p1"> <u></u><u></u></p>
<p class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803p1"><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">PCApply</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">6 1.0 1.0242e+01 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 41</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">41</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0 </span>
<span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803apple-converted-space">
</span><span class="gmail-m_-6278275758514210679gmail-m7139920988130781738gmail-m-5205965745375972803s1">0</span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">You don't have GPUs. probably.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Use <span style="font-family:Menlo;color:black">-dm_mat_type hypre</span>. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt">
<div>
<div>
<p class="MsoNormal">are close. It is hard for me tell if hypre on gpu is on or not.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Best,<u></u><u></u></p>
<p class="MsoNormal">Karthik.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12pt;color:black">From:
</span></b><span style="font-size:12pt;color:black">"Chockalingam, Karthikeyan (STFC,DL,HC)" <<a href="mailto:karthikeyan.chockalingam@stfc.ac.uk" target="_blank">karthikeyan.chockalingam@stfc.ac.uk</a>><br>
<b>Date: </b>Friday, 8 October 2021 at 14:55<br>
<b>To: </b>Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>><br>
<b>Cc: </b>"<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>" <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
<b>Subject: </b>Re: [petsc-users] hypre on gpus</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<p class="MsoNormal">Thanks Mark, I will try your recommendations.<u></u><u></u></p>
<p class="MsoNormal">Should I also change
<span style="font-family:Menlo;color:black">-dm_vec_type to hypre </span>currently I have it as mpicuda?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Karthik.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12pt;color:black">From:
</span></b><span style="font-size:12pt;color:black">Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>><br>
<b>Date: </b>Friday, 8 October 2021 at 14:33<br>
<b>To: </b>"Chockalingam, Karthikeyan (STFC,DL,HC)" <<a href="mailto:karthikeyan.chockalingam@stfc.ac.uk" target="_blank">karthikeyan.chockalingam@stfc.ac.uk</a>><br>
<b>Cc: </b>"<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>" <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
<b>Subject: </b>Re: [petsc-users] hypre on gpus</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Hypre does not record its flops with PETSc's timers.<u></u><u></u></p>
<div>
<p class="MsoNormal">Configure with and without CUDA and see if the timings change in PCApply.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Hypre does not dynamically switch between CUDA and CPU solves at this time, but you want to use <span style="font-family:Menlo;color:black">-dm_mat_type hypre.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Menlo;color:black">Mark</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">On Fri, Oct 8, 2021 at 6:59 AM Karthikeyan Chockalingam - STFC UKRI <<a href="mailto:karthikeyan.chockalingam@stfc.ac.uk" target="_blank">karthikeyan.chockalingam@stfc.ac.uk</a>>
wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt">
<div>
<div>
<p class="MsoNormal">Hello,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I am trying to run ex45 (in KSP tutorial) using hypre on gpus. I have attached the python configuration file and -log_view output from running the below command options<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:Menlo;color:black">mpirun -n 2 ./ex45 -log_view -da_grid_x 169 -da_grid_y 169 -da_grid_z 169 -dm_mat_type mpiaijcusparse -dm_vec_type mpicuda -ksp_type
gmres -pc_type hypre -pc_hypre_type boomeramg -ksp_gmres_restart 31 -pc_hypre_boomeramg_strong_threshold 0.7 -ksp_monitor</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:Menlo;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal">The problem was solved and converged but from the output file I suspect hypre is not running on gpus as PCApply and DMCreate does
<b>not</b> record any gpu Mflop/s. However, some events such KSPSolve, MatMult etc are running on gpus.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Can you please let me know if I need to add any extra flag to the attached arch-ci-linux-cuda11-double-xx.py script file to get hypre working on gpus?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">Karthik.<u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:Menlo;color:rgb(192,0,0)"> </span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<p><span style="font-size:6pt">This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and should notify
the sender immediately and delete this email from your system. UK Research and Innovation (UKRI) has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry out its own
virus and malware checks before opening the attachments. UKRI does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses. </span><u></u><u></u></p>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote></div>