29 #ifndef DOXYGEN_SHOULD_SKIP_THIS
30 #define MAXSIZEOFBLOCKS 64
31 static pastix_complex64_t zone = 1.0;
32 static pastix_complex64_t mzone = -1.0;
67 pastix_complex64_t *A,
73 pastix_complex64_t *Akk = A;
74 pastix_complex64_t *Amk = A+1;
75 pastix_complex64_t *Akm = A+lda;
76 pastix_complex64_t alpha;
79 for (k=0; k<n; k++, m--){
80 if ( cabs(*Akk) < criterion ) {
81 if ( creal(*Akk) < 0. ) {
82 *Akk = (pastix_complex64_t)(-criterion);
85 *Akk = (pastix_complex64_t)criterion;
93 cblas_zcopy( m, Amk, 1, Akm, lda );
96 cblas_zscal(m, CBLAS_SADDR( alpha ), Amk, 1 );
103 cblas_zsyrk(CblasColMajor, CblasLower, CblasNoTrans,
105 CBLAS_SADDR( alpha ), Amk, lda,
106 CBLAS_SADDR( zone ), Akk, lda);
144 pastix_complex64_t *A,
150 pastix_complex64_t *Akk, *Amk, *Akm, *Amm;
151 pastix_complex64_t alpha;
154 blocknbr = pastix_iceil( n, MAXSIZEOFBLOCKS );
156 for (k=0; k<blocknbr; k++) {
158 blocksize = pastix_imin(MAXSIZEOFBLOCKS, n-k*MAXSIZEOFBLOCKS);
159 Akk = A+(k*MAXSIZEOFBLOCKS)*(lda+1);
160 Amk = Akk + blocksize;
161 Akm = Akk + blocksize * lda;
162 Amm = Amk + blocksize * lda;
167 if ((k*MAXSIZEOFBLOCKS+blocksize) < n) {
169 matrixsize = n-(k*MAXSIZEOFBLOCKS+blocksize);
178 cblas_ztrsm(CblasColMajor,
179 CblasRight, CblasLower,
180 CblasTrans, CblasUnit,
181 matrixsize, blocksize,
182 CBLAS_SADDR(zone), Akk, lda,
186 for(col = 0; col < blocksize; col++) {
188 cblas_zcopy(matrixsize, Amk + col*lda, 1,
192 alpha = 1.0 / *(Akk + col*(lda+1));
193 cblas_zscal( matrixsize, CBLAS_SADDR(alpha),
198 cblas_zgemm(CblasColMajor,
199 CblasNoTrans, CblasNoTrans,
200 matrixsize, matrixsize, blocksize,
201 CBLAS_SADDR(mzone), Amk, lda,
203 CBLAS_SADDR(zone), Amm, lda);
241 pastix_complex64_t *L;
248 stride = (cblk->
cblktype & CBLK_LAYOUT_2D) ? ncols : cblk->
stride;
250 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
256 assert( lrL->
rk == -1 );
257 assert( stride == lrL->
rkmax );
259 L = (pastix_complex64_t *)dataL;
269 flops = FLOPS_ZSYTRF( ncols );
272 kernel_trace_stop_lvl2( flops );
277 pastix_atomic_add_32b( &(solvmtx->
nbpivots), nbpivots );
319 const pastix_complex64_t *L,
320 pastix_complex64_t *C,
321 pastix_complex64_t *work )
326 const pastix_complex64_t *blokA;
327 const pastix_complex64_t *blokB;
328 const pastix_complex64_t *blokD;
329 pastix_complex64_t *blokC;
340 if ( cblk->
cblktype & CBLK_LAYOUT_2D ) {
357 for (iterblok=blok; iterblok<lblok; iterblok++) {
363 assert( fblok < fcblk[1].fblokptr );
385 pastix_cblk_lock( fcblk );
393 pastix_cblk_unlock( fcblk );
445 cblk, L, L, &(solvmtx->
lowrank) );
447 if ( (DLt != NULL) && (cblk->
cblktype & CBLK_LAYOUT_2D) ) {
489 pastix_complex64_t *DLt,
490 pastix_complex64_t *work,
499 if ( !(cblk->
cblktype & CBLK_LAYOUT_2D) ) {
503 if (cblk->
cblktype & CBLK_COMPRESSED) {
507 assert( dataDLt == NULL );
518 for( ; blok < lblk; blok++ )
522 if ( fcblk->
cblktype & CBLK_FANIN ) {
536 work, lwork, &(solvmtx->
lowrank) );
574 assert( cblk->
cblktype & CBLK_TASKS_2D );
581 for( i=0; blok < lblk; i++, blok++ )
583 assert( !((solvmtx->
cblktab + blok->
fcblknm)->cblktype & CBLK_RECV) );
587 while ( ( blok < lblk ) &&
588 ( blok[0].fcblknm == blok[1].fcblknm ) &&
589 ( blok[0].lcblknm == blok[1].lcblknm ) )
621 pastix_complex64_t *work )
628 if ( fcbk->
cblktype & CBLK_FANIN ) {
642 while ( ( blok < lblk ) &&
643 ( blok[-1].fcblknm == blok[0].fcblknm ) &&
644 ( blok[-1].lcblknm == blok[0].lcblknm ) );
static void core_zsytf2sp(pastix_int_t n, pastix_complex64_t *A, pastix_int_t lda, pastix_int_t *nbpivots, double criterion)
Compute the sequential static pivoting factorization of the symmetric matrix n-by-n A such that A = L...
BEGIN_C_DECLS typedef int pastix_int_t
static void pqueuePush1(pastix_queue_t *q, pastix_int_t elt, double key1)
Push an element with a single key.
static void kernel_trace_stop(int8_t inlast, pastix_ktype_t ktype, int m, int n, int k, double flops, double starttime)
Stop the trace of a single kernel.
static double kernel_trace_start(pastix_ktype_t ktype)
Start the trace of a single kernel.
void core_zsytrfsp(pastix_int_t n, pastix_complex64_t *A, pastix_int_t lda, pastix_int_t *nbpivots, double criterion)
Compute the block static pivoting factorization of the symmetric matrix n-by-n A such that A = L * D ...
int core_zgemdm(pastix_trans_t transA, pastix_trans_t transB, int M, int N, int K, pastix_complex64_t alpha, const pastix_complex64_t *A, int LDA, const pastix_complex64_t *B, int LDB, pastix_complex64_t beta, pastix_complex64_t *C, int LDC, const pastix_complex64_t *D, int incD, pastix_complex64_t *WORK, int LWORK)
Perform one of the following matrix-matrix operations.
void core_zsytrfsp1d_gemm(const SolverCblk *cblk, const SolverBlok *blok, SolverCblk *fcblk, const pastix_complex64_t *L, pastix_complex64_t *C, pastix_complex64_t *work)
void cpucblk_zsytrfsp1dplus_update(SolverMatrix *solvmtx, SolverBlok *blok, pastix_complex64_t *work)
Apply the updates of the LDL^t factorisation of a given panel.
int cpucblk_zsytrfsp1dplus(SolverMatrix *solvmtx, SolverCblk *cblk)
Perform the LDL^t factorization of a given panel and submit tasks for the subsequent updates.
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.
int cpucblk_zsytrfsp1d_panel(SolverMatrix *solvmtx, SolverCblk *cblk, void *L, void *DLt)
Compute the LDL^t factorization of one panel.
void cpucblk_zalloc(pastix_coefside_t side, SolverCblk *cblk)
Allocate the cblk structure to store the coefficient.
pastix_fixdbl_t cpucblk_zgemmsp(pastix_coefside_t sideA, pastix_trans_t trans, const SolverCblk *cblk, const SolverBlok *blok, SolverCblk *fcblk, const void *A, const void *B, void *C, pastix_complex64_t *work, pastix_int_t lwork, const pastix_lr_t *lowrank)
Compute the updates associated to one off-diagonal block.
void cpucblk_zrelease_deps(pastix_coefside_t side, SolverMatrix *solvmtx, const SolverCblk *cblk, SolverCblk *fcbk)
Release the dependencies of the given cblk after an update.
void cpucblk_zscalo(pastix_trans_t trans, const SolverCblk *cblk, void *dataL, void *dataLD)
Copy the L term with scaling for the two-terms algorithm.
int cpucblk_zsytrfsp1d_sytrf(SolverMatrix *solvmtx, SolverCblk *cblk, void *dataL)
Computes the LDL^t factorization of the diagonal block in a panel.
int cpucblk_zsytrfsp1d(SolverMatrix *solvmtx, SolverCblk *cblk, pastix_complex64_t *DLt, pastix_complex64_t *work, pastix_int_t lwork)
Perform the LDL^t factorization of a given panel and apply all its updates.
void cpucblk_zalloc_lrws(const SolverCblk *cblk, pastix_lrblock_t *lrblok, pastix_complex64_t *ws)
Initialize lrblock structure from a workspace for all blocks of the cblk associated.
The block low-rank structure to hold a matrix in low-rank form.
static pastix_int_t blok_rownbr(const SolverBlok *blok)
Compute the number of rows of a block.
static pastix_int_t cblk_colnbr(const SolverCblk *cblk)
Compute the number of columns in a column block.
static int is_block_inside_fblock(const SolverBlok *blok, const SolverBlok *fblok)
Check if a block is included inside another one.
SolverBlok *restrict bloktab
static void * cblk_getdataU(const SolverCblk *cblk)
Get the pointer to the data associated to the upper part of the cblk.
static void * cblk_getdataL(const SolverCblk *cblk)
Get the pointer to the data associated to the lower part of the cblk.
SolverCblk *restrict cblktab
volatile int32_t nbpivots
Solver column block structure.
Solver column block structure.