csc_intern_compute.c

Functions computing operations on the CSC.

Summary
 csc_intern_compute.c Functions computing operations on the CSC. Variables iun fun Macros Macros CONJ_JJP Computes the conjugate of a coefficient. Functions CscNorm1 Computes the norm 1 of the internal CSCd CscbMAx Computes . CscAxPb Compute the operation CscBerr Compute the operation . CscNormErr Computes the norm 2 of r and the norm 2 of b and return the quotient of these two vectors. CscAx Computes A times p and store the result in x. CscGradAlpha Computes the scalar product of r with z, then the scalar product of x with p and finaly store the quotient in alpha. CscGradBeta Computes the scalar product between r and z and store the result in beta. CscGmresBeta Computes the scalar product between r and z and store the result in beta.

iun

 static INT iun

fun

 static FLOAT fun

Macros

Summary
 Macros CONJ_JJP Computes the conjugate of a coefficient.

CONJ_JJP

Computes the conjugate of a coefficient.

CscNorm1

 double CscNorm1( const CscMatrix * cscmtx, MPI_Comm comm )

Computes the norm 1 of the internal CSCd

Norm 1 is equal to the maximum value of the sum of the Absolute values of the elements of each columns.

Parameters

 cscmtx Internal CSCd to compute the norm of. comm MPI communicator.

Returns

The norm 1 of the internal CSCd.

CscbMAx

 void CscbMAx( Sopalin_Data_t * sopalin_data, int me, volatile FLOAT * r, const volatile FLOAT * b, const CscMatrix * cscmtx, const UpDownVector * updovct, const SymbolMatrix * symbmtx, MPI_Comm comm )

Computes .

Parameters

 sopalin_data Internal structure containing global datas used by PaStiX. me thread ID. r will contains b Vector . cscmtx Internal CSCd matrix containing . updovct UpDownVector structure containing . symbmtx Symbol matrix. comm MPI communicator.

CscAxPb

 void CscAxPb( Sopalin_Data_t * sopalin_data, int me, FLOAT * r, const FLOAT * b, const CscMatrix * cscmtx, const UpDownVector * updovct, const SymbolMatrix * symbmtx, MPI_Comm comm )

Compute the operation

Parameters

 sopalin_data Sopalin_Data_t structure, common to all threads. me thread number r solution (vector commont to all threads) b Added vector (vector commont to all threads) cscmtx Compress Sparse Column matrix A updovct x, multiplied vector symbmtx symbol matrix to know tho local structure of the matrix comm MPI communicator

CscBerr

 void CscBerr( Sopalin_Data_t * sopalin_data, int me, const FLOAT * r, const FLOAT * s, const INT colnbr, const INT smxnbr, double * berr, MPI_Comm comm )

Compute the operation .

Parameters :

 sopalin_data Sopalin_Data_t structure, common to all threads. me thread number r vector(s) (common to all threads) s vector(s) (common to all threads) colnbr size of the vectors smvnbr number of vectors in r and s berr berr (local variable) comm MPI communicator

CscNormErr

 double CscNormErr( Sopalin_Data_t * sopalin_data, int me, const volatile FLOAT * r, const volatile FLOAT * b, const INT colnbr, const INT smxnbr, MPI_Comm comm )

Computes the norm 2 of r and the norm 2 of b and return the quotient of these two vectors.

This Function is multithreaded, each thread will compute a part of the norm, it will be gathered between threads, then between MPI processors.

Parameters

 sopalin_data global PaStix informations. me Thread ID. r first vector from which the norm 2 is computed. b second vector from which the norm 2 is computed. colnbr Size of the vectors. smxnbr Number of vectors (multi-right-hand-side method) comm PaStiX MPI communicator.

CscAx

 void CscAx( Sopalin_Data_t * sopalin_data, int me, const CscMatrix * cscmtx, const volatile FLOAT * p, volatile FLOAT * x, const SymbolMatrix * symbmtx, const UpDownVector * updovct, MPI_Comm comm )

Computes A times p and store the result in x.

When compiled with SMP_RAFF, this operation is multi-threaded.

Parameters

 sopalin_data Gloabl PaStiX data. me thread ID. cscmtx Internal CSCd matrix, A. p Vector which will be multiplied by the CSCd. x vector which will contain the computation result. symbmtx Symbol matrix. updovct Structure used for updown step, it contains information about the vectors. comm MPI Communicator.

