PaStiX Handbook  6.3.2
coeftab_z.c
Go to the documentation of this file.
1 /**
2  *
3  * @file coeftab_z.c
4  *
5  * Precision dependent sequential routines to apply operation of the full matrix.
6  *
7  * @copyright 2015-2023 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8  * Univ. Bordeaux. All rights reserved.
9  *
10  * @version 6.3.2
11  * @author Pierre Ramet
12  * @author Xavier Lacoste
13  * @author Gregoire Pichon
14  * @author Mathieu Faverge
15  * @author Esragul Korkmaz
16  * @author Tony Delarue
17  * @date 2023-07-21
18  *
19  * @generated from /builds/solverstack/pastix/sopalin/coeftab_z.c, normal z -> z, Wed Dec 13 12:09:46 2023
20  *
21  **/
22 #ifndef DOXYGEN_SHOULD_SKIP_THIS
23 #define _GNU_SOURCE 1
24 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
25 #include "common.h"
26 #include "blend/solver.h"
27 #include "lapacke.h"
28 #include "sopalin/coeftab_z.h"
29 #include "pastix_zcores.h"
30 
31 /**
32  *******************************************************************************
33  *
34  * @brief Dump the solver matrix coefficients into a file in human readable
35  * format.
36  *
37  * All non-zeroes coefficients are dumped in the format:
38  * i j val
39  * with one value per row.
40  *
41  *******************************************************************************
42  *
43  * @param[inout] pastix_data
44  * The pastix_data instance to access the unique directory id in which
45  * output the files.
46  *
47  * @param[in] solvmtx
48  * The solver matrix to print.
49  *
50  * @param[in] prefix
51  * The filename where to store the output matrix.
52  *
53  *******************************************************************************/
54 void
56  const SolverMatrix *solvmtx,
57  const char *prefix )
58 {
59  SolverCblk *cblk = solvmtx->cblktab;
60  pastix_int_t itercblk;
61  char filename[256];
62  FILE *stream = NULL;
63 
64  pastix_gendirectories( pastix_data );
65 
66  /*
67  * TODO: there is a problem right here for now, because there are no
68  * distinctions between L and U coeffcients in the final file
69  */
70  for (itercblk=0; itercblk<solvmtx->cblknbr; itercblk++, cblk++)
71  {
72  if ( cblk->cblktype & (CBLK_FANIN|CBLK_RECV) ) {
73  continue;
74  }
75  if ( solvmtx->clustnum != cblk->ownerid ) {
76  continue;
77  }
78 
79  sprintf( filename, "%s_%ld.txt", prefix, (long)cblk->gcblknum );
80  stream = pastix_fopenw( pastix_data->dir_global, filename, "w" );
81  if ( stream == NULL ){
82  continue;
83  }
84 
85  cpucblk_zdump( PastixLCoef, cblk, stream );
86  if ( NULL != cblk->ucoeftab ) {
87  cpucblk_zdump( PastixUCoef, cblk, stream );
88  }
89 
90  fclose( stream );
91  }
92 }
93 
94 /**
95  *******************************************************************************
96  *
97  * @brief Dump a single column block into a FILE in a human readale format.
98  *
99  * All non-zeroes coefficients are dumped in the format:
100  * i j val
101  * with one value per row.
102  *
103  * The filename is as follows : {L, U}cblk{Index of the cblk}_init.txt
104  *
105  *******************************************************************************
106  *
107  * @param[in] side
108  * Define which side of the matrix must be initialized.
109  * @arg PastixLCoef if lower part only
110  * @arg PastixUCoef if upper part only
111  * @arg PastixLUCoef if both sides.
112  *
113  * @param[in] cblk
114  * The column block to dump into the file.
115  *
116  * @param[in] itercblk
117  * The index of the cblk to dump
118  *
119  * @param[inout] directory
120  * The pointer to the temporary directory where to store the output
121  * files.
122  *
123  *******************************************************************************/
124 void
126  SolverCblk *cblk,
127  pastix_int_t itercblk,
128  const char *directory )
129 {
130  FILE *f = NULL;
131  char *filename;
132  int rc;
133 
134  /* Lower part */
135  if ( side != PastixUCoef )
136  {
137  rc = asprintf( &filename, "Lcblk%05ld_init.txt", (long int) itercblk );
138  f = pastix_fopenw( directory, filename, "w" );
139  if ( f != NULL ) {
140  cpucblk_zdump( PastixLCoef, cblk, f );
141  fclose( f );
142  }
143  free( filename );
144  }
145 
146  /* Upper part */
147  if ( side != PastixLCoef )
148  {
149  rc = asprintf( &filename, "Ucblk%05ld_init.txt", (long int) itercblk );
150  f = pastix_fopenw( directory, filename, "w" );
151  if ( f != NULL ) {
152  cpucblk_zdump( PastixUCoef, cblk, f );
153  fclose( f );
154  }
155  free( filename );
156  }
157  (void)rc;
158 }
159 
160 /**
161  *******************************************************************************
162  *
163  * @brief Compare two solver matrices in full-rank format with the same data
164  * distribution.
165  *
166  * The second solver matrix is overwritten by the difference of the two
167  * matrices. The frobenius norm of the difference of each column block is
168  * computed and the functions returns 0 if the result for all the column blocks
169  * of:
170  * || B_k - A_k || / ( || A_k || * eps )
171  *
172  * is below 10. Otherwise, an error message is printed and 1 is returned.
173  *
174  *******************************************************************************
175  *
176  * @param[in] side
177  * Define which side of the cblk must be tested.
178  * @arg PastixLCoef if lower part only
179  * @arg PastixUCoef if upper part only
180  * @arg PastixLUCoef if both sides.
181  *
182  * @param[in] solvA
183  * The solver matrix A.
184  *
185  * @param[inout] solvB
186  * The solver matrix B.
187  * On exit, B coefficient arrays are overwritten by the result of
188  * (B-A).
189  *
190  *******************************************************************************
191  *
192  * @return 0 if the test is passed, >= 0 otherwise.
193  *
194  *******************************************************************************/
195 int
197  const SolverMatrix *solvA,
198  SolverMatrix *solvB )
199 {
200  SolverCblk *cblkA = solvA->cblktab;
201  SolverCblk *cblkB = solvB->cblktab;
202  pastix_int_t cblknum;
203  int rc = 0;
204  int saved_rc = 0;
205 
206  for(cblknum=0; cblknum<solvA->cblknbr; cblknum++, cblkA++, cblkB++) {
207  rc += cpucblk_zdiff( side, cblkA, cblkB );
208  if ( rc != saved_rc ){
209  fprintf(stderr, "CBLK %ld was not correctly compressed\n", (long)cblknum);
210  saved_rc = rc;
211  }
212  }
213 
214  return rc;
215 }
216 
217 /**
218  *******************************************************************************
219  *
220  * @brief Compress all the cblks marked as valid for low-rank format.
221  *
222  * All the cblk in the top levels of the elimination tree marked as candidates
223  * for compression are compressed if there is a gain to compress them. The
224  * compression to low-rank format is parameterized by the input information
225  * stored in the lowrank structure. On exit, all the cblks marked for
226  * compression are stored through the low-rank structure, even if they are kept
227  * in their full-rank form.
228  *
229  * @remark This routine is sequential
230  *
231  *******************************************************************************
232  *
233  * @param[inout] solvmtx
234  * The solver matrix of the problem to compress.
235  *
236  *******************************************************************************
237  *
238  * @return The memory gain resulting from the compression to low-rank format in
239  * Bytes.
240  *
241  *******************************************************************************/
244 {
245  SolverCblk *cblk = solvmtx->cblktab;
247  int ilu_lvl;
248  pastix_int_t cblknum, gain = 0;
249 
250  ilu_lvl = solvmtx->lowrank.compress_preselect ? -1 : solvmtx->lowrank.ilu_lvl;
251 
252  for(cblknum=0; cblknum<solvmtx->cblknbr; cblknum++, cblk++) {
253  if ( cblk->cblktype & CBLK_COMPRESSED ) {
254  gain += cpucblk_zcompress( solvmtx, side, ilu_lvl, cblk );
255  }
256  }
257  return gain;
258 }
259 
260 /**
261  *******************************************************************************
262  *
263  * @brief Uncompress all column block in low-rank format into full-rank format
264  *
265  *******************************************************************************
266  *
267  * @param[inout] solvmtx
268  * The solver matrix of the problem.
269  *
270  *******************************************************************************/
271 void
273 {
274  SolverCblk *cblk = solvmtx->cblktab;
275  pastix_int_t cblknum;
277 
278  for(cblknum=0; cblknum<solvmtx->cblknbr; cblknum++, cblk++) {
279  if (cblk->cblktype & CBLK_COMPRESSED) {
280  cpucblk_zuncompress( side, cblk );
281  }
282  }
283 }
284 
285 /**
286  *******************************************************************************
287  *
288  * @brief Compute the memory gain of the low-rank form over the full-rank form
289  * for the entire matrix.
290  *
291  * This function returns the memory gain in bytes for the full matrix when
292  * column blocks are stored in low-rank format compared to a full rank storage.
293  *
294  *******************************************************************************
295  *
296  * @param[in] solvmtx
297  * The solver matrix of the problem.
298  *
299  * @param[in] iparm
300  * The integer parameter array
301  *
302  * @param[inout] dparm
303  * The double parameter array which is going to be updated.
304  *
305  *******************************************************************************/
306 void
308  const pastix_int_t *iparm,
309  pastix_fixdbl_t *dparm )
310 {
312  SolverCblk *cblk = solvmtx->cblktab;
313  const SolverBlok *blok;
314  pastix_int_t i, cblknum;
315  pastix_int_t gain[MEMORY_STATS_SIZE] = { 0 };
316  pastix_int_t orig[MEMORY_STATS_SIZE] = { 0 };
317  pastix_fixdbl_t memlr[MEMORY_STATS_SIZE] = { 0. };
318  pastix_fixdbl_t memfr[MEMORY_STATS_SIZE] = { 0. };
319  pastix_fixdbl_t totlr, totfr;
320 
321 #if defined(PASTIX_SUPERNODE_STATS)
322  pastix_int_t last[3] = { 0 };
323  pastix_fixdbl_t memlast[4];
324  const SolverBlok *solvblok = solvmtx->bloktab;
325 
326  for(i=0; i<solvmtx->bloknbr; i++, solvblok++ ) {
327  const SolverCblk *lcblk = solvmtx->cblktab + solvblok->lcblknm;
328  pastix_int_t ncols = cblk_colnbr( lcblk );
329  pastix_int_t nrows = blok_rownbr( solvblok );
330  pastix_int_t size = ncols * nrows;
331 
332  /* Skip remote data */
333  if ( cblk->ownerid != solvmtx->clustnum ) {
334  continue;
335  }
336 
337  /* Let's skip recv and fanin for now */
338  if ( lcblk->cblktype & (CBLK_RECV|CBLK_FANIN) ) {
339  continue;
340  }
341 
342  if ( !(lcblk->cblktype & CBLK_COMPRESSED) ) {
343  if ( side != PastixLCoef ) {
344  last[solvblok->inlast] += 2 * size;
345  }
346  else{
347  last[solvblok->inlast] += size;
348  }
349  }
350  else{
351  if ( side != PastixUCoef ) {
352  if ( solvblok->LRblock[0].rk >= 0 ) {
353  assert( solvblok->LRblock[0].rk <= core_get_rklimit( nrows, ncols ) );
354  assert( ((nrows+ncols) * solvblok->LRblock[0].rkmax) <= size );
355  last[solvblok->inlast] += ((nrows+ncols) * solvblok->LRblock[0].rkmax);
356  }
357  else {
358  last[solvblok->inlast] += size;
359  }
360  }
361 
362  if ( side != PastixLCoef ) {
363  if ( solvblok->LRblock[1].rk >= 0 ) {
364  assert( solvblok->LRblock[1].rk <= core_get_rklimit( nrows, ncols ) );
365  assert( ((nrows+ncols) * solvblok->LRblock[1].rkmax) <= size );
366  last[solvblok->inlast] += ((nrows+ncols) * solvblok->LRblock[1].rkmax);
367  }
368  else {
369  last[solvblok->inlast] += size;
370  }
371  }
372  }
373  }
374  for (i=0; i<3; i++) {
375  memlast[i] = last[i] * pastix_size_of( PastixComplex64 );
376  }
377  memlast[3] = memlast[0] + memlast[1] + memlast[2];
378 
379  pastix_print( solvmtx->clustnum, 0,
380  " Compression on LAST\n"
381  " ------------------------------------------------\n"
382  " A11 %8.3g %co\n"
383  " A12 %8.3g %co\n"
384  " A22 %8.3g %co\n"
385  " SUM %8.3g %co\n",
386  pastix_print_value(memlast[0]), pastix_print_unit(memlast[0]),
387  pastix_print_value(memlast[1]), pastix_print_unit(memlast[1]),
388  pastix_print_value(memlast[2]), pastix_print_unit(memlast[2]),
389  pastix_print_value(memlast[3]), pastix_print_unit(memlast[3]));
390 #endif
391 
392  for(cblknum=0; cblknum<solvmtx->cblknbr; cblknum++, cblk++) {
393  pastix_int_t colnbr = cblk_colnbr( cblk );
394 
395  /* Skip remote data */
396  if ( cblk->ownerid != solvmtx->clustnum ) {
397  continue;
398  }
399 
400  /* Let's skip recv and fanin for now */
401  if ( cblk->cblktype & (CBLK_RECV|CBLK_FANIN) ) {
402  continue;
403  }
404 
405  if ( !(cblk->cblktype & CBLK_COMPRESSED) )
406  {
407  pastix_int_t in_height = 0;
408  pastix_int_t off_height = cblk->stride;
409 
410  /* Compute the size of the original supernode diagonal block */
411  blok = cblk->fblokptr;
412  while( (blok < cblk[1].fblokptr) &&
413  ((solvmtx->cblktab + blok->fcblknm)->sndeidx == cblk->sndeidx) )
414  {
415  in_height += blok_rownbr( blok );
416  blok++;
417  }
418 
419  /* Size of the cblk outside the diagonal block */
420  off_height -= in_height;
421 
422  orig[FR_InDiag] += colnbr * in_height;
423  orig[FR_OffDiag] += colnbr * off_height;
424  }
425  else {
426  /* The gain for the diagonal block is always 0 */
427  orig[LR_DInD] += colnbr * colnbr;
428  cpucblk_zmemory( side, solvmtx, cblk, orig, gain );
429  }
430  }
431 
432  if ( side == PastixLUCoef ) {
433  orig[FR_InDiag] *= 2;
434  orig[FR_OffDiag] *= 2;
435  orig[LR_InDiag] *= 2;
436  orig[LR_OffDiag] *= 2;
437  orig[LR_InSele] *= 2;
438  }
439 
440  totlr = 0.;
441  totfr = 0.;
442 
443  for (i=0; i<MEMORY_STATS_SIZE; i++) {
444  memlr[i] = (orig[i] - gain[i]) * pastix_size_of( PastixComplex64 );
445  memfr[i] = orig[i] * pastix_size_of( PastixComplex64 );
446  totlr += memlr[i];
447  totfr += memfr[i];
448  }
449 
450  if( iparm[IPARM_VERBOSE] > PastixVerboseNot ) {
451  pastix_print( solvmtx->clustnum, 0,
452  " Compression:\n"
453  " ------------------------------------------------\n"
454  " Full-rank supernodes\n"
455  " Inside %8.3g %co\n"
456  " Outside %8.3g %co\n"
457  " Low-rank supernodes\n"
458  " Diag in diag %8.3g %co\n"
459  " Inside not selected %8.3g %co / %8.3g %co\n"
460  " Inside selected %8.3g %co / %8.3g %co\n"
461  " Outside %8.3g %co / %8.3g %co\n"
462  " ------------------------------------------------\n"
463  " Total %8.3g %co / %8.3g %co\n",
464  pastix_print_value(memfr[FR_InDiag] ), pastix_print_unit(memfr[FR_InDiag] ),
465  pastix_print_value(memfr[FR_OffDiag]), pastix_print_unit(memfr[FR_OffDiag]),
466 
467  pastix_print_value(memfr[LR_DInD]), pastix_print_unit(memfr[LR_DInD]),
468 
469  pastix_print_value(memlr[LR_InDiag] ), pastix_print_unit(memlr[LR_InDiag] ),
470  pastix_print_value(memfr[LR_InDiag] ), pastix_print_unit(memfr[LR_InDiag] ),
471 
472  pastix_print_value(memlr[LR_InSele] ), pastix_print_unit(memlr[LR_InSele]),
473  pastix_print_value(memfr[LR_InSele] ), pastix_print_unit(memfr[LR_InSele]),
474 
475  pastix_print_value(memlr[LR_OffDiag]), pastix_print_unit(memlr[LR_OffDiag]),
476  pastix_print_value(memfr[LR_OffDiag]), pastix_print_unit(memfr[LR_OffDiag]),
477 
478  pastix_print_value(totlr), pastix_print_unit(totlr),
479  pastix_print_value(totfr), pastix_print_unit(totfr) );
480  }
481 
482  dparm[DPARM_MEM_FR] = totfr;
483  dparm[DPARM_MEM_LR] = totlr;
484 
485  return;
486 }
487 
488 /**
489  *******************************************************************************
490  *
491  * @brief Compute the memory usage of the full-rank form for the entire matrix.
492  *
493  * This function returns the memory usage in bytes for the full matrix when
494  * column blocks are stored in full-rank format.
495  *
496  *******************************************************************************
497  *
498  * @param[in] solvmtx
499  * The solver matrix of the problem.
500  *
501  * @param[inout] dparm
502  * The double parameter array which is going to be updated.
503  *
504  * @param[in] iparm
505  * The integer parameter array
506  *
507  *******************************************************************************/
508 void
510  const pastix_int_t *iparm,
511  pastix_fixdbl_t *dparm )
512 {
514  const SolverCblk *cblk = solvmtx->cblktab;
515  pastix_int_t cblknum;
516  pastix_fixdbl_t totmem = 0.;
517 
518  for(cblknum=0; cblknum<solvmtx->cblknbr; cblknum++, cblk++) {
519  pastix_int_t colnbr = cblk_colnbr( cblk );
520  pastix_int_t rownbr = cblk->stride;
521 
522  /* Skip remote data */
523  if ( cblk->ownerid != solvmtx->clustnum ) {
524  continue;
525  }
526 
527  /* Let's skip recv and fanin for now */
528  if ( cblk->cblktype & (CBLK_RECV|CBLK_FANIN) ) {
529  continue;
530  }
531 
532  totmem += (double)colnbr * (double)rownbr;
533  }
534 
535  if ( side == PastixLUCoef ) {
536  totmem *= 2.;
537  }
538 
539  totmem *= (double)pastix_size_of( PastixComplex64 );
540 
541  dparm[DPARM_MEM_FR] = totmem;
542 
543  if( iparm[IPARM_VERBOSE] > PastixVerboseNot ) {
544  pastix_print( solvmtx->clustnum, 0,
545  " Memory usage of coeftab %8.3g %co\n",
546  pastix_print_value(dparm[DPARM_MEM_FR]), pastix_print_unit(dparm[DPARM_MEM_FR]) );
547  }
548 
549  return;
550 }
551 
552 /**
553  *******************************************************************************
554  *
555  * @brief Compute the memory usage for the entire matrix.
556  *
557  * This functions computes the memory usage and gain if the matrix is compressed
558  *
559  *******************************************************************************
560  *
561  * @param[in] solvmtx
562  * The solver matrix of the problem.
563  *
564  * @param[in] iparm
565  * The integer parameter array. Uses IPARM_COMPRESS_WHEN, IPARM_VERBOSE
566  *
567  * @param[inout] dparm
568  * The double parameter array which is going to be updated.
569  * Update DPARM_MEM_FR and DPARM_MEM_LR.
570  *
571  *******************************************************************************/
572 void
574  const pastix_int_t *iparm,
575  pastix_fixdbl_t *dparm )
576 {
577  if ( iparm[IPARM_COMPRESS_WHEN] != PastixCompressNever ) {
578  coeftab_zmemory_lr( solvmtx, iparm, dparm );
579  }
580  else {
581  coeftab_zmemory_fr( solvmtx, iparm, dparm );
582  }
583 }
584 
585 /**
586  *******************************************************************************
587  *
588  * @brief Extract the Schur complement
589  *
590  * This routine is sequential and returns the full Schur complement
591  * uncommpressed in Lapack format.
592  *
593  *******************************************************************************
594  *
595  * @param[in] solvmtx
596  * The solver matrix structure describing the problem.
597  *
598  * @param[inout] S
599  * The pointer to the allocated matrix array that will store the Schur
600  * complement.
601  *
602  * @param[in] lds
603  * The leading dimension of the S array.
604  *
605  *******************************************************************************/
606 void
608  pastix_complex64_t *S, pastix_int_t lds )
609 {
610  SolverCblk *cblk = solvmtx->cblktab + solvmtx->cblkschur;
611  pastix_complex64_t *localS;
612  pastix_int_t itercblk, fcolnum, nbcol;
613  pastix_int_t ret;
614  int upper_part = (solvmtx->factotype == PastixFactLU);
615  fcolnum = cblk->fcolnum;
616 
617  nbcol = solvmtx->nodenbr - fcolnum;
618  assert( nbcol <= lds );
619 
620  /* Initialize the array to 0 */
621  ret = LAPACKE_zlaset_work( LAPACK_COL_MAJOR, 'A', nbcol, nbcol, 0., 0., S, lds );
622  assert( ret == 0 );
623 
624  for (itercblk=solvmtx->cblkschur; itercblk<solvmtx->cblknbr; itercblk++, cblk++)
625  {
626  assert( cblk->cblktype & CBLK_IN_SCHUR );
627  assert( lds >= cblk->stride );
628 
629  localS = S + (cblk->fcolnum - fcolnum) * lds + (cblk->fcolnum - fcolnum);
630 
631  cpucblk_zgetschur( cblk, upper_part, localS, lds );
632  }
633  (void)ret;
634 }
635 
636 /**
637  *******************************************************************************
638  *
639  * @brief Extract the diagonal
640  *
641  * This routine is sequential and returns the full diagonal in the vector D,
642  * such that:
643  * D[incD*i]= A(i, i)
644  *
645  *******************************************************************************
646  *
647  * @param[in] solvmtx
648  * The solver matrix structure describing the problem.
649  *
650  * @param[inout] D
651  * The pointer to the allocated vector array that will store the diagonal.
652  * D must be of size solvmtx->nodenbr * incD.
653  *
654  * @param[in] incD
655  * The increment bewteen two elements of D. incD > 0.
656  *
657  *******************************************************************************/
658 void
660  pastix_complex64_t *D, pastix_int_t incD )
661 {
662  SolverCblk *cblk = solvmtx->cblktab;
663  pastix_complex64_t *A;
664  pastix_int_t lda, itercblk, nbcol, i;
665 
666  for (itercblk=0; itercblk<solvmtx->cblknbr; itercblk++, cblk++)
667  {
668  nbcol = cblk_colnbr( cblk );
669  if ( cblk->cblktype & CBLK_COMPRESSED ) {
670  assert( cblk->fblokptr->LRblock[0]->rk == -1 );
671  A = cblk->fblokptr->LRblock[0]->u;
672  lda = cblk_colnbr( cblk ) + 1;
673  }
674  else {
675  A = cblk->lcoeftab;
676 
677  if ( cblk->cblktype & CBLK_LAYOUT_2D ) {
678  lda = cblk_colnbr( cblk ) + 1;
679  }
680  else {
681  lda = cblk->stride + 1;
682  }
683  }
684 
685  for (i=0; i<nbcol; i++, D += incD, A += lda ) {
686  *D = *A;
687  }
688  }
689 }
void coeftab_zmemory_fr(const SolverMatrix *solvmtx, const pastix_int_t *iparm, pastix_fixdbl_t *dparm)
Compute the memory usage of the full-rank form for the entire matrix.
Definition: coeftab_z.c:509
void coeftab_zmemory_lr(const SolverMatrix *solvmtx, const pastix_int_t *iparm, pastix_fixdbl_t *dparm)
Compute the memory gain of the low-rank form over the full-rank form for the entire matrix.
Definition: coeftab_z.c:307
BEGIN_C_DECLS typedef int pastix_int_t
Definition: datatypes.h:51
double pastix_fixdbl_t
Definition: datatypes.h:65
void coeftab_zgetschur(const SolverMatrix *solvmtx, pastix_complex64_t *S, pastix_int_t lds)
Extract the Schur complement.
Definition: coeftab_z.c:607
void coeftab_zuncompress(SolverMatrix *solvmtx)
Uncompress all column block in low-rank format into full-rank format.
Definition: coeftab_z.c:272
int coeftab_zdiff(pastix_coefside_t side, const SolverMatrix *solvA, SolverMatrix *solvB)
Compare two solver matrices in full-rank format with the same data distribution.
Definition: coeftab_z.c:196
pastix_int_t coeftab_zcompress(SolverMatrix *solvmtx)
Compress all the cblks marked as valid for low-rank format.
Definition: coeftab_z.c:243
void coeftab_zmemory(const SolverMatrix *solvmtx, const pastix_int_t *iparm, pastix_fixdbl_t *dparm)
Compute the memory usage for the entire matrix.
Definition: coeftab_z.c:573
void coeftab_zgetdiag(const SolverMatrix *solvmtx, pastix_complex64_t *D, pastix_int_t incD)
Extract the diagonal.
Definition: coeftab_z.c:659
void coeftab_zdump(pastix_data_t *pastix_data, const SolverMatrix *solvmtx, const char *prefix)
Dump the solver matrix coefficients into a file in human readable format.
Definition: coeftab_z.c:55
void cpucblk_zdumpfile(pastix_coefside_t side, SolverCblk *cblk, pastix_int_t itercblk, const char *directory)
Dump a single column block into a FILE in a human readale format.
Definition: coeftab_z.c:125
void cpucblk_zuncompress(pastix_coefside_t side, SolverCblk *cblk)
Uncompress a single column block from low-rank format to full-rank format.
void cpucblk_zgetschur(const SolverCblk *cblk, int upper_part, pastix_complex64_t *S, pastix_int_t lds)
Extract a cblk panel of the Schur complement to a dense lapack form.
int cpucblk_zdiff(pastix_coefside_t side, const SolverCblk *cblkA, SolverCblk *cblkB)
Compare two column blocks in full-rank format.
Definition: cpucblk_zdiff.c:63
void cpucblk_zdump(pastix_coefside_t side, const SolverCblk *cblk, FILE *stream)
Dump a single column block into a FILE in a human readale format.
Definition: coeftab_zinit.c:54
pastix_int_t cpucblk_zcompress(const SolverMatrix *solvmtx, pastix_coefside_t side, int max_ilulvl, SolverCblk *cblk)
Compress a single column block from full-rank to low-rank format.
void cpucblk_zmemory(pastix_coefside_t side, const SolverMatrix *solvmtx, SolverCblk *cblk, pastix_int_t *orig, pastix_int_t *gain)
Return the memory gain of the low-rank form over the full-rank form for a single column-block.
int compress_preselect
pastix_int_t(* core_get_rklimit)(pastix_int_t, pastix_int_t)
Compute the maximal rank accepted for a given matrix size. The pointer is set according to the low-ra...
Definition: kernels_trace.c:46
@ FR_InDiag
@ LR_DInD
@ LR_InSele
@ FR_OffDiag
@ LR_InDiag
@ LR_OffDiag
FILE * pastix_fopenw(const char *dirname, const char *filename, const char *mode)
Open a file in the unique directory of the pastix instance.
Definition: api.c:242
void pastix_gendirectories(pastix_data_t *pastix_data)
Generate a unique temporary directory to store output files.
Definition: api.c:76
enum pastix_coefside_e pastix_coefside_t
Data blocks used in the kernel.
@ PastixFactLU
Definition: api.h:317
@ DPARM_MEM_FR
Definition: api.h:175
@ DPARM_MEM_LR
Definition: api.h:176
@ PastixLCoef
Definition: api.h:478
@ PastixLUCoef
Definition: api.h:480
@ PastixUCoef
Definition: api.h:479
@ PastixCompressNever
Definition: api.h:385
@ IPARM_COMPRESS_WHEN
Definition: api.h:131
@ IPARM_VERBOSE
Definition: api.h:36
@ PastixVerboseNot
Definition: api.h:220
char * dir_global
Definition: pastixdata.h:109
Main PaStiX data structure.
Definition: pastixdata.h:67
pastix_int_t nodenbr
Definition: solver.h:205
static pastix_int_t blok_rownbr(const SolverBlok *blok)
Compute the number of rows of a block.
Definition: solver.h:390
void * ucoeftab
Definition: solver.h:172
pastix_lr_t lowrank
Definition: solver.h:230
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 fcblknm
Definition: solver.h:140
pastix_int_t sndeidx
Definition: solver.h:168
pastix_int_t cblknbr
Definition: solver.h:208
SolverBlok *restrict bloktab
Definition: solver.h:223
pastix_factotype_t factotype
Definition: solver.h:231
SolverBlok * fblokptr
Definition: solver.h:163
pastix_int_t bloknbr
Definition: solver.h:220
pastix_lrblock_t * LRblock[2]
Definition: solver.h:150
pastix_int_t lcblknm
Definition: solver.h:139
pastix_int_t gcblknum
Definition: solver.h:169
int8_t inlast
Definition: solver.h:146
SolverCblk *restrict cblktab
Definition: solver.h:222
pastix_int_t stride
Definition: solver.h:164
int8_t cblktype
Definition: solver.h:159
int ownerid
Definition: solver.h:175
pastix_int_t cblkschur
Definition: solver.h:217
void * lcoeftab
Definition: solver.h:171
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