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 );
108 workL = pastix_malloc_pinned( size );
109 memset( workL, 0, size );
113 workU = pastix_malloc_pinned( size );
114 memset( workU, 0, size );
121 for ( i=0; i<solvmatr->
cblknbr; i++, cblk++ ) {
124 if ( cblk->
cblktype & (CBLK_RECV|CBLK_FANIN) ) {
129 assert( (
size_t) (
step) < size );
163 struct coeftabinit_s *ciargs = (
struct coeftabinit_s*)args;
165 const pastix_bcsc_t *bcsc = ciargs->bcsc;
166 const char *dirname = ciargs->dirname;
171 int rank = ctx->rank;
173 for (i=0; i < datacode->ttsknbr[rank]; i++)
175 task = datacode->ttsktab[rank][i];
176 itercblk = datacode->tasktab[task].
cblknum;
179 initfunc[mixed][bcsc->flttype - 2]( side, datacode, bcsc, itercblk, dirname );
207 struct coeftabinit_s args;
210 args.datacode = pastix_data->
solvmatr;
211 args.bcsc = pastix_data->
bcsc;
216 if ( args.datacode->globalalloc )
219 pastix_print_warning(
"Global allocation is not allowed with compression. It is disabled\n" );
229 #if defined(PASTIX_DEBUG_DUMP_COEFTAB)
271 #if defined(PASTIX_WITH_PARSEC)
273 if ( solvmtx->parsec_desc != NULL ) {
275 free( solvmtx->parsec_desc );
277 solvmtx->parsec_desc = NULL;
280 #if defined(PASTIX_WITH_STARPU)
282 if ( solvmtx->starpu_desc != NULL ) {
284 free( solvmtx->starpu_desc );
286 solvmtx->starpu_desc = NULL;
303 for ( i = 0; i < solvmtx->
cblknbr; i++, cblk++ ) {
304 if ( cblk->
cblktype & (CBLK_FANIN|CBLK_RECV) ) {
325 struct coeftabcomp_s {
328 pastix_atomic_lock_t lock;
354 struct coeftabcomp_s *ccargs = (
struct coeftabcomp_s*)args;
357 pastix_atomic_lock_t *lock = &(ccargs->lock);
363 int rank = ctx->rank;
368 case PastixComplex32:
371 case PastixComplex64:
383 for (i=0; i < solvmtx->ttsknbr[rank]; i++)
385 task = solvmtx->ttsktab[rank][i];
386 itercblk = solvmtx->tasktab[task].
cblknum;
387 cblk = solvmtx->
cblktab + itercblk;
389 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
390 gain += compfunc( solvmtx, side, -1, cblk );
394 pastix_atomic_lock( lock );
396 pastix_atomic_unlock( lock );
421 struct coeftabcomp_s args;
424 args.solvmtx = pastix_data->
solvmatr;
426 args.lock = PASTIX_ATOMIC_UNLOCKED;
462 for (; blokB<lblkB; blokB++) {
468 for (blokA=blokB; blokA<lblkB; blokA++) {
474 assert( blokC < fcblk[1].fblokptr );
478 if ( (blokA->
iluklvl == INT_MAX) ||
487 pastix_cblk_lock( fcblk );
491 pastix_cblk_unlock( fcblk );
494 pastix_atomic_dec_32b( &(fcblk->
ctrbcnt) );
498 #if defined(PASTIX_WITH_MPI)
532 size_t eltsize = pastix_size_of( flttype );
541 for(i=0; i<solvmtx->
cblknbr; i++, cblk++)
546 if ( (solvmtx->clustnum == root) &&
547 (solvmtx->clustnum != cblk->
ownerid) )
549 MPI_Send( cblk->
lcoeftab, cblksize, MPI_CHAR,
551 free_fct( side, cblk );
555 if ( (solvmtx->clustnum != root) &&
556 (solvmtx->clustnum == cblk->
ownerid) )
558 MPI_Recv( cblk->
lcoeftab, cblksize, MPI_CHAR,
559 root, i, comm, &status );
597 size_t eltsize = pastix_size_of( flttype );
600 void *recvbuf = NULL;
608 for( i=0; i<solvmtx->
cblknbr; i++, cblk++ )
612 if ( (solvmtx->clustnum == root) &&
613 (solvmtx->clustnum != cblk->
ownerid) )
615 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
621 MALLOC_INTERN( recvbuf, cblksize,
char );
622 MPI_Recv( recvbuf, cblksize, MPI_CHAR,
623 cblk->
ownerid, i, comm, &status );
626 case PastixComplex64:
629 case PastixComplex32:
644 alloc_fct( side, cblk );
645 MPI_Recv( cblk->
lcoeftab, cblksize, MPI_CHAR,
646 cblk->
ownerid, i, comm, &status );
650 if ( (solvmtx->clustnum != root) &&
651 (solvmtx->clustnum == cblk->
ownerid) )
653 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
657 case PastixComplex64:
662 case PastixComplex32:
681 MPI_Send( buffer, bufsize, MPI_CHAR,
685 MPI_Send( cblk->
lcoeftab, cblksize, MPI_CHAR,
711 for( i=0; i < solvmtx->
cblknbr; i++, cblk++ )
713 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.