42 template <
typename PARMAT>
71 struct Edge_randomizer :
public std::unary_function<std::pair<bool, float>, std::pair<bool, float>>
73 const std::pair<bool, float>
operator()(
const std::pair<bool, float> & x)
const 75 float edgeRand =
static_cast<float>(rand());
76 return std::pair<bool, float>(x.first, edgeRand);
82 static void MPI_randuniq(
void * invec,
void * inoutvec,
int * len, MPI_Datatype *datatype)
87 for (
int i=0; i<*len; i++ )
88 inoutveccast[i] = RR(inveccast[i], inoutveccast[i]);
103 if(arg1.
p < arg2.
p)
return arg1;
127 static T_promote
id(){
return -1; };
131 static T_promote
add(
const T_promote & arg1,
const T_promote & arg2)
133 cout << arg1 <<
" a " << arg2 << endl;
134 return std::max(arg1, arg2);
137 static T_promote
multiply(
const bool & arg1,
const T_promote & arg2)
139 cout << arg1 <<
" m " << arg2 << endl;
158 MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
159 MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
172 SpMV<SelectRandSRing>(
A, fringe, fringe,
false);
178 int main(
int argc,
char* argv[])
181 MPI_Init(&argc, &argv);
182 MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
183 MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
188 cout <<
"Usage: ./rpbfs <Scale>" << endl;
189 cout <<
"Example: mpirun -np 4 ./spbfs 20" << endl;
201 scale =
static_cast<unsigned>(atoi(argv[1]));
202 double initiator[4] = {.57, .19, .19, .05};
207 MPI_Barrier(MPI_COMM_WORLD);
218 ABool->
Reduce(*ColSums,
Column, plus<int64_t>(), static_cast<int64_t>(0));
219 ABool->
Reduce(*RowSums,
Row, plus<int64_t>(), static_cast<int64_t>(0));
220 ColSums->
EWiseApply(*RowSums, plus<int64_t>());
222 nonisov = ColSums->
FindInds(bind2nd(greater<int64_t>(), 0));
226 ABool->operator()(nonisov, nonisov,
true);
void SetElement(IT indx, NT numx)
Indexing is performed 0-based.
FullyDistVec< IT, NT > Reduce(Dim dim, _BinaryOperation __binary_op, NT id, _UnaryOperation __unary_op) const
static bool returnedSAID()
std::shared_ptr< CommGrid > getcommgrid() const
double cblas_alltoalltime
double cblas_transvectime
void GenGraph500Data(double initiator[4], int log_numverts, int edgefactor, bool scramble=false, bool packed=false)
static ParentType add(const ParentType &arg1, const ParentType &arg2)
FullyDistVec< IT, IT > FindInds(_Predicate pred) const
Return the indices where pred is true.
double cblas_mergeconttime
static T_promote add(const T_promote &arg1, const T_promote &arg2)
static ParentType multiply(const T_promote &arg1, const ParentType &arg2)
void EWiseApply(const FullyDistVec< IT, NT2 > &other, _BinaryOperation __binary_op, _BinaryPredicate _do_op, const bool useExtendedBinOp)
double cblas_allgathertime
void RandomParentBFS(PSpMat_Bool &Aeff)
With 50/50 chances, return a one of the operants.
double cblas_localspmvtime
void Symmetricize(PARMAT &A)
static T_promote multiply(const bool &arg1, const T_promote &arg2)
static MPI_Op MPI_BFSRAND
const std::pair< bool, float > operator()(const std::pair< bool, float > &x) const
static void axpy(T_promote a, const ParentType &x, ParentType &y)
static bool returnedSAID()
SpParMat< int64_t, bool, SpDCCols< int64_t, bool > > PSpMat_Bool
SpParMat< int64_t, int64_t, SpDCCols< int64_t, int64_t > > PSpMat_Int64
SpDCCols< IT, NT > * multiply(SpDCCols< IT, NT > &splitA, SpDCCols< IT, NT > &splitB, CCGrid &CMG, bool isBT, bool threaded)
int main(int argc, char *argv[])
SpParMat< int64_t, bool, SpDCCols< int32_t, bool > > PSpMat_s32p64