On Mon, Jan 19, 2026 at 7:56 AM MIGUEL MOLINOS PEREZ <[email protected]> wrote:
> Dear all, > > I have a question about using DMSwarm data with Kokkos-enabled vectors. > > 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? > You can use https://urldefense.us/v3/__https://petsc.org/main/manualpages/DMSwarm/DMSwarmCreateGlobalVectorFromField/__;!!G_uCfscf7eWS!YsdXvBMzbpnlSNPvPGsxFWG7blJSqc3ONTjAhREcp8h21m_QRZA5cWREcJ03KatOzxUieJcpbM1Js_m4B4AN$ 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 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. 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. Thanks, Matt > Thanks in advance. > > Best, > > Miguel > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!YsdXvBMzbpnlSNPvPGsxFWG7blJSqc3ONTjAhREcp8h21m_QRZA5cWREcJ03KatOzxUieJcpbM1Js57SijbR$ <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!YsdXvBMzbpnlSNPvPGsxFWG7blJSqc3ONTjAhREcp8h21m_QRZA5cWREcJ03KatOzxUieJcpbM1Jsyt6NwWo$ >
