64int main(
int argc,
char* argv[])
67 MPI_Init(&argc, &argv);
68 MPI_Comm_size(MPI_COMM_WORLD,&
nprocs);
69 MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
75 cout <<
"Usage: ./MultTest <MatrixA> <MatrixB> <MatrixC> <vecX> <vecY>" << endl;
76 cout <<
"<MatrixA>,<MatrixB>,<MatrixC> are absolute addresses, and files should be in triples format" << endl;
82 string Aname(argv[1]);
83 string Bname(argv[2]);
84 string Cname(argv[3]);
85 string V1name(argv[4]);
86 string V2name(argv[5]);
88 ifstream vecinpx(V1name.c_str());
89 ifstream vecinpy(V2name.c_str());
91 MPI_Barrier(MPI_COMM_WORLD);
95 shared_ptr<CommGrid> fullWorld;
96 fullWorld.reset(
new CommGrid(MPI_COMM_WORLD, 0, 0) );
115 spx.ReadDistribute(vecinpx, 0);
117 spycontrol.ReadDistribute(vecinpy,0);
135 if (spycontrol == spy)
142 spy.ParallelWrite(
"ycontrol_sparse.txt",
true);
146 SpParMat < int64_t, double, SpCCols<int64_t,double> > ACsc (
A);
157 SpParHelper::Print(
"SpMSpV-bucket does not work correctly for general CSC matrices, go fix it!\n");
186 spx.Apply(bind1st (multiplies<double>(), 100));
190 SpMV<SR>(ABool, spxint64, spyint64,
false);
196 SpMV<SR>(ABool, spxint64, spyint64buf,
false, optbuf);
199 if (spyint64 == spyint64buf)
206 spyint64.ParallelWrite(
"Original_SpMSV.txt",
true);
207 spyint64buf.ParallelWrite(
"Buffered_SpMSV.txt",
true);
214 SpMV<SR>(ABool, spxint64, spyint64_threaded,
false);
216 if (spyint64 == spyint64_threaded)
227 SpParMat < int64_t, bool, SpCCols<int64_t,bool> > ABoolCsc (
A);
230 SpMV<SR>(ABoolCsc, spxint64, spyint64_csc_threaded,
false, SPA1);
232 if (spyint64 == spyint64_csc_threaded)
SpParMat< IU, NUO, UDERO > Mult_AnXBn_Synch(SpParMat< IU, NU1, UDERA > &A, SpParMat< IU, NU2, UDERB > &B, bool clearA=false, bool clearB=false)
SpParMat< IU, NUO, UDERO > Mult_AnXBn_DoubleBuff(SpParMat< IU, NU1, UDERA > &A, SpParMat< IU, NU2, UDERB > &B, bool clearA=false, bool clearB=false)