csc_intern_build.c

Functions to build internal CSCd from user CSCd.

Function to free internal CSCd.

Summary
csc_intern_build.cFunctions to build internal CSCd from user CSCd.
Macros and defines
Macros
COL_IS_LOCAL(col)Uses the result of glob2loc to determine if the column is local.
SET_CSC_COL(newcoltab)Allocate and fill CSC_COLTAB using newcoltab array.
CSC_ALLOCAllocates CSC_ROWTAB, CSC_VALTAB and the transpose CSC arrays.
SET_CSC_ROW_VAL(itercblk, therow, thecol, val)Fill next CSC_ROW and CSC_VAL.
SET_TRANS_ROW_VAL(itercblk, therow, thecol, val)Fill next entries for transpose CSC.
CSC_SORTSort the internal CSC
Functions
CscOrdistribFill in thecsc CSC matrix in column block representation.
CscdOrdistribFill in thecsc CSC matrix in column block representation.
CscExitFree the internal CSCd structure.

Macros and defines

Summary
Macros
COL_IS_LOCAL(col)Uses the result of glob2loc to determine if the column is local.
SET_CSC_COL(newcoltab)Allocate and fill CSC_COLTAB using newcoltab array.
CSC_ALLOCAllocates CSC_ROWTAB, CSC_VALTAB and the transpose CSC arrays.
SET_CSC_ROW_VAL(itercblk, therow, thecol, val)Fill next CSC_ROW and CSC_VAL.
SET_TRANS_ROW_VAL(itercblk, therow, thecol, val)Fill next entries for transpose CSC.
CSC_SORTSort the internal CSC

Macros

COL_IS_LOCAL(col)

Uses the result of glob2loc to determine if the column is local.

Parameters

colglob2loc value.

SET_CSC_COL(newcoltab)

Allocate and fill CSC_COLTAB using newcoltab array.

CSC_COLNBR(thecsc,index) will contain the number of column of the column block “index” of thecsc

CSC_COLTAB(thecsc, index) is the tabular containing the starting index of each column of the column bloc in CSC_ROWTAB and CSC_VALTAB

CSC_COL(thecsc, index, iter) is the starting index for the column iter of the block index.

Parameters

newcoltabarray containing starting index of each column in rows and values, using new ordering.

CSC_ALLOC

Allocates CSC_ROWTAB, CSC_VALTAB and the transpose CSC arrays.

SET_CSC_ROW_VAL(itercblk, therow, thecol, val)

Fill next CSC_ROW and CSC_VAL.

Parameters

itercblkColumn block index.
therowRow index.
thecolColumn index.
valValue array.

SET_TRANS_ROW_VAL(itercblk, therow, thecol, val)

Fill next entries for transpose CSC.

Parameters

itercblkColumn block index.
therowRow index.
thecolColumn index.
valValue array.

CSC_SORT

Sort the internal CSC

Functions

CscOrdistrib

Fill in thecsc CSC matrix in column block representation.

Parameters

thecscMatrix in block column CSC format to fill in.
Type3 charactères for matrix type : only Type[1] is used to check if matrix is Symetric(S) or not(U).
transcsctranspose of the CSC in non symetric mode.
ordordering
NrowNumber of rows.
NcolNumber of columns.
NnzeroNumber of non zeros in the matrix.
colptrIndex in rowind and val of the start of each column.
rowindIndex of the elements.
valvalues of the elements.
forcetransIf matrix symetric, transcsc will be the copy of the CSC_VALTAB.
symbmtxSymbol matrix
procnumMPI process number
dofNumber of degree of freedom.

CscdOrdistrib

void CscdOrdistrib(CscMatrix *thecsc,
char *Type,
FLOAT **transcsc,
const Order *ord,
INT Ncol,
INT *colptr,
INT *rowind,
FLOAT *val,
INT *l2g,
INT gNcol,
INT *g2l,
INT forcetrans,
const SymbolMatrix *symbmtx,
INT procnum,
INT dof,
MPI_Comm comm)

Fill in thecsc CSC matrix in column block representation.

  • Construct cachetab (sizeof(INT)*globalNbCol) which will contain the column block wich will own each column (internal numerotation), or -1 if not local
  • Build newcoltab (sizeof(INT)*globalNbCol) which will contain the coltab corresponding to the local internal CSCd.  This CSCd correspond to the given CSCd adding upper part in Symmetric matrix.  Also count number of triples (i,j,v) to send to each other processors.
  • Send the information about how many triples will be sent
  • Fill-in the arrays containing triples to send and send them.
  • Receive those arrays and correct the newcoltab arrays with information from others processors.
  • Build CSC_COLNBR from symbolic matrix informations and CSC_COL from newcoltab.
  • Construct transpose matrix, in symmetric mode, transcsc == CSC_VALTAB; in unsymmetric mode, allocate trowtab (number of total local elements), and build trscltb which contains number of elements, in each column of each column bloc.
  • fill-in internal CSC row and values from local given CSCd, also fill-in trowtab and transcsc in unsymmetric mode.  CSC_COL and trscltb are incremented for each element added.
  • fill-in internal CSC row and values from iniformation received, also fill in transposed CSCd in unsymmetric mode.  CSC_COL and trscltb are incremented for each element added.
  • restore CSC_COL.
  • sort internal CSCd.
  • sort intranal transposed CSCd.

Parameters

thecscMatrix in block column CSC format to fill in.
Type3 charactères for matrix type : only Type[1] is used to check if matrix is Symetric(S) or not(U).
transcscTranspose of the CSC in non symetric mode.
ordordering
NcolNumber of columns.
colptrIndex in rowind and val of the start of each column.
rowindIndex of the elements.
valvalues of the elements.
l2gglobal numbers of local nodes.
gNcolglobal number of columns.
g2llocal numbers of global nodes, if not local contains -owner
forcetransIf matrix symetric, transcsc will be the copy of the CSC_VALTAB.
symbmtxSymbol matrix
procnumMPI process number.
dofNumber of degree of freedom.
commMPI communicator.

CscExit

void CscExit(CscMatrix *thecsc)

Free the internal CSCd structure.

Parameters

thecscInternal CSCd to free.
void CscdOrdistrib(CscMatrix *thecsc,
char *Type,
FLOAT **transcsc,
const Order *ord,
INT Ncol,
INT *colptr,
INT *rowind,
FLOAT *val,
INT *l2g,
INT gNcol,
INT *g2l,
INT forcetrans,
const SymbolMatrix *symbmtx,
INT procnum,
INT dof,
MPI_Comm comm)
Fill in thecsc CSC matrix in column block representation.
void CscExit(CscMatrix *thecsc)
Free the internal CSCd structure.
Close