Advanced Multi-Physics (AMP)
On-Line Documentation
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
AMP::LinearAlgebra::CSRLocalMatrixData< Config > Class Template Reference

#include <CSRLocalMatrixData.h>

Inheritance diagram for AMP::LinearAlgebra::CSRLocalMatrixData< Config >:
Inheritance graph
[legend]

Public Types

using allocator_type = typename Config::allocator_type
 
using gidx_t = typename Config::gidx_t
 
using lidx_t = typename Config::lidx_t
 
using mask_t = unsigned char
 
using scalar_t = typename Config::scalar_t
 

Public Member Functions

gidx_t beginCol () const
 Get global index of first column in diagonal region (inclusive)
 
gidx_t beginRow () const
 Get global index of first row in block (inclusive)
 
 CSRLocalMatrixData (int64_t fid, AMP::IO::RestartManager *manager)
 Constructor from restart data.
 
 CSRLocalMatrixData (std::shared_ptr< MatrixParametersBase > params, AMP::Utilities::MemoryType memory_location, typename Config::gidx_t first_row, typename Config::gidx_t last_row, typename Config::gidx_t first_col, typename Config::gidx_t last_col, bool is_diag, bool is_symbolic=false, uint64_t hash=0)
 Constructor.
 
gidx_t endCol () const
 Get global index of last column in diagonal region (exclusive)
 
gidx_t endRow () const
 Get global index of last row in block (exclusive)
 
void getColPtrs (std::vector< gidx_t * > &col_ptrs)
 Get pointers into d_cols at start of each row.
 
gidx_tgetColumnMap () const
 Get pointer to unique columns, only useful for off-diagonal block.
 
template<typename idx_t >
void getColumnMap (std::vector< idx_t > &colMap) const
 Copy unique columns into.
 
size_t * getColumnMapSizeT () const
 Get pointer to unique columns as size_t's.
 
std::tuple< lidx_t *, gidx_t *, lidx_t *, scalar_t * > getDataFields ()
 Get all data fields as tuple.
 
std::tuple< const lidx_t *, const gidx_t *, const lidx_t *, const scalar_t * > getDataFields () const
 
scalar_tgetGhostCache () const
 Get pointer to unique columns as size_t's.
 
uint64_t getID () const
 Get a unique id hash for the vector.
 
auto getMemoryLocation () const
 Get the memory space where data is stored.
 
lidx_tgetRowStarts ()
 Get row pointers.
 
void globalToLocalColumns ()
 Convert global column ids to local and free global columns.
 
bool isDiag () const
 Check if this is a diagonal block.
 
bool isEmpty () const
 Check if empty.
 
std::shared_ptr< CSRLocalMatrixDatamaskMatrixData (const mask_t *mask, const bool is_symbolic) const
 Apply a mask to the entries of the matrix and return a new one.
 
std::uint16_t mode () const
 Return CSR mode of the matrix.
 
lidx_t numberOfNonZeros () const
 Get total number of nonzeros in block.
 
lidx_t numLocalColumns () const
 Get number of local columns in diagonal region.
 
lidx_t numLocalRows () const
 Get number of local rows.
 
lidx_t numUniqueColumns () const
 Get number of unique columns.
 
void printAll (bool force=false) const
 Print all information in a matrix block.
 
void printStats (bool verbose, bool show_zeros) const
 Print information about matrix block.
 
void registerChildObjects (AMP::IO::RestartManager *manager) const
 Register any child objects.
 
void removeRange (const scalar_t bnd_lo, const scalar_t bnd_up)
 Remove matrix entries from within given range.
 
void setNNZ (bool do_accum)
 setNNZ function that references d_row_starts and optionally does scan
 
void setNNZ (const lidx_t *nnz)
 Set number of nonzeros in each row and allocate space accordingly.
 
void setNNZ (lidx_t tot_nnz)
 Set total number of nonzeros and allocate space accordingly.
 
std::shared_ptr< CSRLocalMatrixData< Config > > shared_from_this ()
 
std::shared_ptr< const CSRLocalMatrixData< Config > > shared_from_this () const
 
