37 #if defined(PASTIX_WITH_PARSEC)
41 #if defined(PASTIX_WITH_STARPU)
50 #ifndef DOXYGEN_SHOULD_SKIP_THIS
74 struct coeftabinit_s {
76 const pastix_bcsc_t *bcsc;
104 size_t size = solvmatr->
coefnbr * pastix_size_of( flttype );
109 workL = pastix_malloc_pinned( size );
110 memset( workL, 0, size );
114 workU = pastix_malloc_pinned( size );
115 memset( workU, 0, size );
122 for ( i=0; i<solvmatr->
cblknbr; i++, cblk++ ) {
125 if ( cblk->
cblktype & (CBLK_RECV|CBLK_FANIN) ) {
130 assert( (
size_t) (
step) < size );
164 struct coeftabinit_s *ciargs = (
struct coeftabinit_s*)args;
166 const pastix_bcsc_t *bcsc = ciargs->bcsc;
167 const char *dirname = ciargs->dirname;
172 int rank = ctx->rank;
174 for (i=0; i < datacode->ttsknbr[rank]; i++)
176 task = datacode->ttsktab[rank][i];
177 itercblk = datacode->tasktab[task].
cblknum;
180 initfunc[mixed][bcsc->flttype - 2]( side, datacode, bcsc, itercblk, dirname );
208 struct coeftabinit_s args;
211 args.datacode = pastix_data->
solvmatr;
212 args.bcsc = pastix_data->
bcsc;
217 if ( args.datacode->globalalloc )
220 pastix_print_warning(
"Global allocation is not allowed with compression. It is disabled\n" );
230 #if defined(PASTIX_DEBUG_DUMP_COEFTAB)
272 #if defined(PASTIX_WITH_PARSEC)
274 if ( solvmtx->parsec_desc != NULL ) {
276 free( solvmtx->parsec_desc );
278 solvmtx->parsec_desc = NULL;
281 #if defined(PASTIX_WITH_STARPU)
283 if ( solvmtx->starpu_desc != NULL ) {
285 free( solvmtx->starpu_desc );
287 solvmtx->starpu_desc = NULL;
304 for ( i = 0; i < solvmtx->
cblknbr; i++, cblk++ ) {
323 struct coeftabcomp_s {
326 pastix_atomic_lock_t lock;
352 struct coeftabcomp_s *ccargs = (
struct coeftabcomp_s*)args;
355 pastix_atomic_lock_t *lock = &(ccargs->lock);
361 int rank = ctx->rank;
366 case PastixComplex32:
369 case PastixComplex64:
381 for (i=0; i < solvmtx->ttsknbr[rank]; i++)
383 task = solvmtx->ttsktab[rank][i];
384 itercblk = solvmtx->tasktab[task].
cblknum;
385 cblk = solvmtx->
cblktab + itercblk;
387 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
388 gain += compfunc( solvmtx, side, -1, cblk );
392 pastix_atomic_lock( lock );
394 pastix_atomic_unlock( lock );
419 struct coeftabcomp_s args;
422 args.solvmtx = pastix_data->
solvmatr;
424 args.lock = PASTIX_ATOMIC_UNLOCKED;
460 for (; blokB<lblkB; blokB++) {
466 for (blokA=blokB; blokA<lblkB; blokA++) {
472 assert( blokC < fcblk[1].fblokptr );
476 if ( (blokA->
iluklvl == INT_MAX) ||
485 pastix_cblk_lock( fcblk );
489 pastix_cblk_unlock( fcblk );
492 pastix_atomic_dec_32b( &(fcblk->
ctrbcnt) );
496 #if defined(PASTIX_WITH_MPI)
530 size_t eltsize = pastix_size_of( flttype );
539 for(i=0; i<solvmtx->
cblknbr; i++, cblk++)
544 if ( (solvmtx->clustnum == root) &&
545 (solvmtx->clustnum != cblk->
ownerid) )
547 MPI_Send( cblk->
lcoeftab, cblksize, MPI_CHAR,
549 free_fct( side, cblk );
553 if ( (solvmtx->clustnum != root) &&
554 (solvmtx->clustnum == cblk->
ownerid) )
556 MPI_Recv( cblk->
lcoeftab, cblksize, MPI_CHAR,
557 root, i, comm, &status );
595 size_t eltsize = pastix_size_of( flttype );
598 void *recvbuf = NULL;
606 for( i=0; i<solvmtx->
cblknbr; i++, cblk++ )
610 if ( (solvmtx->clustnum == root) &&
611 (solvmtx->clustnum != cblk->
ownerid) )
613 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
619 MALLOC_INTERN( recvbuf, cblksize,
char );
620 MPI_Recv( recvbuf, cblksize, MPI_CHAR,
621 cblk->
ownerid, i, comm, &status );
624 case PastixComplex64:
627 case PastixComplex32:
642 alloc_fct( side, cblk );
643 MPI_Recv( cblk->
lcoeftab, cblksize, MPI_CHAR,
644 cblk->
ownerid, i, comm, &status );
648 if ( (solvmtx->clustnum != root) &&
649 (solvmtx->clustnum == cblk->
ownerid) )
651 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
655 case PastixComplex64:
660 case PastixComplex32:
679 MPI_Send( buffer, bufsize, MPI_CHAR,
683 MPI_Send( cblk->
lcoeftab, cblksize, MPI_CHAR,
709 for( i=0; i < solvmtx->
cblknbr; i++, cblk++ )
711 if ( solvmtx->clustnum != cblk->
ownerid )
void coeftabAlloc(pastix_data_t *pastix_data)
Allocates the entire coeftab matrix with a single allocation.
void pcoeftabInit(isched_thread_t *ctx, void *args)
Internal routine called by each static thread to Initialize the solver matrix structure.
static void pcoeftabComp(isched_thread_t *ctx, void *args)
Internal routine called by each static thread to Initialize the solver matrix structure.
size_t cpucblk_ccompute_size(pastix_coefside_t side, const SolverCblk *cblk)
Compute the size of the buffer to send.
void cpucblk_cunpack_lr(pastix_coefside_t side, SolverCblk *cblk, void *buffer)
Unpack low rank data and fill the column block concerned by the computation.
void * cpucblk_cpack_lr(pastix_coefside_t side, SolverCblk *cblk, size_t size)
Pack low-rank data for column block.
void * cpucblk_dpack_lr(pastix_coefside_t side, SolverCblk *cblk, size_t size)
Pack low-rank data for column block.
size_t cpucblk_dcompute_size(pastix_coefside_t side, const SolverCblk *cblk)
Compute the size of the buffer to send.
void cpucblk_dunpack_lr(pastix_coefside_t side, SolverCblk *cblk, void *buffer)
Unpack low rank data and fill the column block concerned by the computation.
size_t cpucblk_scompute_size(pastix_coefside_t side, const SolverCblk *cblk)
Compute the size of the buffer to send.
void cpucblk_sunpack_lr(pastix_coefside_t side, SolverCblk *cblk, void *buffer)
Unpack low rank data and fill the column block concerned by the computation.
void * cpucblk_spack_lr(pastix_coefside_t side, SolverCblk *cblk, size_t size)
Pack low-rank data for column block.
size_t cpucblk_zcompute_size(pastix_coefside_t side, const SolverCblk *cblk)
Compute the size of the buffer to send.
void * cpucblk_zpack_lr(pastix_coefside_t side, SolverCblk *cblk, size_t size)
Pack low-rank data for column block.
void cpucblk_zunpack_lr(pastix_coefside_t side, SolverCblk *cblk, void *buffer)
Unpack low rank data and fill the column block concerned by the computation.
BEGIN_C_DECLS typedef int pastix_int_t
void coeftabComputeCblkILULevels(const SolverMatrix *solvmtx, SolverCblk *cblk)
Compute the ILU levels of a cblk.
void(* coeftab_fct_memory_t)(const SolverMatrix *, const pastix_int_t *, pastix_fixdbl_t *)
Type of the memory gain functions.
void coeftab_smemory(const SolverMatrix *solvmtx, const pastix_int_t *iparm, pastix_fixdbl_t *dparm)
Compute the memory usage for the entire matrix.
void coeftab_cmemory(const SolverMatrix *solvmtx, const pastix_int_t *iparm, pastix_fixdbl_t *dparm)
Compute the memory usage for the entire matrix.
pastix_int_t coeftabCompress(pastix_data_t *pastix_data)
Compress the factorized matrix structure if not already done.
void coeftabInit(pastix_data_t *pastix_data, pastix_coefside_t side)
Initialize the solver matrix structure.
void coeftab_dmemory(const SolverMatrix *solvmtx, const pastix_int_t *iparm, pastix_fixdbl_t *dparm)
Compute the memory usage for the entire matrix.
void coeftabExit(SolverMatrix *solvmtx)
Free the solver matrix structure.
void coeftab_zmemory(const SolverMatrix *solvmtx, const pastix_int_t *iparm, pastix_fixdbl_t *dparm)
Compute the memory usage for the entire matrix.
coeftab_fct_memory_t coeftabMemory[4]
List of functions to compute the memory gain in low-rank per precision.
void cpucblk_zinit(pastix_coefside_t side, const SolverMatrix *solvmtx, const pastix_bcsc_t *bcsc, pastix_int_t itercblk, const char *directory)
Fully initialize a single cblk.
void cpucblk_dalloc(pastix_coefside_t side, SolverCblk *cblk)
Allocate the cblk structure to store the coefficient.
void cpucblk_sinit(pastix_coefside_t side, const SolverMatrix *solvmtx, const pastix_bcsc_t *bcsc, pastix_int_t itercblk, const char *directory)
Fully initialize a single cblk.
void cpucblk_zalloc(pastix_coefside_t side, SolverCblk *cblk)
Allocate the cblk structure to store the coefficient.
void cpucblk_dfree(pastix_coefside_t side, SolverCblk *cblk)
Free the cblk structure that store the coefficient.
void cpucblk_salloc(pastix_coefside_t side, SolverCblk *cblk)
Allocate the cblk structure to store the coefficient.
void cpucblk_dinit(pastix_coefside_t side, const SolverMatrix *solvmtx, const pastix_bcsc_t *bcsc, pastix_int_t itercblk, const char *directory)
Fully initialize a single cblk.
void cpucblk_sfree(pastix_coefside_t side, SolverCblk *cblk)
Free the cblk structure that store the coefficient.
void cpucblk_zfree(pastix_coefside_t side, SolverCblk *cblk)
Free the cblk structure that store the coefficient.
void cpucblk_cinit(pastix_coefside_t side, const SolverMatrix *solvmtx, const pastix_bcsc_t *bcsc, pastix_int_t itercblk, const char *directory)
Fully initialize a single cblk.
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_calloc(pastix_coefside_t side, SolverCblk *cblk)
Allocate the cblk structure to store the coefficient.
void cpucblk_cfree(pastix_coefside_t side, SolverCblk *cblk)
Free the cblk structure that store the coefficient.
pastix_int_t cpucblk_dcompress(const SolverMatrix *solvmtx, pastix_coefside_t side, int max_ilulvl, SolverCblk *cblk)
Compress a single column block from full-rank to low-rank format.
pastix_int_t cpucblk_ccompress(const SolverMatrix *solvmtx, pastix_coefside_t side, int max_ilulvl, SolverCblk *cblk)
Compress a single column block from full-rank to low-rank format.
pastix_int_t cpucblk_scompress(const SolverMatrix *solvmtx, pastix_coefside_t side, int max_ilulvl, SolverCblk *cblk)
Compress a single column block from full-rank to low-rank format.
Structure to define the type of function to use for the low-rank kernels and their parameters.
spm_coeftype_t pastix_coeftype_t
Arithmetic types.
void pastix_gendirectories(pastix_data_t *pastix_data)
Generate a unique temporary directory to store output files.
enum pastix_coefside_e pastix_coefside_t
Data blocks used in the kernel.
@ DPARM_COMPRESS_TOLERANCE
@ IPARM_COMPRESS_MIN_WIDTH
@ IPARM_COMPRESS_MIN_HEIGHT
@ IPARM_GLOBAL_ALLOCATION
void parsec_sparse_matrix_destroy(parsec_sparse_matrix_desc_t *desc)
Free the PaRSEC descriptor of the sparse matrix.
void starpu_sparse_matrix_destroy(starpu_sparse_matrix_desc_t *desc)
Free the StarPU descriptor of the sparse matrix.
Main PaStiX data structure.
void cpucblk_dsinit(pastix_coefside_t side, const SolverMatrix *solvmtx, const pastix_bcsc_t *bcsc, pastix_int_t itercblk, const char *directory)
Fully initialize a single mixed-precision cblk.
void cpucblk_zcinit(pastix_coefside_t side, const SolverMatrix *solvmtx, const pastix_bcsc_t *bcsc, pastix_int_t itercblk, const char *directory)
Fully initialize a single mixed-precision cblk.
pastix_coeftype_t flttype
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
pastix_factotype_t factotype
SolverCblk *restrict cblktab
Solver column block structure.
Solver column block structure.