23 #include "common/common.h"
63 assert( cblk->
cblktype & CBLK_LAYOUT_2D );
64 assert( lrblok != NULL );
66 for (; (blok < lblok) && (blok->
fcblknm == fcblknm); blok++, lrblok++)
70 lrblok->
rkmax = nrows;
107 assert( cblk->
cblktype & CBLK_LAYOUT_2D );
108 assert( lrblok != NULL );
110 for (; blok<lblok; blok++, lrblok++)
114 lrblok->
rkmax = nrows;
156 size_t size = lblok - blok;
159 assert( cblk->
cblktype & CBLK_LAYOUT_2D );
163 if ( LRblocks == NULL ) {
167 if (!pastix_atomic_cas_xxb( &(blok->
LRblock[0]), (uint64_t)NULL, (uint64_t)LRblocks,
sizeof(
void*) )) {
172 assert( LRblocks != NULL );
174 for (; blok<lblok; blok++)
178 blok->
LRblock[1] = LRblocks + size;
226 size_t coefnbr = cblk->
stride * ncols;
276 pastix_cblk_lock( cblk );
287 pastix_cblk_unlock( cblk );
292 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
298 pastix_cblk_unlock( cblk );
325 pastix_cblk_lock( cblk );
328 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
332 assert( blok->
LRblock[0] != NULL );
333 for (; blok<lblok; blok++) {
337 if ( cblk->
lcoeftab != (
void*)-1 ) {
348 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
352 assert( blok->
LRblock[1] != NULL );
353 for (; blok<lblok; blok++) {
359 if ( (cblk->
cblktype & CBLK_COMPRESSED) &&
367 pastix_cblk_unlock( cblk );
397 const pastix_bcsc_t *bcsc,
403 SolverBlok *lsolvblok = (solvcblk+1)->fblokptr;
410 int is2d = solvcblk->
cblktype & CBLK_LAYOUT_2D;
412 assert( (side !=
PastixUCoef) || (ucoeftab != NULL) );
414 for (itercoltab=0; itercoltab<csccblk->
colnbr; itercoltab++)
423 for (iterval=frow; iterval<lrow; iterval++)
426 #if !defined(NDEBUG) && defined(PASTIX_DEBUG_DUMP_COEFTAB)
427 if ( isnan( (
float)Lvalues[iterval] ) || isinf( (
float)Lvalues[iterval] ) ) {
428 printf(
"cpucblk_cfillin_fr: Lvalues not initialised correctly.\n" );
431 if ( isnan( (
float)Uvalues[iterval] ) || isinf( (
float)Uvalues[iterval] ) ) {
432 printf(
"cpucblk_cfillin_fr: Uvalues not initialised correctly.\n" );
437 if (rownum >= (solvcblk->
fcolnum+itercoltab))
439 while ((solvblok < lsolvblok) &&
440 ((solvblok->
lrownum < rownum) ||
449 if ( solvblok < lsolvblok )
452 coefindx += rownum - solvblok->
frownum;
453 coefindx += itercoltab * ldd;
454 pastix_cblk_lock( solvcblk );
456 pastix_cblk_unlock( solvcblk );
459 lcoeftab[coefindx] = Lvalues[iterval];
463 (rownum > (solvcblk->
fcolnum + itercoltab)) )
465 #if defined(PRECISION_z) || defined(PRECISION_c)
467 ucoeftab[coefindx] = conjf(Uvalues[iterval]);
472 ucoeftab[coefindx] = Uvalues[iterval];
477 #if defined(PASTIX_DEBUG_COEFTAB)
478 fprintf(stderr,
"cpucblk_cfillin: drop coeff from CSC c=%ld(%ld) l=%ld(%ld) cblk=%ld fcol=%ld lcol=%ld\n",
479 (
long)solvcblk->
fcolnum + itercoltab, (
long)itercoltab,
480 (
long)rownum, (
long)iterval, (
long)itercblk,
516 const pastix_bcsc_t *bcsc,
522 SolverBlok *lsolvblok = (solvcblk+1)->fblokptr;
528 assert( solvcblk->
cblktype & CBLK_LAYOUT_2D );
530 for (itercoltab=0; itercoltab<csccblk->
colnbr; itercoltab++)
540 for (iterval=frow; iterval<lrow; iterval++)
545 if ( isnan( (
float)Lvalues[iterval] ) || isinf( (
float)Lvalues[iterval] ) ) {
546 printf(
"cpucblk_cfillin_lr: Lvalues not initialised correctly.\n" );
549 if ( isnan( (
float)Uvalues[iterval] ) || isinf( (
float)Uvalues[iterval] ) ) {
550 printf(
"cpucblk_cfillin_lr: Uvalues not initialised correctly.\n" );
555 if (rownum >= (solvcblk->
fcolnum+itercoltab))
557 while ((solvblok < lsolvblok) &&
558 ((solvblok->
lrownum < rownum) ||
567 if ( solvblok < lsolvblok )
569 coefindx = rownum - solvblok->
frownum;
570 coefindx += itercoltab * ldd;
571 pastix_cblk_lock( solvcblk );
573 pastix_cblk_unlock( solvcblk );
576 lcoeftab[coefindx] = Lvalues[iterval];
580 (rownum > (solvcblk->
fcolnum + itercoltab)) )
582 #if defined(PRECISION_z) || defined(PRECISION_c)
584 ucoeftab[coefindx] = conjf(Uvalues[iterval]);
587 ucoeftab[coefindx] = Uvalues[iterval];
591 #if defined(PASTIX_DEBUG_COEFTAB)
592 fprintf(stderr,
"cpucblk_cfillin: drop coeff from CSC c=%ld(%ld) l=%ld(%ld) cblk=%ld fcol=%ld lcol=%ld\n",
593 (
long)solvcblk->
fcolnum + itercoltab, (
long)itercoltab,
594 (
long)rownum, (
long)iterval, (
long)itercblk,
630 const pastix_bcsc_t *bcsc,
633 if ( (solvmtx->
cblktab + itercblk)->cblktype & CBLK_COMPRESSED ) {
static void cpucblk_cfillin_fr(pastix_coefside_t side, const SolverMatrix *solvmtx, const pastix_bcsc_t *bcsc, pastix_int_t itercblk)
Initialize the full-rank coeftab structure from the internat bcsc.
void cpublok_calloc_lrws(const SolverCblk *cblk, const SolverBlok *blok, pastix_lrblock_t *lrblok, pastix_complex32_t *ws)
Initialize a lrblock structure from a workspace from a specific block to the end of all blocks.
static void cpucblk_cfillin_lr(pastix_coefside_t side, const SolverMatrix *solvmtx, const pastix_bcsc_t *bcsc, pastix_int_t itercblk)
Initialize the low-rank coeftab structure from the internal bcsc.
BEGIN_C_DECLS typedef int pastix_int_t
float _Complex pastix_complex32_t
Compressed colptr format for the bcsc.
void cpucblk_cfillin(pastix_coefside_t side, const SolverMatrix *solvmtx, const pastix_bcsc_t *bcsc, pastix_int_t itercblk)
Initialize the coeftab structure from the internal bcsc.
void cpucblk_calloc_lr(pastix_coefside_t side, SolverCblk *cblk, int rkmax)
Allocate the cblk structure to store the coefficient.
void cpucblk_calloc_fr(pastix_coefside_t side, SolverCblk *cblk)
Allocate the cblk structure to store the coefficient.
void cpucblk_calloc_lrws(const SolverCblk *cblk, pastix_lrblock_t *lrblok, pastix_complex32_t *ws)
Initialize lrblock structure from a workspace for all blocks of the cblk associated.
void cpucblk_calloc(pastix_coefside_t side, SolverCblk *cblk)
Allocate the cblk structure to store the coefficient.
void cpucblk_cfree(pastix_coefside_t side, SolverCblk *cblk)
Free the cblk structure that store the coefficient.
The block low-rank structure to hold a matrix in low-rank form.
void core_clralloc(pastix_int_t M, pastix_int_t N, pastix_int_t rkmax, pastix_lrblock_t *A)
Allocate a low-rank matrix.
void core_clrfree(pastix_lrblock_t *A)
Free a low-rank matrix.
enum pastix_coefside_e pastix_coefside_t
Data blocks used in the kernel.
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.
pastix_lrblock_t * LRblock[2]
SolverCblk *restrict cblktab
Solver column block structure.
Solver column block structure.