PaStiX Handbook  6.2.1
core_ztrsmsp.c
Go to the documentation of this file.
1 /**
2  *
3  * @file core_ztrsmsp.c
4  *
5  * PaStiX kernel routines
6  *
7  * @copyright 2012-2021 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8  * Univ. Bordeaux. All rights reserved.
9  *
10  * @version 6.2.0
11  * @author Mathieu Faverge
12  * @author Pierre Ramet
13  * @author Xavier Lacoste
14  * @author Esragul Korkmaz
15  * @author Gregoire Pichon
16  * @date 2021-03-30
17  * @generated from /builds/solverstack/pastix/kernels/core_ztrsmsp.c, normal z -> z, Tue Apr 12 09:38:36 2022
18  *
19  **/
20 #include "common.h"
21 #include "cblas.h"
22 #include "blend/solver.h"
23 #include "kernels_trace.h"
24 #include "pastix_zcores.h"
25 #include "pastix_zlrcores.h"
26 
27 #ifndef DOXYGEN_SHOULD_SKIP_THIS
28 static pastix_complex64_t zone = 1.0;
29 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
30 
31 /**
32  *******************************************************************************
33  *
34  * @ingroup kernel_fact_null
35  *
36  * @brief Apply all the trsm updates on a panel stored in 1D layout.
37  *
38  *******************************************************************************
39  *
40  * @param[in] side
41  * Specify whether the A matrix appears on the left or right in the
42  * equation. It has to be either PastixLeft or PastixRight.
43  *
44  * @param[in] uplo
45  * Specify whether the A matrix is upper or lower triangular. It has to
46  * be either PastixUpper or PastixLower.
47  *
48  * @param[in] trans
49  * Specify the transposition used for the A matrix. It has to be either
50  * PastixTrans or PastixConjTrans.
51  *
52  * @param[in] diag
53  * Specify if the A matrix is unit triangular. It has to be either
54  * PastixUnit or PastixNonUnit.
55  *
56  * @param[in] cblk
57  * The cblk structure to which block belongs to. The A and C pointers
58  * must be the coeftab of this column block.
59  * Next column blok must be accessible through cblk[1].
60  *
61  * @param[in] A
62  * The pointer to the coeftab of the cblk.lcoeftab matrix storing the
63  * coefficients of the panel when the Lower part is computed,
64  * cblk.ucoeftab otherwise. Must be of size cblk.stride -by- cblk.width
65  *
66  * @param[inout] C
67  * The pointer to the fcblk.lcoeftab if the lower part is computed,
68  * fcblk.ucoeftab otherwise.
69  *
70  *******************************************************************************/
71 static inline void
73  pastix_uplo_t uplo,
74  pastix_trans_t trans,
75  pastix_diag_t diag,
76  const SolverCblk *cblk,
77  const pastix_complex64_t *A,
78  pastix_complex64_t *C )
79 {
80  SolverBlok *fblok;
81  pastix_int_t M, N, lda;
82 
83  N = cblk->lcolnum - cblk->fcolnum + 1;
84  lda = cblk->stride;
85  fblok = cblk->fblokptr; /* The diagonal block */
86 
87  /* vertical dimension */
88  M = lda - N;
89 
90  /* if there is an extra-diagonal bloc in column block */
91  assert( fblok + 1 < cblk[1].fblokptr );
92  assert( blok_rownbr( fblok) == N );
93  assert(!(cblk->cblktype & CBLK_LAYOUT_2D));
94 
95  /* first extra-diagonal bloc in column block address */
96  C = C + fblok[1].coefind;
97 
98  kernel_trace_start_lvl2( PastixKernelLvl2_FR_TRSM );
99  cblas_ztrsm(CblasColMajor,
100  (CBLAS_SIDE)side, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans, (CBLAS_DIAG)diag,
101  M, N,
102  CBLAS_SADDR(zone), A, lda,
103  C, lda);
104  kernel_trace_stop_lvl2( FLOPS_ZTRSM( side, M, N ) );
105 }
106 
107 /**
108  *******************************************************************************
109  *
110  * @ingroup kernel_fact_null
111  *
112  * @brief Compute the updates associated to one off-diagonal block between two
113  * cblk stored in 2D.
114  *
115  *******************************************************************************
116  *
117  * @param[in] side
118  * Specify whether the A matrix appears on the left or right in the
119  * equation. It has to be either PastixLeft or PastixRight.
120  *
121  * @param[in] uplo
122  * Specify whether the A matrix is upper or lower triangular. It has to
123  * be either PastixUpper or PastixLower.
124  *
125  * @param[in] trans
126  * Specify the transposition used for the A matrix. It has to be either
127  * PastixTrans or PastixConjTrans.
128  *
129  * @param[in] diag
130  * Specify if the A matrix is unit triangular. It has to be either
131  * PastixUnit or PastixNonUnit.
132  *
133  * @param[in] cblk
134  * The cblk structure to which block belongs to. The A and C pointers
135  * must be the coeftab of this column block.
136  * Next column blok must be accessible through cblk[1].
137  *
138  * @param[in] A
139  * The pointer to the coeftab of the cblk.lcoeftab matrix storing the
140  * coefficients of the panel when the Lower part is computed,
141  * cblk.ucoeftab otherwise. Must be of size cblk.stride -by- cblk.width
142  *
143  * @param[inout] C
144  * The pointer to the fcblk.lcoeftab if the lower part is computed,
145  * fcblk.ucoeftab otherwise.
146  *
147  *******************************************************************************/
148 static inline void
150  pastix_uplo_t uplo,
151  pastix_trans_t trans,
152  pastix_diag_t diag,
153  const SolverCblk *cblk,
154  const pastix_complex64_t *A,
155  pastix_complex64_t *C )
156 {
157  const SolverBlok *fblok, *lblok, *blok;
158  pastix_int_t M, N, lda, ldc;
159  pastix_complex64_t *blokC;
160 
161  N = cblk->lcolnum - cblk->fcolnum + 1;
162  fblok = cblk[0].fblokptr; /* The diagonal block */
163  lblok = cblk[1].fblokptr; /* The diagonal block of the next cblk */
164  lda = blok_rownbr( fblok );
165 
166  assert( blok_rownbr(fblok) == N );
167  assert( cblk->cblktype & CBLK_LAYOUT_2D );
168 
169  for (blok=fblok+1; blok<lblok; blok++) {
170 
171  blokC = C + blok->coefind;
172  M = blok_rownbr(blok);
173  ldc = M;
174 
175  kernel_trace_start_lvl2( PastixKernelLvl2_FR_TRSM );
176  cblas_ztrsm(CblasColMajor,
177  (CBLAS_SIDE)side, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans, (CBLAS_DIAG)diag,
178  M, N,
179  CBLAS_SADDR(zone), A, lda,
180  blokC, ldc);
181  kernel_trace_stop_lvl2( FLOPS_ZTRSM( side, M, N ) );
182  }
183 }
184 
185 /**
186  *******************************************************************************
187  *
188  * @ingroup kernel_fact_null
189  *
190  * @brief Computes the updates associated to one off-diagonal block between two
191  * cblk stored in low-rank format.
192  *
193  *******************************************************************************
194  *
195  * @param[in] side
196  * Specify whether the off-diagonal blocks appear on the left or right in the
197  * equation. It has to be either PastixLeft or PastixRight.
198  *
199  * @param[in] uplo
200  * Specify whether the off-diagonal blocks are upper or lower
201  * triangular. It has to be either PastixUpper or PastixLower.
202  *
203  * @param[in] trans
204  * Specify the transposition used for the off-diagonal blocks. It has
205  * to be either PastixTrans or PastixConjTrans.
206  *
207  * @param[in] diag
208  * Specify if the off-diagonal blocks are unit triangular. It has to be
209  * either PastixUnit or PastixNonUnit.
210  *
211  * @param[in] cblk
212  * The cblk structure to which block belongs to. The A and C pointers
213  * must be the coeftab of this column block.
214  * Next column blok must be accessible through cblk[1].
215  *
216  * @param[in] lrA
217  * Pointer to the low-rank representation of the block A.
218  * Must be followed by the low-rank representation of the following blocks.
219  *
220  * @param[in] lrC
221  * Pointer to the low-rank representation of the block C.
222  * Must be followed by the low-rank representation of the following blocks.
223  *
224  * @param[in] lowrank
225  * The structure with low-rank parameters.
226  *
227  *******************************************************************************
228  *
229  * @return The number of flops performed
230  *
231  *******************************************************************************/
232 static inline pastix_fixdbl_t
234  pastix_uplo_t uplo,
235  pastix_trans_t trans,
236  pastix_diag_t diag,
237  const SolverCblk *cblk,
238  const pastix_lrblock_t *lrA,
239  pastix_lrblock_t *lrC,
240  const pastix_lr_t *lowrank )
241 {
242  SolverBlok *fblok, *lblok, *blok;
243  pastix_int_t M, N, lda;
244  pastix_complex64_t *A;
245 
246  pastix_fixdbl_t flops = 0.0;
247  pastix_fixdbl_t flops_lr, flops_c;
248 
249  N = cblk->lcolnum - cblk->fcolnum + 1;
250  fblok = cblk[0].fblokptr; /* The diagonal block */
251  lblok = cblk[1].fblokptr; /* The diagonal block of the next cblk */
252 
253  A = lrA->u;
254  lda = lrA->rkmax;
255 
256  assert( lrA->rk == -1 );
257  assert( blok_rownbr(fblok) == N );
258  assert( cblk->cblktype & CBLK_COMPRESSED );
259  assert( cblk->cblktype & CBLK_LAYOUT_2D );
260 
261  lrC++; /* Skip diagonal block */
262  for (blok=fblok+1; blok<lblok; blok++, lrC++) {
263 
264  M = blok_rownbr(blok);
265  flops_lr = 0.;
266  flops_c = 0.;
267 
268  /* Check the size of the block */
269  if ( ( N >= lowrank->compress_min_width ) &&
270  ( M >= lowrank->compress_min_height ) )
271  {
272  int is_preselected = ( blok->iluklvl <= lowrank->ilu_lvl );
273 
274  /*
275  * Try to compress the block: 2 cases
276  * - Non preselected blocks are always compressed
277  * - Preselected blocks are compressed if compress_preselect
278  */
279  if ( lowrank->compress_preselect || (!is_preselected) )
280  {
281  flops_lr = cpublok_zcompress( lowrank, M, N, lrC );
282  }
283  }
284 
285  if ( lrC->rk != 0 ) {
286  if ( lrC->rk != -1 ) {
287  kernel_trace_start_lvl2( PastixKernelLvl2_LR_TRSM );
288  cblas_ztrsm(CblasColMajor,
289  (CBLAS_SIDE)side, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans, (CBLAS_DIAG)diag,
290  lrC->rk, N,
291  CBLAS_SADDR(zone), A, lda,
292  lrC->v, lrC->rkmax);
293  flops_c = FLOPS_ZTRSM( side, lrC->rk, N );
294  kernel_trace_stop_lvl2( flops_c );
295  }
296  else {
297  kernel_trace_start_lvl2( PastixKernelLvl2_FR_TRSM );
298  cblas_ztrsm(CblasColMajor,
299  (CBLAS_SIDE)side, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans, (CBLAS_DIAG)diag,
300  M, N,
301  CBLAS_SADDR(zone), A, lda,
302  lrC->u, lrC->rkmax);
303  flops_c = FLOPS_ZTRSM( side, M, N );
304  kernel_trace_stop_lvl2( flops_c );
305  }
306  }
307 
308  flops += flops_lr + flops_c;
309  }
310  return flops;
311 }
312 
313 /**
314  *******************************************************************************
315  *
316  * @brief Compute the updates associated to a column of off-diagonal blocks.
317  *
318  *******************************************************************************
319  *
320  * @param[in] side
321  * Specify whether the A matrix appears on the left or right in the
322  * equation. It has to be either PastixLeft or PastixRight.
323  *
324  * @param[in] uplo
325  * Specify whether the A matrix is upper or lower triangular. It has to
326  * be either PastixUpper or PastixLower.
327  *
328  * @param[in] trans
329  * Specify the transposition used for the A matrix. It has to be either
330  * PastixTrans or PastixConjTrans.
331  *
332  * @param[in] diag
333  * Specify if the A matrix is unit triangular. It has to be either
334  * PastixUnit or PastixNonUnit.
335  *
336  * @param[in] cblk
337  * The cblk structure to which block belongs to. The A and B pointers
338  * must be the coeftab of this column block.
339  * Next column blok must be accessible through cblk[1].
340  *
341  * @param[in] A
342  * The pointer to the correct representation of A.
343  * - coeftab if the block is in full rank. Must be of size cblk.stride -by- cblk.width.
344  * - pastix_lr_block if the block is compressed.
345  *
346  * @param[inout] C
347  * The pointer to the correct representation of C.
348  * - coeftab if the block is in full rank. Must be of size cblk.stride -by- cblk.width.
349  * - pastix_lr_block if the block is compressed.
350  *
351  * @param[in] lowrank
352  * The structure with low-rank parameters.
353  *
354  *******************************************************************************/
355 void
357  pastix_uplo_t uplo,
358  pastix_trans_t trans,
359  pastix_diag_t diag,
360  const SolverCblk *cblk,
361  const void *A,
362  void *C,
363  const pastix_lr_t *lowrank )
364 {
365  if ( cblk[0].fblokptr + 1 < cblk[1].fblokptr )
366  {
367  pastix_ktype_t ktype = PastixKernelLvl1Nbr;
368  pastix_fixdbl_t time, flops = 0.0;
369  pastix_int_t n = cblk_colnbr( cblk );
370  pastix_int_t m = cblk->stride - n;
371 
372  if ( cblk->cblktype & CBLK_COMPRESSED ) {
373  ktype = PastixKernelTRSMCblkLR;
374  time = kernel_trace_start( ktype );
375 
376  flops = core_ztrsmsp_lr( side, uplo, trans, diag,
377  cblk, A, C, lowrank );
378  }
379  else {
380  if ( cblk->cblktype & CBLK_LAYOUT_2D ) {
381  ktype = PastixKernelTRSMCblk2d;
382  time = kernel_trace_start( ktype );
383 
384  core_ztrsmsp_2d( side, uplo, trans, diag,
385  cblk, A, C );
386  }
387  else {
388  ktype = PastixKernelTRSMCblk1d;
389  time = kernel_trace_start( ktype );
390 
391  core_ztrsmsp_1d( side, uplo, trans, diag,
392  cblk, A, C );
393  }
394  flops = FLOPS_ZTRSM( PastixRight, m, n );
395  }
396 
397  kernel_trace_stop( cblk->fblokptr->inlast, ktype, m, n, 0, flops, time );
398  }
399 }
400 
401 /**
402  *******************************************************************************
403  *
404  * @ingroup kernel_fact_null
405  *
406  * @brief Compute the updates associated to one off-diagonal block between two
407  * cblk stored in 2D.
408  *
409  *******************************************************************************
410  *
411  * @param[in] side
412  * Specify whether the A matrix appears on the left or right in the
413  * equation. It has to be either PastixLeft or PastixRight.
414  *
415  * @param[in] uplo
416  * Specify whether the A matrix is upper or lower triangular. It has to
417  * be either PastixUpper or PastixLower.
418  *
419  * @param[in] trans
420  * Specify the transposition used for the A matrix. It has to be either
421  * PastixTrans or PastixConjTrans.
422  *
423  * @param[in] diag
424  * Specify if the A matrix is unit triangular. It has to be either
425  * PastixUnit or PastixNonUnit.
426  *
427  * @param[in] cblk
428  * The cblk structure to which block belongs to. The A and C pointers
429  * must be the coeftab of this column block.
430  * Next column blok must be accessible through cblk[1].
431  *
432  * @param[in] blok_m
433  * Index of the first off-diagonal block in cblk that is solved. The
434  * TRSM is also applied to all the folowing blocks which are facing the
435  * same diagonal block
436  *
437  * @param[in] A
438  * The pointer to the coeftab of the cblk.lcoeftab matrix storing the
439  * coefficients of the panel when the Lower part is computed,
440  * cblk.ucoeftab otherwise. Must be of size cblk.stride -by- cblk.width
441  *
442  * @param[inout] C
443  * The pointer to the fcblk.lcoeftab if the lower part is computed,
444  * fcblk.ucoeftab otherwise.
445  *
446  *******************************************************************************/
447 static inline pastix_fixdbl_t
449  pastix_uplo_t uplo,
450  pastix_trans_t trans,
451  pastix_diag_t diag,
452  const SolverCblk *cblk,
453  pastix_int_t blok_m,
454  const pastix_complex64_t *A,
455  pastix_complex64_t *C )
456 {
457  const SolverBlok *fblok, *lblok, *blok;
458  pastix_int_t M, N, lda, ldc, offset, cblk_m, full_m;
459  pastix_complex64_t *Cptr;
460  pastix_fixdbl_t flops = 0.0;
461  pastix_fixdbl_t time = kernel_trace_start( PastixKernelTRSMBlok2d );
462 
463  N = cblk->lcolnum - cblk->fcolnum + 1;
464  fblok = cblk[0].fblokptr; /* The diagonal block */
465  lblok = cblk[1].fblokptr; /* The diagonal block of the next cblk */
466  lda = blok_rownbr( fblok );
467 
468  assert( blok_rownbr(fblok) == N );
469  assert( cblk->cblktype & CBLK_LAYOUT_2D );
470 
471  blok = fblok + blok_m;
472  offset = blok->coefind;
473  cblk_m = blok->fcblknm;
474  full_m = 0;
475 
476  for (; (blok < lblok) && (blok->fcblknm == cblk_m); blok++) {
477 
478  Cptr = C + blok->coefind - offset;
479  M = blok_rownbr(blok);
480  ldc = M;
481 
482  cblas_ztrsm( CblasColMajor,
483  (CBLAS_SIDE)side, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans, (CBLAS_DIAG)diag,
484  M, N,
485  CBLAS_SADDR(zone), A, lda,
486  Cptr, ldc );
487 
488  flops += FLOPS_ZTRSM( side, M, N );
489  full_m += M;
490  }
491 
492  kernel_trace_stop( cblk->fblokptr->inlast, PastixKernelTRSMBlok2d,
493  full_m, N, 0, flops, time );
494  return flops;
495 }
496 
497 /**
498  *******************************************************************************
499  *
500  * @ingroup kernel_fact_null
501  *
502  * @brief Compute the updates associated to one off-diagonal block between two
503  * cblk stored in low-rank format.
504  *
505  *******************************************************************************
506  *
507  * @param[in] side
508  * Specify whether the off-diagonal blocks appear on the left or right in the
509  * equation. It has to be either PastixLeft or PastixRight.
510  *
511  * @param[in] uplo
512  * Specify whether the off-diagonal blocks are upper or lower
513  * triangular. It has to be either PastixUpper or PastixLower.
514  *
515  * @param[in] trans
516  * Specify the transposition used for the off-diagonal blocks. It has
517  * to be either PastixTrans or PastixConjTrans.
518  *
519  * @param[in] diag
520  * Specify if the off-diagonal blocks are unit triangular. It has to be
521  * either PastixUnit or PastixNonUnit.
522  *
523  * @param[in] cblk
524  * The cblk structure to which block belongs to. The A and C pointers
525  * must be the coeftab of this column block.
526  * Next column blok must be accessible through cblk[1].
527  *
528  * @param[in] blok_m
529  * Index of the first off-diagonal block in cblk that is solved. The
530  * TRSM is also applied to all the folowing blocks which are facing the
531  * same diagonal block
532  *
533  * @param[in] lrA
534  * Pointer to the low-rank representation of the block A.
535  * Must be followed by the low-rank representation of the following blocks.
536  *
537  * @param[inout] lrC
538  * Pointer to the low-rank representation of the block C.
539  * Must be followed by the low-rank representation of the following blocks.
540  *
541  * @param[in] lowrank
542  * The structure with low-rank parameters.
543  *
544  *******************************************************************************/
545 static inline pastix_fixdbl_t
547  pastix_uplo_t uplo,
548  pastix_trans_t trans,
549  pastix_diag_t diag,
550  const SolverCblk *cblk,
551  pastix_int_t blok_m,
552  const pastix_lrblock_t *lrA,
553  pastix_lrblock_t *lrC,
554  const pastix_lr_t *lowrank )
555 {
556  SolverBlok *fblok, *lblok, *blok;
557  pastix_int_t M, N, lda, cblk_m, full_m, full_n;
558  pastix_complex64_t *A;
559  pastix_fixdbl_t flops = 0.0;
560  pastix_fixdbl_t time = kernel_trace_start( PastixKernelTRSMBlokLR );
561 
562  N = cblk->lcolnum - cblk->fcolnum + 1;
563  fblok = cblk[0].fblokptr; /* The diagonal block */
564  lblok = cblk[1].fblokptr; /* The diagonal block of the next cblk */
565 
566  A = lrA->u;
567  lda = lrA->rkmax;
568 
569  assert( cblk->cblktype & CBLK_COMPRESSED );
570  assert( cblk->cblktype & CBLK_LAYOUT_2D );
571 
572  assert( blok_rownbr(fblok) == N );
573  assert( lrA->rk == -1 );
574 
575  blok = fblok + blok_m;
576  cblk_m = blok->fcblknm;
577  full_m = 0;
578  full_n = 0;
579 
580  for (; (blok < lblok) && (blok->fcblknm == cblk_m); blok++, lrC++) {
581 
582  M = blok_rownbr(blok);
583 
584  if ( ( N >= lowrank->compress_min_width ) &&
585  ( M >= lowrank->compress_min_height ) )
586  {
587  int is_preselected = ( blok->iluklvl <= lowrank->ilu_lvl );
588 
589  /*
590  * Try to compress the block: 2 cases
591  * - Non preselected blocks are always compressed
592  * - Preselected blocks are compressed if compress_preselect
593  */
594  if ( lowrank->compress_preselect || (!is_preselected) )
595  {
596  flops = cpublok_zcompress( lowrank, M, N, lrC );
597  }
598  }
599 
600  if ( lrC->rk != 0 ) {
601  if ( lrC->rk != -1 ) {
602  cblas_ztrsm(CblasColMajor,
603  (CBLAS_SIDE)side, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans, (CBLAS_DIAG)diag,
604  lrC->rk, N,
605  CBLAS_SADDR(zone), A, lda,
606  lrC->v, lrC->rkmax);
607 
608  flops += FLOPS_ZTRSM( side, lrC->rk, N );
609  full_n += lrC->rk;
610  }
611  else {
612  cblas_ztrsm(CblasColMajor,
613  (CBLAS_SIDE)side, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans, (CBLAS_DIAG)diag,
614  M, N,
615  CBLAS_SADDR(zone), A, lda,
616  lrC->u, lrC->rkmax);
617 
618  flops += FLOPS_ZTRSM( side, M, N );
619  full_n += M;
620  }
621  }
622  full_m += M;
623  }
624 
625  kernel_trace_stop( cblk->fblokptr->inlast, PastixKernelTRSMBlokLR,
626  full_m, N, full_n, flops, time );
627  return flops;
628 }
629 
630 /**
631  *******************************************************************************
632  *
633  * @brief Compute the updates associated to one off-diagonal block.
634  *
635  *******************************************************************************
636  *
637  * @param[in] side
638  * Specify whether the A matrix appears on the left or right in the
639  * equation. It has to be either PastixLeft or PastixRight.
640  *
641  * @param[in] uplo
642  * Specify whether the A matrix is upper or lower triangular. It has to
643  * be either PastixUpper or PastixLower.
644  *
645  * @param[in] trans
646  * Specify the transposition used for the A matrix. It has to be either
647  * PastixTrans or PastixConjTrans.
648  *
649  * @param[in] diag
650  * Specify if the A matrix is unit triangular. It has to be either
651  * PastixUnit or PastixNonUnit.
652  *
653  * @param[in] cblk
654  * The cblk structure to which block belongs to. The A and B pointers
655  * must be the coeftab of this column block.
656  * Next column blok must be accessible through cblk[1].
657  *
658  * @param[in] blok_m
659  * Index of the first off-diagonal block in cblk that is solved. The
660  * TRSM is also applied to all the folowing blocks which are facing the
661  * same diagonal block
662  *
663  * @param[in] A
664  * The pointer to the correct representation of A.
665  * - coeftab if the block is in full rank. Must be of size cblk.stride -by- cblk.width.
666  * - pastix_lr_block if the block is compressed.
667  *
668  * @param[inout] C
669  * The pointer to the correct representation of C.
670  * - coeftab if the block is in full rank. Must be of size cblk.stride -by- cblk.width.
671  * - pastix_lr_block if the block is compressed.
672  *
673  * @param[in] lowrank
674  * The structure with low-rank parameters.
675  *
676  *******************************************************************************/
677 pastix_fixdbl_t
679  pastix_uplo_t uplo,
680  pastix_trans_t trans,
681  pastix_diag_t diag,
682  const SolverCblk *cblk,
683  pastix_int_t blok_m,
684  const void *A,
685  void *C,
686  const pastix_lr_t *lowrank )
687 {
688  if ( cblk->cblktype & CBLK_COMPRESSED ) {
689  return core_ztrsmsp_lrsub( side, uplo, trans, diag,
690  cblk, blok_m, A, C, lowrank );
691  }
692  else {
693  return core_ztrsmsp_2dsub( side, uplo, trans, diag,
694  cblk, blok_m, A, C );
695  }
696 }
solver.h
blok_rownbr
static pastix_int_t blok_rownbr(const SolverBlok *blok)
Compute the number of rows of a block.
Definition: solver.h:313
cblk_colnbr
static pastix_int_t cblk_colnbr(const SolverCblk *cblk)
Compute the number of columns in a column block.
Definition: solver.h:247
pastix_uplo_t
enum pastix_uplo_e pastix_uplo_t
Upper/Lower part.
pastix_lr_s
Structure to define the type of function to use for the low-rank kernels and their parameters.
Definition: pastix_lowrank.h:147
solver_cblk_s::fblokptr
SolverBlok * fblokptr
Definition: solver.h:134
pastix_lrblock_s::v
void * v
Definition: pastix_lowrank.h:116
solver_cblk_s::stride
pastix_int_t stride
Definition: solver.h:135
pastix_lrblock_s::u
void * u
Definition: pastix_lowrank.h:115
pastix_lr_s::ilu_lvl
int ilu_lvl
Definition: pastix_lowrank.h:154
pastix_lr_s::compress_min_width
pastix_int_t compress_min_width
Definition: pastix_lowrank.h:150
solver_cblk_s
Solver column block structure.
Definition: solver.h:127
core_ztrsmsp_2d
static void core_ztrsmsp_2d(pastix_side_t side, pastix_uplo_t uplo, pastix_trans_t trans, pastix_diag_t diag, const SolverCblk *cblk, const pastix_complex64_t *A, pastix_complex64_t *C)
Compute the updates associated to one off-diagonal block between two cblk stored in 2D.
Definition: core_ztrsmsp.c:149
pastix_trans_t
enum pastix_trans_e pastix_trans_t
Transpostion.
solver_blok_s
Solver block structure.
Definition: solver.h:107
pastix_zcores.h
pastix_lrblock_s
The block low-rank structure to hold a matrix in low-rank form.
Definition: pastix_lowrank.h:112
pastix_lr_s::compress_preselect
int compress_preselect
Definition: pastix_lowrank.h:152
pastix_lr_s::compress_min_height
pastix_int_t compress_min_height
Definition: pastix_lowrank.h:151
solver_cblk_s::lcolnum
pastix_int_t lcolnum
Definition: solver.h:133
solver_blok_s::iluklvl
int iluklvl
Definition: solver.h:118
pastix_zlrcores.h
core_ztrsmsp_2dsub
static pastix_fixdbl_t core_ztrsmsp_2dsub(pastix_side_t side, pastix_uplo_t uplo, pastix_trans_t trans, pastix_diag_t diag, const SolverCblk *cblk, pastix_int_t blok_m, const pastix_complex64_t *A, pastix_complex64_t *C)
Compute the updates associated to one off-diagonal block between two cblk stored in 2D.
Definition: core_ztrsmsp.c:448
cpublok_zcompress
pastix_fixdbl_t cpublok_zcompress(const pastix_lr_t *lowrank, pastix_int_t M, pastix_int_t N, pastix_lrblock_t *blok)
Compress a single block from full-rank to low-rank format.
Definition: cpucblk_zcompress.c:57
solver_blok_s::coefind
pastix_int_t coefind
Definition: solver.h:114
pastix_lrblock_s::rk
int rk
Definition: pastix_lowrank.h:113
core_ztrsmsp_lrsub
static pastix_fixdbl_t core_ztrsmsp_lrsub(pastix_side_t side, pastix_uplo_t uplo, pastix_trans_t trans, pastix_diag_t diag, const SolverCblk *cblk, pastix_int_t blok_m, const pastix_lrblock_t *lrA, pastix_lrblock_t *lrC, const pastix_lr_t *lowrank)
Compute the updates associated to one off-diagonal block between two cblk stored in low-rank format.
Definition: core_ztrsmsp.c:546
pastix_diag_t
enum pastix_diag_e pastix_diag_t
Diagonal.
solver_cblk_s::cblktype
int8_t cblktype
Definition: solver.h:130
solver_blok_s::inlast
int8_t inlast
Definition: solver.h:117
solver_cblk_s::fcolnum
pastix_int_t fcolnum
Definition: solver.h:132
core_ztrsmsp_1d
static void core_ztrsmsp_1d(pastix_side_t side, pastix_uplo_t uplo, pastix_trans_t trans, pastix_diag_t diag, const SolverCblk *cblk, const pastix_complex64_t *A, pastix_complex64_t *C)
Apply all the trsm updates on a panel stored in 1D layout.
Definition: core_ztrsmsp.c:72
cpucblk_ztrsmsp
void cpucblk_ztrsmsp(pastix_side_t side, pastix_uplo_t uplo, pastix_trans_t trans, pastix_diag_t diag, const SolverCblk *cblk, const void *A, void *C, const pastix_lr_t *lowrank)
Compute the updates associated to a column of off-diagonal blocks.
Definition: core_ztrsmsp.c:356
core_ztrsmsp_lr
static pastix_fixdbl_t core_ztrsmsp_lr(pastix_side_t side, pastix_uplo_t uplo, pastix_trans_t trans, pastix_diag_t diag, const SolverCblk *cblk, const pastix_lrblock_t *lrA, pastix_lrblock_t *lrC, const pastix_lr_t *lowrank)
Computes the updates associated to one off-diagonal block between two cblk stored in low-rank format.
Definition: core_ztrsmsp.c:233
pastix_lrblock_s::rkmax
int rkmax
Definition: pastix_lowrank.h:114
pastix_side_t
enum pastix_side_e pastix_side_t
Side of the operation.
solver_blok_s::fcblknm
pastix_int_t fcblknm
Definition: solver.h:110
PastixRight
@ PastixRight
Definition: api.h:474
cpublok_ztrsmsp
pastix_fixdbl_t cpublok_ztrsmsp(pastix_side_t side, pastix_uplo_t uplo, pastix_trans_t trans, pastix_diag_t diag, const SolverCblk *cblk, pastix_int_t blok_m, const void *A, void *C, const pastix_lr_t *lowrank)
Compute the updates associated to one off-diagonal block.
Definition: core_ztrsmsp.c:678