LAMA
lama::OpenMPELLUtils Class Reference

This class provides routines to converse ELL storage data to CSR storage data and vice versa. More...

#include <OpenMPELLUtils.hpp>

Public Member Functions

template<typename ValueType >
void jacobi (ValueType solution[], const IndexType numRows, const IndexType UNUSED(ellNumValuesPerRow), const IndexType ellSizes[], const IndexType ellJA[], const ValueType ellValues[], const ValueType oldSolution[], const ValueType rhs[], const ValueType omega, class SyncToken *syncToken)
template<typename ValueType >
void jacobiHalo (ValueType solution[], const IndexType numRows, const ValueType diagonal[], const IndexType UNUSED(ellNumValuesPerRow), const IndexType ellSizes[], const IndexType ellJA[], const ValueType ellValues[], const IndexType rowIndexes[], const IndexType numNonEmptyRows, const ValueType oldSolution[], const ValueType omega, class SyncToken *syncToken)
template<typename ValueType >
void normalGEMV (ValueType result[], const ValueType alpha, const ValueType x[], const ValueType beta, const ValueType y[], const IndexType numRows, const IndexType UNUSED(numNonZerosPerRow), const IndexType ellSizes[], const IndexType ellJA[], const ValueType ellValues[], SyncToken *syncToken)
template<typename ValueType >
void sparseGEMV (ValueType result[], const IndexType numRows, const IndexType UNUSED(numNonZerosPerRow), const ValueType alpha, const ValueType x[], const IndexType numNonZeroRows, const IndexType rowIndexes[], const IndexType ellSizes[], const IndexType ellJA[], const ValueType ellValues[], SyncToken *syncToken)

Static Public Member Functions

static IndexType countNonEmptyRowsBySizes (const IndexType sizes[], const IndexType numRows)
 This method computes the total number of non-zero rows by the size array.
static void setNonEmptyRowsBySizes (IndexType rowIndexes[], const IndexType numNonEmptyRows, const IndexType sizes[], const IndexType numRows)
 Build a vector of indexes for non-empty rows.
static IndexType ellindex (const IndexType i, const IndexType jj, const IndexType numRows)
 Addressing function for the arrays ia and ja: column-wise.
static void check (const IndexType mNumRows, const IndexType mNumValuesPerRow, const IndexType mNumColumns, const IndexType *ia, const IndexType *ja, const char *msg)
template<typename ValueType , typename OtherValueType >
static void getRow (OtherValueType *row, const IndexType i, const IndexType numRows, const IndexType numColumns, const IndexType *ia, const IndexType *ja, const ValueType *values)
 Returns one row of the matrix.
template<typename ValueType , typename OtherValueType >
static OtherValueType getValue (const IndexType i, const IndexType j, const IndexType numRows, const IndexType *ia, const IndexType *ja, const ValueType *values)
 Returns one value of the matrix.
static bool hasDiagonalProperty (const IndexType numDiagonals, const IndexType csrJA[])
 check diagonal property
template<typename ValueType , typename OtherValueType >
static void scaleValue (const IndexType numRows, const IndexType Ia[], ValueType mValues[], const OtherValueType values[])
template<typename ValueType >
static void compressIA (const IndexType IA[], const IndexType JA[], const ValueType values[], const IndexType numRows, const ValueType eps, IndexType newIA[])
 Implementation for ELLUtilsInterface::Conversions::compressIA.
template<typename ValueType >
static void compressValues (const IndexType IA[], const IndexType JA[], const ValueType values[], const IndexType numRows, const ValueType eps, IndexType newJA[], ValueType newValues[])
 Implementation for ELLUtilsInterface::Conversions::compressValues.
template<typename ELLValueType , typename CSRValueType >
static void getCSRValues (IndexType csrJA[], CSRValueType csrValues[], const IndexType csrIA[], const IndexType numRows, const IndexType ellSizes[], const IndexType ellJA[], const ELLValueType ellValues[])
 Implementation for ELLUtilsInterface::Conversions::getCSRValues.
template<typename ELLValueType , typename CSRValueType >
static void setCSRValues (IndexType ellJA[], ELLValueType ellValues[], const IndexType ellSizes[], const IndexType numRows, const IndexType numValuesPerRow, const IndexType csrIA[], const IndexType csrJA[], const CSRValueType csrValues[])
 Implementation for ELLUtilsInterface::Conversions::setCSRValues.
template<typename ValueType >
static void computeIA (const IndexType aIA[], const IndexType aJA[], const IndexType aNumRows, const IndexType bIA[], const IndexType bJA[], const IndexType bNumRows, IndexType cIA[])
 Implementation for ELLUtilsInterface::MatrixTimesMatrix::computeIA.
