29#include "CombBLAS/CombBLAS.h"
44bool from_string(T & t,
const string& s, std::ios_base& (*f)(std::ios_base&))
47 return !(iss >> f >> t).fail();
51template <
typename PARMAT>
62int main(
int argc,
char* argv[])
66 int provided, flag, claimed;
67 MPI_Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &provided );
68 MPI_Is_thread_main( &flag );
70 SpParHelper::Print(
"This thread called init_thread but Is_thread_main gave false\n");
71 MPI_Query_thread( &claimed );
72 if (claimed != provided)
73 SpParHelper::Print(
"Query thread gave different thread level than requested\n");
75 MPI_Init(&argc, &argv);
78 MPI_Comm_size(MPI_COMM_WORLD,&
nprocs);
79 MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
84 cout <<
"Usage: ./genwritemat <Scale> <Edgefactor> <Symmetricize> <outputname>" << endl;
85 cout <<
"Example: ./genwritemat 25 16 1 scale25_ef16_symmetric.mtx" << endl;
91 unsigned scale =
static_cast<unsigned>(atoi(argv[1]));
92 unsigned edgefactor =
static_cast<unsigned>(atoi(argv[2]));
93 int symmetric =
static_cast<unsigned>(atoi(argv[3]));
96 double initiator[4] = {.57, .19, .19, .05};
98 double t01 = MPI_Wtime();
102 SpParHelper::Print(
"Generated renamed edge lists\n");
105 tinfo <<
"Generation took " << t02-t01 <<
" seconds" << endl;
106 SpParHelper::Print(tinfo.str());
112 SpParHelper::Print(
"Created Sparse Matrix (with int32 local indices and values)\n");
115 ostringstream loopinfo;
116 loopinfo <<
"Removed " << removed <<
" loops" << endl;
117 SpParHelper::Print(loopinfo.str());
123 SpParHelper::Print(
"Symmetricized\n");
128 outs <<
"Load balance: " << balance << endl;
129 SpParHelper::Print(outs.str());
int main(int argc, char *argv[])
void Symmetricize(PARMAT &A)
bool from_string(T &t, const string &s, std::ios_base &(*f)(std::ios_base &))
SpParMat< int64_t, int, SpDCCols< int32_t, int > > PSpMat_s32p64_Int
void GenGraph500Data(double initiator[4], int log_numverts, int edgefactor, bool scramble=false, bool packed=false)
float LoadImbalance() const
void ParallelWriteMM(const std::string &filename, bool onebased, HANDLER handler)