COMBINATORIAL_BLAS  1.6
SpParMat< IT, NT, DER > Class Template Reference

#include <BFSFriends.h>

Classes

class  ScalarReadSaveHandler
 

Public Types

typedef DER::LocalIT LocalIT
 
typedef DER::LocalNT LocalNT
 
typedef IT GlobalIT
 
typedef NT GlobalNT
 

Public Member Functions

 SpParMat ()
 Deprecated. Don't call the default constructor. More...
 
 SpParMat (MPI_Comm world)
 
 SpParMat (shared_ptr< CommGrid > grid)
 
 SpParMat (DER *myseq, shared_ptr< CommGrid > grid)
 
 SpParMat (ifstream &input, MPI_Comm &world)
 
 SpParMat (DER *myseq, MPI_Comm &world)
 
template<class DELIT >
 SpParMat (const DistEdgeList< DELIT > &rhs, bool removeloops=true)
 
 SpParMat (const SpParMat< IT, NT, DER > &rhs)
 
 SpParMat (IT total_m, IT total_n, const FullyDistVec< IT, IT > &, const FullyDistVec< IT, IT > &, const FullyDistVec< IT, NT > &, bool SumDuplicates=false)
 All vectors are zero-based indexed (as usual) More...
 
 SpParMat (IT total_m, IT total_n, const FullyDistVec< IT, IT > &, const FullyDistVec< IT, IT > &, const NT &, bool SumDuplicates=false)
 
SpParMat< IT, NT, DER > & operator= (const SpParMat< IT, NT, DER > &rhs)
 
SpParMat< IT, NT, DER > & operator+= (const SpParMat< IT, NT, DER > &rhs)
 
 ~SpParMat ()
 
template<typename SR >
void Square ()
 
float LoadImbalance () const
 
void Transpose ()
 
void FreeMemory ()
 
void EWiseMult (const SpParMat< IT, NT, DER > &rhs, bool exclude)
 
void EWiseScale (const DenseParMat< IT, NT > &rhs)
 
void Find (FullyDistVec< IT, IT > &, FullyDistVec< IT, IT > &, FullyDistVec< IT, NT > &) const
 
void Find (FullyDistVec< IT, IT > &, FullyDistVec< IT, IT > &) const
 
template<typename _BinaryOperation >
void DimApply (Dim dim, const FullyDistVec< IT, NT > &v, _BinaryOperation __binary_op)
 
template<typename _BinaryOperation , typename _UnaryOperation >
FullyDistVec< IT, NT > Reduce (Dim dim, _BinaryOperation __binary_op, NT id, _UnaryOperation __unary_op) const
 
template<typename _BinaryOperation >
FullyDistVec< IT, NT > Reduce (Dim dim, _BinaryOperation __binary_op, NT id) const
 
template<typename VT , typename GIT , typename _BinaryOperation , typename _UnaryOperation >
void Reduce (FullyDistVec< GIT, VT > &rvec, Dim dim, _BinaryOperation __binary_op, VT id, _UnaryOperation __unary_op) const
 
template<typename VT , typename GIT , typename _BinaryOperation >
void Reduce (FullyDistVec< GIT, VT > &rvec, Dim dim, _BinaryOperation __binary_op, VT id) const
 
template<typename VT , typename GIT >
bool Kselect (FullyDistVec< GIT, VT > &rvec, IT k_limit, int kselectVersion) const
 
template<typename VT , typename GIT >
bool Kselect (FullyDistSpVec< GIT, VT > &kth, IT k_limit, int kselectVersion) const
 
template<typename VT , typename GIT , typename _UnaryOperation >
bool Kselect1 (FullyDistVec< GIT, VT > &rvec, IT k_limit, _UnaryOperation __unary_op) const
 
template<typename VT , typename GIT , typename _UnaryOperation >
bool Kselect1 (FullyDistSpVec< GIT, VT > &rvec, IT k_limit, _UnaryOperation __unary_op) const
 
template<typename VT , typename GIT >
bool Kselect1 (FullyDistVec< GIT, VT > &rvec, IT k_limit) const
 
template<typename VT , typename GIT >
bool Kselect2 (FullyDistVec< GIT, VT > &rvec, IT k_limit) const
 
IT Bandwidth () const
 
IT Profile () const
 
template<typename VT , typename GIT , typename _BinaryOperation >
void MaskedReduce (FullyDistVec< GIT, VT > &rvec, FullyDistSpVec< GIT, VT > &mask, Dim dim, _BinaryOperation __binary_op, VT id, bool exclude=false) const
 
template<typename VT , typename GIT , typename _BinaryOperation , typename _UnaryOperation >
void MaskedReduce (FullyDistVec< GIT, VT > &rvec, FullyDistSpVec< GIT, VT > &mask, Dim dim, _BinaryOperation __binary_op, VT id, _UnaryOperation __unary_op, bool exclude=false) const
 
template<typename _UnaryOperation >
void Apply (_UnaryOperation __unary_op)
 
IT RemoveLoops ()
 
void AddLoops (NT loopval, bool replaceExisting=false)
 
void AddLoops (FullyDistVec< IT, NT > loopvals, bool replaceExisting=false)
 
template<typename LIT , typename OT >
void OptimizeForGraph500 (OptBuf< LIT, OT > &optbuf)
 
void ActivateThreading (int numsplits)
 
template<typename _UnaryOperation >
SpParMat< IT, NT, DER > PruneI (_UnaryOperation __unary_op, bool inPlace=true)
 
template<typename _UnaryOperation >
SpParMat< IT, NT, DER > Prune (_UnaryOperation __unary_op, bool inPlace=true)
 
template<typename _BinaryOperation >
SpParMat< IT, NT, DER > PruneColumn (const FullyDistVec< IT, NT > &pvals, _BinaryOperation __binary_op, bool inPlace=true)
 Prune every column of a sparse matrix based on pvals. More...
 
template<typename _BinaryOperation >
SpParMat< IT, NT, DER > PruneColumn (const FullyDistSpVec< IT, NT > &pvals, _BinaryOperation __binary_op, bool inPlace=true)
 
template<typename _BinaryOperation >
void UpdateDense (DenseParMat< IT, NT > &rhs, _BinaryOperation __binary_op) const
 