template<typename ValueType >
static void computeValues (const IndexType aIA[], const IndexType aJA[], const ValueType aValues[], const IndexType aNumRows, const IndexType bIA[], const IndexType bJA[], const ValueType bValues[], const IndexType bNumRows, const ValueType alpha, const IndexType cIA[], IndexType cJA[], ValueType cValues[])
 Implementation for ELLUtilsInterface::MatrixTimesMatrix::computeValues.
template<typename ValueType >
static void addComputeIA (const IndexType aIA[], const IndexType aJA[], const IndexType aNumRows, const IndexType bIA[], const IndexType bJA[], const IndexType bNumRows, IndexType cIA[])
 Implementation for ELLUtilsInterface::MatrixTimesMatrix::addComputeIA.
template<typename ValueType >
static void addComputeValues (const IndexType aIA[], const IndexType aJA[], const ValueType aValues[], const IndexType aNumRows, const IndexType bIA[], const IndexType bJA[], const ValueType bValues[], const IndexType bNumRows, const ValueType beta, const IndexType cIA[], IndexType cJA[], ValueType cValues[])
 Implementation for ELLUtilsInterface::MatrixTimesMatrix::addComputeValues.
template<typename ValueType >
static void jacobi (ValueType solution[], const IndexType numRows, const IndexType ellNumValuesPerRow, const IndexType ellSizes[], const IndexType ellJA[], const ValueType ellValues[], const ValueType oldSolution[], const ValueType rhs[], const ValueType omega, class SyncToken *syncToken)
 Implementation for ELLUtilsInterface::Solver::jacobi.
template<typename ValueType >
static void jacobiHalo (ValueType solution[], const IndexType numRows, const ValueType diagonal[], const IndexType ellNumValuesPerRow, const IndexType ellSizes[], const IndexType ellJA[], const ValueType ellValues[], const IndexType rowIndexes[], const IndexType numNonEmptyRows, const ValueType oldSolution[], const ValueType omega, class SyncToken *syncToken)
 Implementation for ELLUtilsInterface::Solver::jacobiHalo.
template<typename ValueType >
static void normalGEMV (ValueType result[], const ValueType alpha, const ValueType x[], const ValueType beta, const ValueType y[], const IndexType numRows, const IndexType numNonZerosPerRow, const IndexType csrIA[], const IndexType csrJA[], const ValueType csrValues[], class SyncToken *syncToken)
 Implementation for ELLUtilsInterface::Mult::normalGEMV.
template<typename ValueType >
static void sparseGEMV (ValueType result[], const IndexType numRows, const IndexType numNonZerosPerRow, const ValueType alpha, const ValueType x[], const IndexType numNonZeroRows, const IndexType rowIndexes[], const IndexType csrIA[], const IndexType csrJA[], const ValueType csrValues[], class SyncToken *syncToken)
 Implementation for ELLUtilsInterface::Mult::sparseGEMV.
static void setInterface (struct ELLUtilsInterface &ELLUtils)
 Routine that registers all routines of this class at the LAMA interface.

Private Member Functions

 LAMA_LOG_DECL_STATIC_LOGGER (logger)

Static Private Member Functions

template<typename ValueType >
static void normalGEMV (ValueType result[], const ValueType alpha, const ValueType x[], const ValueType beta, const ValueType y[], const IndexType numRows, const IndexType csrIA[], const IndexType csrJA[], const ValueType csrValues[])
template<typename ValueType >
static void sparseGEMV (ValueType result[], const IndexType numRows, const ValueType alpha, const ValueType x[], const IndexType numNonZeroRows, const IndexType rowIndexes[], const IndexType csrIA[], const IndexType csrJA[], const ValueType csrValues[])

Detailed Description

This class provides routines to converse ELL storage data to CSR storage data and vice versa.

All routines work on already allocated data and utilize OpenMP for their parallelization.


Member Function Documentation

template<typename ValueType >
void lama::OpenMPELLUtils::addComputeIA ( const IndexType  aIA[],
const IndexType  aJA[],
const IndexType  aNumRows,
const IndexType  bIA[],
const IndexType  bJA[],
const IndexType  bNumRows,
IndexType  cIA[] 
) [static]
template<typename ValueType >
void lama::OpenMPELLUtils::addComputeValues ( const IndexType  aIA[],
const IndexType  aJA[],
const ValueType  aValues[],
const IndexType  aNumRows,
const IndexType  bIA[],
const IndexType  bJA[],
const ValueType  bValues[],
const IndexType  bNumRows,
const ValueType  beta,
const IndexType  cIA[],
IndexType  cJA[],
ValueType  cValues[] 
) [static]
void lama::OpenMPELLUtils::check ( const IndexType  mNumRows,
const IndexType  mNumValuesPerRow,
const IndexType  mNumColumns,
const IndexType ia,
const IndexType ja,
const char *  msg 
) [static]

