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. Read [1] for the details. More...
 
subroutine, public constructfrombinary (this, file_name)
 Construct a distributed sparse matrix from a binary file in parallel. Faster than text, so this is good for check pointing. More...
 
subroutine, public writetobinary (this, file_name)
 Save a distributed sparse matrix to a binary file. Faster than text, so this is good for check pointing. More...
 
subroutine, public writetomatrixmarket (this, file_name)
 Write a distributed sparse matrix to a matrix market file. Read [1] for the details. More...
 
subroutine, public fillfromtripletlist (this, triplet_list, preduplicated_in)
 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...
 
subroutine, public getmatrixblock (this, triplet_list, start_row, end_row, start_column, end_column)
 Extract an arbitrary block of a matrix into a triplet list. Block is defined by the row/column start/end values. This is slower than GetTripletList, because communication is required. 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. Includes padding. More...
 
subroutine, public printmatrixinformation (this)
 Print out information about a distributed sparse matrix. Sparsity, and load balancing information. More...
 
subroutine, public printdistributedsparsematrix (this, file_name_in)
 Print out a distributed sparse matrix. This is a serial print routine, and should probably only be used for debug purposes. More...
 
subroutine, public filterdistributedsparsematrix (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...
 
subroutine, public transposedistributedsparsematrix (AMat, TransMat)
 Transpose a sparse matrix. More...
 
pure subroutine, public mergelocalblocks (this, merged_matrix)
 Merge together the local matrix blocks into one big matrix. More...
 

Detailed Description

A Module For Performing Distributed Sparse Matrix Operations.

Function/Subroutine Documentation

◆ 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), intent(inout)  this,
character(len=*), intent(in)  file_name 
)

Construct a distributed sparse matrix from a binary file in parallel. Faster than text, so this is good for check pointing.

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

◆ constructfrommatrixmarket()

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

Construct distributed sparse matrix from a matrix market file in parallel. Read [1] for the details.

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.

◆ 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,
logical, intent(in), optional  preduplicated_in 
)

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.
[in]preduplicated_inif lists are preduplicated across slices set this to true (optional, default=False).

◆ filterdistributedsparsematrix()

subroutine, public distributedsparsematrixmodule::filterdistributedsparsematrix ( 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. Includes padding.

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

◆ getmatrixblock()

subroutine, public distributedsparsematrixmodule::getmatrixblock ( type(distributedsparsematrix_t), intent(in)  this,
type(tripletlist_t), intent(inout)  triplet_list,
integer  start_row,
integer  end_row,
integer  start_column,
integer  end_column 
)

Extract an arbitrary block of a matrix into a triplet list. Block is defined by the row/column start/end values. This is slower than GetTripletList, because communication is required. Data is returned with absolute coordinates.

Parameters
[in]thisthe distributed sparse matrix.
[in,out]triplet_listthe list to fill.
[in]start_rowthe starting row for data to store on this process.
[in]end_rowthe ending row for data to store on this process.
[in]start_columnthe starting col for data to store on this process
[in]end_columnthe ending col for data to store on this process

◆ 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.

◆ mergelocalblocks()

pure subroutine, public distributedsparsematrixmodule::mergelocalblocks ( type(distributedsparsematrix_t), intent(in)  this,
type(sparsematrix_t), intent(inout)  merged_matrix 
)

Merge together the local matrix blocks into one big matrix.

Parameters
[in,out]thisthe distributed sparse matrix.
[in,out]merged_matrixthe merged matrix.

◆ printdistributedsparsematrix()

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

Print out a distributed sparse matrix. This is a serial print routine, and should probably only be used for debug purposes.

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

◆ printmatrixinformation()

subroutine, public distributedsparsematrixmodule::printmatrixinformation ( type(distributedsparsematrix_t), intent(in)  this)

Print out information about a distributed sparse matrix. Sparsity, and load balancing information.

Parameters
[in]thisthe matrix to print information about.

◆ transposedistributedsparsematrix()

subroutine, public distributedsparsematrixmodule::transposedistributedsparsematrix ( type(distributedsparsematrix_t), intent(in)  AMat,
type(distributedsparsematrix_t), intent(out)  TransMat 
)

Transpose a sparse matrix.

Parameters
[in]AMatThe matrix to transpose.
[out]TransMatA^T

◆ writetobinary()

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

Save a distributed sparse matrix to a binary file. Faster than text, so this is good for check pointing.

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

◆ writetomatrixmarket()

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

Write a distributed sparse matrix to a matrix market file. Read [1] for the details.

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