1#ifndef _SPLIT_MAT_DIST_H_
2#define _SPLIT_MAT_DIST_H_
15#ifndef __STDC_CONSTANT_MACROS
16#define __STDC_CONSTANT_MACROS
18#ifndef __STDC_LIMIT_MACROS
19#define __STDC_LIMIT_MACROS
23#include "CombBLAS/CombBLAS.h"
29template <
typename NT,
typename IT>
34 if(
CMG.layer_grid == 0)
43 std::ostringstream
tinfo;
45 tinfo <<
"Reader took " <<
t02-
t01 <<
" seconds" << std::endl;
51 if(
A->getnrow() ==
A->getncol())
53 if(p.TotalLength()!=
A->getnrow())
56 p.iota(
A->getnrow(), 0);
72 std::ostringstream
outs;
73 outs <<
"Input load balance: " <<
balance << std::endl;
82template<
typename IT,
typename NT>
88 if(
CMG.layer_grid == 0)
92 std::ostringstream
minfo;
94 minfo <<
"Started Generation of scale "<<
scale << std::endl;
95 minfo <<
"Using " <<
nprocs <<
" MPI processes" << std::endl;
101 std::ostringstream
tinfo;
103 tinfo <<
"Generation took " <<
t02-
t01 <<
" seconds" << std::endl;
118 p.iota(
A->getnrow(), 0);
121 std::ostringstream
tinfo1;
129 std::ostringstream
outs;
143template <
typename IT,
typename NT>
148 std::vector< SpDCCols<IT, NT> >
partsmat;
150 if(
CMG.layer_grid == 0)
156 for(
int i=0; i<
nparts; ++i)
173 if(
CMG.layer_grid == 0)
180 for(
unsigned int i=0; i<
arrinfo.indarrs.size(); ++i)
185 for(
unsigned int i=0; i<
arrinfo.numarrs.size(); ++i)
197 for(
unsigned int i=0; i<
arrinfo.indarrs.size(); ++i)
201 for(
unsigned int i=0; i<
arrinfo.numarrs.size(); ++i)
209 std::ostringstream
tinfo;
210 tinfo <<
"Matrix split and distributed along layers: time " <<
MPI_Wtime()-
t01 <<
" seconds" << std::endl;
void GenGraph500Data(double initiator[4], int log_numverts, int edgefactor, bool scramble=false, bool packed=false)
std::shared_ptr< CommGrid > commGrid
static void Print(const std::string &s)
SpDCCols< IT, NT > * ReadMat(std::string filename, CCGrid &CMG, bool permute, FullyDistVec< IT, IT > &p)
void SplitMat(CCGrid &CMG, SpDCCols< IT, NT > *localmat, SpDCCols< IT, NT > &splitmat, bool rowsplit=false)
SpDCCols< IT, NT > * GenMat(CCGrid &CMG, unsigned scale, unsigned EDGEFACTOR, double initiator[4], bool permute)