40 int main(
int argc,
char* argv[])
43 MPI_Init(&argc, &argv);
44 MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
45 MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
51 cout <<
"Usage: ./IteratorTest <BASEADDRESS> <Matrix>" << endl;
52 cout <<
"Input file <Matrix> should be under <BASEADDRESS> in triples format" << endl;
58 string directory(argv[1]);
60 name = directory+
"/"+name;
63 shared_ptr<CommGrid> fullWorld;
64 fullWorld.reset(
new CommGrid(MPI_COMM_WORLD, 0, 0) );
67 A.ReadDistribute(name, 0);
80 MPI_Allreduce( &count, &total, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
82 if(total == A.getnnz())
83 SpParHelper::Print(
"Iteration passed soft test\n");
85 SpParHelper::Print(
"Iteration failed !!!\n") ;
Iterate over (sparse) columns of the sparse matrix.
int main(int argc, char *argv[])
Iterate over the nonzeros of the sparse column.