References LAMA_ASSERT_ERROR.

Referenced by setInterface().

template<typename ValueType >
void lama::OpenMPELLUtils::compressIA ( const IndexType  IA[],
const IndexType  JA[],
const ValueType  values[],
const IndexType  numRows,
const ValueType  eps,
IndexType  newIA[] 
) [static]

Implementation for ELLUtilsInterface::Conversions::compressIA.

References lama::abs().

Referenced by setInterface().

template<typename ValueType >
void lama::OpenMPELLUtils::compressValues ( const IndexType  IA[],
const IndexType  JA[],
const ValueType  values[],
const IndexType  numRows,
const ValueType  eps,
IndexType  newJA[],
ValueType  newValues[] 
) [static]

Implementation for ELLUtilsInterface::Conversions::compressValues.

References lama::abs().

Referenced by setInterface().

template<typename ValueType >
void lama::OpenMPELLUtils::computeIA ( const IndexType  aIA[],
const IndexType  aJA[],
const IndexType  aNumRows,
const IndexType  bIA[],
const IndexType  bJA[],
const IndexType  bNumRows,
IndexType  cIA[] 
) [static]
template<typename ValueType >
void lama::OpenMPELLUtils::computeValues ( const IndexType  aIA[],
const IndexType  aJA[],
const ValueType  aValues[],
const IndexType  aNumRows,
const IndexType  bIA[],
const IndexType  bJA[],
const ValueType  bValues[],
const IndexType  bNumRows,
const ValueType  alpha,
const IndexType  cIA[],
IndexType  cJA[],
ValueType  cValues[] 
) [static]
IndexType lama::OpenMPELLUtils::countNonEmptyRowsBySizes ( const IndexType  sizes[],
const IndexType  numRows 
) [static]

This method computes the total number of non-zero rows by the size array.

Referenced by setInterface().

static IndexType lama::OpenMPELLUtils::ellindex ( const IndexType  i,
const IndexType  jj,
const IndexType  numRows 
) [inline, static]

Addressing function for the arrays ia and ja: column-wise.

Referenced by getCSRValues(), and setCSRValues().

template<typename ELLValueType , typename CSRValueType >
void lama::OpenMPELLUtils::getCSRValues ( IndexType  csrJA[],
CSRValueType  csrValues[],
const IndexType  csrIA[],
const IndexType  numRows,
const IndexType  ellSizes[],
const IndexType  ellJA[],
const ELLValueType  ellValues[] 
) [static]
template<typename ValueType , typename OtherValueType >
void lama::OpenMPELLUtils::getRow ( OtherValueType *  row,
const IndexType  i,
const IndexType  numRows,
const IndexType  numColumns,
const IndexType ia,
const IndexType ja,
const ValueType *  values 
) [static]

Returns one row of the matrix.

Referenced by setInterface().

template<typename ValueType , typename OtherValueType >
OtherValueType lama::OpenMPELLUtils::getValue ( const IndexType  i,
const IndexType  j,
const IndexType  numRows,
const IndexType ia,
const IndexType ja,
const ValueType *  values 
) [static]

Returns one value of the matrix.

Referenced by setInterface().

bool lama::OpenMPELLUtils::hasDiagonalProperty ( const IndexType  numDiagonals,
const IndexType  csrJA[] 
) [static]

check diagonal property

Referenced by setInterface().

template<typename ValueType >
static void lama::OpenMPELLUtils::jacobi ( ValueType  solution[],
const IndexType  numRows,
const IndexType  ellNumValuesPerRow,
const IndexType  ellSizes[],
const IndexType  ellJA[],
const ValueType  ellValues[],
const ValueType  oldSolution[],
const ValueType  rhs[],
const ValueType  omega,
class SyncToken syncToken 
) [static]

Implementation for ELLUtilsInterface::Solver::jacobi.

Referenced by setInterface().

template<typename ValueType >
void lama::OpenMPELLUtils::jacobi ( ValueType  solution[],
const IndexType  numRows,
const IndexType   UNUSEDellNumValuesPerRow,
const IndexType  ellSizes[],
const IndexType  ellJA[],
const ValueType  ellValues[],
const ValueType  oldSolution[],
const ValueType  rhs[],
const ValueType  omega,
class SyncToken syncToken 
)
template<typename ValueType >
static void lama::OpenMPELLUtils::jacobiHalo ( ValueType  solution[],
const IndexType  numRows,
const ValueType  diagonal[],
const IndexType  ellNumValuesPerRow,
const IndexType  ellSizes[],
const IndexType  ellJA[],
const ValueType  ellValues[],
const IndexType  rowIndexes[],
const IndexType  numNonEmptyRows,
const ValueType  oldSolution[],
const ValueType  omega,
class SyncToken syncToken 
) [static]

