COMBINATORIAL_BLAS 1.6
 
Loading...
Searching...
No Matches
BlockedSpGEMM.cpp
Go to the documentation of this file.
1#include <iostream>
2#include <vector>
3
4#include "CombBLAS/CombBLAS.h"
5
6using namespace std;
7using namespace combblas;
8
9typedef int64_t IT;
10typedef double NT;
11
12
13
14int main(int argc, char* argv[])
15{
16 int nprocs, myrank;
17 MPI_Init(&argc, &argv);
20
21 if(argc < 4)
22 {
23 if(myrank == 0)
24 cout << "Usage: ./BlockedSpGEMM <MatrixA> <MatrixB> <br> <bc>" << endl;
25 MPI_Finalize();
26 return -1;
27 }
28
29
30 {
31 string Aname(argv[1]);
32 string Bname(argv[2]);
33 int br = atoi(argv[3]);
34 int bc = atoi(argv[4]);
35
38 typedef SpDCCols<IT, NT> DER;
39
41 fullWorld.reset(new CommGrid(MPI_COMM_WORLD, 0, 0));
42
44 A.ParallelReadMM(Aname, true, maximum<NT>());
45 IT nr = A.getnrow(), nc = A.getncol(), nnz = A.getnnz();
46 if (myrank == 0)
47 cout << "A " << nr << " " << nc << " " << nnz << std::endl;
48
50 B.ParallelReadMM(Bname, true, maximum<NT>());
51 nr = B.getnrow(), nc = B.getncol(), nnz = B.getnnz();
52 if (myrank == 0)
53 cout << "B " << nr << " " << nc << " " << nnz << std::endl;
54
55 // auto blocks = A.BlockSplit(br, bc);
58 while (bspgemm.hasNext())
59 {
60 auto C = bspgemm.getNextBlock<SR_PT, NT, DER>(roffset, coffset);
61 nr = C.getnrow(), nc = C.getncol(), nnz = C.getnnz();
62 if (myrank == 0)
63 cout << "block size " << nr << " " << nc << " " << nnz
64 << " offsets " << roffset << " " << coffset
65 << std::endl;
66 }
67
68 // auto C = bspgemm.getBlockId<SR_PT, NT, DER>(0, 1, roffset, coffset);
69 // nr = C.getnrow(), nc = C.getncol(), nnz = C.getnnz();
70 // if (myrank == 0)
71 // cout << "block size " << nr << " " << nc << " " << nnz
72 // << " offsets " << roffset << " " << coffset
73 // << std::endl;
74
75 }
76
77
79 return 0;
80}
int64_t IT
double NT
int main()
Definition Driver.cpp:12
Definition test.cpp:53
int nprocs
Definition comms.cpp:55
double A
double C
Definition options.h:15