void swapDataFields (CSRLocalMatrixData< Config > &other)
 Swap data fields with another CSRLocalMatrix.
 
std::string type () const
 
void writeRestart (int64_t fid) const
 Write restart data to file.
 
virtual ~CSRLocalMatrixData ()
 Destructor.
 

Static Public Member Functions

static std::shared_ptr< CSRLocalMatrixDataConcatHorizontal (std::shared_ptr< MatrixParametersBase > params, std::map< int, std::shared_ptr< CSRLocalMatrixData > > blocks)
 
static std::shared_ptr< CSRLocalMatrixDataConcatVertical (std::shared_ptr< MatrixParametersBase > params, std::map< int, std::shared_ptr< CSRLocalMatrixData > > blocks, const gidx_t first_col, const gidx_t last_col, const bool is_diag)
 
static std::shared_ptr< gidx_t[]> makeGidxArray (const size_t N)
 
static std::shared_ptr< lidx_t[]> makeLidxArray (const size_t N)
 
static std::shared_ptr< scalar_t[]> makeScalarArray (const size_t N)
 
template<typename U >
static std::shared_ptr< U[]> sharedArrayBuilder (const size_t N)
 

Protected Member Functions

void addValuesByGlobalID (const size_t local_row, const size_t num_cols, const size_t *cols, const scalar_t *vals)
 Add to existing values at given column locations in a row.
 
std::shared_ptr< CSRLocalMatrixDatacloneMatrixData ()
 Make a clone of this matrix data.
 
std::vector< size_t > getColumnIDs (const size_t local_row) const
 Get columns and values from one row.
 
void getRowByGlobalID (const size_t local_row, std::vector< size_t > &cols, std::vector< double > &values) const
 Get columns and values from one row.
 
void getValuesByGlobalID (const size_t local_row, const size_t num_cols, const size_t *cols, scalar_t *values) const
 Get values from the matrix.
 
template<typename ConfigOut >
std::shared_ptr< CSRLocalMatrixData< ConfigOut > > migrate () const
 Migrate data to new memory space.
 
size_t numberColumnIDs (size_t local_row) const
 Given a row, retrieve the number of non-zero column indices of the matrix.
 
void setValuesByGlobalID (const size_t local_row, const size_t num_cols, const size_t *cols, const scalar_t *vals)
 Overwrite existing values at given column locations in a row.
 
void sortColumns ()
 Sort the columns/values within each row.
 
std::shared_ptr< CSRLocalMatrixDatatranspose (std::shared_ptr< MatrixParametersBase > params) const
 Make matrix data for transpose.
 

Protected Attributes

std::shared_ptr< scalar_t[]> d_coeffs
 Nonzero values in each row.
 
std::shared_ptr< gidx_t[]> d_cols
 Global column indices for nonzeros in each row.
 
std::shared_ptr< lidx_t[]> d_cols_loc
 Local column indices for nonzeros in each row.
 
std::shared_ptr< gidx_t[]> d_cols_unq
 Unique set of indices from d_cols, unused for diagonal block.
 
std::shared_ptr< size_t[]> d_cols_unq_size_t
 column map as size_t, generated lazily only if needed
 
gidx_t d_first_col
 Global index of first column of diagonal block.
 
gidx_t d_first_row
 Global index of first row of this block.
 
std::shared_ptr< scalar_t[]> d_ghost_cache
 Storage space for vector ghost information, allocated lazily.
 
uint64_t d_hash = 0
 hash to uniquely identify this object during restart
 
bool d_is_diag
 Flag to indicate if this is a diagonal block or not.
 
bool d_is_empty = true
 Flag to indicate if this is empty.
 
bool d_is_symbolic = false
 Flag to indicate if this is a symbolic matrix.
 
gidx_t d_last_col
 Global index of last column of diagonal block.
 
gidx_t d_last_row
 Global index of last row of this block.
 
AMP::Utilities::MemoryType d_memory_location
 Memory space where data lives, compatible with allocator template parameter.
 
lidx_t d_ncols_unq = 0
 Number of unique columns referenced by block.
 
