36 #include "CombBLAS/CombBLAS.h"
52 int main(
int argc,
char* argv[])
55 MPI_Init(&argc, &argv);
56 MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
57 MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
63 cout <<
"Usage: ./ReduceTest <MatrixA> <SumColumns> <SumRows>" << endl;
64 cout <<
"<Matrix>,<SumColumns>,<SumRows> are absolute addresses, and files should be in triples format" << endl;
70 string Aname(argv[1]);
71 string Bname(argv[2]);
72 string Cname(argv[3]);
74 ifstream inputB(Bname.c_str());
75 ifstream inputC(Cname.c_str());
76 MPI_Barrier(MPI_COMM_WORLD);
78 shared_ptr<CommGrid> fullWorld;
79 fullWorld.reset(
new CommGrid(MPI_COMM_WORLD, 0, 0) );
85 A.ReadDistribute(Aname, 0);
91 A.Reduce(rowsums_control,
Row, std::plus<double>() , 0.0);
92 A.Reduce(colsums_control,
Column, std::plus<double>() , 0.0);
94 if (rowsums_control == rowsums && colsums_control == colsums)
96 SpParHelper::Print(
"Reduction via summation working correctly\n");
100 SpParHelper::Print(
"ERROR in Reduce via summation, go fix it!\n");
int main(int argc, char *argv[])
SpParMat< int, NT, DCCols > MPI_DCCols
SpDCCols< int, NT > DCCols
std::ifstream & ReadDistribute(std::ifstream &infile, int master, HANDLER handler)