NTPoly
Data Types | Functions/Subroutines
distributedsparsematrixmodule Module Reference

A Module For Performing Distributed Sparse Matrix Operations. More...

Data Types

type  distributedsparsematrix_t
 A datatype for a distributed blocked CSR matrix. More...
 

Functions/Subroutines

pure subroutine, public constructemptydistributedsparsematrix (this, matrix_dim_)
 Construct an empty sparse, distributed, matrix. More...
 
pure subroutine, public destructdistributedsparsematrix (this)
 Destruct a distributed sparse matrix. More...
 
pure subroutine, public copydistributedsparsematrix (matA, matB)
 Copy a distributed sparse matrix in a safe way. More...
 
subroutine, public constructfrommatrixmarket (this, file_name)
 Construct distributed sparse matrix from a matrix market file in parallel. More...
 
subroutine, public constructfrombinary (this, file_name)
 Construct a distributed sparse matrix from a binary file in parallel. More...
 
subroutine, public writetobinary (this, file_name)
 Save a distributed sparse matrix to a file. More...
 
subroutine, public writetomatrixmarket (this, file_name)
 Write a distributed sparse matrix to a matrix market file. More...
 
subroutine, public fillfromtripletlist (this, triplet_list)
 This routine fills in a matrix based on local triplet lists. Each process should pass in triplet lists with global coordinates. It doesn't matter where each triplet is stored, as long as global coordinates are given. More...
 
pure subroutine, public filldistributedidentity (this)
 Fill in the values of a distributed matrix with the identity matrix. More...
 
pure subroutine, public filldistributedpermutation (this, permutation_vector, permuterows)
 Fill in the values of a distributed matrix with a permutation. If you don't specify permuterows, will default to permuting rows. More...
 
pure subroutine, public gettripletlist (this, triplet_list)
 Extracts a triplet list of the data that is stored on this process. Data is returned with absolute coordinates. More...
 
pure integer function, public getactualdimension (this)
 Get the actual dimension of the matrix. More...
 
pure integer function, public getlogicaldimension (this)
 Get the logical dimension of the matrix. More...
 
subroutine, public incrementdistributedsparsematrix (matA, matB, alpha_in, threshold_in)
 Matrix B = alpha*Matrix A + Matrix B (AXPY) This will utilize the sparse vector increment routine. More...
 
real(ntreal) function, public dotdistributedsparsematrix (matA, matB)
 product = dot(Matrix A,Matrix B) More...
 
real(ntreal) function, public distributedgrandsum (matA)
 Sum up the elements in a matrix. More...
 
subroutine, public distributedpairwisemultiply (matA, matB, matC)
 Elementwise multiplication. C_ij = A_ij * B_ij. More...
 
subroutine, public distributedgemm (matA, matB, matC, alpha_in, beta_in, threshold_in, memory_pool_in)
 Multiply two matrices together, and add to the third. C := alpha*matA*matB+ beta*matC. More...
 
pure subroutine, public scaledistributedsparsematrix (this, constant)
 Will scale a distributed sparse matrix by a constant. More...
 
real(ntreal) function, public distributedsparsenorm (this)
 Compute the norm of a distributed sparse matrix along the rows. More...
 
real(ntreal) function, public trace (this)
 Compute the trace of the matrix. More...
 
subroutine, public computesigma (this, sigma_value)
 Compute sigma for the inversion method. More...
 
subroutine, public printdistributedsparsematrix (this, file_name_in)
 Print ouf a distributed sparse matrix. More...
 
subroutine, public filtersparsematrix (this, threshold)
 A utility routine that filters a sparse matrix. All (absolute) values below the threshold are set to zero. More...
 
integer(c_long) function, public getsize (this)
 Get the total number of non zero entries in the distributed sparse matrix. More...
 
subroutine, public getloadbalance (this, min_size, max_size)
 Get a measure of how load balanced this matrix is. For each process, the number of non-zero entries is calculated. Then, this function returns the max and min of those values. More...
 

Detailed Description

A Module For Performing Distributed Sparse Matrix Operations.

Function/Subroutine Documentation

◆ computesigma()

subroutine, public distributedsparsematrixmodule::computesigma ( type(distributedsparsematrix_t), intent(in)  this,
real(ntreal), intent(out)  sigma_value 
)

Compute sigma for the inversion method.

Todo:
describe this better.
Parameters
[in]thisthe matrix to compute the sigma value of.
[out]sigma_valuesigma.

◆ constructemptydistributedsparsematrix()

pure subroutine, public distributedsparsematrixmodule::constructemptydistributedsparsematrix ( type(distributedsparsematrix_t), intent(inout)  this,
integer, intent(in)  matrix_dim_ 
)

Construct an empty sparse, distributed, matrix.

Parameters
[out]thisthe matrix to be constructed.
[in]matrix_dim_the dimension of the full matrix.

◆ constructfrombinary()