lidx_t d_nnz = 0
 Total number of nonzeros.
 
lidx_t d_num_rows
 Number of locally stored rows, (d_local_row - d_first_row)
 
std::shared_ptr< lidx_t[]> d_row_starts
 Starting index of each row within other data arrays.
 
std::weak_ptr< CSRLocalMatrixData< Config > > weak_ptr_
 

Friends

template<typename C >
class CSRLocalMatrixData
 
template<typename C >
class CSRMatrixCommunicator
 
template<typename C >
class CSRMatrixData
 
template<typename C >
class CSRMatrixSpGEMMDefault
 
template<typename C >
class CSRMatrixSpGEMMDevice
 

Detailed Description

template<typename Config>
class AMP::LinearAlgebra::CSRLocalMatrixData< Config >

Definition at line 37 of file CSRLocalMatrixData.h.

Member Typedef Documentation

◆ allocator_type

template<typename Config >
using AMP::LinearAlgebra::CSRLocalMatrixData< Config >::allocator_type = typename Config::allocator_type

Definition at line 55 of file CSRLocalMatrixData.h.

◆ gidx_t

template<typename Config >
using AMP::LinearAlgebra::CSRLocalMatrixData< Config >::gidx_t = typename Config::gidx_t

Definition at line 52 of file CSRLocalMatrixData.h.

◆ lidx_t

template<typename Config >
using AMP::LinearAlgebra::CSRLocalMatrixData< Config >::lidx_t = typename Config::lidx_t

Definition at line 53 of file CSRLocalMatrixData.h.

◆ mask_t

template<typename Config >
using AMP::LinearAlgebra::CSRLocalMatrixData< Config >::mask_t = unsigned char

Definition at line 51 of file CSRLocalMatrixData.h.

◆ scalar_t

template<typename Config >
using AMP::LinearAlgebra::CSRLocalMatrixData< Config >::scalar_t = typename Config::scalar_t

Definition at line 54 of file CSRLocalMatrixData.h.

Constructor & Destructor Documentation

◆ CSRLocalMatrixData() [1/2]

template<typename Config >
AMP::LinearAlgebra::CSRLocalMatrixData< Config >::CSRLocalMatrixData ( std::shared_ptr< MatrixParametersBase params,
AMP::Utilities::MemoryType  memory_location,
typename Config::gidx_t  first_row,
typename Config::gidx_t  last_row,
typename Config::gidx_t  first_col,
typename Config::gidx_t  last_col,
bool  is_diag,
bool  is_symbolic = false,
uint64_t  hash = 0 
)
explicit

Constructor.

Parameters
[in]paramsDescription of the matrix
[in]memory_locationMemory space where data is located
[in]first_rowGlobal index of starting row (inclusive)
[in]last_rowGlobal index of final row (exclusive)
[in]first_colGlobal index of starting column (inclusive)
[in]last_colGlobal index of final column (exclusive)
[in]is_diagTrue if this is the diag block, influences use of first/last col
[in]is_symbolicTrue if this is a symbolic matrix storing only the NZ pattern
[in]hashHash value

◆ ~CSRLocalMatrixData()

template<typename Config >
virtual AMP::LinearAlgebra::CSRLocalMatrixData< Config >::~CSRLocalMatrixData ( )
virtual

Destructor.

◆ CSRLocalMatrixData() [2/2]

template<typename Config >
AMP::LinearAlgebra::CSRLocalMatrixData< Config >::CSRLocalMatrixData ( int64_t  fid,
AMP::IO::RestartManager manager 
)

Constructor from restart data.

Member Function Documentation

◆ addValuesByGlobalID()

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::addValuesByGlobalID ( const size_t  local_row,
const size_t  num_cols,
const size_t *  cols,
const scalar_t vals 
)
protected

Add to existing values at given column locations in a row.

Parameters
[in]local_rowLocal index row to alter
[in]num_colsNumber of columns/values passed in
[in]colsGlobal column indices where values are to be altered
[in]valsValues to add to existing ones

Entries in passed cols array that aren't the stored row are ignored

◆ beginCol()

template<typename Config >
gidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::beginCol ( ) const
inline

