23 #include "order/order_internal.h"
132 double timer_all = 0.;
133 double timer_current = 0.;
139 if (pastix_data == NULL) {
140 pastix_print_error(
"pastix_subtask_blend: wrong pastix_data parameter" );
143 if ( !(pastix_data->
steps & STEP_SYMBFACT) ) {
144 pastix_print_error(
"pastix_subtask_blend: pastix_subtask_symbfact() has to be called before calling this function" );
148 iparm = pastix_data->
iparm;
149 dparm = pastix_data->
dparm;
152 symbmtx = pastix_data->
symbmtx;
155 if (ordeptr == NULL) {
156 pastix_print_error(
"pastix_subtask_blend: the pastix_data->ordemesh field has not been initialized, pastix_task_order should be called first" );
159 if (symbmtx == NULL) {
160 pastix_print_error(
"pastix_subtask_blend: the pastix_data->symbmtx has not been initialized, pastix_task_symbfact should be called first" );
163 if (symbmtx->
dof < 1) {
164 pastix_print_error(
"pastix_subtask_blend: Dof number has not been correctly initialized" );
169 if ( pastix_data->
graph != NULL ) {
171 memFree_null( pastix_data->
graph );
175 if ( pastix_data->
solvloc != NULL ) {
177 memFree_null( pastix_data->
solvloc );
179 if ( pastix_data->
solvglob != NULL ) {
181 memFree_null( pastix_data->
solvglob );
187 pastix_data->
solvloc = solvmtx_loc;
188 pastix_data->
solvglob = solvmtx_glob;
194 clockStart(timer_all);
196 pastix_print( procnum, 0, OUT_STEP_BLEND );
203 pastix_print( procnum, 0, OUT_BLEND_CONF,
216 pastix_print( procnum, 0, OUT_BLEND_CHKSMBMTX );
221 #if defined(PASTIX_ORDER_DRAW_LASTSEP)
230 #if !defined(PASTIX_BLEND_PROPMAP_2STEPS)
240 pastix_print( procnum, 0, OUT_BLEND_SPLITSYMB );
242 clockStart(timer_current);
246 clockStop(timer_current);
248 pastix_print( procnum, 0, OUT_BLEND_SPLITSYMB_TIME,
249 clockVal(timer_current) );
252 #if defined(PASTIX_ORDER_DRAW_LASTSEP)
263 pastix_print( procnum, 0, OUT_BLEND_ELIMTREE );
265 clockStart(timer_current);
269 clockStop(timer_current);
271 pastix_print( procnum, 0, OUT_BLEND_ELIMTREE_TIME,
272 clockVal(timer_current) );
279 pastix_print( procnum, 0, OUT_BLEND_COSTMATRIX );
281 clockStart(timer_current);
287 clockStop(timer_current);
289 pastix_print( procnum, 0, OUT_BLEND_COSTMATRIX_TIME,
290 clockVal(timer_current) );
307 pastix_print( procnum, 0, OUT_BLEND_ELIMTREE_TOTAL_COST,
316 pastix_print( procnum, 0, OUT_BLEND_PROPMAP );
318 clockStart(timer_current);
330 clockStop(timer_current);
333 pastix_print( procnum, 0, OUT_BLEND_PROPMAP_TIME,
334 clockVal(timer_current) );
343 #if defined(PASTIX_BLEND_PROPMAP_2STEPS)
346 ( pastix_data->
procnum == 0 ) )
371 pastix_print( procnum, 0, OUT_BLEND_SPLITSYMB );
373 clockStart(timer_current);
379 clockStop(timer_current);
381 pastix_print( procnum, 0, OUT_BLEND_SPLITSYMB_TIME,
382 clockVal(timer_current) );
388 ( pastix_data->
procnum == 0 ) )
413 #if defined(PASTIX_SYMBOL_DUMP_SYMBMTX)
439 pastix_print( procnum, 0, OUT_BLEND_BUILDSIMU );
441 clockStart(timer_current);
444 MALLOC_INTERN(simuctrl, 1,
SimuCtrl);
451 clockStop(timer_current);
454 pastix_print( procnum, 0, OUT_BLEND_BUILDSIMU_TIME,
455 clockVal(timer_current),
460 pastix_print( procnum, 0, OUT_BLEND_SIMU );
462 clockStart(timer_current);
464 simuRun( simuctrl, &ctrl, symbmtx );
466 clockStop(timer_current);
468 pastix_print( procnum, 0, OUT_BLEND_SIMU_TIME,
469 clockVal(timer_current) );
473 #ifdef PASTIX_DYNSCHED
481 clockStart(timer_current);
483 splitPartLocal( &ctrl, simuctrl, symbmtx );
485 clockStop(timer_current);
487 pastix_print( procnum, 0,
" -- Split build at time: %g --\n", clockVal(timer_current));
502 pastix_print( procnum, 0, OUT_BLEND_SOLVER );
504 clockStart(timer_current);
507 pastix_data->
ordemesh, simuctrl, &ctrl,
511 pastix_data->
ordemesh, simuctrl, &ctrl,
514 clockStop(timer_current);
516 pastix_print( procnum, 0, OUT_BLEND_SOLVER_TIME,
517 clockVal(timer_current) );
531 #if defined(PASTIX_DEBUG_BLEND)
534 pastix_print( procnum, 0, OUT_BLEND_CHKSOLVER );
545 clockStop(timer_all);
560 memFree_null(pastix_data->
symbmtx);
577 pastix_print( procnum, 0, OUT_BLEND_SUMMARY,
597 MPI_Reduce(&sizeL, &sizeG, 1, PASTIX_MPI_INT, MPI_MAX, 0, pastix_comm);
601 sizeG *=
sizeof(pastix_complex64_t);
606 fprintf( stdout, OUT_COEFSIZE,
607 pastix_print_value(sizeG),
608 pastix_print_unit(sizeG) );
628 pastix_data->
steps &= ~( STEP_CSC2BCSC |
633 pastix_data->
steps |= STEP_ANALYSE;
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.
Cand * candInit(pastix_int_t cblknbr)
Initialize the candtab array with default values.
void candGenCompressedDot(const EliminTree *etree, const Cand *candtab, FILE *stream)
Print the compressed elimination tree in a dot file, where all nodes with the same candidates are mer...
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.
void candGenDot(const EliminTree *etree, const Cand *candtab, FILE *stream)
Print the elimination tree in a dot file.
void candGenDotLevel(const EliminTree *etree, const Cand *candtab, FILE *stream, pastix_int_t level)
Print the first levels of the elimination tree in a dot file.
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 * core2clust
pastix_int_t up_after_split
pastix_int_t local_nbcores
pastix_int_t width_tasks2d
pastix_int_t local_nbctxts
pastix_int_t level_tasks2d
pastix_int_t local_nbthrds
pastix_int_t total_nbcores
int blendCtrlInit(pastix_data_t *pastix_data, BlendCtrl *ctrl)
Initialize the Blend control structure.
void blendCtrlExit(BlendCtrl *)
Finalize the Blend control structure.
The type and structure definitions.
static pastix_int_t eTreeRoot(const EliminTree *etree)
Return the root of the elimination tree.
EliminTree * eTreeBuild(const symbol_matrix_t *)
Build the elimination tree.
void eTreeExit(EliminTree *)
Free the elimination tree structure.
void simuExit(SimuCtrl *, pastix_int_t, pastix_int_t, pastix_int_t)
Free the simulation structure.
pastix_int_t simuInit(SimuCtrl *, const symbol_matrix_t *, const Cand *, pastix_int_t, pastix_int_t)
Initialize the simulation structures.
void simuTaskBuild(SimuCtrl *, const symbol_matrix_t *)
Initialize the tasktab array of the simulation structure.
Control structure for the simulation.
void solverRealloc(SolverMatrix *solvptr)
Realloc in a contiguous way a given solver structure.
int solverSave(const SolverMatrix *solvptr, FILE *stream)
Save a solver matrix structure into a file.
void solverPrintStats(const SolverMatrix *solvptr)
Print statistical information about the solver matrix structure.
int solverCheck(const SolverMatrix *solvmtx)
Checks the consistency of the given solver matrix structure.
void solverExit(SolverMatrix *solvmtx)
Free the content of the solver matrix structure.
int pastix_subtask_blend(pastix_data_t *pastix_data)
Compute the proportional mapping and the final solver structure.
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.
@ IPARM_COMPRESS_MIN_WIDTH
@ IPARM_NNZEROS_BLOCK_LOCAL
@ IPARM_SPLITTING_STRATEGY
@ PASTIX_ERR_BADPARAMETER
@ PastixSplitKwayProjections
void splitSymbol(BlendCtrl *ctrl, symbol_matrix_t *symbmtx)
Split the column blocks of the symbol matrix to generate parallelism.
void propMappTree(Cand *candtab, const EliminTree *etree, pastix_int_t candnbr, int nocrossproc, int allcand)
Apply the proportional mapping algorithm.
void simuRun(SimuCtrl *, const BlendCtrl *, const symbol_matrix_t *)
Run the simulation to map the data on the nodes.
int solverMatrixGen(SolverMatrix *solvmtx, const symbol_matrix_t *symbmtx, const pastix_order_t *ordeptr, const SimuCtrl *simuctl, const BlendCtrl *ctrl, PASTIX_Comm comm, isched_t *isched)
Initialize the solver matrix structure.
int solverMatrixGenSeq(SolverMatrix *solvmtx, const symbol_matrix_t *symbmtx, const pastix_order_t *ordeptr, const SimuCtrl *simuctl, const BlendCtrl *ctrl, PASTIX_Comm comm, isched_t *isched, pastix_int_t is_dbg)
Initialize the solver matrix structure in sequential.
void graphExit(pastix_graph_t *graph)
Free the content of the graph structure.
void pastixSymbolPrintStats(const symbol_matrix_t *symbptr)
Print statistical information about the symbolic matrix structure.
int pastixSymbolDraw(const symbol_matrix_t *symbptr, FILE *stream)
Export the symbol structure in a PostScript format.
size_t pastixSymbolGetNNZ(const symbol_matrix_t *symbptr)
Computes the number of non-zero elements in L.
void pastixSymbolDrawMap(pastix_data_t *pastix_data, const char *extname, pastix_int_t sndeidx)
Dump a separator mapping into a map file.
int pastixSymbolSave(const symbol_matrix_t *symbptr, FILE *stream)
Save the given block matrix structure to the given stream.
void pastixSymbolGetFlops(const symbol_matrix_t *symbmtx, pastix_coeftype_t flttype, pastix_factotype_t factotype, double *thflops, double *rlflops)
Computes the number of theoretical and real flops.
void pastixSymbolExit(symbol_matrix_t *symbptr)
Free the content of symbolic matrix.
int pastixSymbolCheck(const symbol_matrix_t *symbptr)
Checks the consistency of the given symbolic block matrix.
pastix_order_t * ordemesh
symbol_matrix_t * symbmtx
PASTIX_Comm inter_node_comm
Main PaStiX data structure.
Solver column block structure.