CscGradAlpha

 void CscGradAlpha( Sopalin_Data_t * sopalin_data, int me, const volatile FLOAT * r, const volatile FLOAT * z, const volatile FLOAT * x, const volatile FLOAT * p, INT colnbr, INT smxnbr, double * alpha, MPI_Comm comm )

Computes the scalar product of r with z, then the scalar product of x with p and finaly store the quotient in alpha.

Multi-threaded in SMP_RAFF mode.

Parameters

 sopalin_data Gloabal PaStiX data structure. me Thread ID. r A vector of size colnbr times smxnbr. z A vector of size colnbr times smxnbr. x A vector of size colnbr times smxnbr. p A vector of size colnbr times smxnbr. colnbr Number of unkowns. smxnbr Number of right-hand-side members. alpha Float which will store the computation result. comm MPI communicator.

CscGradBeta

 void CscGradBeta( Sopalin_Data_t * sopalin_data, int me, const volatile FLOAT * r, const volatile FLOAT * z, INT colnbr, INT smxnbr, double * beta, MPI_Comm comm )

Computes the scalar product between r and z and store the result in beta.

At the end, beta is only on thread 0.

Parameters

 sopalin_data PaStiX data structure. me Thread ID. r first vector of size colnbr times smxnbr. z second vector of size colnbr times smxnbr.a colnbr Number of unknowns. smxnbr Number of right-hand-side members. beta Float which will store the solution. comm MPI communicator.

CscGmresBeta

 void CscGmresBeta( Sopalin_Data_t * sopalin_data, int me, const volatile FLOAT * r, const volatile FLOAT * z, INT colnbr, INT smxnbr, double * beta, MPI_Comm comm )

Computes the scalar product between r and z and store the result in beta.

Parameters

 sopalin_data PaStiX data structure. me Thread ID. r first vector of size colnbr times smxnbr. z second vector of size colnbr times smxnbr.a colnbr Number of unknowns. smxnbr Number of right-hand-side members. beta Float which will store the solution. comm MPI communicator.
 static INT iun
 static FLOAT fun
 double CscNorm1( const CscMatrix * cscmtx, MPI_Comm comm )
Computes the norm 1 of the internal CSCd
 void CscbMAx( Sopalin_Data_t * sopalin_data, int me, volatile FLOAT * r, const volatile FLOAT * b, const CscMatrix * cscmtx, const UpDownVector * updovct, const SymbolMatrix * symbmtx, MPI_Comm comm )
Computes .
 void CscAxPb( Sopalin_Data_t * sopalin_data, int me, FLOAT * r, const FLOAT * b, const CscMatrix * cscmtx, const UpDownVector * updovct, const SymbolMatrix * symbmtx, MPI_Comm comm )
Compute the operation
 void CscBerr( Sopalin_Data_t * sopalin_data, int me, const FLOAT * r, const FLOAT * s, const INT colnbr, const INT smxnbr, double * berr, MPI_Comm comm )
Compute the operation .
 double CscNormErr( Sopalin_Data_t * sopalin_data, int me, const volatile FLOAT * r, const volatile FLOAT * b, const INT colnbr, const INT smxnbr, MPI_Comm comm )
Computes the norm 2 of r and the norm 2 of b and return the quotient of these two vectors.
 void CscAx( Sopalin_Data_t * sopalin_data, int me, const CscMatrix * cscmtx, const volatile FLOAT * p, volatile FLOAT * x, const SymbolMatrix * symbmtx, const UpDownVector * updovct, MPI_Comm comm )
Computes A times p and store the result in x.
 void CscGradAlpha( Sopalin_Data_t * sopalin_data, int me, const volatile FLOAT * r, const volatile FLOAT * z, const volatile FLOAT * x, const volatile FLOAT * p, INT colnbr, INT smxnbr, double * alpha, MPI_Comm comm )
Computes the scalar product of r with z, then the scalar product of x with p and finaly store the quotient in alpha.
 void CscGradBeta( Sopalin_Data_t * sopalin_data, int me, const volatile FLOAT * r, const volatile FLOAT * z, INT colnbr, INT smxnbr, double * beta, MPI_Comm comm )
Computes the scalar product between r and z and store the result in beta.
 void CscGmresBeta( Sopalin_Data_t * sopalin_data, int me, const volatile FLOAT * r, const volatile FLOAT * z, INT colnbr, INT smxnbr, double * beta, MPI_Comm comm )
Computes the scalar product between r and z and store the result in beta.