36 #include "../CombBLAS.h"
53 int main(
int argc,
char* argv[])
56 MPI_Init(&argc, &argv);
57 MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
58 MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
64 cout <<
"Usage: ./Galerkin <Matrix> <S> <STranspose>" << endl;
65 cout <<
"<Matrix>,<S>,<STranspose> are absolute addresses, and files should be in triples format" << endl;
71 string Aname(argv[1]);
72 string Sname(argv[2]);
73 string STname(argv[3]);
75 ifstream inputA(Aname.c_str());
76 ifstream inputS(Sname.c_str());
77 ifstream inputST(STname.c_str());
79 MPI_Barrier(MPI_COMM_WORLD);
95 MPI_Barrier(MPI_COMM_WORLD);
96 MPI_Pcontrol(1,
"SpGEMM_DoubleBuff_right");
97 double t1 = MPI_Wtime();
103 MPI_Barrier(MPI_COMM_WORLD);
104 double t2 = MPI_Wtime();
105 MPI_Pcontrol(-1,
"SpGEMM_DoubleBuff_right");
108 cout<<
"Double buffered multiplications (right evaluate) finished"<<endl;
109 printf(
"%.6lf seconds elapsed per iteration\n", (t2-t1)/(
double)ITERATIONS);
118 MPI_Barrier(MPI_COMM_WORLD);
119 MPI_Pcontrol(1,
"SpGEMM_DoubleBuff_left");
126 MPI_Barrier(MPI_COMM_WORLD);
128 MPI_Pcontrol(-1,
"SpGEMM_DoubleBuff_left");
131 cout<<
"Double buffered multiplications (left evaluate) finished"<<endl;
132 printf(
"%.6lf seconds elapsed per iteration\n", (t2-t1)/(
double)ITERATIONS);
141 MPI_Barrier(MPI_COMM_WORLD);
142 MPI_Pcontrol(1,
"SpGEMM_Synch_right");
149 MPI_Barrier(MPI_COMM_WORLD);
150 MPI_Pcontrol(-1,
"SpGEMM_Synch_right");
154 cout<<
"Synchronous multiplications (right evaluate) finished"<<endl;
155 printf(
"%.6lf seconds elapsed per iteration\n", (t2-t1)/(
double)ITERATIONS);
164 MPI_Barrier(MPI_COMM_WORLD);
165 MPI_Pcontrol(1,
"SpGEMM_Synch_left");
172 MPI_Barrier(MPI_COMM_WORLD);
173 MPI_Pcontrol(-1,
"SpGEMM_Synch_left");
177 cout<<
"Synchronous multiplications (left evaluate) finished"<<endl;
178 printf(
"%.6lf seconds elapsed per iteration\n", (t2-t1)/(
double)ITERATIONS);