inciter::Discretization class

Discretization Charm++ chare array holding common functinoality to all discretization schemes.

Public static functions

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

Constructors, destructors, conversion operators

Discretization(const CProxy_DistFCT& fctproxy, const CProxy_Transporter& transporter, const tk::CProxy_MeshWriter& meshwriter, const std::vector<std::size_t>& ginpoel, const tk::UnsMesh::CoordMap& coordmap, const std::map<int, std::unordered_set<std::size_t>>& msum, int nc) explicit
Constructor.
Discretization(CkMigrateMessage*) explicit
Migrate constructor.

Public functions

void resize(const tk::UnsMesh::Chunk& chunk, const tk::UnsMesh::Coords& coord, const std::unordered_map<int, std::vector<std::size_t>>& msum)
Resize mesh data structures (e.g., after mesh refinement)
void vol()
Sum mesh volumes to nodes, start communicating them on chare-boundaries.
void setRefiner(const CProxy_Refiner& ref)
Set Refiner Charm++ proxy.
void comvol(const std::vector<std::size_t>& gid, const std::vector<tk::real>& nodevol)
Collect nodal volumes across chare boundaries.
void totalvol()
Sum mesh volumes and contribute own mesh volume to total volume.
void stat()
Compute mesh cell statistics.
void setdt(tk::real newdt)
Set time step size.
void next()
Prepare for next step.
void status()
Otput one-liner status report.
void write(const std::vector<std::size_t>& inpoel, const tk::UnsMesh::Coords& coord, const std::map<int, std::vector<std::size_t>>& bface, const std::map<int, std::vector<std::size_t>>& bnode, const std::vector<std::size_t>& triinpoel, const std::vector<std::string>& elemfieldnames, const std::vector<std::string>& nodefieldnames, const std::vector<std::vector<tk::real>>& elemfields, const std::vector<std::vector<tk::real>>& nodefields, CkCallback c)
Output mesh and fields data (solution dump) to file(s)
auto msumset() const -> std::unordered_map<int, std::unordered_set<std::size_t>>
Return chare-node adjacency map as sets.

Accessors

auto Coord() const -> const tk::UnsMesh::Coords&
auto Coord() -> tk::UnsMesh::Coords&
Coordinates accessors as non-const ref.
auto Gid() const -> const std::vector<std::size_t>&
Global ids accessors as const-ref.
auto Gid() -> std::vector<std::size_t>&
Global ids accessors as non-const-ref.
auto Lid() const -> const std::unordered_map<std::size_t, std::size_t>&
Local ids accessors as const-ref.
auto Lid() -> std::unordered_map<std::size_t, std::size_t>&
Local ids accessors as non-const-ref.
auto Inpoel() const -> const std::vector<std::size_t>&
Tetrahedron element connectivity (with local ids) accessors as const-ref.
auto Inpoel() -> std::vector<std::size_t>&
Tetrahedron element connectivity (with local ids) accessors as non-const-ref.
auto V() const -> const std::vector<tk::real>&
Total mesh volume accessors const-ref.
auto V() -> std::vector<tk::real>&
Total mesh volume accessors non-const-ref.
auto Vol() const -> const std::vector<tk::real>&
Nodal mesh volumes accessors as const-ref.
auto Vol() -> std::vector<tk::real>&
Nodal mesh volumes accessors as non-const-ref.
auto Dt() const -> tk::real
Time step size accessor.
auto T() const -> tk::real
Physical time accessor.
auto It() const -> uint64_t
Iteration count accessor.
auto Itr() -> uint64_t&
Non-const-ref refinement iteration count accessor.
auto Itf() -> uint64_t&
Non-const-ref field-output iteration count accessor.
auto Timer() const -> const tk::Timer&
Timer accessor as const-ref.
auto Timer() -> tk::Timer&
Timer accessor as non-const-ref.
auto refined() const -> int
Accessor to flag indicating if the mesh was refined as a value.
auto refined() -> int&
Accessor to flag indicating if the mesh was refined as non-const-ref.
auto Tr() const -> const CProxy_Transporter&
Transporter proxy accessor as const-ref.
auto Tr() -> CProxy_Transporter&
Transporter proxy accessor as non-const-ref.
auto Ref() const -> Refiner*
Access bound Refiner class pointer.
auto FCT() const -> DistFCT*
Access bound DistFCT class pointer.
auto Bid() const -> const std::unordered_map<std::size_t, std::size_t>&
Boundary node ids accessor as const-ref.
auto Bid() -> std::unordered_map<std::size_t, std::size_t>&
Boundary node ids accessor as non-const-ref.
auto Msum() const -> const std::unordered_map<int, std::vector<std::size_t>>&
Nodal communication map accessor as const-ref.
auto Msum() -> std::unordered_map<int, std::vector<std::size_t>>&
Nodal communication map accessor as non-const-ref.
auto Psup() const -> const std::pair<std::vector<std::size_t>, std::vector<std::size_t>>&
Points surrounding points accessor as const-ref.
auto Psup() -> std::pair<std::vector<std::size_t>, std::vector<std::size_t>>&
Points surrounding points accessor as non-const-ref.