void Dump (string filename) const
 
void PrintInfo () const
 
template<typename NNT , typename NDER >
 operator SpParMat< IT, NNT, NDER > () const
 Type conversion operator. More...
 
template<typename NIT , typename NNT , typename NDER >
 operator SpParMat< NIT, NNT, NDER > () const
 Type conversion operator (for indices as well) More...
 
IT getnrow () const
 
IT getncol () const
 
IT getnnz () const
 
SpParMat< IT, NT, DER > SubsRefCol (const vector< IT > &ci) const
 Column indexing with special parallel semantics. More...
 
template<typename SelectFirstSR , typename SelectSecondSR >
SpParMat< IT, NT, DER > SubsRef_SR (const FullyDistVec< IT, IT > &ri, const FullyDistVec< IT, IT > &ci, bool inplace=false)
 General indexing with serial semantics. More...
 
SpParMat< IT, NT, DER > operator() (const FullyDistVec< IT, IT > &ri, const FullyDistVec< IT, IT > &ci, bool inplace=false)
 
void Prune (const FullyDistVec< IT, IT > &ri, const FullyDistVec< IT, IT > &ci)
 prune all entries whose row indices are in ri and column indices are in ci More...
 
void SpAsgn (const FullyDistVec< IT, IT > &ri, const FullyDistVec< IT, IT > &ci, SpParMat< IT, NT, DER > &B)
 
bool operator== (const SpParMat< IT, NT, DER > &rhs) const
 
template<typename _BinaryOperation >
void ParallelReadMM (const string &filename, bool onebased, _BinaryOperation BinOp)
 
template<typename _BinaryOperation >
FullyDistVec< IT, array< char, MAXVERTNAME > > ReadGeneralizedTuples (const string &, _BinaryOperation)
 
template<class HANDLER >
void ReadDistribute (const string &filename, int master, bool nonum, HANDLER handler, bool transpose=false, bool pario=false)
 
void ReadDistribute (const string &filename, int master, bool nonum=false, bool pario=false)
 
template<class HANDLER >
void SaveGathered (string filename, HANDLER handler, bool transpose=false) const
 
void SaveGathered (string filename) const
 
ofstream & put (ofstream &outfile) const
 
shared_ptr< CommGridgetcommgrid () const
 
DER::LocalIT getlocalrows () const
 
DER::LocalIT getlocalcols () const
 
DER::LocalIT getlocalnnz () const
 
DER & seq ()
 
DER * seqptr ()
 

Friends

template<class IU , class NU >
class DenseParMat
 
template<typename SR , typename NUO , typename UDERO , typename IU , typename NU1 , typename NU2 , typename UDER1 , typename UDER2 >
SpParMat< IU, NUO, UDERO > Mult_AnXBn_DoubleBuff (SpParMat< IU, NU1, UDER1 > &A, SpParMat< IU, NU2, UDER2 > &B, bool clearA, bool clearB)
 Friend declarations. More...
 
template<typename SR , typename NUO , typename UDERO , typename IU , typename NU1 , typename NU2 , typename UDER1 , typename UDER2 >
SpParMat< IU, NUO, UDERO > Mult_AnXBn_Synch (SpParMat< IU, NU1, UDER1 > &A, SpParMat< IU, NU2, UDER2 > &B, bool clearA, bool clearB)
 
template<typename SR , typename IU , typename NU1 , typename NU2 , typename UDER1 , typename UDER2 >
SpParMat< IU, typename promote_trait< NU1, NU2 >::T_promote, typename promote_trait< UDER1, UDER2 >::T_promote > Mult_AnXBn_ActiveTarget (const SpParMat< IU, NU1, UDER1 > &A, const SpParMat< IU, NU2, UDER2 > &B)
 
template<typename SR , typename IU , typename NU1 , typename NU2 , typename UDER1 , typename UDER2 >
SpParMat< IU, typename promote_trait< NU1, NU2 >::T_promote, typename promote_trait< UDER1, UDER2 >::T_promote > Mult_AnXBn_PassiveTarget (const SpParMat< IU, NU1, UDER1 > &A, const SpParMat< IU, NU2, UDER2 > &B)
 
template<typename SR , typename IU , typename NU1 , typename NU2 , typename UDER1 , typename UDER2 >
SpParMat< IU, typename promote_trait< NU1, NU2 >::T_promote, typename promote_trait< UDER1, UDER2 >::T_promote > Mult_AnXBn_Fence (const SpParMat< IU, NU1, UDER1 > &A, const SpParMat< IU, NU2, UDER2 > &B)
 
template<typename SR , typename NUO , typename UDERO , typename IU , typename NU1 , typename NU2 , typename UDERA , typename UDERB >
SpParMat< IU, NUO, UDERO > MemEfficientSpGEMM (SpParMat< IU, NU1, UDERA > &A, SpParMat< IU, NU2, UDERB > &B, int phases, NUO hardThreshold, IU selectNum, IU recoverNum, NUO recoverPct, int kselectVersion, int64_t perProcessMem)
 
template<typename SR , typename IU , typename NUM , typename NUV , typename UDER >
FullyDistSpVec< IU, typename promote_trait< NUM, NUV >::T_promote > SpMV (const SpParMat< IU, NUM, UDER > &A, const FullyDistSpVec< IU, NUV > &x)
 
template<typename SR , typename IU , typename NUM , typename NUV , typename UDER >
FullyDistVec< IU, typename promote_trait< NUM, NUV >::T_promote > SpMV (const SpParMat< IU, NUM, UDER > &A, const FullyDistVec< IU, NUV > &x)
 
template<typename SR , typename IU , typename NUM , typename UDER >
FullyDistSpVec< IU, typename promote_trait< NUM, IU >::T_promote > SpMV (const SpParMat< IU, NUM, UDER > &A, const FullyDistSpVec< IU, IU > &x, bool indexisvalue)
 
template<typename SR , typename IVT , typename OVT , typename IU , typename NUM , typename UDER >
void SpMV (const SpParMat< IU, NUM, UDER > &A, const FullyDistSpVec< IU, IVT > &x, FullyDistSpVec< IU, OVT > &y, bool indexisvalue)
 
