11#include "../CombBLAS.h"
52 cout <<
"\n-------------- usage --------------\n";
53 cout <<
"Usage: ./awpm -input <filename>\n";
54 cout <<
"Optional parameters: -randPerm: randomly permute the matrix for load balance (default: no random permutation)\n";
55 cout <<
" -optsum: Optimize the sum of diagonal (default: Optimize the product of diagonal)\n";
56 cout <<
" -noWeightedCard: do not use weighted cardinality matching (default: use weighted cardinality matching)\n";
57 cout <<
" -output <output file>: output file name (if not provided: inputfile.awpm.txt)\n";
58 cout <<
" \n-------------- examples ----------\n";
59 cout <<
"Example: mpirun -np 4 ./awpm -input cage12.mtx \n" <<
endl;
60 cout <<
"(output matching is saved to cage12.mtx.awpm.txt)\n" <<
endl;
78 printf(
"ERROR: The MPI library does not have MPI_THREAD_SERIALIZED support\n");
103 string ifilename =
"";
105 for(
int i = 1; i<
argc; i++)
107 if (
string(
argv[i]) ==
string(
"-input")) ifilename =
argv[i+1];
111 if (
string(
argv[i]) ==
string(
"-randPerm"))
randPerm =
true;
144 AWeighted->Prune([](
double val){
return fabs(val)==0;},
true);
224 SpParHelper::Print(
"Maximal is not better that the natural ordering. Hence, keeping the natural ordering.\n");
259 SpParHelper::Print(
"AWPM is not better that the natural ordering. Hence, keeping the natural ordering.\n");
int main(int argc, char *argv[])
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)
bool CheckMatching(FullyDistVec< IT, IT > &mateRow2Col, FullyDistVec< IT, IT > &mateCol2Row)
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 maximumMatching(SpParMat< IT, NT, DER > &A, FullyDistVec< IT, IT > &mateRow2Col, FullyDistVec< IT, IT > &mateCol2Row, bool prune=true, bool randMM=false, bool maximizeWeight=false)
void TwoThirdApprox(SpParMat< IT, NT, DER > &A, FullyDistVec< IT, IT > &mateRow2Col, FullyDistVec< IT, IT > &mateCol2Row)
void WeightedGreedy(Par_MAT_Double &A, FullyDistVec< IT, IT > &mateRow2Col, FullyDistVec< IT, IT > &mateCol2Row, FullyDistVec< IT, IT > °Col)