Okay, cool. Should I do that by explicitly setting each particle's DMSwarmField_rank when I assign its position? What role does DMSwarmMigrate play in all of this?
--Matt ========================== Matthew Young, PhD (he/him) Research Scientist II Space Science Center University of New Hampshire [email protected] ========================== On Fri, May 12, 2023 at 10:05 AM Matthew Knepley <[email protected]> wrote: > On Fri, May 12, 2023 at 9:40 AM Matthew Young < > [email protected]> wrote: > >> Got it. >> >> I'm specifically thinking about this in terms of the gather stage of my >> PIC code, where I loop over local particles to fill local density and flux >> arrays by linearly interpolating particle positions to the grid. The gather >> function currently assumes that the coordinates (i.e., the array >> representation of DMSwarmPICField_coor) of all particles on a given rank >> would correspond to only the global indices owned by that rank, via the >> relationship between indices and coordinates in the associated cell DM. >> Based on what you described, it sounds like I need to make sure that I >> initially lay down the particles so that their rank matches their >> coordinates. >> > > Right now, yes. I will fix that before August. > > Thanks, > > Matt > > >> --Matt >> ========================== >> Matthew Young, PhD (he/him) >> Research Scientist II >> Space Science Center >> University of New Hampshire >> [email protected] >> ========================== >> >> >> On Fri, May 12, 2023 at 5:15 AM Matthew Knepley <[email protected]> >> wrote: >> >>> On Thu, May 11, 2023 at 9:15 PM Matthew Young < >>> [email protected]> wrote: >>> >>>> Does setting up a PIC-type DMSWARM with an associated cell DM guarantee >>>> that each MPI rank will own the particles with coordinates inside the >>>> bounds of the portion of the grid it owns? >>>> >>> >>> There is a caveat that we are currently fixing. Swarm communication is >>> setup to be nearest neighbor (since there is no coarse grid of >>> bounding boxes). So if your particles are initially in the right place, and >>> only move nearest neighbor, everything is fine. We are adding a hierarchy >>> of bounding boxes so that we can communicate anywhere. >>> >>> Thanks, >>> >>> Matt >>> >>> >>>> --Matt >>>> ========================== >>>> Matthew Young, PhD (he/him) >>>> Research Scientist II >>>> Space Science Center >>>> University of New Hampshire >>>> [email protected] >>>> ========================== >>>> >>> >>> >>> -- >>> 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://www.cse.buffalo.edu/~knepley/ >>> <http://www.cse.buffalo.edu/~knepley/> >>> >> > > -- > 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://www.cse.buffalo.edu/~knepley/ > <http://www.cse.buffalo.edu/~knepley/> >