template<typename SR , typename IVT , typename OVT , typename IU , typename NUM , typename UDER >
void SpMV (const SpParMat< IU, NUM, UDER > &A, const FullyDistSpVec< IU, IVT > &x, FullyDistSpVec< IU, OVT > &y, bool indexisvalue, OptBuf< int32_t, OVT > &optbuf)
 
template<typename IU , typename NU1 , typename NU2 , typename UDER1 , typename UDER2 >
SpParMat< IU, typename promote_trait< NU1, NU2 >::T_promote, typename promote_trait< UDER1, UDER2 >::T_promote > EWiseMult (const SpParMat< IU, NU1, UDER1 > &A, const SpParMat< IU, NU2, UDER2 > &B, bool exclude)
 
template<typename RETT , typename RETDER , typename IU , typename NU1 , typename NU2 , typename UDERA , typename UDERB , typename _BinaryOperation >
SpParMat< IU, RETT, RETDER > EWiseApply (const SpParMat< IU, NU1, UDERA > &A, const SpParMat< IU, NU2, UDERB > &B, _BinaryOperation __binary_op, bool notB, const NU2 &defaultBVal)
 
template<typename RETT , typename RETDER , typename IU , typename NU1 , typename NU2 , typename UDERA , typename UDERB , typename _BinaryOperation , typename _BinaryPredicate >
SpParMat< IU, RETT, RETDER > EWiseApply (const SpParMat< IU, NU1, UDERA > &A, const SpParMat< IU, NU2, UDERB > &B, _BinaryOperation __binary_op, _BinaryPredicate do_op, bool allowANulls, bool allowBNulls, const NU1 &ANullVal, const NU2 &BNullVal, const bool allowIntersect, const bool useExtendedBinOp)
 
template<typename SR , typename IVT , typename OVT , typename IU , typename NUM , typename UDER >
void LocalSpMV (const SpParMat< IU, NUM, UDER > &A, int rowneighs, OptBuf< int32_t, OVT > &optbuf, int32_t *&indacc, IVT *&numacc, int32_t *&sendindbuf, OVT *&sendnumbuf, int *&sdispls, int *sendcnt, int accnz, bool indexisvalue, PreAllocatedSPA< OVT > &SPA)
 
template<typename VT , typename IU , typename UDER >
void LocalSpMV (const SpParMat< IU, bool, UDER > &A, int rowneighs, OptBuf< int32_t, VT > &optbuf, int32_t *&indacc, VT *&numacc, int *sendcnt, int accnz)
 
template<typename IU , typename NU , typename UDER >
ofstream & operator<< (ofstream &outfile, const SpParMat< IU, NU, UDER > &s)
 

Detailed Description

template<class IT, class NT, class DER>
class SpParMat< IT, NT, DER >

Fundamental 2D distributed sparse matrix class The index type IT is encapsulated by the class in a way that it is only guarantee that the implementation will ensure the requested semantics. For instance, if IT=int64 then the implementation can still use 32 bit local indices but it should return correct 64-bit numbers in its functions. In other words, DER can be SpDCCols<int32_t, double> while IT=int64_t

Definition at line 46 of file BFSFriends.h.

Member Typedef Documentation

◆ GlobalIT

template<class IT, class NT, class DER>
typedef IT SpParMat< IT, NT, DER >::GlobalIT

Definition at line 72 of file SpParMat.h.

◆ GlobalNT

template<class IT, class NT, class DER>
typedef NT SpParMat< IT, NT, DER >::GlobalNT

Definition at line 73 of file SpParMat.h.

◆ LocalIT

template<class IT, class NT, class DER>
typedef DER::LocalIT SpParMat< IT, NT, DER >::LocalIT

Definition at line 70 of file SpParMat.h.

◆ LocalNT

template<class IT, class NT, class DER>
typedef DER::LocalNT SpParMat< IT, NT, DER >::LocalNT

Definition at line 71 of file SpParMat.h.

Constructor & Destructor Documentation

◆ SpParMat() [1/10]

template<class IT , class NT , class DER >
SpParMat< IT, NT, DER >::SpParMat ( )

Deprecated. Don't call the default constructor.

Definition at line 88 of file SpParMat.cpp.

◆ SpParMat() [2/10]

template<class IT , class NT , class DER >
SpParMat< IT, NT, DER >::SpParMat ( MPI_Comm  world)

If there is a single file read by the master process only, use this and then call ReadDistribute()

Definition at line 100 of file SpParMat.cpp.

◆ SpParMat() [3/10]

template<class IT , class NT , class DER >
SpParMat< IT, NT, DER >::SpParMat ( shared_ptr< CommGrid grid)

Definition at line 79 of file SpParMat.cpp.

◆ SpParMat() [4/10]

template<class IT , class NT , class DER>
SpParMat< IT, NT, DER >::SpParMat ( DER *  myseq,
shared_ptr< CommGrid grid 
)

Definition at line 72 of file SpParMat.cpp.

◆ SpParMat() [5/10]

template<class IT , class NT , class DER>
SpParMat< IT, NT, DER >::SpParMat ( ifstream &  input,
MPI_Comm &  world 
)

If every processor has a distinct triples file such as {A_0, A_1, A_2,... A_p} for p processors

Definition at line 52 of file SpParMat.cpp.

◆ SpParMat() [6/10]

template<class IT , class NT , class DER>
SpParMat< IT, NT, DER >::SpParMat ( DER *  myseq,
MPI_Comm &  world 
)

Definition at line 65 of file SpParMat.cpp.

◆ SpParMat() [7/10]

template<class IT , class NT , class DER >
template<class DELIT >
SpParMat< IT, NT, DER >::SpParMat ( const DistEdgeList< DELIT > &  rhs,
bool  removeloops = true 
)

Definition at line 2564 of file SpParMat.cpp.

◆ SpParMat() [8/10]

template<class IT, class NT, class DER>
SpParMat< IT, NT, DER >::SpParMat ( const SpParMat< IT, NT, DER > &  rhs)

Definition at line 618 of file SpParMat.cpp.

◆ SpParMat() [9/10]

template<class IT, class NT, class DER>
SpParMat< IT, NT, DER >::SpParMat ( IT  total_m,
IT  total_n,
const FullyDistVec< IT, IT > &  distrows,
const FullyDistVec< IT, IT > &  distcols,
const FullyDistVec< IT, NT > &  distvals,
bool  SumDuplicates = false 
)

All vectors are zero-based indexed (as usual)

Definition at line 2490 of file SpParMat.cpp.

◆ SpParMat() [10/10]

template<class IT, class NT, class DER>
SpParMat< IT, NT, DER >::SpParMat ( IT  total_m,
IT  total_n,
const FullyDistVec< IT, IT > &  distrows,
const FullyDistVec< IT, IT > &  distcols,
const NT &  val,
bool  SumDuplicates = false 
)

Definition at line 2528 of file SpParMat.cpp.

◆ ~SpParMat()

template<class IT , class NT , class DER >
SpParMat< IT, NT, DER >::~SpParMat ( )

Definition at line 109 of file SpParMat.cpp.

Member Function Documentation

◆ ActivateThreading()

template<class IT , class NT , class DER >
void SpParMat< IT, NT, DER >::ActivateThreading ( int  numsplits)

Definition at line 2867 of file SpParMat.cpp.

◆ AddLoops() [1/2]

template<class IT , class NT, class DER >
void SpParMat< IT, NT, DER >::AddLoops ( NT  loopval,
bool  replaceExisting = false 
)

Definition at line 2700 of file SpParMat.cpp.

◆ AddLoops() [2/2]

template<class IT, class NT, class DER >
void SpParMat< IT, NT, DER >::AddLoops ( FullyDistVec< IT, NT >  loopvals,
bool  replaceExisting = false 
)

Definition at line 2717 of file SpParMat.cpp.

◆ Apply()

template<class IT, class NT, class DER>
template<typename _UnaryOperation >
void SpParMat< IT, NT, DER >::Apply ( _UnaryOperation  __unary_op)
inline

Definition at line 144 of file SpParMat.h.

◆ Bandwidth()

template<class IT , class NT , class DER >
IT SpParMat< IT, NT, DER >::Bandwidth ( ) const

Definition at line 1597 of file SpParMat.cpp.

◆ DimApply()

template<class IT, class NT, class DER >
template<typename _BinaryOperation >
void SpParMat< IT, NT, DER >::DimApply ( Dim  dim,
const FullyDistVec< IT, NT > &  v,
_BinaryOperation  __binary_op 
)

Definition at line 703 of file SpParMat.cpp.

◆ Dump()

template<class IT , class NT , class DER >
void SpParMat< IT, NT, DER >::Dump ( string  filename) const

Definition at line 561 of file SpParMat.cpp.

◆ EWiseMult()

template<class IT, class NT, class DER>
void SpParMat< IT, NT, DER >::EWiseMult ( const SpParMat< IT, NT, DER > &  rhs,
bool  exclude 
)

Definition at line 2334 of file SpParMat.cpp.

◆ EWiseScale()

template<class IT, class NT, class DER >
void SpParMat< IT, NT, DER >::EWiseScale ( const DenseParMat< IT, NT > &  rhs)

Definition at line 2349 of file SpParMat.cpp.

◆ Find() [1/2]

template<class IT, class NT, class DER >
void SpParMat< IT, NT, DER >::Find ( FullyDistVec< IT, IT > &  distrows,
FullyDistVec< IT, IT > &  distcols,
FullyDistVec< IT, NT > &  distvals 
) const

The input parameters' identity (zero) elements as well as their communication grid is preserved while outputting

Definition at line 4050 of file SpParMat.cpp.

◆ Find() [2/2]

template<class IT, class NT, class DER >
void SpParMat< IT, NT, DER >::Find ( FullyDistVec< IT, IT > &  distrows,
FullyDistVec< IT, IT > &  distcols 
) const

The input parameters' identity (zero) elements as well as their communication grid is preserved while outputting

Definition at line 4128 of file SpParMat.cpp.

◆ FreeMemory()

template<class IT , class NT , class DER >
void SpParMat< IT, NT, DER >::FreeMemory ( )

Definition at line 115 of file SpParMat.cpp.

◆ getcommgrid()

template<class IT, class NT, class DER>
shared_ptr<CommGrid> SpParMat< IT, NT, DER >::getcommgrid ( ) const
inline

Definition at line 271 of file SpParMat.h.

◆ getlocalcols()

template<class IT, class NT, class DER>
DER::LocalIT SpParMat< IT, NT, DER >::getlocalcols ( ) const
inline

Definition at line 273 of file SpParMat.h.

◆ getlocalnnz()

template<class IT, class NT, class DER>
DER::LocalIT SpParMat< IT, NT, DER >::getlocalnnz ( ) const
inline

Definition at line 274 of file SpParMat.h.

◆ getlocalrows()

template<class IT, class NT, class DER>
DER::LocalIT SpParMat< IT, NT, DER >::getlocalrows ( ) const
inline

Definition at line 272 of file SpParMat.h.

◆ getncol()

template<class IT , class NT , class DER >
IT SpParMat< IT, NT, DER >::getncol ( ) const

Definition at line 693 of file SpParMat.cpp.

◆ getnnz()

template<class IT , class NT , class DER >
IT SpParMat< IT, NT, DER >::getnnz ( ) const

Definition at line 675 of file SpParMat.cpp.

◆ getnrow()

template<class IT , class NT , class DER >
IT SpParMat< IT, NT, DER >::getnrow ( ) const

Definition at line 684 of file SpParMat.cpp.

◆ Kselect() [1/2]

template<class IT, class NT , class DER >
template<typename VT , typename GIT >
bool SpParMat< IT, NT, DER >::Kselect ( FullyDistVec< GIT, VT > &  rvec,
IT  k_limit,
int  kselectVersion 
) const

Returns true if Kselect algorithm is invoked for at least one column Otherwise, returns false if false, rvec contains either the minimum entry in each column or zero

Definition at line 1062 of file SpParMat.cpp.

◆ Kselect() [2/2]

template<class IT, class NT , class DER >
template<typename VT , typename GIT >
bool SpParMat< IT, NT, DER >::Kselect ( FullyDistSpVec< GIT, VT > &  kth,
IT  k_limit,
int  kselectVersion 
) const

Kselect wrapper for a select columns of the matrix Indices of the input sparse vectors kth denote the queried columns of the matrix Upon return, values of kth stores the kth entries of the queried columns Returns true if Kselect algorithm is invoked for at least one column Otherwise, returns false

Definition at line 1022 of file SpParMat.cpp.

◆ Kselect1() [1/3]

template<class IT, class NT , class DER >
template<typename VT , typename GIT , typename _UnaryOperation >
bool SpParMat< IT, NT, DER >::Kselect1 ( FullyDistVec< GIT, VT > &  rvec,
IT  k_limit,
_UnaryOperation  __unary_op 
) const

Definition at line 1093 of file SpParMat.cpp.

◆ Kselect1() [2/3]

template<class IT, class NT , class DER >
template<typename VT , typename GIT , typename _UnaryOperation >
bool SpParMat< IT, NT, DER >::Kselect1 ( FullyDistSpVec< GIT, VT > &  rvec,
IT  k_limit,
_UnaryOperation  __unary_op 
) const

Definition at line 1314 of file SpParMat.cpp.

◆ Kselect1() [3/3]

template<class IT, class NT, class DER>
template<typename VT , typename GIT >
bool SpParMat< IT, NT, DER >::Kselect1 ( FullyDistVec< GIT, VT > &  rvec,
IT  k_limit 
) const

◆ Kselect2()

template<class IT, class NT , class DER >
template<typename VT , typename GIT >
bool SpParMat< IT, NT, DER >::Kselect2 ( FullyDistVec< GIT, VT > &  rvec,
IT  k_limit 
) const

identify the k-th maximum element in each column of a matrix if the number of nonzeros in a column is less than k, return the numeric_limits<NT>::min() This is an efficient implementation of the Saukas/Song algorithm http://www.ime.usp.br/~einar/select/INDEX.HTM Preferred for large k values

Definition at line 308 of file SpParMat.cpp.

◆ LoadImbalance()

template<class IT , class NT , class DER >
float SpParMat< IT, NT, DER >::LoadImbalance ( ) const

Definition at line 664 of file SpParMat.cpp.

◆ MaskedReduce() [1/2]

template<class IT , class NT , class DER >
template<typename VT , typename GIT , typename _BinaryOperation >
void SpParMat< IT, NT, DER >::MaskedReduce ( FullyDistVec< GIT, VT > &  rvec,
FullyDistSpVec< GIT, VT > &  mask,
Dim  dim,
_BinaryOperation  __binary_op,
VT  id,
bool  exclude = false 
) const

Definition at line 1703 of file SpParMat.cpp.

◆ MaskedReduce() [2/2]

template<class IT , class NT , class DER >
template<typename VT , typename GIT , typename _BinaryOperation , typename _UnaryOperation >
void SpParMat< IT, NT, DER >::MaskedReduce ( FullyDistVec< GIT, VT > &  rvec,
FullyDistSpVec< GIT, VT > &  mask,
Dim  dim,
_BinaryOperation  __binary_op,
VT  id,
_UnaryOperation  __unary_op,
bool  exclude = false 
) const

Reduce along the column into a vector

Parameters
[in]mask{A sparse vector indicating row indices included/excluded (based on exclude argument) in the reduction }
[in]__binary_op{the operation used for reduction; examples: max, min, plus, multiply, and, or. Its parameters and return type are all VT}
[in]id{scalar that is used as the identity for __binary_op; examples: zero, infinity}
[in]__unary_op{optional unary operation applied to nonzeros before the __binary_op; examples: 1/x, x^2}
[in]exclude{if true, masked row indices are included in the reduction}
[out]rvec{the return vector, specified as an output parameter to allow arbitrary return types via VT}

Definition at line 1724 of file SpParMat.cpp.

◆ operator SpParMat< IT, NNT, NDER >()

template<class IT , class NT , class DER >
template<typename NNT , typename NDER >
SpParMat< IT, NT, DER >::operator SpParMat< IT, NNT, NDER > ( ) const

Type conversion operator.

Definition at line 1846 of file SpParMat.cpp.

◆ operator SpParMat< NIT, NNT, NDER >()

template<class IT , class NT , class DER >
template<typename NIT , typename NNT , typename NDER >
SpParMat< IT, NT, DER >::operator SpParMat< NIT, NNT, NDER > ( ) const

Type conversion operator (for indices as well)

Change index type as well.

Definition at line 1855 of file SpParMat.cpp.

◆ operator()()

template<class IT, class NT, class DER>
SpParMat<IT,NT,DER> SpParMat< IT, NT, DER >::operator() ( const FullyDistVec< IT, IT > &  ri,
const FullyDistVec< IT, IT > &  ci,
bool  inplace = false 
)
inline

Definition at line 212 of file SpParMat.h.

◆ operator+=()

template<class IT, class NT, class DER>
SpParMat< IT, NT, DER > & SpParMat< IT, NT, DER >::operator+= ( const SpParMat< IT, NT, DER > &  rhs)

Definition at line 643 of file SpParMat.cpp.

◆ operator=()

template<class IT, class NT, class DER>
SpParMat< IT, NT, DER > & SpParMat< IT, NT, DER >::operator= ( const SpParMat< IT, NT, DER > &  rhs)

Check agains NULL is probably unneccessary, delete won't fail on NULL But useful in the presence of a user defined "operator delete" which fails to check NULL

Definition at line 627 of file SpParMat.cpp.

◆ operator==()

template<class IT, class NT, class DER>
bool SpParMat< IT, NT, DER >::operator== ( const SpParMat< IT, NT, DER > &  rhs) const

Definition at line 2410 of file SpParMat.cpp.

◆ OptimizeForGraph500()

template<class IT , class NT , class DER >
template<typename LIT , typename OT >
void SpParMat< IT, NT, DER >::OptimizeForGraph500 ( OptBuf< LIT, OT > &  optbuf)

Pre-allocates buffers for row communication additionally (if GATHERVOPT is defined, incomplete as of March 2016):

  • Splits the local column indices to sparse & dense pieces to avoid redundant AllGather (sparse pieces get p2p)

Definition at line 2766 of file SpParMat.cpp.

◆ ParallelReadMM()

