GHOST  1.1.2
General, Hybrid, and Optimized Sparse Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Global operations

Numerical operations which involve communication. More...

Collaboration diagram for Global operations:

Functions

ghost_error ghost_dot (void *res, ghost_densemat *vec1, ghost_densemat *vec2)
 Compute the global dot product of two dense vectors/matrices. More...
 
ghost_error ghost_spmv (ghost_densemat *res, ghost_sparsemat *mat, ghost_densemat *invec, ghost_spmv_opts opts)
 Multiply a sparse matrix with a dense vector. More...
 
ghost_error ghost_gemm (ghost_densemat *x, ghost_densemat *v, const char *transv, ghost_densemat *w, const char *transw, void *alpha, void *beta, int reduce, ghost_gemm_flags flags)
 Compute the general (dense) matrix-matrix product x = v*w. More...
 
ghost_error ghost_normalize (ghost_densemat *x)
 Normalizes a densemat (interpreted as a block vector). More...
 
ghost_error ghost_tsmtspmtsm (ghost_densemat *x, ghost_densemat *v, ghost_densemat *w, ghost_sparsemat *A, void *alpha, void *beta, int reduce)
 Multiply a transposed distributed dense tall skinny matrix with a sparse matrix and another distributed dense tall skinny matrix and Allreduce the result. More...
 
ghost_error ghost_tsmttsm (ghost_densemat *x, ghost_densemat *v, ghost_densemat *w, void *alpha, void *beta, int reduce, int conjv, ghost_gemm_flags flags)
 Multiply a transposed distributed dense tall skinny matrix with another distributed dense tall skinny matrix and Allreduce the result. More...
 

Detailed Description

Numerical operations which involve communication.

These operations usually call one or more local operations (cf. Local operations) together with communication calls.

Function Documentation

ghost_error ghost_dot ( void *  res,
ghost_densemat vec1,
ghost_densemat vec2 
)

Compute the global dot product of two dense vectors/matrices.

Parameters
resWhere to store the result.
vec1The first vector/matrix.
vec2The second vector/matrix.
Returns
GHOST_SUCCESS on success or an error indicator.

This function first computes the local dot product and then performs an allreduce on the result.

Here is the call graph for this function:

ghost_error ghost_gemm ( ghost_densemat x,
ghost_densemat v,
const char *  transv,
ghost_densemat w,
const char *  transw,
void *  alpha,
void *  beta,
int  reduce,
ghost_gemm_flags  flags 
)

Compute the general (dense) matrix-matrix product x = v*w.

Parameters
x
v
transv
w
transw
alpha
beta
reduce
flags
Returns

Here is the call graph for this function:

ghost_error ghost_normalize ( ghost_densemat x)

Normalizes a densemat (interpreted as a block vector).

Parameters
xThe densemat.
Returns
GHOST_SUCCESS on success or an error indicator.

This function normalizes every column of the matrix to have Euclidian norm 1.

Here is the call graph for this function:

ghost_error ghost_spmv ( ghost_densemat res,
ghost_sparsemat mat,
ghost_densemat invec,
ghost_spmv_opts  opts 
)

Multiply a sparse matrix with a dense vector.

Parameters
resThe result vector.
matThe sparse matrix.
invecThe right hand side vector.
optsConfiguration options for the spMV operation.
Returns
GHOST_SUCCESS on success or an error indicator.

In the most general case, this function computes the operation $y = \alpha (A - \gamma I) x + \beta y$. If required by the operation, $\alpha$ , $\beta$, $\gamma$, $\delta$, $\eta$, dot, and z have to be given in the traits struct (z has to be pointer to a ghost_densemat, everyhing else are pointers to variables of the same type as the vector's data).

Application of the scaling factor $\alpha$ can be switched on by setting GHOST_SPMV_SCALE in the flags. Otherwise, $\alpha=1$.

The scaling factor $\beta$ can be enabled by setting GHOST_SPMV_AXPBY in the flags. The flag GHOST_SPMV_AXPY sets $\beta$ to a fixed value of 1 which is a very common case.

$\gamma$ will be evaluated if the flags contain GHOST_SPMV_SHIFT or GHOST_SPMV_VSHIFT.

In case GHOST_SPMV_DOT, GHOST_SPMV_DOT_YY, GHOST_SPMV_DOT_XY, or GHOST_SPMV_DOT_XX are set, dot has to point to a memory destination with the size (3 * "number of vector columns" * "sizeof(vector entry))". Column-wise dot products $y^Hy, x^Hy, x^Hx$ will be computed and stored to this location.

This operation maybe changed with an additional AXPBY operation on the vector z: $z = \delta z + \eta y$ If this should be done, GHOST_SPMV_CHAIN_AXPBY has to be set in the flags.

Here is the call graph for this function:

ghost_error ghost_tsmtspmtsm ( ghost_densemat x,
ghost_densemat v,
ghost_densemat w,
ghost_sparsemat A,
void *  alpha,
void *  beta,
int  reduce 
)

Multiply a transposed distributed dense tall skinny matrix with a sparse matrix and another distributed dense tall skinny matrix and Allreduce the result.

Parameters
[in,out]x
[in]v
[in]w
[in]A
[in]alpha
[in]beta

$ x = \alpha \cdot v^T \cdot A \cdot w + \beta \cdot x $.

x is MxN, redundant.

v is KxM, distributed.

w is KxM, distributed.

A is a KxK sparse matrix

M,N << K

alpha and beta are pointers to values in host memory, that have the same data type as x

The data types of x, v, w and A have to be the same, except for the special case that v, w, and A are float, and x is double. In that case, all calculations are peformed in double precision.

This kernel is auto-generated at compile time for given values of M and N.

Returns
GHOST_SUCCESS on success or an error indicator.

Here is the call graph for this function:

ghost_error ghost_tsmttsm ( ghost_densemat x,
ghost_densemat v,
ghost_densemat w,
void *  alpha,
void *  beta,
int  reduce,
int  conjv,
ghost_gemm_flags  flags 
)

Multiply a transposed distributed dense tall skinny matrix with another distributed dense tall skinny matrix and Allreduce the result.

Parameters
[in,out]x
[in]v
[in]w
[in]alpha
[in]beta
[in]reduce
[in]contextIn which context to do the reduction if one is specified.
[in]conjvIf v should be conjugated, set this to != 1.
[in]flagsFlags. Currently, they are only checked for GHOST_GEMM_KAHAN.

$ x = \alpha \cdot v^T \cdot w + \beta \cdot x $.

v is NxM, distributed.

w is NxK, distributed.

x is NxK, redundant.

M<<N

This kernel is auto-generated at compile time for given values of K and M.

Returns
GHOST_SUCCESS on success or an error indicator.

Here is the call graph for this function: