PaStiX Handbook  6.3.2
bcsc.c File Reference
#include "common.h"
#include "pastix/order.h"
#include <spm.h>
#include "blend/solver.h"
#include "bcsc/bcsc.h"
#include "bcsc/bcsc_z.h"
#include "bcsc/bcsc_c.h"
#include "bcsc/bcsc_d.h"
#include "bcsc/bcsc_s.h"

Go to the source code of this file.

Macros

#define BCSC_COMM_NBR   6
 

Functions

void bcsc_handle_comm_init (const SolverMatrix *solvmtx, pastix_bcsc_t *bcsc)
 Initializes the bcsc_handle_comm_t structure. More...
 
void bcsc_handle_comm_exit (bcsc_handle_comm_t *bcsc_comm)
 Frees the bcsc_handle_comm pointers. More...
 
pastix_int_tbcsc_init_col2cblk_shm (const SolverMatrix *solvmtx, const pastix_bcsc_t *bcsc)
 Creates the array which represents the repartition of each column in the block structure. The array size is spm->gNexp where: More...
 
pastix_int_tbcsc_init_col2cblk (const SolverMatrix *solvmtx, const pastix_bcsc_t *bcsc, const spmatrix_t *spm)
 Creates the array which represents the repartition of each column in the block structure. This routine calls bcsc_init_col2cblk_shm or bcsc_init_col2cblk_dst according to the way the matrix is stored in the memory. More...
 
static pastix_int_tbcsc_init_dofshift (const spmatrix_t *spm, const pastix_order_t *ord)
 Initializes the dofshit array of size gNexp which gives dofshift[index_permuted] = index. This corresponds to the inverse of the permutation given in ord->permtab. More...
 
static void bcsc_init_global_coltab_shm_cdof (const spmatrix_t *spm, const pastix_order_t *ord, pastix_int_t *globcol)
 Initializes the coltab of a block csc matrix. The coltab corresponds to the number of rows (expended) per column (non expended). This rountine is called when the matrix is stored in shared memory or the matrix is replicated on the processors and the matrix's degree of liberty is constant. More...
 
static void bcsc_init_global_coltab_shm_vdof (const spmatrix_t *spm, const pastix_order_t *ord, pastix_int_t *globcol)
 Initializes the coltab of a block csc matrix. The coltab corresponds to the number of rows (expended) per column (non expended). This rountine is called when the matrix is stored in shared memory or the matrix is replicated on the processors and the matrix's degree of liberty is variadic. More...
 
static pastix_int_tbcsc_init_global_coltab (const spmatrix_t *spm, const pastix_order_t *ord, const SolverMatrix *solvmtx, const pastix_int_t *col2cblk, bcsc_handle_comm_t *bcsc_comm)
 Initializes the coltab of a block csc matrix. The coltab corresponds to the number of rows (expended) per column (non expended). This routine is calls bcsc_init_global_coltab_[shm,dst]_[c,v]dof according to the way the matrix is stored and if the degree of liberty of the matrix is constant or variadic. If the matrix is distributed in the memory, this function also calls the routines which exchange the amount of data for the communication, store the indexes and values to send and exchange the indexes. More...
 
pastix_int_t bcsc_init_coltab (const spmatrix_t *spm, const pastix_order_t *ord, const SolverMatrix *solvmtx, pastix_bcsc_t *bcsc)
 Initializes the coltab of a block csc matrix. The coltab corresponds to the number of rows (expended) per column (non expended). If the matrix is distributed in the memory, this function also calls the routines which exchange the amount of data for the communication, store the indexes and values to send and exchange the indexes. More...
 
void bcsc_restore_coltab (pastix_bcsc_t *bcsc)
 Restores the coltab array when it has been modified to initialize the row and values arrays. More...
 
void bcsc_init_struct (const spmatrix_t *spm, const SolverMatrix *solvmtx, pastix_bcsc_t *bcsc)
 Initializes a block csc. More...
 
void bcsc_exit_struct (pastix_bcsc_t *bcsc)
 Cleanup the bcsc struct. (symmetric of bcsc_init_struct) More...
 
static void bcsc_init (const spmatrix_t *spm, const pastix_order_t *ord, const SolverMatrix *solvmtx, pastix_int_t initAt, pastix_bcsc_t *bcsc)
 Initializes a block csc. More...
 
double bcscInit (const spmatrix_t *spm, const pastix_order_t *ord, const SolverMatrix *solvmtx, pastix_int_t initAt, pastix_bcsc_t *bcsc)
 Initializes the block csc matrix. More...
 
void bcscExit (pastix_bcsc_t *bcsc)
 Frees the block csc structure but do not free the bcsc pointer. More...
 

Detailed Description

Version
6.3.2
Author
Mathieu Faverge
Pierre Ramet
Xavier Lacoste
Theophile Terraz
Tony Delarue
Alycia Lisito
Date
2023-07-21

Definition in file bcsc.c.

Function Documentation

◆ bcsc_init_dofshift()

static pastix_int_t* bcsc_init_dofshift ( const spmatrix_t *  spm,
const pastix_order_t ord 
)
inlinestatic

Initializes the dofshit array of size gNexp which gives dofshift[index_permuted] = index. This corresponds to the inverse of the permutation given in ord->permtab.

Parameters
[in]spmThe initial sparse matrix in the spm format.
[in]ordThe ordering that needs to be applied on the spm to generate the block csc.
Returns
The dofshift array.

Definition at line 752 of file bcsc.c.

References pastix_int_t, and pastix_order_s::permtab.

Referenced by bcsc_init_coltab().

◆ bcsc_init_global_coltab_shm_cdof()

static void bcsc_init_global_coltab_shm_cdof ( const spmatrix_t *  spm,
const pastix_order_t ord,
pastix_int_t globcol 
)
inlinestatic

Initializes the coltab of a block csc matrix. The coltab corresponds to the number of rows (expended) per column (non expended). This rountine is called when the matrix is stored in shared memory or the matrix is replicated on the processors and the matrix's degree of liberty is constant.

Parameters
[in]spmThe initial sparse matrix in the spm format.
[in]ordThe ordering which needs to be applied on the spm to generate the block csc.
[out]globcolThe array which contains, for each column, its beginning in the smp->colptr.

Definition at line 803 of file bcsc.c.

References pastix_int_t, and pastix_order_s::permtab.

Referenced by bcsc_init_global_coltab().

◆ bcsc_init_global_coltab_shm_vdof()

static void bcsc_init_global_coltab_shm_vdof ( const spmatrix_t *  spm,
const pastix_order_t ord,
pastix_int_t globcol 
)
inlinestatic

Initializes the coltab of a block csc matrix. The coltab corresponds to the number of rows (expended) per column (non expended). This rountine is called when the matrix is stored in shared memory or the matrix is replicated on the processors and the matrix's degree of liberty is variadic.

Parameters
[in]spmThe initial sparse matrix in the spm format.
[in]ordThe ordering which needs to be applied on the spm to generate the block csc.
[out]globcolThe array which contains, for each column, its begining in the smp->colptr.

Definition at line 873 of file bcsc.c.

References pastix_int_t, and pastix_order_s::permtab.

Referenced by bcsc_init_global_coltab().

◆ bcsc_init_global_coltab()

static pastix_int_t* bcsc_init_global_coltab ( const spmatrix_t *  spm,
const pastix_order_t ord,
const SolverMatrix solvmtx,
const pastix_int_t col2cblk,
bcsc_handle_comm_t bcsc_comm 
)
inlinestatic

Initializes the coltab of a block csc matrix. The coltab corresponds to the number of rows (expended) per column (non expended). This routine is calls bcsc_init_global_coltab_[shm,dst]_[c,v]dof according to the way the matrix is stored and if the degree of liberty of the matrix is constant or variadic. If the matrix is distributed in the memory, this function also calls the routines which exchange the amount of data for the communication, store the indexes and values to send and exchange the indexes.

Parameters
[in]spmThe initial sparse matrix in the spm format.
[in]ordThe ordering which needs to be applied on the spm to generate the block csc.
[in]solvmtxThe solver matrix structure which describes the data distribution.
[in]col2cblkThe array which contains the repartition of the matrix columns into the block structure.
[in,out]bcsc_commThe handle_comm_structure updated with the amount of data the current processor has to send to the other processor if PASTIX_WITH_MPI = ON and the matrix is distributed in memory. If it is not the case, bcsc_comm = NULL.
Returns
The array which contains, for each column, its begining in the smp->colptr.

Definition at line 1464 of file bcsc.c.

References bcsc_init_global_coltab_shm_cdof(), bcsc_init_global_coltab_shm_vdof(), pastix_int_t, and pastix_order_s::permtab.

Referenced by bcsc_init_coltab().

◆ bcsc_init()

static void bcsc_init ( const spmatrix_t *  spm,
const pastix_order_t ord,
const SolverMatrix solvmtx,
pastix_int_t  initAt,
pastix_bcsc_t *  bcsc 
)
inlinestatic

Initializes a block csc.

Parameters
[in]spmThe initial sparse matrix in the spm format.
[in]ordThe ordering which needs to be applied on the spm to generate the block csc.
[in]solvmtxThe solver matrix structure which describes the data distribution.
[in]initAtThe test to know if At has to be initialized:
  • if initAt = 0 then the matrix is symmetric of hermitian which means that Lvalues = Uvalues so At does not need to be initialised.
  • if initAt = 1 then the matrix is general and which means that At needs to be initialised and computed.
[in,out]bcscOn entry, the pointer to an allocated bcsc. On exit, the bcsc stores the input spm with the permutation applied and grouped accordingly to the distribution described in solvmtx.

Definition at line 1813 of file bcsc.c.

References bcsc_cinit(), bcsc_dinit(), bcsc_init_coltab(), bcsc_init_struct(), bcsc_sinit(), bcsc_zinit(), and pastix_int_t.

Referenced by bcscInit().