54 int main(
int argc,
char* argv[])
57 MPI_Init(&argc, &argv);
58 MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
59 MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
65 cout <<
"Usage: ./Galerkin <Matrix> <S> <STranspose>" << endl;
66 cout <<
"<Matrix>,<S>,<STranspose> are absolute addresses, and files should be in triples format" << endl;
72 string Aname(argv[1]);
73 string Sname(argv[2]);
74 string STname(argv[3]);
76 MPI_Barrier(MPI_COMM_WORLD);
84 SpParHelper::Print(
"Data read\n");
90 SpParHelper::Print(
"Warmed up for DoubleBuff (right evaluate)\n");
92 MPI_Barrier(MPI_COMM_WORLD);
93 MPI_Pcontrol(1,
"SpGEMM_DoubleBuff_right");
94 double t1 = MPI_Wtime();
100 MPI_Barrier(MPI_COMM_WORLD);
101 double t2 = MPI_Wtime();
102 MPI_Pcontrol(-1,
"SpGEMM_DoubleBuff_right");
105 cout<<
"Double buffered multiplications (right evaluate) finished"<<endl;
106 printf(
"%.6lf seconds elapsed per iteration\n", (t2-t1)/(
double)ITERATIONS);
113 SpParHelper::Print(
"Warmed up for DoubleBuff (left evaluate)\n");
115 MPI_Barrier(MPI_COMM_WORLD);
116 MPI_Pcontrol(1,
"SpGEMM_DoubleBuff_left");
123 MPI_Barrier(MPI_COMM_WORLD);
125 MPI_Pcontrol(-1,
"SpGEMM_DoubleBuff_left");
128 cout<<
"Double buffered multiplications (left evaluate) finished"<<endl;
129 printf(
"%.6lf seconds elapsed per iteration\n", (t2-t1)/(
double)ITERATIONS);
137 SpParHelper::Print(
"Warmed up for Synch (right evaluate)\n");
138 MPI_Barrier(MPI_COMM_WORLD);
139 MPI_Pcontrol(1,
"SpGEMM_Synch_right");
146 MPI_Barrier(MPI_COMM_WORLD);
147 MPI_Pcontrol(-1,
"SpGEMM_Synch_right");
151 cout<<
"Synchronous multiplications (right evaluate) finished"<<endl;
152 printf(
"%.6lf seconds elapsed per iteration\n", (t2-t1)/(
double)ITERATIONS);
160 SpParHelper::Print(
"Warmed up for Synch (left evaluate)\n");
161 MPI_Barrier(MPI_COMM_WORLD);
162 MPI_Pcontrol(1,
"SpGEMM_Synch_left");
169 MPI_Barrier(MPI_COMM_WORLD);
170 MPI_Pcontrol(-1,
"SpGEMM_Synch_left");
174 cout<<
"Synchronous multiplications (left evaluate) finished"<<endl;
175 printf(
"%.6lf seconds elapsed per iteration\n", (t2-t1)/(
double)ITERATIONS);
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
int main(int argc, char *argv[])