41 #ifndef DOXYGEN_SHOULD_SKIP_THIS
43 int pastix_blend_with_constant_split(
void ) {
44 return pastix_env_is_set_to(
"PASTIX_BLEND_SPLIT",
"CONSTANT");
48 int pastix_blend_with_smallest_upper_split(
void ) {
49 return pastix_env_is_set_to(
"PASTIX_BLEND_SPLIT",
"UPPER");
53 int pastix_blend_split_percent(
void ) {
55 pastix_getenv_get_value_int(
"PASTIX_BLEND_SPLIT_AUTORIZED_PERCENTAGE",
90 if( width <= blas_max_col) {
93 nseq = pastix_iceil( width, blas_max_col );
96 if ( nseq > 1 && (width / nseq) < blas_min_col ) {
139 memset( nblocksperline, 0, size *
sizeof(
pastix_int_t) );
142 for(bloknum=0; bloknum<symbmtx->
bloknbr; bloknum++, curblok++ )
144 if ( curblok->
lrownum < frowsplit ) {
152 for(line = pastix_imax( curblok->
frownum, frowsplit);
153 line < curblok->lrownum; line++ )
155 nblocksperline[ line-frowsplit ]++;
158 assert( nblocksperline[ size-1 ] == 0 );
160 return nblocksperline;
163 #ifndef DOXYGEN_SHOULD_SKIP_THIS
216 lmin = pastix_imax( lavg - limit - 1, min );
217 lmax = pastix_imin( lavg + limit + 1, max );
220 nbsplit = nblocksperline[ lcolnum ];
223 for(i=lavg+1; i<lmax; i++ )
225 if ( nblocksperline[ i ] < nbsplit )
228 nbsplit = nblocksperline[ i ];
231 for(i=lavg-1; i>lmin; i-- )
233 if ( nblocksperline[ i ] < nbsplit )
236 nbsplit = nblocksperline[ i ];
291 lmin = pastix_imax( lavg - limit, min );
292 lmax = pastix_imin( lavg + limit + 1, max );
295 nbsplit = nblocksperline[ lcolnum ];
298 for(i=lmin; i<lmax; i++ )
300 if ( nblocksperline[ i ] <= nbsplit )
303 nbsplit = nblocksperline[ i ];
342 pastix_int_t authorized_percent __attribute__((unused)) )
389 if (pastix_blend_with_constant_split()) {
392 else if (pastix_blend_with_smallest_upper_split()) {
396 authorized_percent = pastix_blend_split_percent();
399 for(cblknum = 0; cblknum<symbmtx->
cblknbr; cblknum++, curcblk++)
408 if ( curcblk->selevtx == SYMBCBLK_KWAY ) {
416 width = lcolnum - fcolnum + 1;
423 if ( nblocksperline == NULL ) {
424 assert( fsplitrow == -1 );
425 assert( fcolnum != -1 );
428 nblocksperline -= fsplitrow;
433 while( fcol <= lcolnum )
445 step = pastix_iceil( width, nseq );
452 lcol = fcol + split_fct( nblocksperline + fcol,
454 authorized_percent );
456 assert( (lcol >= fcol) && (lcol <= lcolnum) );
462 lwidth = lcol - fcol + 1;
463 width = width - lwidth;
470 extracblk->
addcblk += nbcblk-1;
472 extracblk->
sptcbnb[cblknum] = nbcblk;
476 for(bloknum = curcblk[0].bloknum + 1;
477 bloknum < curcblk[1].
bloknum; bloknum++, curblok++)
479 for(line = curblok->
frownum; line < curblok->lrownum; line++ )
481 nblocksperline[ line ] += nbcblk-1;
486 if ( nblocksperline != NULL ) {
487 assert( fsplitrow != -1 );
488 nblocksperline += fsplitrow;
489 memFree_null( nblocksperline );
553 if (ctrl->
etree != NULL) {
BEGIN_C_DECLS typedef int pastix_int_t
void candUpdate(Cand *candtab, EliminTree *etree, const symbol_matrix_t *symbmtx, const CostMatrix *costmtx)
Update the candtab array costs after the symbol split algorithm has been applied.
void costMatrixExit(CostMatrix *costmtx)
Free the cost matrix structure.
CostMatrix * costMatrixBuild(const symbol_matrix_t *symbmtx, pastix_coeftype_t flttype, pastix_factotype_t factotype)
Build the cost matrix structure from the symbol matrix structure.
pastix_int_t up_after_split
The type and structure definitions.
EliminTree * eTreeBuild(const symbol_matrix_t *)
Build the elimination tree.
void eTreeExit(EliminTree *)
Free the elimination tree structure.
static pastix_int_t computeNbSplit(const BlendCtrl *ctrl, pastix_int_t width)
Compute the number of cut for a given cblk width and number of candidates.
void extraCblkAdd(ExtraCblk_t *extracblk, pastix_int_t fcolnum, pastix_int_t lcolnum, int8_t selevtx)
Add a new additional cblk defined by its first and last columns.
void extraCblkExit(ExtraCblk_t *extracblk)
Free the extracblk structure.
static pastix_int_t computeSmallestSplit(const pastix_int_t *nblocksperline, pastix_int_t step, pastix_int_t min, pastix_int_t max, pastix_int_t authorized_percent)
Compute the cut that minimizes the generation of off-diagonal blocks.
static pastix_int_t computeConstantSplit(const pastix_int_t *nblocksperline, pastix_int_t step, pastix_int_t min, pastix_int_t max, pastix_int_t authorized_percent)
Compute a constant cut with the given parameters.
void extraCblkMerge(const ExtraCblk_t *extracblk, symbol_matrix_t *newsymb, Cand **candtab)
Merge the existing symbol structure with the additional information from the extracblk structure.
void splitSmart(const BlendCtrl *ctrl, const symbol_matrix_t *symbmtx, ExtraCblk_t *extracblk)
Split the column blocks to generate parallelism.
void extraCblkInit(pastix_int_t cblknbr, ExtraCblk_t *extracblk)
Initialize the extracblk structure.
static pastix_int_t * computeNbBlocksPerLine(const symbol_matrix_t *symbmtx, pastix_int_t frowsplit)
Generate an array with the number of blocks facing each row to minimize the cuts.
static pastix_int_t computeSmallestSplit_max(const pastix_int_t *nblocksperline, pastix_int_t step, pastix_int_t min, pastix_int_t max, pastix_int_t authorized_percent)
Compute the cut that minimizes the generation of off-diagonal blocks.
void splitSymbol(BlendCtrl *ctrl, symbol_matrix_t *symbmtx)
Split the column blocks of the symbol matrix to generate parallelism.
void pastixSymbolPrintStats(const symbol_matrix_t *symbptr)
Print statistical information about the symbolic matrix structure.
int pastixSymbolCheck(const symbol_matrix_t *symbptr)
Checks the consistency of the given symbolic block matrix.
Symbol column block structure.