template<class IT , class NT , class DER >
template<typename _BinaryOperation >
void SpParMat< IT, NT, DER >::ParallelReadMM ( const string &  filename,
bool  onebased,
_BinaryOperation  BinOp 
)

Handles all sorts of orderings, even duplicates (what happens to them is determined by BinOp) Requires proper matrix market banner at the moment Replaces ReadDistribute for properly load balanced input in matrix market format

Definition at line 3367 of file SpParMat.cpp.

◆ PrintInfo()

template<class IT , class NT , class DER >
void SpParMat< IT, NT, DER >::PrintInfo ( ) const

Definition at line 2386 of file SpParMat.cpp.

◆ Profile()

template<class IT , class NT , class DER >
IT SpParMat< IT, NT, DER >::Profile ( ) const

Definition at line 1640 of file SpParMat.cpp.

◆ Prune() [1/2]

template<class IT, class NT, class DER>
template<typename _UnaryOperation >
SpParMat<IT,NT,DER> SpParMat< IT, NT, DER >::Prune ( _UnaryOperation  __unary_op,
bool  inPlace = true 
)
inline

Definition at line 174 of file SpParMat.h.

◆ Prune() [2/2]

template<class IT, class NT , class DER >
void SpParMat< IT, NT, DER >::Prune ( const FullyDistVec< IT, IT > &  ri,
const FullyDistVec< IT, IT > &  ci 
)

prune all entries whose row indices are in ri and column indices are in ci

Definition at line 2148 of file SpParMat.cpp.

◆ PruneColumn() [1/2]

template<class IT, class NT, class DER >
template<typename _BinaryOperation >
SpParMat< IT, NT, DER > SpParMat< IT, NT, DER >::PruneColumn ( const FullyDistVec< IT, NT > &  pvals,
_BinaryOperation  __binary_op,
bool  inPlace = true 
)

Prune every column of a sparse matrix based on pvals.

Definition at line 2184 of file SpParMat.cpp.

◆ PruneColumn() [2/2]

template<class IT, class NT, class DER >
template<typename _BinaryOperation >
SpParMat< IT, NT, DER > SpParMat< IT, NT, DER >::PruneColumn ( const FullyDistSpVec< IT, NT > &  pvals,
_BinaryOperation  __binary_op,
bool  inPlace = true 
)

Prune columns of a sparse matrix selected by nonzero indices of pvals Each selected column is pruned by corresponding values in pvals

Definition at line 2263 of file SpParMat.cpp.

◆ PruneI()

template<class IT, class NT, class DER>
template<typename _UnaryOperation >
SpParMat<IT,NT,DER> SpParMat< IT, NT, DER >::PruneI ( _UnaryOperation  __unary_op,
bool  inPlace = true 
)
inline

Definition at line 158 of file SpParMat.h.

◆ put()

template<class IT , class NT , class DER >
ofstream & SpParMat< IT, NT, DER >::put ( ofstream &  outfile) const

Definition at line 4198 of file SpParMat.cpp.

◆ ReadDistribute() [1/2]

template<class IT , class NT , class DER >
template<class HANDLER >
void SpParMat< IT, NT, DER >::ReadDistribute ( const string &  filename,
int  master,
bool  nonum,
HANDLER  handler,
bool  transpose = false,
bool  pario = false 
)

Handles all sorts of orderings as long as there are no duplicates May perform better when the data is already reverse column-sorted (i.e. in decreasing order) if nonum is true, then numerics are not supplied and they are assumed to be all 1's

Definition at line 3510 of file SpParMat.cpp.

◆ ReadDistribute() [2/2]

template<class IT, class NT, class DER>
void SpParMat< IT, NT, DER >::ReadDistribute ( const string &  filename,
int  master,
bool  nonum = false,
bool  pario = false 
)
inline

Definition at line 260 of file SpParMat.h.

◆ ReadGeneralizedTuples()

template<class IT , class NT , class DER >
template<typename _BinaryOperation >
FullyDistVec< IT, array< char, MAXVERTNAME > > SpParMat< IT, NT, DER >::ReadGeneralizedTuples ( const string &  filename,
_BinaryOperation  BinOp 
)

Handles all sorts of orderings as long as there are no duplicates Does not take matrix market banner (only tuples) Data can be load imbalanced and the vertex labels can be arbitrary strings Replaces ReadDistribute for imbalanced arbitrary input in tuples format

Definition at line 3134 of file SpParMat.cpp.

◆ Reduce() [1/4]

template<class IT , class NT, class DER >
template<typename _BinaryOperation , typename _UnaryOperation >
FullyDistVec< IT, NT > SpParMat< IT, NT, DER >::Reduce ( Dim  dim,
_BinaryOperation  __binary_op,
NT  id,
_UnaryOperation  __unary_op 
) const

Definition at line 790 of file SpParMat.cpp.

◆ Reduce() [2/4]

template<class IT , class NT, class DER >
template<typename _BinaryOperation >
FullyDistVec< IT, NT > SpParMat< IT, NT, DER >::Reduce ( Dim  dim,
_BinaryOperation  __binary_op,
NT  id 
) const

Definition at line 818 of file SpParMat.cpp.

◆ Reduce() [3/4]

template<class IT , class NT, class DER >
template<typename VT , typename GIT , typename _BinaryOperation , typename _UnaryOperation >
void SpParMat< IT, NT, DER >::Reduce ( FullyDistVec< GIT, VT > &  rvec,
Dim  dim,
_BinaryOperation  __binary_op,
VT  id,
_UnaryOperation  __unary_op 
) const

Definition at line 855 of file SpParMat.cpp.

◆ Reduce() [4/4]

template<class IT , class NT, class DER >
template<typename VT , typename GIT , typename _BinaryOperation >
void SpParMat< IT, NT, DER >::Reduce ( FullyDistVec< GIT, VT > &  rvec,
Dim  dim,
_BinaryOperation  __binary_op,
VT  id 
) const

Definition at line 847 of file SpParMat.cpp.

◆ RemoveLoops()

template<class IT , class NT , class DER >
IT SpParMat< IT, NT, DER >::RemoveLoops ( )

Definition at line 2681 of file SpParMat.cpp.

◆ SaveGathered() [1/2]

