11#include "CombBLAS/CombBLAS.h"
99 cout <<
"ncol nrows nedges deg \n";
116 cout <<
"\n-------------- usage --------------\n";
117 cout <<
"Usage (random matrix): ./bpmm <er|g500|ssca> <Scale> <EDGEFACTOR> <init><diropt><prune><graft>\n";
118 cout <<
"Usage (input matrix): ./bpmm <input> <matrix> <init><diropt><prune><graft>\n\n";
120 cout <<
" \n-------------- meaning of arguments ----------\n";
121 cout <<
"** er: Erdos-Renyi, g500: Graph500 benchmark, ssca: SSCA benchmark\n";
122 cout <<
"** scale: matrix dimention is 2^scale\n";
123 cout <<
"** edgefactor: average degree of vertices\n";
124 cout <<
"** (optional) init : maximal matching algorithm used to initialize\n ";
125 cout <<
" none: noinit, greedy: greedy init , ks: Karp-Sipser, dmd: dynamic mindegree\n";
126 cout <<
" default: none\n";
127 cout <<
"** (optional) randMaximal: random parent selection in greedy/Karp-Sipser\n" ;
129 cout <<
"** (optional) prune: discard trees as soon as an augmenting path is found\n" ;
131 cout <<
"** (optional) moreSplit: more splitting of Matrix.\n" ;
132 cout <<
"** (optional) randPerm: Randomly permute the matrix for load balance.\n" ;
133 cout <<
"** (optional) saveMatching: Save the matching vector in a file (filename: inputfile_matching.txt).\n" ;
134 cout <<
"(order of optional arguments does not matter)\n";
137 cout <<
" \n-------------- examples ----------\n";
138 cout <<
"Example: mpirun -np 4 ./bpmm g500 18 16" <<
endl;
139 cout <<
"Example: mpirun -np 4 ./bpmm g500 18 16 ks diropt graft" <<
endl;
140 cout <<
"Example: mpirun -np 4 ./bpmm input cage12.mtx randPerm ks diropt graft\n" <<
endl;
147 for(
int i=0; i<
argc; i++)
152 if(
allArg.find(
"prune")!=string::npos)
154 if(
allArg.find(
"fewexp")!=string::npos)
156 if(
allArg.find(
"moreSplit")!=string::npos)
158 if(
allArg.find(
"saveMatching")!=string::npos)
160 if(
allArg.find(
"randMM")!=string::npos)
162 if(
allArg.find(
"randMaximal")!=string::npos)
164 if(
allArg.find(
"randPerm")!=string::npos)
166 if(
allArg.find(
"greedy")!=string::npos)
168 else if(
allArg.find(
"ks")!=string::npos)
170 else if(
allArg.find(
"dmd")!=string::npos)
181 tinfo <<
"\n---------------------------------\n";
182 tinfo <<
"Calling maximum-cardinality matching with options: " <<
endl;
188 if(
randMaximal)
tinfo <<
" random parent selection in greedy/Karp-Sipser, ";
191 if(
randPerm)
tinfo <<
" Randomly permute the matrix for load balance ";
193 tinfo <<
"\n---------------------------------\n\n";
340 cout <<
"\n maximal matching experiment \n";
355 printf(
"ERROR: The MPI library does not have MPI_THREAD_SERIALIZED support\n");
385 if(
string(
argv[1]) ==
string(
"input"))
426 cout <<
"Randomly generated ER matric\n";
435 cout <<
"Randomly generated G500 matric\n";
444 cout <<
"Randomly generated SSCA matric\n";
449 printf(
"The input type - %s - is not recognized.\n",
argv[2]);
void experiment_maximal(Par_DCSC_Bool &A, Par_DCSC_Bool &AT, FullyDistVec< int64_t, int64_t > degCol)
SpParMat< int64_t, bool, SpDCCols< int64_t, bool > > Par_DCSC_Bool
SpParMat< int64_t, bool, SpCCols< int64_t, bool > > Par_CSC_Bool
void GetOptions(char *argv[], int argc)
SpParMat< int64_t, double, SpDCCols< int64_t, double > > Par_DCSC_Double
void defaultExp(Par_DCSC_Bool &A, Par_DCSC_Bool &AT, FullyDistVec< int64_t, int64_t > degCol)
SpParMat< int64_t, int64_t, SpDCCols< int64_t, int64_t > > Par_DCSC_int64_t
void removeIsolated(Par_DCSC_Bool &A)
void experiment(Par_DCSC_Bool &A, Par_DCSC_Bool &AT, FullyDistVec< int64_t, int64_t > degCol)
void GenGraph500Data(double initiator[4], int log_numverts, int edgefactor, bool scramble=false, bool packed=false)
static void Print(const std::string &s)
void Symmetricize(PARMAT &A)
void maximumMatching(SpParMat< IT, NT, DER > &A, FullyDistVec< IT, IT > &mateRow2Col, FullyDistVec< IT, IT > &mateCol2Row, bool prune=true, bool randMM=false, bool maximizeWeight=false)
void MaximalMatching(Par_DCSC_Bool &A, Par_DCSC_Bool &AT, FullyDistVec< IT, IT > &mateRow2Col, FullyDistVec< IT, IT > &mateCol2Row, FullyDistVec< IT, IT > °ColRecv, int type, bool rand=true)