inciter::Sorter class

Mesh sorter for global distributed mesh node reordering.

Public static functions

static void registerReducers()
Configure Charm++ reduction types.

Constructors, destructors, conversion operators

Sorter(const CProxy_Transporter& transporter, const tk::CProxy_MeshWriter& meshwriter, const tk::SorterCallback& cbs, const Scheme& scheme, const std::vector<std::size_t>& ginpoel, const tk::UnsMesh::CoordMap& coordmap, const std::map<int, std::vector<std::size_t>>& bface, const std::vector<std::size_t>& triinpoel, const std::map<int, std::vector<std::size_t>>& bnode, int nchare) explicit
Constructor.
Sorter(CkMigrateMessage*) explicit
Migrate constructor.

Public functions

void setup(std::size_t npoin)
Setup chare mesh boundary node communication map.
void query(int fromch, const std::vector<std::size_t>& nodes)
Incoming query for a list mesh nodes for which this chare compiles node communication maps.
void recvquery()
Report receipt of boundary node lists.
void response()
Respond to boundary node list queries.
void bnd(int fromch, const std::map<int, std::unordered_set<std::size_t>>& msum)
Receive boundary node communication maps for our mesh chunk.
void recvbnd()
Receive receipt of boundary node communication map.
void start()
Start reordering (if user enabled it)
void offset(int c, std::size_t u)
Receive number of uniquely assigned global mesh node IDs from chares with lower indices.
void request(int c, const std::unordered_set<std::size_t>& nd)
Request new global node IDs for old node IDs.
void lower(std::size_t low)
Receive lower bound of node IDs our PE operates on after reordering.
void neworder(const std::unordered_map<std::size_t, std::tuple<std::size_t, tk::UnsMesh::Coord>>& nodes)
Receive new (reordered) global node IDs and coordinates.
void createWorkers()
Create worker chare array elements on this PE.

Charm++ pack/unpack serializer member functions

void pup(PUP::er& p) override
Pack/Unpack serialize member function.
void operator|(PUP::er& p, Sorter& s)
Pack/Unpack serialize operator|.

Function documentation

inciter::Sorter::Sorter(const CProxy_Transporter& transporter, const tk::CProxy_MeshWriter& meshwriter, const tk::SorterCallback& cbs, const Scheme& scheme, const std::vector<std::size_t>& ginpoel, const tk::UnsMesh::CoordMap& coordmap, const std::map<int, std::vector<std::size_t>>& bface, const std::vector<std::size_t>& triinpoel, const std::map<int, std::vector<std::size_t>>& bnode, int nchare) explicit

Constructor.

Parameters
transporter in Transporter (host) Charm++ proxy
meshwriter in Mesh writer Charm++ proxy
cbs in Charm++ callbacks for Sorter
scheme in Discretization scheme
ginpoel in Mesh connectivity (this chare) using global node IDs
coordmap in Mesh node coordinates (this chare) for global node IDs
bface in Face lists mapped to side set ids
triinpoel in Interconnectivity of points and boundary-faces
bnode in Node ids mapped to side set ids
nchare in Total number of Charm++ worker chares

void inciter::Sorter::setup(std::size_t npoin)

Setup chare mesh boundary node communication map.

Parameters
npoin in Total number of mesh points in mesh

void inciter::Sorter::query(int fromch, const std::vector<std::size_t>& nodes)

Incoming query for a list mesh nodes for which this chare compiles node communication maps.

Parameters
fromch in Sender chare ID
nodes in Chare-boundary node list from another chare

void inciter::Sorter::bnd(int fromch, const std::map<int, std::unordered_set<std::size_t>>& msum)

Receive boundary node communication maps for our mesh chunk.

Parameters
fromch in Sender chare ID
msum in Boundary node communication map assembled by chare fromch

void inciter::Sorter::offset(int c, std::size_t u)

Receive number of uniquely assigned global mesh node IDs from chares with lower indices.

Parameters
in Chare ID
in Number of mesh node IDs chare c will assign IDs to

This function computes the offset each chare will need to start assigning its new node IDs from. The offset for a chare is the offset for the previous chare plus the number of node IDs the previous chare (uniquely) assigns new IDs for minus the number of node IDs the previous chare receives from others (lower chares). This is computed here in a parallel/distributed fashion by each chare sending its number of node IDs (that it uniquely assigns) to all chares. Note that each chare would only need to send this information to chares with higher IDs, but instead this function is called in a broadcast fashion, because that is more efficient than individual calls to only chares with higher IDs. Therefore when computing the offsets, we only count the lower chares. When this is done, we have the precise asymmetric communication map as well as the start offset on all chares and so we can start the distributed global mesh node ID reordering.

void inciter::Sorter::request(int c, const std::unordered_set<std::size_t>& nd)

Request new global node IDs for old node IDs.

Parameters
in Chare request coming from and to which we send new IDs to
nd in Set of old node IDs whose new IDs are requested

void inciter::Sorter::neworder(const std::unordered_map<std::size_t, std::tuple<std::size_t, tk::UnsMesh::Coord>>& nodes)

Receive new (reordered) global node IDs and coordinates.

Parameters
nodes in Map associating new to old node IDs

void inciter::Sorter::pup(PUP::er& p) override

Pack/Unpack serialize member function.

Parameters
in/out Charm++'s PUP::er serializer object reference

void inciter::Sorter::operator|(PUP::er& p, Sorter& s)

Pack/Unpack serialize operator|.

Parameters
in/out Charm++'s PUP::er serializer object reference
in/out Sorter object reference