11#include "CombBLAS/CombBLAS.h"
42 cout <<
"\n-------------- usage --------------\n";
43 cout <<
"Usage: ./awpm -input <filename>\n";
44 cout <<
"Optional parameters: -randPerm: randomly permute the matrix for load balance (default: no random permutation)\n";
45 cout <<
" -optsum: Optimize the sum of diagonal (default: Optimize the product of diagonal)\n";
46 cout <<
" -noWeightedCard: do not use weighted cardinality matching (default: use weighted cardinality matching)\n";
47 cout <<
" -output <output file>: output file name \n";
49 cout <<
" \n-------------- examples ----------\n";
50 cout <<
"Example: mpirun -np 4 ./awpm -input cage12.mtx \n" <<
endl;
51 cout <<
"(output matching is saved to cage12.mtx.awpm.txt)\n" <<
endl;
69 printf(
"ERROR: The MPI library does not have MPI_THREAD_SERIALIZED support\n");
86 string ifilename =
"";
89 for(
int i = 1; i<
argc; i++)
91 if (
string(
argv[i]) ==
string(
"-input")) ifilename =
argv[i+1];
96 if (
string(
argv[i]) ==
string(
"-randPerm"))
randPerm =
true;
124 tinfo <<
"Input file name: " << ifilename <<
endl;
125 tinfo <<
"Reading the input matrix in" <<
t02-
t01 <<
" seconds" <<
endl;
129 AWeighted->Prune([](
double val){
return fabs(val)==0;},
true);
197 tinfo <<
"Matching is computed " <<
endl;
198 tinfo <<
"Sum of Diagonal (with transformation)" <<
endl;
203 tinfo <<
"----------------------------------------\n";
SpParMat< int64_t, bool, SpDCCols< int64_t, bool > > Par_DCSC_Bool
SpParMat< int64_t, double, SpCCols< int64_t, double > > Par_CSC_Double
SpParMat< int64_t, bool, SpCCols< int64_t, bool > > Par_CSC_Bool
SpParMat< int64_t, double, SpDCCols< int64_t, double > > Par_DCSC_Double
SpParMat< int64_t, int64_t, SpDCCols< int64_t, int64_t > > Par_DCSC_int64_t
static void Print(const std::string &s)
NT MatchingWeight(std::vector< NT > &RepMateWC2R, MPI_Comm RowWorld, NT &minw)
void TransformWeight(SpParMat< IT, NT, DER > &A, bool applylog)
NT Trace(SpParMat< IT, NT, DER > &A, IT &rettrnnz=0)
void AWPM(SpParMat< IT, NT, SpDCCols< IT, NT > > &A1, FullyDistVec< IT, IT > &mateRow2Col, FullyDistVec< IT, IT > &mateCol2Row, bool optimizeProd=true, bool weightedCard=true)