Get global index of first column in diagonal region (inclusive)

Definition at line 138 of file CSRLocalMatrixData.h.

References AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_first_col.

◆ beginRow()

template<typename Config >
gidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::beginRow ( ) const
inline

Get global index of first row in block (inclusive)

Definition at line 132 of file CSRLocalMatrixData.h.

References AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_first_row.

◆ cloneMatrixData()

template<typename Config >
std::shared_ptr< CSRLocalMatrixData > AMP::LinearAlgebra::CSRLocalMatrixData< Config >::cloneMatrixData ( )
protected

Make a clone of this matrix data.

◆ ConcatHorizontal()

template<typename Config >
static std::shared_ptr< CSRLocalMatrixData > AMP::LinearAlgebra::CSRLocalMatrixData< Config >::ConcatHorizontal ( std::shared_ptr< MatrixParametersBase params,
std::map< int, std::shared_ptr< CSRLocalMatrixData< Config > > >  blocks 
)
static

◆ ConcatVertical()

template<typename Config >
static std::shared_ptr< CSRLocalMatrixData > AMP::LinearAlgebra::CSRLocalMatrixData< Config >::ConcatVertical ( std::shared_ptr< MatrixParametersBase params,
std::map< int, std::shared_ptr< CSRLocalMatrixData< Config > > >  blocks,
const gidx_t  first_col,
const gidx_t  last_col,
const bool  is_diag 
)
static

◆ endCol()

template<typename Config >
gidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::endCol ( ) const
inline

Get global index of last column in diagonal region (exclusive)

Definition at line 141 of file CSRLocalMatrixData.h.

References AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_last_col.

◆ endRow()

template<typename Config >
gidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::endRow ( ) const
inline

Get global index of last row in block (exclusive)

Definition at line 135 of file CSRLocalMatrixData.h.

References AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_last_row.

◆ getColPtrs()

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getColPtrs ( std::vector< gidx_t * > &  col_ptrs)

Get pointers into d_cols at start of each row.

◆ getColumnIDs()

template<typename Config >
std::vector< size_t > AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getColumnIDs ( const size_t  local_row) const
protected

Get columns and values from one row.

Parameters
[in]local_rowLocal index of desired row
Returns
std::vector of global column ids in row

◆ getColumnMap() [1/2]

template<typename Config >
gidx_t * AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getColumnMap ( ) const
inline

Get pointer to unique columns, only useful for off-diagonal block.

Definition at line 147 of file CSRLocalMatrixData.h.

References AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_cols_unq, and AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_is_diag.

◆ getColumnMap() [2/2]

template<typename Config >
template<typename idx_t >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getColumnMap ( std::vector< idx_t > &  colMap) const
inline

Copy unique columns into.

Parameters
[out]colMapVector to copy column indices into

If this is a diagonal block the uniques are all columns in diagonal region and is only supported for simplicity in calling contexts. If this is an off-diagonal block this copies out the the contents of d_cols_unq.

Definition at line 169 of file CSRLocalMatrixData.h.

References AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_cols_unq, AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_first_col, AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_is_diag, AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_is_empty, AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_last_col, and AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_ncols_unq.

◆ getColumnMapSizeT()

template<typename Config >
size_t * AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getColumnMapSizeT ( ) const

Get pointer to unique columns as size_t's.

◆ getDataFields() [1/2]

template<typename Config >
std::tuple< lidx_t *, gidx_t *, lidx_t *, scalar_t * > AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getDataFields ( )
inline

◆ getDataFields() [2/2]

template<typename Config >
std::tuple< const lidx_t *, const gidx_t *, const lidx_t *, const scalar_t * > AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getDataFields ( ) const
inline

◆ getGhostCache()

template<typename Config >
scalar_t * AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getGhostCache ( ) const

Get pointer to unique columns as size_t's.

◆ getID()

template<typename Config >
uint64_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getID ( ) const
inline

Get a unique id hash for the vector.

Definition at line 248 of file CSRLocalMatrixData.h.

References AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_hash.

◆ getMemoryLocation()

