PaStiX Handbook  6.3.2
solver.c
Go to the documentation of this file.
1 /**
2  * @file solver.c
3  *
4  * PaStiX solver structure basic functions.
5  *
6  * @copyright 2004-2023 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
7  * Univ. Bordeaux. All rights reserved.
8  *
9  * @version 6.3.2
10  * @author Mathieu Faverge
11  * @author Pierre Ramet
12  * @author Xavier Lacoste
13  * @author Tony Delarue
14  * @date 2023-12-11
15  *
16  **/
17 #include "common.h"
18 #include "blend/solver.h"
20 #include "sopalin/coeftab.h"
21 
22 #if defined(PASTIX_WITH_PARSEC)
24 #endif
25 
26 #if defined(PASTIX_WITH_STARPU)
28 #endif
29 
30 /**
31  *******************************************************************************
32  *
33  * @ingroup blend_dev_solver_null
34  *
35  * @brief Compute the memory size used by the solver sturcture itself.
36  *
37  * This function doesn't count the memory space of the numerical information,
38  * but only the sapce of the data structure that describes the matrix.
39  *
40  *******************************************************************************
41  *
42  * @param[in] solvptr
43  * The pointer to the solver matrix structure.
44  *
45  *******************************************************************************
46  *
47  * @return the memory size in octet of the solver structure.
48  *
49  *******************************************************************************/
50 static inline size_t
51 solver_size( const SolverMatrix *solvptr )
52 {
53  size_t mem = sizeof(SolverMatrix);
54 
55  /* cblk and blocks arrays */
56  if ( solvptr->cblktab ) {
57  mem += solvptr->cblknbr * sizeof( SolverCblk );
58  }
59  if ( solvptr->bloktab ) {
60  mem += solvptr->bloknbr * sizeof( SolverBlok );
61  }
62  if ( solvptr->browtab ) {
63  mem += solvptr->brownbr * sizeof( pastix_int_t );
64  }
65 #if defined(PASTIX_WITH_PARSEC)
66  if ( solvptr->parsec_desc ) {
67  mem += sizeof( parsec_sparse_matrix_desc_t );
68  }
69 #endif
70 #if defined(PASTIX_WITH_STARPU)
71  if ( solvptr->starpu_desc ) {
72  mem += sizeof( starpu_sparse_matrix_desc_t );
73  }
74 #endif
75 
76  /* /\* BubbleTree *\/ */
77  /* if ( solvptr->btree ) { */
78  /* mem += solvptr->bublnbr * sizeof( BubbleTree ); */
79  /* mem += solvptr->btree->nodemax * sizeof( BubbleTreeNode ); */
80  /* mem += solvptr->btree->nodemax * sizeof( int ); */
81  /* } */
82 
83  /* Tasks */
84  if ( solvptr->tasktab ) {
85  mem += solvptr->tasknbr * sizeof(Task);
86  }
87  if ( solvptr->ttsknbr ) {
88  int i;
89  mem += solvptr->thrdnbr * sizeof(pastix_int_t);
90  mem += solvptr->thrdnbr * sizeof(pastix_int_t*);
91 
92  for( i=0; i<solvptr->thrdnbr; i++ ) {
93  mem += solvptr->ttsknbr[i] * sizeof(pastix_int_t);
94  }
95  }
96 
97  return mem;
98 }
99 
100 /**
101  * @addtogroup blend_dev_solver
102  * @{
103  *
104  */
105 
106 /**
107  *******************************************************************************
108  *
109  * @brief Initialize the solver structure.
110  *
111  *******************************************************************************
112  *
113  * @param[inout] solvmtx
114  * The solver structure to initialize.
115  *
116  *******************************************************************************/
117 void
119 {
120  memset(solvmtx, 0, sizeof (SolverMatrix));
121  solvmtx->cblkmax1d = -1;
122  solvmtx->cblkmaxblk = 1;
123  return;
124 }
125 
126 /**
127  *******************************************************************************
128  *
129  * @brief Free the content of the solver matrix structure.
130  *
131  * All the arrays from the structure are freed and the structure is memset to 0
132  * at exit, but the solver itself is not freed. It will require a new call to
133  * solverInit if the memory space area needs to be reused for a new solver
134  * matrix.
135  *
136  *******************************************************************************
137  *
138  * @param[inout] solvmtx
139  * The pointer to the structure to free.
140  *
141  *******************************************************************************/
142 void
144 {
145  pastix_int_t i;
146 
147  coeftabExit( solvmtx );
148 
149  /* Free arrays of solvmtx */
150  if(solvmtx->cblktab) {
151  memFree_null(solvmtx->cblktab);
152  }
153  if(solvmtx->bloktab) {
154  memFree_null(solvmtx->bloktab);
155  }
156  if(solvmtx->browtab) {
157  memFree_null(solvmtx->browtab);
158  }
159  if(solvmtx->gcbl2loc) {
160  memFree_null(solvmtx->gcbl2loc);
161  }
162  if(solvmtx->tasktab) {
163  memFree_null(solvmtx->tasktab);
164  }
165  memFree_null(solvmtx->ttsknbr);
166  for (i=0;i<solvmtx->bublnbr;i++)
167  {
168  if (solvmtx->ttsktab[i] != NULL) {
169  memFree_null(solvmtx->ttsktab[i]);
170  }
171  }
172  memFree_null(solvmtx->ttsktab);
173 #if defined(PASTIX_WITH_STARPU)
174  {
175  if ( solvmtx->starpu_desc_rhs != NULL ) {
176  starpu_dense_matrix_destroy( solvmtx->starpu_desc_rhs );
177  free( solvmtx->starpu_desc_rhs );
178  }
179  solvmtx->starpu_desc_rhs = NULL;
180  }
181 #endif
182 }
183 
184 /**
185  *******************************************************************************
186  *
187  * @brief Print statistical information about the solver matrix structure.
188  *
189  *******************************************************************************
190  *
191  * @param[in] solvptr
192  * The pointer to the solver matrix structure.
193  *
194  *******************************************************************************/
195 void
197 {
198  SolverCblk *cblk;
199  SolverBlok *blok;
200  size_t memstruct, memcoef;
201  pastix_int_t itercblk;
202  int64_t cblknbr;
203 
204  /* 0: Total, 1: 1d, 2: 2d */
205  int64_t fcol[3], lcol[3];
206  /* Average width of cblks, and height of off-diagonal blocks */
207  int64_t width[3] = { 0, 0, 0 };
208  int64_t height[3] = { 0, 0, 0 };
209  /* Number of cblks, and of blocks without diagonal blocks */
210  int64_t nbcblk[3] = { 0, 0, 0 };
211  int64_t nbblok[3] = { 0, 0, 0 };
212  int64_t fblok[3], lblok[3];
213  /* Number of blocks with teh regular diagonal partion of the matrix that includes subblocks */
214  int64_t nbpartblok[3] = { 0, 0, 0 };
215 
216  /* Compute the number of GEMM tasks in the multiple cases */
217  int64_t gemm_dense = 0;
218  int64_t gemm_nopart_full2 = 0;
219  int64_t gemm_nopart_hybrid = 0;
220  int64_t gemm_parsec_full2 = 0;
221  int64_t gemm_parsec_hybrid = 0;
222  int64_t gemm_starpu_full2 = 0;
223  int64_t gemm_starpu_hybrid = 0;
224  int64_t gemm_full1 = 0;
225 
226  cblknbr = solvptr->cblknbr;
227  cblk = solvptr->cblktab;
228  memcoef = 0;
229  for(itercblk=0; itercblk<cblknbr; itercblk++, cblk++)
230  {
231  pastix_int_t colnbr = cblk->lcolnum - cblk->fcolnum + 1;
232  pastix_int_t rownbr = cblk->stride;
233  int64_t bcol_size = cblk[1].fblokptr - cblk[0].fblokptr;
234  int64_t brow_size[3];
235  int64_t nbpblok = 0;
236 
237  brow_size[0] = cblk[1].brownum - cblk[0].brownum;
238  brow_size[1] = cblk[0].brown2d - cblk[0].brownum;
239  brow_size[2] = cblk[1].brownum - cblk[0].brown2d;
240  assert( brow_size[0] == (brow_size[1] + brow_size[2]) );
241 
242  memcoef += colnbr * rownbr;
243 
244  /* Update counters when no diagonal partitionning is considered and all blocks are considers */
245  gemm_nopart_full2 += brow_size[0] * bcol_size;
246  gemm_nopart_hybrid += brow_size[1] + (brow_size[2] * bcol_size);
247 
248  /* Compute the compressed version of the brow size */
249 #if !defined(NDEBUG)
250  {
251  pastix_int_t b;
252  pastix_int_t lcblk = -1;
253  pastix_int_t *browptr = solvptr->browtab + cblk[0].brownum;
254  int64_t brow_csze[3] = { 0, 0, 0 };
255 
256  for ( b = cblk[0].brownum; b < cblk[1].brownum; b++, browptr++ ) {
257  blok = solvptr->bloktab + (*browptr);
258  if ( blok->lcblknm != lcblk ) {
259  lcblk = blok->lcblknm;
260 
261  brow_csze[0]++;
262  if ( (solvptr->cblktab + lcblk)->cblktype & CBLK_TASKS_2D ) {
263  brow_csze[2]++;
264  }
265  else {
266  brow_csze[1]++;
267  }
268  }
269  }
270  assert( brow_csze[0] == (brow_csze[1] + brow_csze[2]) );
271  assert( brow_csze[0] <= brow_size[0] );
272  assert( brow_csze[1] <= brow_size[1] );
273  assert( brow_csze[2] <= brow_size[2] );
274  }
275 #endif
276 
277  /*
278  * Compute the compressed version of the bcol size
279  * The algorithm goes backward to avoid a double pass to compute StarPU
280  * number of tasks.
281  */
282  blok = cblk->fblokptr + 1;
283  while( blok < cblk[1].fblokptr ) {
284  while( (blok < cblk[1].fblokptr-1) &&
285  (blok[0].fcblknm == blok[1].fcblknm) &&
286  (blok[0].lcblknm == blok[1].lcblknm) )
287  {
288  blok++;
289  }
290  nbpblok++;
291  blok++;
292  }
293 
294  /* Compute the number of PaRSEC GEMM tasks in a left looking manner */
295  gemm_parsec_full2 += (nbpblok+1) * brow_size[0];
296  gemm_parsec_hybrid += ((nbpblok+1) * brow_size[2]) + brow_size[1];
297 
298  /* Compute the number of StarPU GEMM tasks in a right looking manner */
299  gemm_starpu_full2 += (nbpblok * (nbpblok+1)) / 2;
300 
301  if (cblk->cblktype & CBLK_TASKS_2D) {
302  gemm_starpu_hybrid += (nbpblok * (nbpblok+1)) / 2;
303 
304  nbpartblok[2] += nbpblok;
305  width[2] += colnbr;
306  height[2] += rownbr - colnbr;
307  }
308  else {
309  gemm_starpu_hybrid += bcol_size - 1;
310 
311  nbpartblok[1] += nbpblok;
312  width[1] += colnbr;
313  height[1] += rownbr - colnbr;
314  }
315 
316  nbpartblok[0] += nbpblok;
317  width[0] += colnbr;
318  height[0] += rownbr - colnbr;
319  }
320 
321  assert( (width[1] + width[2]) == solvptr->nodenbr );
322  assert( (width[1] + width[2]) == width[0] );
323  assert( (height[1] + height[2]) == height[0] );
324 
325  memstruct = solver_size( solvptr );
326 
327  gemm_dense = (cblknbr * ( cblknbr * cblknbr - 1 )) / 6;
328  gemm_full1 = solvptr->bloknbr - solvptr->cblknbr;
329 
330  fcol[0] = 0;
331  fcol[1] = 0;
332  fcol[2] = (solvptr->cblktab + solvptr->cblkmin2d)->fcolnum;
333 
334  lcol[0] = (solvptr->cblktab + solvptr->cblknbr )->fcolnum;
335  lcol[1] = (solvptr->cblktab + solvptr->cblkmax1d)->lcolnum + 1;
336  lcol[2] = (solvptr->cblktab + solvptr->cblknbr )->fcolnum;
337 
338  nbcblk[0] = cblknbr;
339  nbcblk[1] = (cblknbr - solvptr->nb2dcblk);
340  nbcblk[2] = solvptr->nb2dcblk;
341 
342  nbblok[0] = solvptr->bloknbr - cblknbr;
343  nbblok[1] = (solvptr->bloknbr - cblknbr) - (solvptr->nb2dblok - solvptr->nb2dcblk);
344  nbblok[2] = solvptr->nb2dblok - solvptr->nb2dcblk;
345 
346  fblok[0] = 0;
347  fblok[1] = 0;
348  fblok[2] = ((solvptr->cblktab + solvptr->cblkmin2d)->fblokptr - solvptr->bloktab);
349 
350  lblok[0] = solvptr->bloknbr;
351  lblok[1] = (solvptr->cblktab + solvptr->cblkmax1d + 1)->fblokptr - solvptr->bloktab;
352  lblok[2] = solvptr->bloknbr;
353 
354  fprintf( stdout,
355  " Solver Matrix statistics: | %-12s | %-12s | %-12s |\n"
356  " --------------------------------------------------------------------------------\n"
357  " Number of cblk | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " |\n"
358  " Number of block | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " |\n"
359  " Number of block (diag part.) | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " |\n"
360  " Cblk: first | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " |\n"
361  " last | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " |\n"
362  " Block: first | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " |\n"
363  " last | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " |\n"
364  " rownum: first | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " |\n"
365  " last | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " |\n"
366  " Average width | %12.2lf | %12.2lf | %12.2lf |\n"
367  " Average height | %12.2lf | %12.2lf | %12.2lf |\n"
368  " Structure memory space %11.2lf %co\n"
369  " Number of coeficients stored %10ld\n",
370  /* Header */
371  "All", "1d", "2d",
372  /* Number of cblk */
373  nbcblk[0], nbcblk[1], nbcblk[2],
374  /* Number of blok without diagonal blocks (Add cblknbr to get the total) */
375  nbblok[0], nbblok[1], nbblok[2],
376  /*
377  * Number of block in the compressed version (count 1 per block in
378  * the matrix partition following the diagonal blocks
379  */
380  nbpartblok[0], nbpartblok[1], nbpartblok[2],
381  /* Cblk */
382  (int64_t)0, (int64_t)0, (int64_t)(solvptr->cblkmin2d),
383  (int64_t)(cblknbr), (int64_t)(solvptr->cblkmax1d + 1), (int64_t)(cblknbr),
384  /* Blok */
385  fblok[0], fblok[1], fblok[2],
386  lblok[0], lblok[1], lblok[2],
387  /* Rownum/Colnum */
388  fcol[0], fcol[1], fcol[2],
389  lcol[0], lcol[1], lcol[2],
390  /* Average width */
391  (double)(width[0]) / (double)(nbcblk[0]),
392  (double)(width[1]) / (double)(nbcblk[1]),
393  (double)(width[2]) / (double)(nbcblk[2]),
394  /* Average height */
395  (double)(height[0]) / (double)(nbblok[0]),
396  (double)(height[1]) / (double)(nbblok[1]),
397  (double)(height[2]) / (double)(nbblok[2]),
398  /* Memory space */
399  pastix_print_value( memstruct ),
400  pastix_print_unit( memstruct ),
401  /* Memory coefficient */
402  (long)memcoef );
403 
404  fprintf( stdout,
405  " Number of GEMM tasks: | %-12s | %-12s | %-12s | %-12s |\n"
406  " - All blocks | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " |\n"
407  " - PaRSEC | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " |\n"
408  " - StarPU | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " | %12" PRIi64 " |\n",
409  "Dense", "Full2d", "Hybrid", "Full1d",
410  gemm_dense, gemm_nopart_full2, gemm_nopart_hybrid, gemm_full1,
411  gemm_dense, gemm_parsec_full2, gemm_parsec_hybrid, gemm_full1,
412  gemm_dense, gemm_starpu_full2, gemm_starpu_hybrid, gemm_full1 );
413 }
414 
415 /**
416  *******************************************************************************
417  *
418  * @brief Instanciate the arrays for the requests according to the scheduler.
419  *
420  *******************************************************************************
421  *
422  * @param[in] solve_step
423  * Define which step of the solve is concerned.
424  * @arg PastixSolveForward
425  * @arg PastixSolveBackward
426  * @arg PastixFacto
427  *
428  * @param[inout] solvmtx
429  * The pointer to the solver matrix structure.
430  *
431  *******************************************************************************/
432 void
434  SolverMatrix *solvmtx )
435 {
436  MPI_Request *request;
437  pastix_int_t *reqindx;
438  pastix_int_t i, reqnbr;
439 
440  if ( solve_step == PastixSolveBackward ) {
441  reqnbr = solvmtx->recvnbr + 1;
442  }
443  else {
444  reqnbr = solvmtx->faninnbr + 1;
445  }
446 
447  /* Restore recv and fanin nbr */
448  solvmtx->fanincnt = solvmtx->faninnbr;
449  solvmtx->recvcnt = solvmtx->recvnbr;
450 
451  solvmtx->reqnbr = reqnbr;
452  solvmtx->reqlock = PASTIX_ATOMIC_UNLOCKED;
453 
454  MALLOC_INTERN( solvmtx->reqtab, reqnbr, MPI_Request );
455  MALLOC_INTERN( solvmtx->reqidx, reqnbr, pastix_int_t );
456 
457  request = solvmtx->reqtab;
458  reqindx = solvmtx->reqidx;
459  for ( i = 0; i < reqnbr; i++, request++, reqindx++ )
460  {
461  *request = MPI_REQUEST_NULL;
462  *reqindx = -1;
463  }
464  solverComMatrixInit( solvmtx );
465 
466  return;
467 }
468 
469 /**
470  *******************************************************************************
471  *
472  * @brief Free the arrays related to the requests
473  *
474  *******************************************************************************
475  *
476  * @param[inout] solvmtx
477  * The pointer to the solver matrix structure.
478  *
479  *******************************************************************************/
480 void
482 {
483  assert( solvmtx->reqnum == 0 );
484  assert( solvmtx->reqlock == PASTIX_ATOMIC_UNLOCKED );
485 
486  if( solvmtx->reqtab ) {
487  memFree_null( solvmtx->reqtab );
488  }
489  if( solvmtx->reqidx ) {
490  memFree_null( solvmtx->reqidx );
491  }
492  solverComMatrixGather( solvmtx );
493  solverComMatrixExit( solvmtx );
494 }
495 
496 /**
497  *******************************************************************************
498  *
499  * @brief Allocate the reception buffer, and initiate the first persistant
500  * reception
501  *
502  *******************************************************************************
503  *
504  * @param[in] side
505  * Define which side of the cblk must be tested.
506  * @arg PastixLCoef if lower part only
507  * @arg PastixUCoef if upper part only
508  * @arg PastixLUCoef if both sides.
509  *
510  * @param[inout] solvmtx
511  * The pointer to the solver matrix structure.
512  *
513  * @param[in] flttype
514  * Define which type are the coefficients.
515  * @arg PastixFloat
516  * @arg PastixDouble
517  * @arg PastixComplex32
518  * @arg PastixComplex64
519  *
520  *******************************************************************************/
521 void
523  SolverMatrix *solvmtx,
524  pastix_coeftype_t flttype )
525 {
526  /* Compute the max size (in bytes) for the communication buffer */
527  pastix_int_t size = pastix_size_of(flttype) * solvmtx->maxrecv;
528  size *= (side == PastixLUCoef) ? 2 : 1;
529 
530  if( solvmtx->recvnbr == 0 ) {
531  return;
532  }
533 
534  assert( solvmtx->maxrecv > 0 );
535 
536  /* Init communication */
537  MALLOC_INTERN( solvmtx->rcoeftab, size, char );
538  MPI_Recv_init( solvmtx->rcoeftab, size,
539  MPI_CHAR, MPI_ANY_SOURCE, MPI_ANY_TAG,
540  solvmtx->solv_comm, solvmtx->reqtab );
541  MPI_Start( solvmtx->reqtab );
542 
543  assert( solvmtx->reqnum == 0 );
544  solvmtx->reqnum++;
545 #if defined(PASTIX_DEBUG_MPI)
546  fprintf( stderr, "[%2d] Start persistant recv from any source\n",
547  solvmtx->clustnum );
548 #endif
549 }
550 
551 /**
552  *******************************************************************************
553  *
554  * @brief Free the array linked to pending reception.
555  *
556  *******************************************************************************
557  *
558  * @param[inout] solvmtx
559  * The pointer to the solver matrix structure.
560  *
561  *******************************************************************************/
562 void
564 {
565  /* In fact, the pointer should never been freed by this call */
566  assert( solvmtx->reqtab == NULL );
567  if( solvmtx->rcoeftab ) {
568  memFree_null( solvmtx->rcoeftab );
569  }
570 }
571 
572 /**
573  *******************************************************************************
574  *
575  * @brief Computes the max size of recv cblk.
576  *
577  *******************************************************************************
578  *
579  * @param[inout] solvmtx
580  * The pointer to the solver matrix structure.
581  *
582  *******************************************************************************
583  *
584  * @return maximun recv size
585  *
586  *******************************************************************************/
587 static inline pastix_int_t
589 {
590  pastix_int_t cblknbr = solvmtx->cblknbr;
591  const SolverCblk *cblk;
592  pastix_int_t k, max = 0;
593 
594  cblk = solvmtx->cblktab;
595  for ( k = 0; k < cblknbr; k++, cblk++ ) {
596  if ( cblk->cblktype & (CBLK_RECV | CBLK_FANIN) ) {
597  max = pastix_imax( max, cblk_colnbr( cblk ) );
598  }
599  }
600 
601  return max;
602 }
603 
604 /**
605  *******************************************************************************
606  *
607  * @brief Allocates the reception buffer, and initiate the first persistant
608  * reception
609  *
610  *******************************************************************************
611  *
612  * @param[in] solve_step
613  * Define which step of the solve is concerned.
614  * @arg PastixSolveForward
615  * @arg PastixSolveBackward
616  *
617  * @param[inout] solvmtx
618  * The pointer to the solver matrix structure.
619  *
620  * @param[in] flttype
621  * Define which type are the coefficients.
622  * @arg PastixFloat
623  * @arg PastixDouble
624  * @arg PastixComplex32
625  * @arg PastixComplex64
626  *
627  * @param[inout] rhsb
628  * The pointer to the rhs data structure that holds the vectors of the
629  * right hand side.
630  *
631  *******************************************************************************/
632 void
634  SolverMatrix *solvmtx,
635  pastix_coeftype_t flttype,
636  pastix_rhs_t rhsb )
637 {
638  /* Computes the max size (in bytes) for the communication buffer */
639  pastix_int_t size;
640 
641  if ( ( ( solve_step == PastixSolveForward ) && ( solvmtx->recvnbr == 0 ) ) ||
642  ( ( solve_step == PastixSolveBackward ) && ( solvmtx->faninnbr == 0 ) ) )
643  {
644  return;
645  }
646 
647  size = pastix_size_of(flttype) * solverRhsRecvMax( solvmtx ) * rhsb->n;
648 
649  /* Init communication */
650  MALLOC_INTERN( solvmtx->rcoeftab, size, char );
651  MPI_Recv_init( solvmtx->rcoeftab, size,
652  MPI_CHAR, MPI_ANY_SOURCE, MPI_ANY_TAG,
653  solvmtx->solv_comm, solvmtx->reqtab );
654  MPI_Start( solvmtx->reqtab );
655 
656  assert( solvmtx->reqnum == 0 );
657  solvmtx->reqnum++;
658 #if defined(PASTIX_DEBUG_MPI)
659  fprintf( stderr, "[%2d] Start persistant recv from any source (max = %ld B)\n",
660  solvmtx->clustnum, (long)size );
661 #endif
662 }
663 
664 /**
665  *******************************************************************************
666  *
667  * @brief Frees the array linked to pending reception.
668  *
669  *******************************************************************************
670  *
671  * @param[inout] solvmtx
672  * The pointer to the solver matrix structure.
673  *
674  *******************************************************************************/
675 void
677 {
678  solverRecvExit( solvmtx );
679 }
680 
681 /**
682  *@}
683  */
BEGIN_C_DECLS typedef int pastix_int_t
Definition: datatypes.h:51
void solverRecvExit(SolverMatrix *solvmtx)
Free the array linked to pending reception.
Definition: solver.c:563
void solverRequestExit(SolverMatrix *solvmtx)
Free the arrays related to the requests.
Definition: solver.c:481
static pastix_int_t solverRhsRecvMax(SolverMatrix *solvmtx)
Computes the max size of recv cblk.
Definition: solver.c:588
void solverRhsRecvExit(SolverMatrix *solvmtx)
Frees the array linked to pending reception.
Definition: solver.c:676
void solverRecvInit(pastix_coefside_t side, SolverMatrix *solvmtx, pastix_coeftype_t flttype)
Allocate the reception buffer, and initiate the first persistant reception.
Definition: solver.c:522
void solverRhsRecvInit(solve_step_t solve_step, SolverMatrix *solvmtx, pastix_coeftype_t flttype, pastix_rhs_t rhsb)
Allocates the reception buffer, and initiate the first persistant reception.
Definition: solver.c:633
void solverPrintStats(const SolverMatrix *solvptr)
Print statistical information about the solver matrix structure.
Definition: solver.c:196
void solverRequestInit(solve_step_t solve_step, SolverMatrix *solvmtx)
Instanciate the arrays for the requests according to the scheduler.
Definition: solver.c:433
void solverInit(SolverMatrix *solvmtx)
Initialize the solver structure.
Definition: solver.c:118
void solverExit(SolverMatrix *solvmtx)
Free the content of the solver matrix structure.
Definition: solver.c:143
void coeftabExit(SolverMatrix *solvmtx)
Free the solver matrix structure.
Definition: coeftab.c:267
spm_coeftype_t pastix_coeftype_t
Arithmetic types.
Definition: api.h:294
enum pastix_coefside_e pastix_coefside_t
Data blocks used in the kernel.
@ PastixLUCoef
Definition: api.h:480
struct parsec_sparse_matrix_desc_s parsec_sparse_matrix_desc_t
PaRSEC descriptor stucture for the sparse matrix.
void starpu_dense_matrix_destroy(starpu_dense_matrix_desc_t *desc)
Free the StarPU descriptor of the dense matrix.
struct starpu_sparse_matrix_desc_s starpu_sparse_matrix_desc_t
StarPU descriptor stucture for the sparse matrix.
pastix_int_t n
Definition: pastixdata.h:154
Main PaStiX RHS structure.
Definition: pastixdata.h:150
static size_t solver_size(const SolverMatrix *solvptr)
Compute the memory size used by the solver sturcture itself.
Definition: solver.c:51
pastix_int_t nodenbr
Definition: solver.h:205
pastix_int_t reqnbr
Definition: solver.h:266
pastix_int_t nb2dcblk
Definition: solver.h:218
pastix_atomic_lock_t reqlock
Definition: solver.h:268
pastix_int_t maxrecv
Definition: solver.h:211
pastix_int_t cblkmin2d
Definition: solver.h:215
pastix_int_t brownum
Definition: solver.h:166
static pastix_int_t cblk_colnbr(const SolverCblk *cblk)
Compute the number of columns in a column block.
Definition: solver.h:324
pastix_int_t brown2d
Definition: solver.h:167
struct task_s Task
The task structure for the numerical factorization.
pastix_int_t nb2dblok
Definition: solver.h:219
MPI_Request * reqtab
Definition: solver.h:264
pastix_int_t recvcnt
Definition: solver.h:213
void * rcoeftab
Definition: solver.h:269
pastix_int_t cblknbr
Definition: solver.h:208
pastix_int_t * gcbl2loc
Definition: solver.h:228
pastix_int_t cblkmaxblk
Definition: solver.h:216
SolverBlok *restrict bloktab
Definition: solver.h:223
pastix_int_t cblkmax1d
Definition: solver.h:214
pastix_int_t brownbr
Definition: solver.h:221
pastix_int_t faninnbr
Definition: solver.h:209
pastix_int_t fanincnt
Definition: solver.h:210
struct solver_cblk_s SolverCblk
Solver column block structure.
struct solver_blok_s SolverBlok
Solver block structure.
SolverBlok * fblokptr
Definition: solver.h:163
pastix_int_t bloknbr
Definition: solver.h:220
pastix_int_t recvnbr
Definition: solver.h:212
pastix_int_t *restrict browtab
Definition: solver.h:224
volatile int32_t reqnum
Definition: solver.h:267
pastix_int_t lcblknm
Definition: solver.h:139
SolverCblk *restrict cblktab
Definition: solver.h:222
pastix_int_t stride
Definition: solver.h:164
int8_t cblktype
Definition: solver.h:159
enum solve_step_e solve_step_t
Tags used in MPI communications.
pastix_int_t * reqidx
Definition: solver.h:265
pastix_int_t lcolnum
Definition: solver.h:162
pastix_int_t fcolnum
Definition: solver.h:161
Solver block structure.
Definition: solver.h:137
Solver column block structure.
Definition: solver.h:156
Solver column block structure.
Definition: solver.h:200
void solverComMatrixExit(SolverMatrix *solvmtx)
Free the communication matrix.
void solverComMatrixGather(SolverMatrix *solvmtx)
Gather the volume of communication and save it as a csv.
void solverComMatrixInit(SolverMatrix *solvmtx)
Initialize the communication matrix.