8 #include "../CombBLAS.h"
15 int main(
int argc,
char* argv[])
18 MPI_Init(&argc, &argv);
19 MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
20 MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
26 cout <<
"Usage: ./IndexingTiming <Scale>" << endl;
34 double initiator[4] = {.6, .4/3, .4/3, .4/3};
37 int scale =
static_cast<unsigned>(atoi(argv[1]));
38 ostringstream outs, outs2, outs3;
39 outs <<
"Forcing scale to : " << scale << endl;
45 A =
new PARDBMAT(*DEL,
false);
49 float balance = A->LoadImbalance();
50 outs2 <<
"Load balance: " << balance << endl;
54 for(
unsigned i=1; i<4; i++)
58 B =
new PARDBMAT(*DEL,
false);
63 perm.
iota(A->getnrow(), 0);
68 sel.
iota(B->getnrow(), 0);
72 A->SpAsgn(perm,perm,*B);
75 double t1 = MPI_Wtime();
78 A->SpAsgn(perm,perm,*B);
80 double t2 = MPI_Wtime();
84 cout<<
"Scale " << scale-i <<
" assignment iterations finished"<<endl;
85 printf(
"%.6lf seconds elapsed per iteration\n", (t2-t1)/(
double)ITERATIONS);