template<typename Config >
auto AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getMemoryLocation ( ) const
inline

Get the memory space where data is stored.

Definition at line 108 of file CSRLocalMatrixData.h.

References AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_memory_location.

◆ getRowByGlobalID()

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getRowByGlobalID ( const size_t  local_row,
std::vector< size_t > &  cols,
std::vector< double > &  values 
) const
protected

Get columns and values from one row.

Parameters
[in]local_rowLocal index of desired row
[out]colsVector of global column ids to push onto
[out]valuesVector of values to push onto

◆ getRowStarts()

template<typename Config >
lidx_t * AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getRowStarts ( )
inline

Get row pointers.

Definition at line 105 of file CSRLocalMatrixData.h.

References AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_row_starts.

◆ getValuesByGlobalID()

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getValuesByGlobalID ( const size_t  local_row,
const size_t  num_cols,
const size_t *  cols,
scalar_t values 
) const
protected

Get values from the matrix.

Parameters
[in]local_rowLocal row to query
[in]num_colsNumber of cols to query
[in]colsThe column indices to query
[out]valuesPlace to write retrieved values

If the matrix has not allocated a particular col specified those values will be set to zero.

◆ globalToLocalColumns()

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::globalToLocalColumns ( )

Convert global column ids to local and free global columns.

◆ isDiag()

template<typename Config >
bool AMP::LinearAlgebra::CSRLocalMatrixData< Config >::isDiag ( ) const
inline

Check if this is a diagonal block.

Definition at line 111 of file CSRLocalMatrixData.h.

References AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_is_diag.

◆ isEmpty()

template<typename Config >
bool AMP::LinearAlgebra::CSRLocalMatrixData< Config >::isEmpty ( ) const
inline

Check if empty.

Definition at line 114 of file CSRLocalMatrixData.h.

References AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_is_empty.

◆ makeGidxArray()

template<typename Config >
static std::shared_ptr< gidx_t[]> AMP::LinearAlgebra::CSRLocalMatrixData< Config >::makeGidxArray ( const size_t  N)
inlinestatic

Definition at line 236 of file CSRLocalMatrixData.h.

◆ makeLidxArray()

template<typename Config >
static std::shared_ptr< lidx_t[]> AMP::LinearAlgebra::CSRLocalMatrixData< Config >::makeLidxArray ( const size_t  N)
inlinestatic

Definition at line 231 of file CSRLocalMatrixData.h.

◆ makeScalarArray()

template<typename Config >
static std::shared_ptr< scalar_t[]> AMP::LinearAlgebra::CSRLocalMatrixData< Config >::makeScalarArray ( const size_t  N)
inlinestatic

Definition at line 241 of file CSRLocalMatrixData.h.

◆ maskMatrixData()

template<typename Config >
std::shared_ptr< CSRLocalMatrixData > AMP::LinearAlgebra::CSRLocalMatrixData< Config >::maskMatrixData ( const mask_t mask,
const bool  is_symbolic 
) const

Apply a mask to the entries of the matrix and return a new one.

◆ migrate()

template<typename Config >
template<typename ConfigOut >
std::shared_ptr< CSRLocalMatrixData< ConfigOut > > AMP::LinearAlgebra::CSRLocalMatrixData< Config >::migrate ( ) const
protected

Migrate data to new memory space.

◆ mode()

template<typename Config >
std::uint16_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::mode ( ) const
inline

Return CSR mode of the matrix.

Definition at line 85 of file CSRLocalMatrixData.h.

◆ numberColumnIDs()

template<typename Config >
size_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::numberColumnIDs ( size_t  local_row) const
protected

Given a row, retrieve the number of non-zero column indices of the matrix.

Parameters
[in]local_rowLocal index of desired row

◆ numberOfNonZeros()

template<typename Config >
lidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::numberOfNonZeros ( ) const
inline

Get total number of nonzeros in block.

Definition at line 117 of file CSRLocalMatrixData.h.

References AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_nnz.

◆ numLocalColumns()

template<typename Config >
lidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::numLocalColumns ( ) const
inline

Get number of local columns in diagonal region.

