23 #include "order/order_internal.h"
124 pastix_int_t procnum, verbose;
129 SolverMatrix *solvmtx_loc;
130 SolverMatrix *solvmtx_glob;
132 double timer_all = 0.;
133 double timer_current = 0.;
138 if (pastix_data == NULL) {
139 pastix_print_error(
"pastix_subtask_blend: wrong pastix_data parameter" );
142 if ( !(pastix_data->steps & STEP_SYMBFACT) ) {
143 pastix_print_error(
"pastix_subtask_blend: pastix_subtask_symbfact() has to be called before calling this function" );
147 iparm = pastix_data->iparm;
148 dparm = pastix_data->dparm;
149 procnum = pastix_data->inter_node_procnum;
150 ordeptr = pastix_data->ordemesh;
151 symbmtx = pastix_data->symbmtx;
154 if (ordeptr == NULL) {
155 pastix_print_error(
"pastix_subtask_blend: the pastix_data->ordemesh field has not been initialized, pastix_task_order should be called first" );
158 if (symbmtx == NULL) {
159 pastix_print_error(
"pastix_subtask_blend: the pastix_data->symbmtx has not been initialized, pastix_task_symbfact should be called first" );
162 if (symbmtx->
dof < 1) {
163 pastix_print_error(
"pastix_subtask_blend: Dof number has not been correctly initialized" );
168 if ( pastix_data->graph != NULL ) {
170 memFree_null( pastix_data->graph );
174 if ( pastix_data->solvmatr != NULL ) {
176 memFree_null( pastix_data->solvmatr );
178 if ( pastix_data->solvglob != NULL ) {
180 memFree_null( pastix_data->solvglob );
183 solvmtx_loc = (SolverMatrix*)malloc(
sizeof(SolverMatrix));
184 solvmtx_glob = (SolverMatrix*)malloc(
sizeof(SolverMatrix));
185 pastix_data->solvloc = solvmtx_loc;
186 pastix_data->solvglob = solvmtx_glob;
189 pastix_data->solvmatr = pastix_data->solvloc;
192 clockStart(timer_all);
194 pastix_print( procnum, 0, OUT_STEP_BLEND );
201 pastix_print( procnum, 0, OUT_BLEND_CONF,
214 pastix_print( procnum, 0, OUT_BLEND_CHKSMBMTX );
219 #if defined(PASTIX_ORDER_DRAW_LASTSEP)
224 pastixSymbolDrawMap( pastix_data,
"bsplit", ordeptr->
sndenbr-1 );
228 #if !defined(PASTIX_BLEND_PROPMAP_2STEPS)
238 pastix_print( procnum, 0, OUT_BLEND_SPLITSYMB );
240 clockStart(timer_current);
244 clockStop(timer_current);
246 pastix_print( procnum, 0, OUT_BLEND_SPLITSYMB_TIME,
247 clockVal(timer_current) );
250 #if defined(PASTIX_ORDER_DRAW_LASTSEP)
254 pastixSymbolDrawMap( pastix_data,
"asplit", ordeptr->
sndenbr-1 );
261 pastix_print( procnum, 0, OUT_BLEND_ELIMTREE );
263 clockStart(timer_current);
267 clockStop(timer_current);
269 pastix_print( procnum, 0, OUT_BLEND_ELIMTREE_TIME,
270 clockVal(timer_current) );
277 pastix_print( procnum, 0, OUT_BLEND_COSTMATRIX );
279 clockStart(timer_current);
285 clockStop(timer_current);
287 pastix_print( procnum, 0, OUT_BLEND_COSTMATRIX_TIME,
288 clockVal(timer_current) );
305 pastix_print( procnum, 0, OUT_BLEND_ELIMTREE_TOTAL_COST,
314 pastix_print( procnum, 0, OUT_BLEND_PROPMAP );
316 clockStart(timer_current);
328 clockStop(timer_current);
331 pastix_print( procnum, 0, OUT_BLEND_PROPMAP_TIME,
332 clockVal(timer_current) );
341 #if defined(PASTIX_BLEND_PROPMAP_2STEPS)
344 ( pastix_data->procnum == 0 ) )
347 stream =
pastix_fopenw( pastix_data->dir_global,
"etree.dot",
"w" );
353 stream =
pastix_fopenw( pastix_data->dir_global,
"ctree.dot",
"w" );
369 pastix_print( procnum, 0, OUT_BLEND_SPLITSYMB );
371 clockStart(timer_current);
377 clockStop(timer_current);
379 pastix_print( procnum, 0, OUT_BLEND_SPLITSYMB_TIME,
380 clockVal(timer_current) );
386 ( pastix_data->procnum == 0 ) )
389 stream =
pastix_fopenw( pastix_data->dir_global,
"etree_split.dot",
"w" );
395 stream =
pastix_fopenw( pastix_data->dir_global,
"ctree_split.dot",
"w" );
411 #if defined(PASTIX_SYMBOL_DUMP_SYMBMTX)
415 stream =
pastix_fopenw( pastix_data->dir_global,
"symbol_after_split.eps",
"w" );
427 file =
pastix_fopenw( pastix_data->dir_global,
"symbol_after_split",
"w" );
437 pastix_print( procnum, 0, OUT_BLEND_BUILDSIMU );
439 clockStart(timer_current);
442 MALLOC_INTERN(simuctrl, 1,
SimuCtrl);
449 clockStop(timer_current);
452 pastix_print( procnum, 0, OUT_BLEND_BUILDSIMU_TIME,
453 clockVal(timer_current),
458 pastix_print( procnum, 0, OUT_BLEND_SIMU );
460 clockStart(timer_current);
462 simuRun( simuctrl, &ctrl, symbmtx );
464 clockStop(timer_current);
466 pastix_print( procnum, 0, OUT_BLEND_SIMU_TIME,
467 clockVal(timer_current) );
471 #ifdef PASTIX_DYNSCHED
479 clockStart(timer_current);
481 splitPartLocal( &ctrl, simuctrl, symbmtx );
483 clockStop(timer_current);
485 pastix_print( procnum, 0,
" -- Split build at time: %g --\n", clockVal(timer_current));
500 pastix_print( procnum, 0, OUT_BLEND_SOLVER );
502 clockStart(timer_current);
505 pastix_data->ordemesh, simuctrl, &ctrl,
506 pastix_data->inter_node_comm, pastix_data->isched, 0 );
509 pastix_data->ordemesh, simuctrl, &ctrl,
510 pastix_data->inter_node_comm, pastix_data->isched );
512 clockStop(timer_current);
514 pastix_print( procnum, 0, OUT_BLEND_SOLVER_TIME,
515 clockVal(timer_current) );
529 #if defined(PASTIX_DEBUG_BLEND)
532 pastix_print( procnum, 0, OUT_BLEND_CHKSOLVER );
543 clockStop(timer_all);
552 memFree_null(pastix_data->symbmtx);
569 pastix_print( procnum, 0, OUT_BLEND_SUMMARY,
586 PASTIX_Comm pastix_comm = pastix_data->inter_node_comm;
587 pastix_int_t sizeL = solvmtx_loc->coefnbr;
588 pastix_int_t sizeG = 0;
590 MPI_Reduce(&sizeL, &sizeG, 1, PASTIX_MPI_INT, MPI_MAX, 0, pastix_comm);
594 sizeG *=
sizeof(pastix_complex64_t);
599 fprintf( stdout, OUT_COEFSIZE,
600 pastix_print_value(sizeG),
601 pastix_print_unit(sizeG) );
613 file =
pastix_fopenw( pastix_data->dir_global,
"solvergen",
"w" );
621 pastix_data->steps &= ~( STEP_CSC2BCSC |
626 pastix_data->steps |= STEP_ANALYSE;