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 );
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 );
166 assert( candtab[-1].fcandnum == 0 );
167 assert( candtab[-1].lcandnum == coresnbr-1 );
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 );
177 candtab[i].lccandnum = core2clust[ candtab[i].lcandnum ];
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;
282 if ( rootnum == -1 ) {
298 for(i=0; i<sonsnbr; i++)
309 mycp = (mycp > soncp) ? mycp : soncp;
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 );
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;
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;
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;
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 );
BEGIN_C_DECLS typedef int pastix_int_t
int candCheck(const Cand *candtab, const symbol_matrix_t *symbmtx)
Check the correctness of the computed candidates.
void candSubTreeDistribFirstLevel(pastix_int_t rootnum, pastix_int_t cblktype, pastix_int_t level2D, pastix_int_t ratiolimitLR, Cand *candtab, const EliminTree *etree, const symbol_matrix_t *symbmtx)
Recursive function to compute the distribution of the nodes among the different levels based on depth...
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.
static double candSubTreeBuild(pastix_int_t rootnum, Cand *candtab, EliminTree *etree, const symbol_matrix_t *symbmtx, const CostMatrix *costmtx, double *cripath)
Recursive function to update the cost fields of the both the candtab array, and the elimination tree ...
Cand * candInit(pastix_int_t cblknbr)
Initialize the candtab array with default values.
void candSave(const Cand *candtab, pastix_int_t cblknbr, const char *directory)
Print the candidates array into the candtab.txt file.
pastix_int_t candSubTreeDistribDeepestLevel(pastix_int_t rootnum, pastix_int_t cblktype, pastix_int_t level2D, pastix_int_t ratiolimitLR, Cand *candtab, const EliminTree *etree, const symbol_matrix_t *symbmtx)
Recursive function to compute the distribution of the nodes among the different levels based on depth...
void candExit(Cand *candtab)
Exit and free the candtab structure given.
void candSetClusterCand(Cand *candtab, pastix_int_t cblknbr, const pastix_int_t *core2clust, pastix_int_t coresnbr)
Set the clusters candidates from the cores canditates.
void candBuild(pastix_int_t level_tasks2d, pastix_int_t width_tasks2d, pastix_compress_when_t lr_when, pastix_int_t lr_width, Cand *candtab, EliminTree *etree, const symbol_matrix_t *symbmtx, const CostMatrix *costmtx)
Finish to build the candtab array for the proportionnal mapping.
pastix_int_t candSubTreeDistribDeepestWidth(pastix_int_t rootnum, pastix_int_t cblktype, pastix_int_t ratiolimit2D, pastix_int_t ratiolimitLR, Cand *candtab, const EliminTree *etree, const symbol_matrix_t *symbmtx)
Recursive function to compute the distribution of the nodes among the different levels.
void candSubTreeDistribFirstWidth(pastix_int_t rootnum, pastix_int_t cblktype, pastix_int_t ratiolimit2D, pastix_int_t ratiolimitLR, Cand *candtab, const EliminTree *etree, const symbol_matrix_t *symbmtx)
Recursive function to compute the distribution of the nodes among the different levels.
Processor candidate group to own a column blok.
Arrays of double to store the cost of each element in the matrix.
static pastix_int_t eTreeRoot(const EliminTree *etree)
Return the root of the elimination tree.
static pastix_int_t eTreeSonI(const EliminTree *etree, pastix_int_t node, pastix_int_t i)
Return the i^{th} son of a given node.
FILE * pastix_fopenw(const char *dirname, const char *filename, const char *mode)
Open a file in the unique directory of the pastix instance.
enum pastix_compress_when_e pastix_compress_when_t
Compression strategy available for IPARM_COMPRESS_WHEN parameter.
static double cost(symbol_cblk_t *cblk)
Computes the cost of a cblk.