template<class IT , class NT , class DER >
template<class HANDLER >
void SpParMat< IT, NT, DER >::SaveGathered ( string  filename,
HANDLER  handler,
bool  transpose = false 
) const

Definition at line 3013 of file SpParMat.cpp.

◆ SaveGathered() [2/2]

template<class IT, class NT, class DER>
void SpParMat< IT, NT, DER >::SaveGathered ( string  filename) const
inline

Definition at line 267 of file SpParMat.h.

◆ seq()

template<class IT, class NT, class DER>
DER& SpParMat< IT, NT, DER >::seq ( )
inline

Definition at line 275 of file SpParMat.h.

◆ seqptr()

template<class IT, class NT, class DER>
DER* SpParMat< IT, NT, DER >::seqptr ( )
inline

Definition at line 276 of file SpParMat.h.

◆ SpAsgn()

template<class IT, class NT, class DER>
void SpParMat< IT, NT, DER >::SpAsgn ( const FullyDistVec< IT, IT > &  ri,
const FullyDistVec< IT, IT > &  ci,
SpParMat< IT, NT, DER > &  B 
)

Definition at line 2105 of file SpParMat.cpp.

◆ Square()

template<class IT , class NT , class DER >
template<typename SR >
void SpParMat< IT, NT, DER >::Square ( )

Parallel routine that returns A*A on the semiring SR Uses only MPI-1 features (relies on simple blocking broadcast)

Definition at line 2879 of file SpParMat.cpp.

◆ SubsRef_SR()

template<class IT, class NT , class DER >
template<typename PTNTBOOL , typename PTBOOLNT >
SpParMat< IT, NT, DER > SpParMat< IT, NT, DER >::SubsRef_SR ( const FullyDistVec< IT, IT > &  ri,
const FullyDistVec< IT, IT > &  ci,
bool  inplace = false 
)

General indexing with serial semantics.

Generalized sparse matrix indexing (ri/ci are 0-based indexed) Both the storage and the actual values in FullyDistVec should be IT The index vectors are dense and FULLY distributed on all processors We can use this function to apply a permutation like A(p,q) Sequential indexing subroutine (via multiplication) is general enough.

Definition at line 1882 of file SpParMat.cpp.

◆ SubsRefCol()

template<class IT, class NT , class DER >
SpParMat< IT, NT, DER > SpParMat< IT, NT, DER >::SubsRefCol ( const vector< IT > &  ci) const

Column indexing with special parallel semantics.

Create a submatrix of size m x (size(ci) * s) on a r x s processor grid Essentially fetches the columns ci[0], ci[1],... ci[size(ci)] from every submatrix

Definition at line 1866 of file SpParMat.cpp.

◆ Transpose()

template<class IT , class NT , class DER >
void SpParMat< IT, NT, DER >::Transpose ( )

Definition at line 2951 of file SpParMat.cpp.

◆ UpdateDense()

template<class IT, class NT, class DER >
template<typename _BinaryOperation >
void SpParMat< IT, NT, DER >::UpdateDense ( DenseParMat< IT, NT > &  rhs,
_BinaryOperation  __binary_op 
) const

Definition at line 2364 of file SpParMat.cpp.

Friends And Related Function Documentation

◆ DenseParMat

template<class IT, class NT, class DER>
template<class IU , class NU >
friend class DenseParMat
friend

Definition at line 377 of file SpParMat.h.

◆ EWiseApply [1/2]

template<class IT, class NT, class DER>
template<typename RETT , typename RETDER , typename IU , typename NU1 , typename NU2 , typename UDERA , typename UDERB , typename _BinaryOperation >
SpParMat<IU,RETT,RETDER> EWiseApply ( const SpParMat< IU, NU1, UDERA > &  A,
const SpParMat< IU, NU2, UDERB > &  B,
_BinaryOperation  __binary_op,
bool  notB,
const NU2 &  defaultBVal 
)
friend

Definition at line 1735 of file ParFriends.h.

◆ EWiseApply [2/2]

template<class IT, class NT, class DER>
template<typename RETT , typename RETDER , typename IU , typename NU1 , typename NU2 , typename UDERA , typename UDERB , typename _BinaryOperation , typename _BinaryPredicate >
SpParMat<IU,RETT,RETDER> EWiseApply ( const SpParMat< IU, NU1, UDERA > &  A,
const SpParMat< IU, NU2, UDERB > &  B,
_BinaryOperation  __binary_op,
_BinaryPredicate  do_op,
bool  allowANulls,
bool  allowBNulls,
const NU1 &  ANullVal,
const NU2 &  BNullVal,
const bool  allowIntersect,
const bool  useExtendedBinOp 
)
friend

Definition at line 1752 of file ParFriends.h.

◆ EWiseMult

template<class IT, class NT, class DER>
template<typename IU , typename NU1 , typename NU2 , typename UDER1 , typename UDER2 >
SpParMat<IU,typename promote_trait<NU1,NU2>::T_promote,typename promote_trait<UDER1,UDER2>::T_promote> EWiseMult ( const SpParMat< IU, NU1, UDER1 > &  A,
const SpParMat< IU, NU2, UDER2 > &  B,
bool  exclude 
)
friend

◆ LocalSpMV [1/2]

template<class IT, class NT, class DER>
template<typename SR , typename IVT , typename OVT , typename IU , typename NUM , typename UDER >
void LocalSpMV ( const SpParMat< IU, NUM, UDER > &  A,
int  rowneighs,
OptBuf< int32_t, OVT > &  optbuf,
int32_t *&  indacc,
IVT *&  numacc,
int32_t *&  sendindbuf,
OVT *&  sendnumbuf,
int *&  sdispls,
int *  sendcnt,
int  accnz,
bool  indexisvalue,
PreAllocatedSPA< OVT > &  SPA 
)
friend

Step 3 of the sparse SpMV algorithm, with the semiring

Parameters
[in,out]optbuf{scratch space for all-to-all (fold) communication}
[in,out]indacc,numacc{index and values of the input vector, deleted upon exit}
[in,out]sendindbuf,sendnumbuf{index and values of the output vector, created}

Definition at line 1052 of file ParFriends.h.

◆ LocalSpMV [2/2]

template<class IT, class NT, class DER>
template<typename VT , typename IU , typename UDER >
void LocalSpMV ( const SpParMat< IU, bool, UDER > &  A,
int  rowneighs,
OptBuf< int32_t, VT > &  optbuf,
int32_t *&  indacc,
VT *&  numacc,
int *  sendcnt,
int  accnz 
)
friend

◆ MemEfficientSpGEMM

template<class IT, class NT, class DER>
template<typename SR , typename NUO , typename UDERO , typename IU , typename NU1 , typename NU2 , typename UDERA , typename UDERB >
SpParMat<IU,NUO,UDERO> MemEfficientSpGEMM ( SpParMat< IU, NU1, UDERA > &  A,
SpParMat< IU, NU2, UDERB > &  B,
int  phases,
NUO  hardThreshold,
IU  selectNum,
IU  recoverNum,
NUO  recoverPct,
int  kselectVersion,
int64_t  perProcessMem 
)
friend

Broadcasts A multiple times (#phases) in order to save storage in the output Only uses 1/phases of C memory if the threshold/max limits are proper

Definition at line 349 of file ParFriends.h.

◆ Mult_AnXBn_ActiveTarget

template<class IT, class NT, class DER>
template<typename SR , typename IU , typename NU1 , typename NU2 , typename UDER1 , typename UDER2 >
SpParMat<IU,typename promote_trait<NU1,NU2>::T_promote,typename promote_trait<UDER1,UDER2>::T_promote> Mult_AnXBn_ActiveTarget ( const SpParMat< IU, NU1, UDER1 > &  A,
const SpParMat< IU, NU2, UDER2 > &  B 
)
friend

◆ Mult_AnXBn_DoubleBuff

template<class IT, class NT, class DER>
template<typename SR , typename NUO , typename UDERO , typename IU , typename NU1 , typename NU2 , typename UDER1 , typename UDER2 >
SpParMat<IU, NUO, UDERO> Mult_AnXBn_DoubleBuff ( SpParMat< IU, NU1, UDER1 > &  A,
SpParMat< IU, NU2, UDER2 > &  B,
bool  clearA,
bool  clearB 
)
friend

Friend declarations.

◆ Mult_AnXBn_Fence

template<class IT, class NT, class DER>
template<typename SR , typename IU , typename NU1 , typename NU2 , typename UDER1 , typename UDER2 >
SpParMat<IU,typename promote_trait<NU1,NU2>::T_promote,typename promote_trait<UDER1,UDER2>::T_promote> Mult_AnXBn_Fence ( const SpParMat< IU, NU1, UDER1 > &  A,
const SpParMat< IU, NU2, UDER2 > &  B 
)
friend

◆ Mult_AnXBn_PassiveTarget

template<class IT, class NT, class DER>
template<typename SR , typename IU , typename NU1 , typename NU2 , typename UDER1 , typename UDER2 >
SpParMat<IU,typename promote_trait<NU1,NU2>::T_promote,typename promote_trait<UDER1,UDER2>::T_promote> Mult_AnXBn_PassiveTarget ( const SpParMat< IU, NU1, UDER1 > &  A,
const SpParMat< IU, NU2, UDER2 > &  B 
)
friend

◆ Mult_AnXBn_Synch

template<class IT, class NT, class DER>
template<typename SR , typename NUO , typename UDERO , typename IU , typename NU1 , typename NU2 , typename UDER1 , typename UDER2 >
SpParMat<IU,NUO,UDERO> Mult_AnXBn_Synch ( SpParMat< IU, NU1, UDER1 > &  A,
SpParMat< IU, NU2, UDER2 > &  B,
bool  clearA,
bool  clearB 
)
friend

◆ operator<<

template<class IT, class NT, class DER>
template<typename IU , typename NU , typename UDER >
ofstream& operator<< ( ofstream &  outfile,
const SpParMat< IU, NU, UDER > &  s 
)
friend

Definition at line 4205 of file SpParMat.cpp.

◆ SpMV [1/5]

template<class IT, class NT, class DER>
template<typename SR , typename IU , typename NUM , typename NUV , typename UDER >
FullyDistSpVec<IU,typename promote_trait<NUM,NUV>::T_promote> SpMV ( const SpParMat< IU, NUM, UDER > &  A,
const FullyDistSpVec< IU, NUV > &  x 
)
friend

: Old version that is no longer considered optimal Kept for legacy purposes To be removed when other functionals are fully tested.

Definition at line 1568 of file ParFriends.h.

◆ SpMV [2/5]

template<class IT, class NT, class DER>
template<typename SR , typename IU , typename NUM , typename NUV , typename UDER >
FullyDistVec<IU,typename promote_trait<NUM,NUV>::T_promote> SpMV ( const SpParMat< IU, NUM, UDER > &  A,
const FullyDistVec< IU, NUV > &  x 
)
friend

Parallel dense SpMV

Definition at line 1488 of file ParFriends.h.

◆ SpMV [3/5]

template<class IT, class NT, class DER>
template<typename SR , typename IU , typename NUM , typename UDER >
FullyDistSpVec<IU,typename promote_trait<NUM,IU>::T_promote> SpMV ( const SpParMat< IU, NUM, UDER > &  A,
const FullyDistSpVec< IU, IU > &  x,
bool  indexisvalue 
)
friend

Definition at line 938 of file ParFriends.h.

◆ SpMV [4/5]

template<class IT, class NT, class DER>
template<typename SR , typename IVT , typename OVT , typename IU , typename NUM , typename UDER >
void SpMV ( const SpParMat< IU, NUM, UDER > &  A,
const FullyDistSpVec< IU, IVT > &  x,
FullyDistSpVec< IU, OVT > &  y,
bool  indexisvalue 
)
friend

Definition at line 1454 of file ParFriends.h.

◆ SpMV [5/5]

template<class IT, class NT, class DER>
template<typename SR , typename IVT , typename OVT , typename IU , typename NUM , typename UDER >
void SpMV ( const SpParMat< IU, NUM, UDER > &  A,
const FullyDistSpVec< IU, IVT > &  x,
FullyDistSpVec< IU, OVT > &  y,
bool  indexisvalue,
OptBuf< int32_t, OVT > &  optbuf 
)
friend

Definition at line 1462 of file ParFriends.h.


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