Go to the documentation of this file.
19 #include "common/common.h"
22 #include "kernels_trace.h"
58 pastix_int_t M, pastix_int_t N,
61 pastix_fixdbl_t flops;
62 pastix_complex32_t *A = lrA->
u;
64 if ( lrA->
rk != -1 ) {
67 assert( lrA->
u != NULL );
68 assert( lrA->
v == NULL );
70 kernel_trace_start_lvl2( PastixKernelLvl2_LR_init_compress );
73 kernel_trace_stop_lvl2_rank( flops, lrA->
rk );
75 assert( A != lrA->
u );
120 pastix_int_t gainL = 0;
121 pastix_int_t gainU = 0;
124 assert( cblk->
cblktype & CBLK_LAYOUT_2D );
125 assert( cblk->
cblktype & CBLK_COMPRESSED );
127 if ( ncols < lowrank->compress_min_width ) {
131 for (; blok<lblok; blok++)
134 int is_preselected = ( blok->
iluklvl <= max_ilulvl );
137 if ( nrows < lowrank->compress_min_height ) {
141 if ( is_preselected ) {
145 gain = nrows * ncols;
152 if ( lrA->
rk == -1 ) {
156 if ( lrA->
rk != -1 ) {
157 gainL += gain - ((nrows+ncols) * lrA->
rk);
165 if ( lrA->
rk == -1 ) {
169 if ( lrA->
rk != -1 ) {
170 gainU += gain - ((nrows+ncols) * lrA->
rk);
175 return gainL + gainU;
207 for (; blok<lblok; blok++)
226 for (; blok<lblok; blok++)
278 SolverMatrix *solvmtx,
288 pastix_int_t origblok;
289 pastix_int_t gainblok, gaintmp;
291 assert( cblk->
ownerid == solvmtx->clustnum );
294 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
295 int ilu_lvl = solvmtx->lowrank.compress_preselect ? -1 : solvmtx->lowrank.ilu_lvl;
299 for (; blok<lblok; blok++)
303 size = nrows * ncols;
311 gaintmp = (size - ((nrows+ncols) * blok->
LRblock[0]->
rkmax));
312 assert( gaintmp >= 0 );
320 gaintmp = (size - ((nrows+ncols) * blok->
LRblock[1]->
rkmax));
321 assert( gaintmp >= 0 );
static pastix_int_t blok_rownbr(const SolverBlok *blok)
Compute the number of rows of a block.
static pastix_int_t cblk_colnbr(const SolverCblk *cblk)
Compute the number of columns in a column block.
Structure to define the type of function to use for the low-rank kernels and their parameters.
pastix_fixdbl_t cpublok_ccompress(const pastix_lr_t *lowrank, pastix_int_t M, pastix_int_t N, pastix_lrblock_t *lrA)
Compress a single block from full-rank to low-rank format.
void cpucblk_cuncompress(pastix_coefside_t side, SolverCblk *cblk)
Uncompress a single column block from low-rank format to full-rank format.
Solver column block structure.
enum pastix_coefside_e pastix_coefside_t
Data blocks used in the kernel.
The block low-rank structure to hold a matrix in low-rank form.
int core_clr2ge(pastix_trans_t trans, pastix_int_t M, pastix_int_t N, const pastix_lrblock_t *Alr, pastix_complex32_t *A, pastix_int_t lda)
Convert a low rank matrix into a dense matrix.
void core_clralloc(pastix_int_t M, pastix_int_t N, pastix_int_t rkmax, pastix_lrblock_t *A)
Allocate a low-rank matrix.
static int blok_is_preselected(const SolverCblk *cblk, const SolverBlok *blok, const SolverCblk *fcbk)
Return if a block is preselected as either part of the projection, or as a sub-diagonal block.
pastix_int_t cpucblk_ccompress(const SolverMatrix *solvmtx, pastix_coefside_t side, int max_ilulvl, SolverCblk *cblk)
Compress a single column block from full-rank to low-rank format.
pastix_lrblock_t * LRblock[2]
void core_clrfree(pastix_lrblock_t *A)
Free a low-rank matrix.
void cpucblk_cmemory(pastix_coefside_t side, SolverMatrix *solvmtx, SolverCblk *cblk, pastix_int_t *orig, pastix_int_t *gain)
Return the memory gain of the low-rank form over the full-rank form for a single column-block.