subroutine, public distributedsparsematrixmodule::constructfrombinary ( type(distributedsparsematrix_t this,
character(len=*), intent(in)  file_name 
)

Construct a distributed sparse matrix from a binary file in parallel.

Parameters
[out]thisthe file being constructed.
[in]file_namename of the file to read.

◆ constructfrommatrixmarket()

subroutine, public distributedsparsematrixmodule::constructfrommatrixmarket ( type(distributedsparsematrix_t this,
character(len=*), intent(in)  file_name 
)

Construct distributed sparse matrix from a matrix market file in parallel.

Parameters
[out]thisthe file being constructed.
[in]file_namename of the file to read.

◆ copydistributedsparsematrix()

pure subroutine, public distributedsparsematrixmodule::copydistributedsparsematrix ( type(distributedsparsematrix_t), intent(in)  matA,
type(distributedsparsematrix_t), intent(inout)  matB 
)

Copy a distributed sparse matrix in a safe way.

Parameters
[in]matAmatrix to copy
[in,out]matB= matA

◆ destructdistributedsparsematrix()

pure subroutine, public distributedsparsematrixmodule::destructdistributedsparsematrix ( type(distributedsparsematrix_t), intent(inout)  this)

Destruct a distributed sparse matrix.

Parameters
[in,out]thisthe matrix to destruct

◆ distributedgemm()

subroutine, public distributedsparsematrixmodule::distributedgemm ( type(distributedsparsematrix_t), intent(in)  matA,
type(distributedsparsematrix_t), intent(in)  matB,
type(distributedsparsematrix_t), intent(inout)  matC,
real(ntreal), intent(in), optional  alpha_in,
real(ntreal), intent(in), optional  beta_in,
real(ntreal), intent(in), optional  threshold_in,
type(distributedmatrixmemorypool_t), intent(inout), optional  memory_pool_in 
)

Multiply two matrices together, and add to the third. C := alpha*matA*matB+ beta*matC.

Parameters
[in]matAMatrix A
[in]matBMatrix B
[out]matC= alpha*matA*matB + beta*matC
[in]alpha_inscales the multiplication
[in]beta_inscales matrix we sum on to
[in]threshold_infor flushing values to zero. Default value is 0.0.
[in,out]memory_pool_ina memory pool that can be used for the calculation.

◆ distributedgrandsum()

real(ntreal) function, public distributedsparsematrixmodule::distributedgrandsum ( type(distributedsparsematrix_t), intent(in)  matA)

Sum up the elements in a matrix.

Parameters
[in]matAMatrix A.
Returns
sum the sum of all elements.

◆ distributedpairwisemultiply()

subroutine, public distributedsparsematrixmodule::distributedpairwisemultiply ( type(distributedsparsematrix_t), intent(in)  matA,
type(distributedsparsematrix_t), intent(in)  matB,
type(distributedsparsematrix_t), intent(inout)  matC 
)

Elementwise multiplication. C_ij = A_ij * B_ij.

Parameters
[in]matAMatrix A.
[in]matBMatrix B.
[in,out]matC= MatA mult MatB.

◆ distributedsparsenorm()

real(ntreal) function, public distributedsparsematrixmodule::distributedsparsenorm ( type(distributedsparsematrix_t), intent(in)  this)

Compute the norm of a distributed sparse matrix along the rows.

Parameters
[in]thisthe matrix to compute the norm of.
Returns
the norm value of the full distributed sparse matrix.

◆ dotdistributedsparsematrix()

real(ntreal) function, public distributedsparsematrixmodule::dotdistributedsparsematrix ( type(distributedsparsematrix_t), intent(in)  matA,
type(distributedsparsematrix_t), intent(in)  matB 
)

product = dot(Matrix A,Matrix B)

Parameters
[in]matAMatrix A.
[in,out]matBMatrix B.
Returns
product the dot product.

◆ filldistributedidentity()

pure subroutine, public distributedsparsematrixmodule::filldistributedidentity ( type(distributedsparsematrix_t), intent(inout)  this)

Fill in the values of a distributed matrix with the identity matrix.

Parameters
[in,out]thisthe matrix being filled.

◆ filldistributedpermutation()

pure subroutine, public distributedsparsematrixmodule::filldistributedpermutation ( type(distributedsparsematrix_t), intent(inout)  this,
integer, dimension(:), intent(in)  permutation_vector,
logical, intent(in), optional  permuterows 
)

Fill in the values of a distributed matrix with a permutation. If you don't specify permuterows, will default to permuting rows.

Parameters
[in,out]thisthe matrix being filled.
[in]permutation_vectordescribes for each row/column, where it goes.
[in]permuterowsif true permute rows, false permute columns.

◆ fillfromtripletlist()

subroutine, public distributedsparsematrixmodule::fillfromtripletlist ( type(distributedsparsematrix_t this,
type(tripletlist_t)  triplet_list 
)

This routine fills in a matrix based on local triplet lists. Each process should pass in triplet lists with global coordinates. It doesn't matter where each triplet is stored, as long as global coordinates are given.

Parameters
[in,out]thisthe matrix to fill.
[in]triplet_listthe triplet list of values.

◆ filtersparsematrix()

subroutine, public distributedsparsematrixmodule::filtersparsematrix ( type(distributedsparsematrix_t), intent(inout)  this,
real(ntreal), intent(in)  threshold 
)

A utility routine that filters a sparse matrix. All (absolute) values below the threshold are set to zero.

Parameters
[in,out]thismatrix to filter
[in]threshold(absolute) values below this are filtered

◆ getactualdimension()

pure integer function, public distributedsparsematrixmodule::getactualdimension ( type(distributedsparsematrix_t), intent(in)  this)

Get the actual dimension of the matrix.

Parameters
[in]thisthe matrix.
Returns
dimension of the matrix;

◆ getloadbalance()

subroutine, public distributedsparsematrixmodule::getloadbalance ( type(distributedsparsematrix_t), intent(in)  this,
integer, intent(out)  min_size,
integer, intent(out)  max_size 
)

Get a measure of how load balanced this matrix is. For each process, the number of non-zero entries is calculated. Then, this function returns the max and min of those values.

Parameters
[in]thisThe matrix to compute the measure on.
[out]min_sizethe minimum entries contained on a single process.
[out]max_sizethe maximum entries contained on a single process.

◆ getlogicaldimension()

pure integer function, public distributedsparsematrixmodule::getlogicaldimension ( type(distributedsparsematrix_t), intent(in)  this)

Get the logical dimension of the matrix.

Parameters
[in]thisthe matrix.
Returns
dimension of the matrix;

◆ getsize()

integer(c_long) function, public distributedsparsematrixmodule::getsize ( type(distributedsparsematrix_t), intent(in)  this)

Get the total number of non zero entries in the distributed sparse matrix.

Parameters
[in]thisthe distributed sparse matrix to calculate the non-zero entries of.
Returns
the number of non-zero entries in the matrix.

◆ gettripletlist()

pure subroutine, public distributedsparsematrixmodule::gettripletlist ( type(distributedsparsematrix_t), intent(in)  this,
type(tripletlist_t), intent(inout)  triplet_list 
)

Extracts a triplet list of the data that is stored on this process. Data is returned with absolute coordinates.

Parameters
[in]thisthe distributed sparse matrix.
[in,out]triplet_listthe list to fill.

◆ incrementdistributedsparsematrix()

subroutine, public distributedsparsematrixmodule::incrementdistributedsparsematrix ( type(distributedsparsematrix_t), intent(in)  matA,
type(distributedsparsematrix_t), intent(inout)  matB,
real(ntreal), intent(in), optional  alpha_in,
real(ntreal), intent(in), optional  threshold_in 
)

Matrix B = alpha*Matrix A + Matrix B (AXPY) This will utilize the sparse vector increment routine.

Parameters
[in]matAMatrix A.
[in,out]matBMatrix B.
[in]alpha_inmultiplier. Default value is 1.0
[in]threshold_infor flushing values to zero. Default value is 0.0

◆ printdistributedsparsematrix()

subroutine, public distributedsparsematrixmodule::printdistributedsparsematrix ( type(distributedsparsematrix_t this,
character(len=*), intent(in), optional  file_name_in 
)

Print ouf a distributed sparse matrix.

Parameters
[in]thisthe matrix to print.
[in]file_name_inoptionally, you can pass a file to print to.

◆ scaledistributedsparsematrix()

pure subroutine, public distributedsparsematrixmodule::scaledistributedsparsematrix ( type(distributedsparsematrix_t), intent(inout)  this,
real(ntreal), intent(in)  constant 
)

Will scale a distributed sparse matrix by a constant.

Parameters
[in,out]thisMatrix to scale.
[in]constantscale factor.

◆ trace()

real(ntreal) function, public distributedsparsematrixmodule::trace ( type(distributedsparsematrix_t), intent(in)  this)

Compute the trace of the matrix.

Parameters
[in]thisthe matrix to compute the norm of.
Returns
the trace value of the full distributed sparse matrix.

◆ writetobinary()

subroutine, public distributedsparsematrixmodule::writetobinary ( type(distributedsparsematrix_t this,
character(len=*), intent(in)  file_name 
)

Save a distributed sparse matrix to a file.

Parameters
[in]thisthe Matrix to write.
[in]file_namename of the file to write to.

◆ writetomatrixmarket()

subroutine, public distributedsparsematrixmodule::writetomatrixmarket ( type(distributedsparsematrix_t this,
character(len=*), intent(in)  file_name 
)

Write a distributed sparse matrix to a matrix market file.

Parameters
[in]thisthe Matrix to write.
[in]file_namename of the file to write to.