53 MALLOC_INTERN( candtab, cblknbr+1,
Cand );
56 for(i=-1;i<cblknbr;i++, cand++)
65 cand->
cblktype = CBLK_LAYOUT_2D | CBLK_TASKS_2D;
86 memFree_null( candtab );
109 pastix_int_t cblknbr,
110 const char *directory )
117 fprintf(f,
"%ld\n", (
long)cblknbr );
118 for(i=-1;i<cblknbr;i++)
120 fprintf(f,
"%lf %ld %ld %ld %ld %ld %ld %ld\n",
121 (
double)candtab[i].costlevel,
122 (
long)candtab[i].treelevel,
123 (
long)candtab[i].fcandnum,
124 (
long)candtab[i].lcandnum,
125 (
long)candtab[i].fccandnum,
126 (
long)candtab[i].lccandnum,
127 (
long)candtab[i].cluster,
128 (
long)candtab[i].cblktype );
159 pastix_int_t cblknbr,
160 const pastix_int_t *core2clust,
161 pastix_int_t coresnbr )
166 assert( candtab[-1].fcandnum == 0 );
167 assert( candtab[-1].lcandnum == coresnbr-1 );
169 candtab[-1].lccandnum = core2clust[ candtab[-1].lcandnum ];
171 for(i=0; i<cblknbr; i++) {
172 assert( candtab[i].fcandnum >= 0 );
173 assert( candtab[i].lcandnum >= 0 );
174 assert( candtab[i].fcandnum < coresnbr );
175 assert( candtab[i].lcandnum < coresnbr );
176 candtab[i].fccandnum = core2clust[ candtab[i].fcandnum ];
177 candtab[i].lccandnum = core2clust[ candtab[i].lcandnum ];
208 pastix_int_t facecblknum;
210 for(i=0; i<symbmtx->
cblknbr; i++)
213 j < symbmtx->cblktab[i+1].bloknum; j++)
217 if( (candtab[i].fcandnum < candtab[facecblknum].fcandnum) ||
218 (candtab[i].lcandnum > candtab[facecblknum].lcandnum) )
220 pastix_print_error(
"bad processor candidat sets : cblk %ld candidat =[%ld %ld] father %ld candidat = [%ld %ld].",
221 (
long)i, (
long)candtab[i].fcandnum, (
long)candtab[i].lcandnum,
222 (
long)facecblknum, (
long)candtab[facecblknum].fcandnum,
223 (
long)candtab[facecblknum].lcandnum);
278 double cost, mycp = 0.0;
279 pastix_int_t i, son, sonsnbr;
282 if ( rootnum == -1 ) {
298 for(i=0; i<sonsnbr; i++)
309 mycp = (mycp > soncp) ? mycp : soncp;
370 pastix_int_t cblktype,
371 pastix_int_t ratiolimit2D,
372 pastix_int_t ratiolimitLR,
380 if ( (cblktype & CBLK_IN_SCHUR) &&
383 cblktype &= ~(CBLK_IN_SCHUR);
386 if( (cblktype & CBLK_TASKS_2D) && (width < ratiolimit2D) ) {
387 cblktype = cblktype & (~CBLK_TASKS_2D);
390 if( (cblktype & CBLK_COMPRESSED) && (width < ratiolimitLR) ) {
391 cblktype = cblktype & (~CBLK_COMPRESSED);
394 candtab[ rootnum ].
cblktype = cblktype;
400 ratiolimit2D, ratiolimitLR,
401 candtab, etree, symbmtx );
456 pastix_int_t cblktype,
457 pastix_int_t ratiolimit2D,
458 pastix_int_t ratiolimitLR,
464 pastix_int_t sonstype = 0;
467 if ( (cblktype & CBLK_IN_SCHUR) &&
470 cblktype &= ~(CBLK_IN_SCHUR);
477 ratiolimit2D, ratiolimitLR,
478 candtab, etree, symbmtx );
481 if( (cblktype & CBLK_TASKS_2D) && (width < ratiolimit2D) ) {
482 cblktype = cblktype & (~CBLK_TASKS_2D);
485 if( (cblktype & CBLK_COMPRESSED) && (width < ratiolimitLR) ) {
486 cblktype = cblktype & (~CBLK_COMPRESSED);
489 candtab[ rootnum ].
cblktype = cblktype | sonstype;
541 pastix_int_t cblktype,
542 pastix_int_t level2D,
543 pastix_int_t ratiolimitLR,
549 pastix_int_t sonstype = 0;
552 if ( (cblktype & CBLK_IN_SCHUR) &&
555 cblktype &= ~(CBLK_IN_SCHUR);
558 if( (cblktype & CBLK_TASKS_2D) && (level2D <= 0) ) {
559 cblktype = cblktype & (~CBLK_TASKS_2D);
567 level2D, ratiolimitLR,
568 candtab, etree, symbmtx );
571 if( (cblktype & CBLK_COMPRESSED) && (width < ratiolimitLR) ) {
572 cblktype = cblktype & (~CBLK_COMPRESSED);
575 candtab[ rootnum ].
cblktype = cblktype | sonstype;
623 pastix_int_t cblktype,
624 pastix_int_t level2D,
625 pastix_int_t ratiolimitLR,
633 if ( (cblktype & CBLK_IN_SCHUR) &&
636 cblktype &= ~(CBLK_IN_SCHUR);
639 if( (cblktype & CBLK_TASKS_2D) && (level2D <= 0) ) {
640 cblktype = cblktype & (~CBLK_TASKS_2D);
643 if( (cblktype & CBLK_COMPRESSED) && (width < ratiolimitLR) ) {
644 cblktype = cblktype & (~CBLK_COMPRESSED);
652 level2D, ratiolimitLR,
653 candtab, etree, symbmtx );
656 candtab[ rootnum ].
cblktype = cblktype;
709 candBuild( pastix_int_t level_tasks2d, pastix_int_t width_tasks2d,
717 pastix_int_t i, son, root =
eTreeRoot(etree);
718 pastix_int_t cblktype = CBLK_LAYOUT_2D | CBLK_TASKS_2D | CBLK_IN_SCHUR | CBLK_COMPRESSED;
720 #if defined(PASTIX_CUDA_FERMI)
721 cblktype = CBLK_IN_SCHUR | CBLK_COMPRESSED;
731 lr_width = PASTIX_INT_MAX;
737 #if defined(PASTIX_BLEND_DEEPEST_DISTRIB)
742 if( level_tasks2d < 0 )
745 width_tasks2d, lr_width,
746 candtab, etree, symbmtx );
751 level_tasks2d, lr_width,
752 candtab, etree, symbmtx );
760 if( level_tasks2d < 0 )
763 width_tasks2d, lr_width,
764 candtab, etree, symbmtx );
769 level_tasks2d, lr_width,
770 candtab, etree, symbmtx );