25 #define ElementType double 28 int main(
int argc,
char* argv[])
31 MPI_Init(&argc, &argv);
32 MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
33 MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
39 cout <<
"Usage: ./MultTest <MatrixA> <MatrixB>" << endl;
40 cout <<
"<MatrixA>,<MatrixB> are absolute addresses, and files should be in triples format" << endl;
46 string Aname(argv[1]);
47 string Bname(argv[2]);
55 SpParHelper::Print(
"Data read\n");
61 tinfo <<
"C has a total of " << cnnz <<
" nonzeros" << endl;
62 SpParHelper::Print(tinfo.str());
63 SpParHelper::Print(
"Warmed up for DoubleBuff\n");
66 MPI_Barrier(MPI_COMM_WORLD);
67 MPI_Pcontrol(1,
"SpGEMM_DoubleBuff");
68 double t1 = MPI_Wtime();
73 MPI_Barrier(MPI_COMM_WORLD);
74 double t2 = MPI_Wtime();
75 MPI_Pcontrol(-1,
"SpGEMM_DoubleBuff");
78 cout<<
"Double buffered multiplications finished"<<endl;
79 printf(
"%.6lf seconds elapsed per iteration\n", (t2-t1)/(
double)ITERATIONS);
86 SpParHelper::Print(
"Warmed up for Synch\n");
87 MPI_Barrier(MPI_COMM_WORLD);
88 MPI_Pcontrol(1,
"SpGEMM_Synch");
94 MPI_Barrier(MPI_COMM_WORLD);
95 MPI_Pcontrol(-1,
"SpGEMM_Synch");
99 cout<<
"Synchronous multiplications finished"<<endl;
100 printf(
"%.6lf seconds elapsed per iteration\n", (t2-t1)/(
double)ITERATIONS);
int main(int argc, char *argv[])
void ReadDistribute(const std::string &filename, int master, bool nonum, HANDLER handler, bool transpose=false, bool pario=false)
SpDCCols< int, NT > DCCols
SpParMat< int, NT, DCCols > MPI_DCCols