Charm++ pack/unpack serializer member functions

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

Function documentation

static void inciter::Discretization::registerReducers()

Configure Charm++ reduction types.

Since this is a [nodeinit] routine, see cg.ci, the Charm++ 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::Discretization::Discretization(const CProxy_DistFCT& fctproxy, const CProxy_Transporter& transporter, const tk::CProxy_MeshWriter& meshwriter, const std::vector<std::size_t>& ginpoel, const tk::UnsMesh::CoordMap& coordmap, const std::map<int, std::unordered_set<std::size_t>>& msum, int nc) explicit

Constructor.

Parameters
fctproxy in Distributed FCT proxy
transporter in Host (Transporter) proxy
meshwriter in Mesh writer proxy
ginpoel in Vector of mesh element connectivity owned (global IDs)
coordmap in Coordinates of mesh nodes and their global IDs
msum in Global mesh node IDs associated to chare IDs bordering the mesh chunk we operate on
nc in Total number of Discretization chares

void inciter::Discretization::resize(const tk::UnsMesh::Chunk& chunk, const tk::UnsMesh::Coords& coord, const std::unordered_map<int, std::vector<std::size_t>>& msum)

Resize mesh data structures (e.g., after mesh refinement)

Parameters
chunk in New mesh chunk (connectivity and global<->local id maps)
coord in New mesh node coordinates
msum in New node communication map

void inciter::Discretization::setRefiner(const CProxy_Refiner& ref)

Set Refiner Charm++ proxy.

Parameters
ref in Incoming refiner proxy to store

void inciter::Discretization::comvol(const std::vector<std::size_t>& gid, const std::vector<tk::real>& nodevol)

Collect nodal volumes across chare boundaries.

Parameters
gid in Global mesh node IDs at which we receive volume contributions
nodevol in Partial sums of nodal volume contributions to chare-boundary nodes

This function receives contributions to m_vol, which stores the nodal volumes. While m_vol stores own contributions, m_volc collects the neighbor chare contributions during communication. This way work on m_vol and m_volc is overlapped. The two are combined in totalvol().

void inciter::Discretization::setdt(tk::real newdt)

Set time step size.

Parameters
newdt in Size of the new time step

void inciter::Discretization::write(const std::vector<std::size_t>& inpoel, const tk::UnsMesh::Coords& coord, const std::map<int, std::vector<std::size_t>>& bface, const std::map<int, std::vector<std::size_t>>& bnode, const std::vector<std::size_t>& triinpoel, const std::vector<std::string>& elemfieldnames, const std::vector<std::string>& nodefieldnames, const std::vector<std::vector<tk::real>>& elemfields, const std::vector<std::vector<tk::real>>& nodefields, CkCallback c)

Output mesh and fields data (solution dump) to file(s)

Parameters
inpoel in Mesh connectivity for the mesh chunk to be written
coord in Node coordinates of the mesh chunk to be written
bface in Map of boundary-face lists mapped to corresponding side set ids for this mesh chunk
bnode in Map of boundary-node lists mapped to corresponding side set ids for this mesh chunk
triinpoel in Interconnectivity of points and boundary-face in this mesh chunk
elemfieldnames in Names of element fields to be output to file
nodefieldnames in Names of node fields to be output to file
elemfields in Field data in mesh elements to output to file
nodefields in Field data in mesh node to output to file
in Function to continue with after the write

Since m_meshwriter is a Charm++ chare group, it never migrates and an instance is guaranteed on every PE. We index the first PE on every logical compute node. In Charm++'s non-SMP mode, a node is the same as a PE, so the index is the same as CkMyPe(). In SMP mode the index is the first PE on every logical node. In non-SMP mode this yields one or more output files per PE with zero or non-zero virtualization, respectively. If there are multiple chares on a PE, the writes are serialized per PE, since only a single entry method call can be executed at any given time. In SMP mode, still the same number of files are output (one per chare), but the output is serialized through the first PE of each compute node. In SMP mode, channeling multiple files via a single PE on each node is required by NetCDF and HDF5, as well as ExodusII, since none of these libraries are thread-safe.

std::unordered_map<int, std::unordered_set<std::size_t>> inciter::Discretization::msumset() const

Return chare-node adjacency map as sets.

Returns Chare-node adjacency map that holds sets instead of vectors

const tk::UnsMesh::Coords& inciter::Discretization::Coord() const

Coordinates accessors as const-ref

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

Pack/Unpack serialize member function.

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

void inciter::Discretization::operator|(PUP::er& p, Discretization& i)

Pack/Unpack serialize operator|.

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