22 #ifndef DOXYGEN_SHOULD_SKIP_THIS
70 for (itercblk=0; itercblk<solvmtx->
cblknbr; itercblk++, cblk++)
72 if ( cblk->
cblktype & (CBLK_FANIN|CBLK_RECV) ) {
75 if ( solvmtx->clustnum != cblk->
ownerid ) {
79 sprintf( filename,
"%s_%ld.txt", prefix, (
long)cblk->
gcblknum );
81 if ( stream == NULL ){
128 const char *directory )
137 rc = asprintf( &filename,
"Lcblk%05ld_init.txt", (
long int) itercblk );
149 rc = asprintf( &filename,
"Ucblk%05ld_init.txt", (
long int) itercblk );
206 for(cblknum=0; cblknum<solvA->
cblknbr; cblknum++, cblkA++, cblkB++) {
208 if ( rc != saved_rc ){
209 fprintf(stderr,
"CBLK %ld was not correctly compressed\n", (
long)cblknum);
252 for(cblknum=0; cblknum<solvmtx->
cblknbr; cblknum++, cblk++) {
253 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
278 for(cblknum=0; cblknum<solvmtx->
cblknbr; cblknum++, cblk++) {
279 if (cblk->
cblktype & CBLK_COMPRESSED) {
321 #if defined(PASTIX_SUPERNODE_STATS)
326 for(i=0; i<solvmtx->
bloknbr; i++, solvblok++ ) {
333 if ( cblk->
ownerid != solvmtx->clustnum ) {
338 if ( lcblk->
cblktype & (CBLK_RECV|CBLK_FANIN) ) {
342 if ( !(lcblk->
cblktype & CBLK_COMPRESSED) ) {
344 last[solvblok->
inlast] += 2 * size;
347 last[solvblok->
inlast] += size;
354 assert( ((nrows+ncols) * solvblok->
LRblock[0].
rkmax) <= size );
358 last[solvblok->
inlast] += size;
365 assert( ((nrows+ncols) * solvblok->
LRblock[1].
rkmax) <= size );
369 last[solvblok->
inlast] += size;
374 for (i=0; i<3; i++) {
375 memlast[i] = last[i] * pastix_size_of( PastixFloat );
377 memlast[3] = memlast[0] + memlast[1] + memlast[2];
379 pastix_print( solvmtx->clustnum, 0,
380 " Compression on LAST\n"
381 " ------------------------------------------------\n"
386 pastix_print_value(memlast[0]), pastix_print_unit(memlast[0]),
387 pastix_print_value(memlast[1]), pastix_print_unit(memlast[1]),
388 pastix_print_value(memlast[2]), pastix_print_unit(memlast[2]),
389 pastix_print_value(memlast[3]), pastix_print_unit(memlast[3]));
392 for(cblknum=0; cblknum<solvmtx->
cblknbr; cblknum++, cblk++) {
396 if ( cblk->
ownerid != solvmtx->clustnum ) {
401 if ( cblk->
cblktype & (CBLK_RECV|CBLK_FANIN) ) {
405 if ( !(cblk->
cblktype & CBLK_COMPRESSED) )
412 while( (blok < cblk[1].fblokptr) &&
420 off_height -= in_height;
427 orig[
LR_DInD] += colnbr * colnbr;
443 for (i=0; i<MEMORY_STATS_SIZE; i++) {
444 memlr[i] = (orig[i] - gain[i]) * pastix_size_of( PastixFloat );
445 memfr[i] = orig[i] * pastix_size_of( PastixFloat );
451 pastix_print( solvmtx->clustnum, 0,
453 " ------------------------------------------------\n"
454 " Full-rank supernodes\n"
455 " Inside %8.3g %co\n"
456 " Outside %8.3g %co\n"
457 " Low-rank supernodes\n"
458 " Diag in diag %8.3g %co\n"
459 " Inside not selected %8.3g %co / %8.3g %co\n"
460 " Inside selected %8.3g %co / %8.3g %co\n"
461 " Outside %8.3g %co / %8.3g %co\n"
462 " ------------------------------------------------\n"
463 " Total %8.3g %co / %8.3g %co\n",
467 pastix_print_value(memfr[
LR_DInD]), pastix_print_unit(memfr[
LR_DInD]),
478 pastix_print_value(totlr), pastix_print_unit(totlr),
479 pastix_print_value(totfr), pastix_print_unit(totfr) );
518 for(cblknum=0; cblknum<solvmtx->
cblknbr; cblknum++, cblk++) {
523 if ( cblk->
ownerid != solvmtx->clustnum ) {
528 if ( cblk->
cblktype & (CBLK_RECV|CBLK_FANIN) ) {
532 totmem += (float)colnbr * (
float)rownbr;
539 totmem *= (float)pastix_size_of( PastixFloat );
544 pastix_print( solvmtx->clustnum, 0,
545 " Memory usage of coeftab %8.3g %co\n",
617 nbcol = solvmtx->
nodenbr - fcolnum;
618 assert( nbcol <= lds );
621 ret = LAPACKE_slaset_work( LAPACK_COL_MAJOR,
'A', nbcol, nbcol, 0., 0., S, lds );
624 for (itercblk=solvmtx->
cblkschur; itercblk<solvmtx->cblknbr; itercblk++, cblk++)
626 assert( cblk->
cblktype & CBLK_IN_SCHUR );
627 assert( lds >= cblk->
stride );
629 localS = S + (cblk->
fcolnum - fcolnum) * lds + (cblk->
fcolnum - fcolnum);
666 for (itercblk=0; itercblk<solvmtx->
cblknbr; itercblk++, cblk++)
669 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
677 if ( cblk->
cblktype & CBLK_LAYOUT_2D ) {
685 for (i=0; i<nbcol; i++, D += incD, A += lda ) {
void coeftab_smemory_lr(const SolverMatrix *solvmtx, const pastix_int_t *iparm, pastix_fixdbl_t *dparm)
Compute the memory gain of the low-rank form over the full-rank form for the entire matrix.
void coeftab_smemory_fr(const SolverMatrix *solvmtx, const pastix_int_t *iparm, pastix_fixdbl_t *dparm)
Compute the memory usage of the full-rank form for the entire matrix.
BEGIN_C_DECLS typedef int pastix_int_t
int coeftab_sdiff(pastix_coefside_t side, const SolverMatrix *solvA, SolverMatrix *solvB)
Compare two solver matrices in full-rank format with the same data distribution.
void coeftab_sgetschur(const SolverMatrix *solvmtx, float *S, pastix_int_t lds)
Extract the Schur complement.
void cpucblk_sdumpfile(pastix_coefside_t side, SolverCblk *cblk, pastix_int_t itercblk, const char *directory)
Dump a single column block into a FILE in a human readale format.
void coeftab_sdump(pastix_data_t *pastix_data, const SolverMatrix *solvmtx, const char *prefix)
Dump the solver matrix coefficients into a file in human readable format.
void coeftab_smemory(const SolverMatrix *solvmtx, const pastix_int_t *iparm, pastix_fixdbl_t *dparm)
Compute the memory usage for the entire matrix.
void coeftab_sgetdiag(const SolverMatrix *solvmtx, float *D, pastix_int_t incD)
Extract the diagonal.
void coeftab_suncompress(SolverMatrix *solvmtx)
Uncompress all column block in low-rank format into full-rank format.
pastix_int_t coeftab_scompress(SolverMatrix *solvmtx)
Compress all the cblks marked as valid for low-rank format.
void cpucblk_sgetschur(const SolverCblk *cblk, int upper_part, float *S, pastix_int_t lds)
Extract a cblk panel of the Schur complement to a dense lapack form.
void cpucblk_suncompress(pastix_coefside_t side, SolverCblk *cblk)
Uncompress a single column block from low-rank format to full-rank format.
void cpucblk_smemory(pastix_coefside_t side, const 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.
int cpucblk_sdiff(pastix_coefside_t side, const SolverCblk *cblkA, SolverCblk *cblkB)
Compare two column blocks in full-rank format.
pastix_int_t cpucblk_scompress(const SolverMatrix *solvmtx, pastix_coefside_t side, int max_ilulvl, SolverCblk *cblk)
Compress a single column block from full-rank to low-rank format.
void cpucblk_sdump(pastix_coefside_t side, const SolverCblk *cblk, FILE *stream)
Dump a single column block into a FILE in a human readale format.
pastix_int_t(* core_get_rklimit)(pastix_int_t, pastix_int_t)
Compute the maximal rank accepted for a given matrix size. The pointer is set according to the low-ra...
FILE * pastix_fopenw(const char *dirname, const char *filename, const char *mode)
Open a file in the unique directory of the pastix instance.
void pastix_gendirectories(pastix_data_t *pastix_data)
Generate a unique temporary directory to store output files.
enum pastix_coefside_e pastix_coefside_t
Data blocks used in the kernel.
Main PaStiX data structure.
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.
SolverBlok *restrict bloktab
pastix_factotype_t factotype
pastix_lrblock_t * LRblock[2]
SolverCblk *restrict cblktab
Solver column block structure.
Solver column block structure.