Implementation for ELLUtilsInterface::Solver::jacobiHalo.

Referenced by setInterface().

template<typename ValueType >
void lama::OpenMPELLUtils::jacobiHalo ( ValueType  solution[],
const IndexType  numRows,
const ValueType  diagonal[],
const IndexType   UNUSEDellNumValuesPerRow,
const IndexType  ellSizes[],
const IndexType  ellJA[],
const ValueType  ellValues[],
const IndexType  rowIndexes[],
const IndexType  numNonEmptyRows,
const ValueType  oldSolution[],
const ValueType  omega,
class SyncToken syncToken 
)
template<typename ValueType >
static void lama::OpenMPELLUtils::normalGEMV ( ValueType  result[],
const ValueType  alpha,
const ValueType  x[],
const ValueType  beta,
const ValueType  y[],
const IndexType  numRows,
const IndexType  numNonZerosPerRow,
const IndexType  csrIA[],
const IndexType  csrJA[],
const ValueType  csrValues[],
class SyncToken syncToken 
) [static]

Implementation for ELLUtilsInterface::Mult::normalGEMV.

Referenced by normalGEMV(), and setInterface().

template<typename ValueType >
void lama::OpenMPELLUtils::normalGEMV ( ValueType  result[],
const ValueType  alpha,
const ValueType  x[],
const ValueType  beta,
const ValueType  y[],
const IndexType  numRows,
const IndexType  csrIA[],
const IndexType  csrJA[],
const ValueType  csrValues[] 
) [static, private]
template<typename ValueType >
void lama::OpenMPELLUtils::normalGEMV ( ValueType  result[],
const ValueType  alpha,
const ValueType  x[],
const ValueType  beta,
const ValueType  y[],
const IndexType  numRows,
const IndexType   UNUSEDnumNonZerosPerRow,
const IndexType  ellSizes[],
const IndexType  ellJA[],
const ValueType  ellValues[],
SyncToken syncToken 
)
template<typename ValueType , typename OtherValueType >
void lama::OpenMPELLUtils::scaleValue ( const IndexType  numRows,
const IndexType  Ia[],
ValueType  mValues[],
const OtherValueType  values[] 
) [static]

Referenced by setInterface().

template<typename ELLValueType , typename CSRValueType >
void lama::OpenMPELLUtils::setCSRValues ( IndexType  ellJA[],
ELLValueType  ellValues[],
const IndexType  ellSizes[],
const IndexType  numRows,
const IndexType  numValuesPerRow,
const IndexType  csrIA[],
const IndexType  csrJA[],
const CSRValueType  csrValues[] 
) [static]

Implementation for ELLUtilsInterface::Conversions::setCSRValues.

References ellindex().

Referenced by setInterface().

void lama::OpenMPELLUtils::setNonEmptyRowsBySizes ( IndexType  rowIndexes[],
const IndexType  numNonEmptyRows,
const IndexType  sizes[],
const IndexType  numRows 
) [static]

Build a vector of indexes for non-empty rows.

References LAMA_ASSERT_EQUAL_DEBUG.

Referenced by setInterface().

template<typename ValueType >
static void lama::OpenMPELLUtils::sparseGEMV ( ValueType  result[],
const IndexType  numRows,
const IndexType  numNonZerosPerRow,
const ValueType  alpha,
const ValueType  x[],
const IndexType  numNonZeroRows,
const IndexType  rowIndexes[],
const IndexType  csrIA[],
const IndexType  csrJA[],
const ValueType  csrValues[],
class SyncToken syncToken 
) [static]

Implementation for ELLUtilsInterface::Mult::sparseGEMV.

Referenced by setInterface(), and sparseGEMV().

template<typename ValueType >
void lama::OpenMPELLUtils::sparseGEMV ( ValueType  result[],
const IndexType  numRows,
const ValueType  alpha,
const ValueType  x[],
const IndexType  numNonZeroRows,
const IndexType  rowIndexes[],
const IndexType  csrIA[],
const IndexType  csrJA[],
const ValueType  csrValues[] 
) [static, private]
template<typename ValueType >
void lama::OpenMPELLUtils::sparseGEMV ( ValueType  result[],
const IndexType  numRows,
const IndexType   UNUSEDnumNonZerosPerRow,
const ValueType  alpha,
const ValueType  x[],
const IndexType  numNonZeroRows,
const IndexType  rowIndexes[],
const IndexType  ellSizes[],
const IndexType  ellJA[],
const ValueType  ellValues[],
SyncToken syncToken 
)

The documentation for this class was generated from the following files: