#include <FullyDistSpVec.h>
Classes | |
class | retTrue |
class | ScalarReadSaveHandler |
Public Member Functions | |
FullyDistVec () | |
FullyDistVec (IT globallen, NT initval) | |
FullyDistVec (std::shared_ptr< CommGrid > grid) | |
FullyDistVec (std::shared_ptr< CommGrid > grid, IT globallen, NT initval) | |
FullyDistVec (const FullyDistSpVec< IT, NT > &rhs) | |
FullyDistVec (const std::vector< NT > &fillarr, std::shared_ptr< CommGrid > grid) | |
template<class ITRHS , class NTRHS > | |
FullyDistVec (const FullyDistVec< ITRHS, NTRHS > &rhs) | |
template<class HANDLER > | |
void | ParallelWrite (const std::string &filename, bool onebased, HANDLER handler, bool includeindices=true) |
void | ParallelWrite (const std::string &filename, bool onebased, bool includeindices=true) |
template<typename _BinaryOperation > | |
void | ParallelRead (const std::string &filename, bool onebased, _BinaryOperation BinOp) |
template<class HANDLER > | |
std::ifstream & | ReadDistribute (std::ifstream &infile, int master, HANDLER handler) |
std::ifstream & | ReadDistribute (std::ifstream &infile, int master) |
template<class HANDLER > | |
void | SaveGathered (std::ofstream &outfile, int master, HANDLER handler, bool printProcSplits=false) |
void | SaveGathered (std::ofstream &outfile, int master) |
template<class ITRHS , class NTRHS > | |
FullyDistVec< IT, NT > & | operator= (const FullyDistVec< ITRHS, NTRHS > &rhs) |
FullyDistVec< IT, NT > & | operator= (const FullyDistVec< IT, NT > &rhs) |
Actual assignment operator. More... | |
FullyDistVec< IT, NT > & | operator= (const FullyDistSpVec< IT, NT > &rhs) |
FullyDistSpVec->FullyDistVec conversion operator. More... | |
FullyDistVec< IT, NT > & | operator= (NT fixedval) |
FullyDistVec< IT, NT > | operator() (const FullyDistVec< IT, IT > &ri) const |
FullyDistVec< IT, NT > & | operator+= (const FullyDistSpVec< IT, NT > &rhs) |
FullyDistVec< IT, NT > & | operator+= (const FullyDistVec< IT, NT > &rhs) |
FullyDistVec< IT, NT > & | operator-= (const FullyDistSpVec< IT, NT > &rhs) |
FullyDistVec< IT, NT > & | operator-= (const FullyDistVec< IT, NT > &rhs) |
bool | operator== (const FullyDistVec< IT, NT > &rhs) const |
void | SetElement (IT indx, NT numx) |
void | SetLocalElement (IT index, NT value) |
NT | GetElement (IT indx) const |
NT | operator[] (IT indx) const |
void | Set (const FullyDistSpVec< IT, NT > &rhs) |
template<class NT1 , typename _BinaryOperationIdx , typename _BinaryOperationVal > | |
void | GSet (const FullyDistSpVec< IT, NT1 > &spVec, _BinaryOperationIdx __binopIdx, _BinaryOperationVal __binopVal, MPI_Win win) |
template<class NT1 , typename _BinaryOperationIdx > | |
FullyDistSpVec< IT, NT > | GGet (const FullyDistSpVec< IT, NT1 > &spVec, _BinaryOperationIdx __binopIdx, NT nullValue) |
void | iota (IT globalsize, NT first) |
void | RandPerm () |
FullyDistVec< IT, IT > | sort () |
IT | LocArrSize () const |
const NT * | GetLocArr () const |
template<typename _Predicate > | |
FullyDistSpVec< IT, NT > | Find (_Predicate pred) const |
Return the elements for which pred is true. More... | |
FullyDistSpVec< IT, NT > | Find (NT val) const |
Return the elements val is found. More... | |
template<typename _Predicate > | |
FullyDistVec< IT, IT > | FindInds (_Predicate pred) const |
Return the indices where pred is true. More... | |
template<typename _Predicate > | |
IT | Count (_Predicate pred) const |
Return the number of elements for which pred is true. More... | |
template<typename _UnaryOperation > | |
void | Apply (_UnaryOperation __unary_op) |
template<typename _BinaryOperation > | |
void | ApplyInd (_BinaryOperation __binary_op) |
template<typename _UnaryOperation , typename IRRELEVANT_NT > | |
void | Apply (_UnaryOperation __unary_op, const FullyDistSpVec< IT, IRRELEVANT_NT > &mask) |
template<typename _BinaryOperation , typename _BinaryPredicate , class NT2 > | |
void | EWiseApply (const FullyDistVec< IT, NT2 > &other, _BinaryOperation __binary_op, _BinaryPredicate _do_op, const bool useExtendedBinOp) |
template<typename _BinaryOperation , typename _BinaryPredicate , class NT2 > | |
void | EWiseApply (const FullyDistSpVec< IT, NT2 > &other, _BinaryOperation __binary_op, _BinaryPredicate _do_op, bool applyNulls, NT2 nullValue, const bool useExtendedBinOp) |
template<typename _BinaryOperation , typename _BinaryPredicate , class NT2 > | |
void | EWiseApply (const FullyDistVec< IT, NT2 > &other, _BinaryOperation __binary_op, _BinaryPredicate _do_op) |
template<typename _BinaryOperation , typename _BinaryPredicate , class NT2 > | |
void | EWiseApply (const FullyDistSpVec< IT, NT2 > &other, _BinaryOperation __binary_op, _BinaryPredicate _do_op, bool applyNulls, NT2 nullValue) |
template<typename _BinaryOperation , class NT2 > | |
void | EWiseApply (const FullyDistVec< IT, NT2 > &other, _BinaryOperation __binary_op) |
template<typename _BinaryOperation , class NT2 > | |
void | EWiseApply (const FullyDistSpVec< IT, NT2 > &other, _BinaryOperation __binary_op, bool applyNulls, NT2 nullValue) |
void | PrintToFile (std::string prefix) |
void | PrintInfo (std::string vectorname) const |
void | DebugPrint () |
std::shared_ptr< CommGrid > | getcommgrid () const |
std::pair< IT, NT > | MinElement () const |
template<typename _BinaryOperation > | |
NT | Reduce (_BinaryOperation __binary_op, NT identity) const |
template<typename OUT , typename _BinaryOperation , typename _UnaryOperation > | |
OUT | Reduce (_BinaryOperation __binary_op, OUT default_val, _UnaryOperation __unary_op) const |
Reduce can be used to implement max_element, for instance. More... | |
void | SelectCandidates (double nver) |
ABAB: Put concept check, NT should be integer for this to make sense. More... | |
template<typename _BinaryOperation , typename OUT = typename std::result_of<_BinaryOperation&(NT,NT)>::type> | |
void | EWiseOut (const FullyDistVec< IT, NT > &rhs, _BinaryOperation __binary_op, FullyDistVec< IT, OUT > &result) |
Friends | |
template<class IU , class NU > | |
class | DenseParMat |
template<class IU , class NU , class UDER > | |
class | SpParMat |
template<class IU , class NU > | |
class | FullyDistVec |
template<class IU , class NU > | |
class | FullyDistSpVec |
template<class IU , class NU > | |
class | DenseVectorLocalIterator |
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 IU , typename NU1 , typename NU2 > | |
FullyDistSpVec< IU, typename promote_trait< NU1, NU2 >::T_promote > | EWiseMult (const FullyDistSpVec< IU, NU1 > &V, const FullyDistVec< IU, NU2 > &W, bool exclude, NU2 zero) |
template<typename IU , typename NU1 , typename NU2 , typename _BinaryOperation > | |
FullyDistSpVec< IU, typename promote_trait< NU1, NU2 >::T_promote > | EWiseApply (const FullyDistSpVec< IU, NU1 > &V, const FullyDistVec< IU, NU2 > &W, _BinaryOperation _binary_op, typename promote_trait< NU1, NU2 >::T_promote zero) |
template<typename RET , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation , typename _BinaryPredicate > | |
FullyDistSpVec< IU, RET > | EWiseApply (const FullyDistSpVec< IU, NU1 > &V, const FullyDistVec< IU, NU2 > &W, _BinaryOperation _binary_op, _BinaryPredicate _doOp, bool allowVNulls, NU1 Vzero, const bool useExtendedBinOp) |
template<typename RET , typename IU , typename NU1 , typename NU2 , typename _BinaryOperation , typename _BinaryPredicate > | |
FullyDistSpVec< IU, RET > | EWiseApply_threaded (const FullyDistSpVec< IU, NU1 > &V, const FullyDistVec< IU, NU2 > &W, _BinaryOperation _binary_op, _BinaryPredicate _doOp, bool allowVNulls, NU1 Vzero, const bool useExtendedBinOp) |
template<typename IU > | |
void | RenameVertices (DistEdgeList< IU > &DEL) |
template<typename IU , typename NU > | |
FullyDistVec< IU, NU > | Concatenate (std::vector< FullyDistVec< IU, NU > > &vecs) |
template<typename IU , typename NU > | |
void | Augment (FullyDistVec< int64_t, int64_t > &mateRow2Col, FullyDistVec< int64_t, int64_t > &mateCol2Row, FullyDistVec< int64_t, int64_t > &parentsRow, FullyDistVec< int64_t, int64_t > &leaves) |
template<class IU , class DER > | |
SpParMat< IU, bool, DER > | PermMat (const FullyDistVec< IU, IU > &ri, const IU ncol) |
void | maximumMatching (SpParMat< int64_t, bool, SpDCCols< int64_t, bool > > &A, FullyDistVec< int64_t, int64_t > &mateRow2Col, FullyDistVec< int64_t, int64_t > &mateCol2Row) |
Definition at line 53 of file FullyDistSpVec.h.
combblas::FullyDistVec< IT, NT >::FullyDistVec | ( | ) |
Definition at line 36 of file FullyDistVec.cpp.
combblas::FullyDistVec< IT, NT >::FullyDistVec | ( | IT | globallen, |
NT | initval | ||
) |
Definition at line 42 of file FullyDistVec.cpp.
combblas::FullyDistVec< IT, NT >::FullyDistVec | ( | std::shared_ptr< CommGrid > | grid | ) |
Definition at line 50 of file FullyDistVec.cpp.
combblas::FullyDistVec< IT, NT >::FullyDistVec | ( | std::shared_ptr< CommGrid > | grid, |
IT | globallen, | ||
NT | initval | ||
) |
Definition at line 55 of file FullyDistVec.cpp.
combblas::FullyDistVec< IT, NT >::FullyDistVec | ( | const FullyDistSpVec< IT, NT > & | rhs | ) |
Definition at line 62 of file FullyDistVec.cpp.
combblas::FullyDistVec< IT, NT >::FullyDistVec | ( | const std::vector< NT > & | fillarr, |
std::shared_ptr< CommGrid > | grid | ||
) |
Initialize a FullyDistVec with a separate vector from each processor Optimizes for the common case where all fillarr's in separate processors are of the same size
Definition at line 87 of file FullyDistVec.cpp.
combblas::FullyDistVec< IT, NT >::FullyDistVec | ( | const FullyDistVec< ITRHS, NTRHS > & | rhs | ) |
Definition at line 71 of file FullyDistVec.cpp.
|
inline |
Definition at line 182 of file FullyDistVec.h.
void combblas::FullyDistVec< IT, NT >::Apply | ( | _UnaryOperation | __unary_op, |
const FullyDistSpVec< IT, IRRELEVANT_NT > & | mask | ||
) |
Definition at line 646 of file FullyDistVec.cpp.
|
inline |
Definition at line 188 of file FullyDistVec.h.
IT combblas::FullyDistVec< IT, NT >::Count | ( | _Predicate | pred | ) | const |
Return the number of elements for which pred is true.
Definition at line 393 of file FullyDistVec.cpp.
void combblas::FullyDistVec< IT, NT >::DebugPrint | ( | ) |
Definition at line 592 of file FullyDistVec.cpp.
void combblas::FullyDistVec< IT, NT >::EWiseApply | ( | const FullyDistVec< IT, NT2 > & | other, |
_BinaryOperation | __binary_op, | ||
_BinaryPredicate | _do_op, | ||
const bool | useExtendedBinOp | ||
) |
Definition at line 658 of file FullyDistVec.cpp.
void combblas::FullyDistVec< IT, NT >::EWiseApply | ( | const FullyDistSpVec< IT, NT2 > & | other, |
_BinaryOperation | __binary_op, | ||
_BinaryPredicate | _do_op, | ||
bool | applyNulls, | ||
NT2 | nullValue, | ||
const bool | useExtendedBinOp | ||
) |
Definition at line 696 of file FullyDistVec.cpp.
|
inline |
Definition at line 209 of file FullyDistVec.h.
|
inline |
Definition at line 217 of file FullyDistVec.h.
|
inline |
Definition at line 236 of file FullyDistVec.h.
|
inline |
Definition at line 241 of file FullyDistVec.h.
void combblas::FullyDistVec< IT, NT >::EWiseOut | ( | const FullyDistVec< IT, NT > & | rhs, |
_BinaryOperation | __binary_op, | ||
FullyDistVec< IT, OUT > & | result | ||
) |
Perform __binary_op(*this[i], rhs[i]) for every element in rhs and *this, which are of the same size. write the result output vector, hence the name EWiseOut
Definition at line 338 of file FullyDistVec.cpp.
FullyDistSpVec< IT, NT > combblas::FullyDistVec< IT, NT >::Find | ( | _Predicate | pred | ) | const |
Return the elements for which pred is true.
Requires no communication because FullyDistSpVec (the return object) is distributed based on length, not nonzero counts
Definition at line 469 of file FullyDistVec.cpp.
FullyDistSpVec< IT, NT > combblas::FullyDistVec< IT, NT >::Find | ( | NT | val | ) | const |
Return the elements val is found.
Retain a sparse vector with indices where the supplied value is found.
Definition at line 488 of file FullyDistVec.cpp.
FullyDistVec< IT, IT > combblas::FullyDistVec< IT, NT >::FindInds | ( | _Predicate | pred | ) | const |
Return the indices where pred is true.
Returns a dense vector of global indices for which the predicate is satisfied
Definition at line 405 of file FullyDistVec.cpp.
|
inline |
Definition at line 257 of file FullyDistVec.h.
NT combblas::FullyDistVec< IT, NT >::GetElement | ( | IT | indx | ) | const |
Definition at line 554 of file FullyDistVec.cpp.
|
inline |
Definition at line 167 of file FullyDistVec.h.
FullyDistSpVec< IT, NT > combblas::FullyDistVec< IT, NT >::GGet | ( | const FullyDistSpVec< IT, NT1 > & | spVec, |
_BinaryOperationIdx | __binopIdx, | ||
NT | nullValue | ||
) |
Definition at line 1148 of file FullyDistVec.cpp.
void combblas::FullyDistVec< IT, NT >::GSet | ( | const FullyDistSpVec< IT, NT1 > & | spVec, |
_BinaryOperationIdx | __binopIdx, | ||
_BinaryOperationVal | __binopVal, | ||
MPI_Win | win | ||
) |
Definition at line 1076 of file FullyDistVec.cpp.
void combblas::FullyDistVec< IT, NT >::iota | ( | IT | globalsize, |
NT | first | ||
) |
Definition at line 928 of file FullyDistVec.cpp.
|
inline |
Definition at line 165 of file FullyDistVec.h.
std::pair< IT, NT > combblas::FullyDistVec< IT, NT >::MinElement | ( | ) | const |
Definition at line 148 of file FullyDistVec.cpp.
FullyDistVec< IT, NT > combblas::FullyDistVec< IT, NT >::operator() | ( | const FullyDistVec< IT, IT > & | ri | ) | const |
Definition at line 938 of file FullyDistVec.cpp.
FullyDistVec< IT, NT > & combblas::FullyDistVec< IT, NT >::operator+= | ( | const FullyDistSpVec< IT, NT > & | rhs | ) |
Let the compiler create an assignment operator and call base class' assignment operator automatically
Definition at line 291 of file FullyDistVec.cpp.
FullyDistVec< IT, NT > & combblas::FullyDistVec< IT, NT >::operator+= | ( | const FullyDistVec< IT, NT > & | rhs | ) |
Definition at line 345 of file FullyDistVec.cpp.
FullyDistVec< IT, NT > & combblas::FullyDistVec< IT, NT >::operator-= | ( | const FullyDistSpVec< IT, NT > & | rhs | ) |
Definition at line 310 of file FullyDistVec.cpp.
FullyDistVec< IT, NT > & combblas::FullyDistVec< IT, NT >::operator-= | ( | const FullyDistVec< IT, NT > & | rhs | ) |
Definition at line 363 of file FullyDistVec.cpp.
FullyDistVec< IT, NT > & combblas::FullyDistVec< IT, NT >::operator= | ( | const FullyDistVec< ITRHS, NTRHS > & | rhs | ) |
Definition at line 237 of file FullyDistVec.cpp.
FullyDistVec< IT, NT > & combblas::FullyDistVec< IT, NT >::operator= | ( | const FullyDistVec< IT, NT > & | rhs | ) |
Actual assignment operator.
Definition at line 255 of file FullyDistVec.cpp.
FullyDistVec< IT, NT > & combblas::FullyDistVec< IT, NT >::operator= | ( | const FullyDistSpVec< IT, NT > & | rhs | ) |
FullyDistSpVec->FullyDistVec conversion operator.
Definition at line 266 of file FullyDistVec.cpp.
|
inline |
Definition at line 126 of file FullyDistVec.h.
bool combblas::FullyDistVec< IT, NT >::operator== | ( | const FullyDistVec< IT, NT > & | rhs | ) | const |
Definition at line 381 of file FullyDistVec.cpp.
|
inline |
Definition at line 146 of file FullyDistVec.h.
|
inline |
Definition at line 105 of file FullyDistVec.h.
|
inline |
Definition at line 96 of file FullyDistVec.h.
|
inline |
Definition at line 101 of file FullyDistVec.h.
void combblas::FullyDistVec< IT, NT >::PrintInfo | ( | std::string | vectorname | ) | const |
Definition at line 1028 of file FullyDistVec.cpp.
|
inline |
Definition at line 246 of file FullyDistVec.h.
void combblas::FullyDistVec< IT, NT >::RandPerm | ( | ) |
Definition at line 795 of file FullyDistVec.cpp.
std::ifstream & combblas::FullyDistVec< IT, NT >::ReadDistribute | ( | std::ifstream & | infile, |
int | master, | ||
HANDLER | handler | ||
) |
Definition at line 507 of file FullyDistVec.cpp.
|
inline |
Definition at line 114 of file FullyDistVec.h.
NT combblas::FullyDistVec< IT, NT >::Reduce | ( | _BinaryOperation | __binary_op, |
NT | identity | ||
) | const |
Definition at line 171 of file FullyDistVec.cpp.
OUT combblas::FullyDistVec< IT, NT >::Reduce | ( | _BinaryOperation | __binary_op, |
OUT | default_val, | ||
_UnaryOperation | __unary_op | ||
) | const |
Reduce can be used to implement max_element, for instance.
Definition at line 183 of file FullyDistVec.cpp.
void combblas::FullyDistVec< IT, NT >::SaveGathered | ( | std::ofstream & | outfile, |
int | master, | ||
HANDLER | handler, | ||
bool | printProcSplits = false |
||
) |
Definition at line 518 of file FullyDistVec.cpp.
|
inline |
Definition at line 118 of file FullyDistVec.h.
void combblas::FullyDistVec< IT, NT >::SelectCandidates | ( | double | nver | ) |
ABAB: Put concept check, NT should be integer for this to make sense.
Definition at line 208 of file FullyDistVec.cpp.
void combblas::FullyDistVec< IT, NT >::Set | ( | const FullyDistSpVec< IT, NT > & | rhs | ) |
Definition at line 1040 of file FullyDistVec.cpp.
void combblas::FullyDistVec< IT, NT >::SetElement | ( | IT | indx, |
NT | numx | ||
) |
Definition at line 525 of file FullyDistVec.cpp.
|
inline |
Definition at line 144 of file FullyDistVec.h.
FullyDistVec< IT, IT > combblas::FullyDistVec< IT, NT >::sort | ( | ) |
Definition at line 758 of file FullyDistVec.cpp.
|
friend |
|
friend |
Definition at line 283 of file FullyDistVec.h.
|
friend |
Definition at line 295 of file FullyDistVec.h.
|
friend |
|
friend |
Performs an arbitrary binary operation _binary_op on the corresponding elements of two vectors with the result stored in a return vector ret. The binary operatiation is only performed if the binary predicate _doOp returns true for those elements. Otherwise the binary operation is not performed and ret does not contain an element at that position. More formally the operation is defined as: if (_doOp(V[i], W[i])) ret[i] = _binary_op(V[i], W[i]) else // ret[i] is not set Hence _doOp can be used to implement a filter on either of the vectors.
The above is only defined if both V[i] and W[i] exist (i.e. an intersection). To allow a union operation (ex. when V[i] doesn't exist but W[i] does) the allowVNulls flag is set to true and the Vzero argument is used as the missing V[i] value.
The type of each element of ret must not necessarily be related to the types of V or W, so the return type must be explicitly specified as a template parameter: FullyDistSpVec<int, double> r = EWiseApply<double>(V, W, plus, retTrue, false, 0)
Definition at line 2127 of file ParFriends.h.
|
friend |
Threaded EWiseApply. Only called internally from EWiseApply.
Definition at line 1981 of file ParFriends.h.
|
friend |
if exclude is true, then we prune all entries W[i] != zero from V if exclude is false, then we perform a proper elementwise multiplication
Definition at line 1892 of file ParFriends.h.
Definition at line 292 of file FullyDistVec.h.
Definition at line 289 of file FullyDistVec.h.
|
friend |
|
friend |
|
friend |
Rename vertices globally. You first need to do create a random permutation distributed on all processors. Then the p round robin algorithm will do the renaming: For all processors P(i,i) Broadcast local_p to all p processors For j= i*N/p to min((i+1)*N/p, N) Rename the all j's with local_p(j) inside the edgelist (and mark them "renamed" so that yeach vertex id is renamed only once)
Definition at line 364 of file DistEdgeList.cpp.
|
friend |
Parallel dense SpMV
Definition at line 1595 of file ParFriends.h.
|
friend |
Definition at line 286 of file FullyDistVec.h.