class
ConjugateGradientsConjugateGradients Charm++ chare array used to perform a distributed linear solve with the conjugate gradients algorithm.
Contents
Public functions
-
auto ConjugateGradients(const CSR& A,
const std::vector<tk::
real>& x, const std::vector<tk:: real>& b, std::size_t maxit, tk:: real stop_tol, const std::vector<std::size_t>& gid, const std::unordered_map<std::size_t, std::size_t>& lid, const NodeCommMap& nodecommmap) -> ConjugateGradients_SDAG_CODE explicit - Constructor.
- void init(CkCallback c)
- Migrate constructor.
- void solve(CkCallback c)
- Solve linear system.
-
void normb(tk::
real n) - Compute the norm of the right hand side.
-
void rho(tk::
real r) - Compute rho = (r,r)
-
void comres(const std::vector<std::size_t>& gid,
const std::vector<std::vector<tk::
real>>& rc) - Receive contributions to r = b - A * x on chare-boundaries.
-
void comq(const std::vector<std::size_t>& gid,
const std::vector<std::vector<tk::
real>>& qc) - Receive contributions to q = A * p on chare-boundaries.
-
void pq(tk::
real n) - Compute the dot product (p,q)
-
void normres(tk::
real r) - Compute the norm of the residual: (r,r)
Pack/unpack (Charm++ serialization) routines
- void pup(PUP::er& p) override
- Pack/Unpack serialize member function.
- void operator|(PUP::er& p, ConjugateGradients& c)
- Pack/Unpack serialize operator|.
Function documentation
ConjugateGradients_SDAG_CODE tk:: ConjugateGradients:: ConjugateGradients(const CSR& A,
const std::vector<tk:: real>& x,
const std::vector<tk:: real>& b,
std::size_t maxit,
tk:: real stop_tol,
const std::vector<std::size_t>& gid,
const std::unordered_map<std::size_t, std::size_t>& lid,
const NodeCommMap& nodecommmap) explicit
Constructor.
Parameters | |
---|---|
A in | Left hand side matrix of the linear system to solve in Ax=b |
x in | Solution (initial guess) of the linear system to solve in Ax=b |
b in | Right hand side of the linear system to solve in Ax=b |
maxit in | Max iteration count |
stop_tol | |
gid in | Global node ids |
lid in | Local node ids associated to global ones |
nodecommmap in | Global mesh node IDs shared with other chares associated to their chare IDs |
void tk:: ConjugateGradients:: init(CkCallback c)
Migrate constructor.
Parameters | |
---|---|
c in | Call to continue with after initialization is complete |
Initialize solver
void tk:: ConjugateGradients:: solve(CkCallback c)
Solve linear system.
Parameters | |
---|---|
c in | Call to continue with after solve is complete |
void tk:: ConjugateGradients:: comres(const std::vector<std::size_t>& gid,
const std::vector<std::vector<tk:: real>>& rc)
Receive contributions to r = b - A * x on chare-boundaries.
Parameters | |
---|---|
gid in | Global mesh node IDs at which we receive contributions |
rc in | Partial contributions at chare-boundary nodes |
void tk:: ConjugateGradients:: pup(PUP::er& p) override
Pack/Unpack serialize member function.
Parameters | |
---|---|
p in/out | Charm++'s PUP::er serializer object reference |
void tk:: ConjugateGradients:: operator|(PUP::er& p,
ConjugateGradients& c)
Pack/Unpack serialize operator|.
Parameters | |
---|---|
p in/out | Charm++'s PUP::er serializer object reference |
c in/out | ConjugateGradients object reference |