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_Solver& solver, 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 createWorkers()
Create worker chare array elements on this PE.
void comChBndNode(CkReductionMsg* msg)
Receive aggregated chare boundary nodes associated to chares.
void comnode(CkReductionMsg* msg)
Receive aggregated boundary nodes for side sets.
void comface(CkReductionMsg* msg)
Receive aggregated boundary faces (and triangle connectivity) for side sets.
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 createDiscWorkers()
Create Discretization 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

static void inciter::Sorter::registerReducers()

Configure Charm++ reduction types.

Since this is a [nodeinit] routine, the runtime system executes the routine exactly once on every logical node early on in the Charm++ init sequence. Must be static as it is called without an object. See also: Section "Initializations at Program Startup" at in the Charm++ manual http://charm.cs.illinois.edu/manuals/html/charm++/manual.html.

inciter::Sorter::Sorter(const CProxy_Transporter& transporter, const tk::CProxy_Solver& solver, 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
solver in Linear system solver 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++ Refiner chares

void inciter::Sorter::comChBndNode(CkReductionMsg* msg)

Receive aggregated chare boundary nodes associated to chares.

Parameters
msg in Aggregated chare boundary nodes across the whole problem

This is a reduction target receiving the aggregated chare boundary nodes associated to chare IDs across the whole problem.

void inciter::Sorter::comnode(CkReductionMsg* msg)

Receive aggregated boundary nodes for side sets.

Parameters
msg in Aggregated boundary nodes of side sets across the whole problem

This is a reduction target receiving the aggregated boundary nodes of side sets across the whole problem.

void inciter::Sorter::comface(CkReductionMsg* msg)

Receive aggregated boundary faces (and triangle connectivity) for side sets.

Parameters
msg in Aggregated boundary faces (and triangle connectivity) of side sets across the whole problem

This is a reduction target receiving the aggregated boundary faces (and triangle connectivity) of side sets across the whole problem.

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::lower(std::size_t low)

Receive lower bound of node IDs our PE operates on after reordering.

Parameters
low in Lower bound of node IDs assigned to this chare

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::createDiscWorkers()

Create Discretization chare array elements on this PE.

We create chare array elements by calling the insert() member function, which allows specifying the PE on which the array element is created. and we send each chare array element the chunk of mesh it will operate on.

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