<div dir="ltr"><div dir="ltr">On Mon, Jan 19, 2026 at 7:56 AM MIGUEL MOLINOS PEREZ <<a href="mailto:mmolinos@us.es">mmolinos@us.es</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Dear all,</p>
<p>I have a question about using DMSwarm data with Kokkos-enabled vectors.</p>
<p>My particle data (including ghost particles) are stored in a DMSwarm and for solver purposes I generate PETSc vectors using VecCreateGhostWithArray. I would like to use VecMPIKOKKOS for MPI+GPU computations. Am I correct that DMSwarm field memory cannot
be directly wrapped into a VecMPIKOKKOS using VecCreateGhostWithArray or VecPlaceArray? Any idea on how to proceed?</p></div></blockquote><div>You can use</div><div><br></div><div> <a href="https://urldefense.us/v3/__https://petsc.org/main/manualpages/DMSwarm/DMSwarmCreateGlobalVectorFromField/__;!!G_uCfscf7eWS!YsdXvBMzbpnlSNPvPGsxFWG7blJSqc3ONTjAhREcp8h21m_QRZA5cWREcJ03KatOzxUieJcpbM1Js_m4B4AN$">https://petsc.org/main/manualpages/DMSwarm/DMSwarmCreateGlobalVectorFromField/</a></div><div><br></div><div>if you have a single field, which is no-copy. However, if you want multiple fields in the Vec, then you need a copy. We</div><div>do this in our PIC code, and the copy time is in the noise, so I would measure it before deciding you do not want a copy.</div><div><br></div><div>I still do not think it would work with ghosted Vecs, because those demand that the shared particles are at the end of the Vec, but Swarm has no idea about this division.</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><p>Thanks in advance.</p>
<p>Best,</p>
<p>Miguel</p>
</div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><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="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!YsdXvBMzbpnlSNPvPGsxFWG7blJSqc3ONTjAhREcp8h21m_QRZA5cWREcJ03KatOzxUieJcpbM1Jsyt6NwWo$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>