Definition at line 123 of file CSRLocalMatrixData.h.

References AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_first_col, and AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_last_col.

◆ numLocalRows()

template<typename Config >
lidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::numLocalRows ( ) const
inline

◆ numUniqueColumns()

template<typename Config >
lidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::numUniqueColumns ( ) const
inline

◆ printAll()

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::printAll ( bool  force = false) const

Print all information in a matrix block.

◆ printStats()

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::printStats ( bool  verbose,
bool  show_zeros 
) const

Print information about matrix block.

◆ registerChildObjects()

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::registerChildObjects ( AMP::IO::RestartManager manager) const

Register any child objects.

This function will register child objects with the manager

Parameters
managerRestart manager

◆ removeRange()

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::removeRange ( const scalar_t  bnd_lo,
const scalar_t  bnd_up 
)

Remove matrix entries from within given range.

◆ setNNZ() [1/3]

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::setNNZ ( bool  do_accum)

setNNZ function that references d_row_starts and optionally does scan

◆ setNNZ() [2/3]

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::setNNZ ( const lidx_t nnz)

Set number of nonzeros in each row and allocate space accordingly.

◆ setNNZ() [3/3]

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::setNNZ ( lidx_t  tot_nnz)

Set total number of nonzeros and allocate space accordingly.

◆ setValuesByGlobalID()

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::setValuesByGlobalID ( const size_t  local_row,
const size_t  num_cols,
const size_t *  cols,
const scalar_t vals 
)
protected

Overwrite existing values at given column locations in a row.

Parameters
[in]local_rowLocal index row to alter
[in]num_colsNumber of columns/values passed in
[in]colsGlobal column indices where values are to be set
[in]valsValues to write

Entries in passed cols array that aren't the stored row are ignored

◆ shared_from_this() [1/2]

std::shared_ptr< CSRLocalMatrixData< Config > > AMP::enable_shared_from_this< CSRLocalMatrixData< Config > >::shared_from_this ( )
inlineinherited

Definition at line 28 of file enable_shared_from_this.h.

◆ shared_from_this() [2/2]

std::shared_ptr< const CSRLocalMatrixData< Config > > AMP::enable_shared_from_this< CSRLocalMatrixData< Config > >::shared_from_this ( ) const
inlineinherited

Definition at line 46 of file enable_shared_from_this.h.

◆ sharedArrayBuilder()

template<typename Config >
template<typename U >
static std::shared_ptr< U[]> AMP::LinearAlgebra::CSRLocalMatrixData< Config >::sharedArrayBuilder ( const size_t  N)
inlinestatic

Definition at line 223 of file CSRLocalMatrixData.h.

◆ sortColumns()

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::sortColumns ( )
protected

Sort the columns/values within each row.

This sorts within each row using the same ordering as Hypre. Diagonal blocks will have the diagonal entry first, and keep columns in ascending order after that. Off-diagonal blocks have local columns in ascending order.

◆ swapDataFields()

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::swapDataFields ( CSRLocalMatrixData< Config > &  other)

Swap data fields with another CSRLocalMatrix.

◆ transpose()

template<typename Config >
std::shared_ptr< CSRLocalMatrixData > AMP::LinearAlgebra::CSRLocalMatrixData< Config >::transpose ( std::shared_ptr< MatrixParametersBase params) const
protected

Make matrix data for transpose.

◆ type()

template<typename Config >
std::string AMP::LinearAlgebra::CSRLocalMatrixData< Config >::type ( ) const

◆ writeRestart()

template<typename Config >
void AMP::LinearAlgebra::CSRLocalMatrixData< Config >::writeRestart ( int64_t  fid) const

Write restart data to file.

This function will write the mesh to an HDF5 file

Parameters
fidFile identifier to write

Friends And Related Symbol Documentation

◆ CSRLocalMatrixData

template<typename Config >
template<typename C >
friend class CSRLocalMatrixData
friend

Definition at line 43 of file CSRLocalMatrixData.h.

◆ CSRMatrixCommunicator

template<typename Config >
template<typename C >
friend class CSRMatrixCommunicator
friend

Definition at line 45 of file CSRLocalMatrixData.h.

◆ CSRMatrixData

template<typename Config >
template<typename C >
friend class CSRMatrixData
friend

Definition at line 41 of file CSRLocalMatrixData.h.

◆ CSRMatrixSpGEMMDefault

template<typename Config >
template<typename C >
friend class CSRMatrixSpGEMMDefault
friend

Definition at line 47 of file CSRLocalMatrixData.h.

◆ CSRMatrixSpGEMMDevice

template<typename Config >
template<typename C >
friend class CSRMatrixSpGEMMDevice
friend

Definition at line 49 of file CSRLocalMatrixData.h.

Member Data Documentation

◆ d_coeffs

template<typename Config >
std::shared_ptr<scalar_t[]> AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_coeffs
protected

◆ d_cols

template<typename Config >
std::shared_ptr<gidx_t[]> AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_cols
protected

◆ d_cols_loc

template<typename Config >
std::shared_ptr<lidx_t[]> AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_cols_loc
protected

◆ d_cols_unq

template<typename Config >
std::shared_ptr<gidx_t[]> AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_cols_unq
protected

Unique set of indices from d_cols, unused for diagonal block.

Definition at line 371 of file CSRLocalMatrixData.h.

Referenced by AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getColumnMap(), and AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getColumnMap().

◆ d_cols_unq_size_t

template<typename Config >
std::shared_ptr<size_t[]> AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_cols_unq_size_t
mutableprotected

column map as size_t, generated lazily only if needed

Definition at line 387 of file CSRLocalMatrixData.h.

◆ d_first_col

template<typename Config >
gidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_first_col
protected

◆ d_first_row

template<typename Config >
gidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_first_row
protected

◆ d_ghost_cache

template<typename Config >
std::shared_ptr<scalar_t[]> AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_ghost_cache
mutableprotected

Storage space for vector ghost information, allocated lazily.

Definition at line 390 of file CSRLocalMatrixData.h.

◆ d_hash

template<typename Config >
uint64_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_hash = 0
protected

hash to uniquely identify this object during restart

Definition at line 384 of file CSRLocalMatrixData.h.

Referenced by AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getID().

◆ d_is_diag

template<typename Config >
bool AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_is_diag
protected

◆ d_is_empty

template<typename Config >
bool AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_is_empty = true
protected

◆ d_is_symbolic

template<typename Config >
bool AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_is_symbolic = false
protected

Flag to indicate if this is a symbolic matrix.

Definition at line 364 of file CSRLocalMatrixData.h.

◆ d_last_col

template<typename Config >
gidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_last_col
protected

◆ d_last_row

template<typename Config >
gidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_last_row
protected

◆ d_memory_location

template<typename Config >
AMP::Utilities::MemoryType AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_memory_location
protected

Memory space where data lives, compatible with allocator template parameter.

Definition at line 349 of file CSRLocalMatrixData.h.

Referenced by AMP::LinearAlgebra::CSRLocalMatrixData< Config >::getMemoryLocation().

◆ d_ncols_unq

template<typename Config >
lidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_ncols_unq = 0
protected

◆ d_nnz

template<typename Config >
lidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_nnz = 0
protected

Total number of nonzeros.

Definition at line 380 of file CSRLocalMatrixData.h.

Referenced by AMP::LinearAlgebra::CSRLocalMatrixData< Config >::numberOfNonZeros().

◆ d_num_rows

template<typename Config >
lidx_t AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_num_rows
protected

Number of locally stored rows, (d_local_row - d_first_row)

Definition at line 378 of file CSRLocalMatrixData.h.

◆ d_row_starts

template<typename Config >
std::shared_ptr<lidx_t[]> AMP::LinearAlgebra::CSRLocalMatrixData< Config >::d_row_starts
protected

◆ weak_ptr_

std::weak_ptr<CSRLocalMatrixData< Config > > AMP::enable_shared_from_this< CSRLocalMatrixData< Config > >::weak_ptr_
mutableprotectedinherited

Definition at line 69 of file enable_shared_from_this.h.


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



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:42.
Comments on this page