8#include "CombBLAS/CombBLAS.h"
15int main(
int argc,
char* argv[])
18 MPI_Init(&argc, &argv);
19 MPI_Comm_size(MPI_COMM_WORLD,&
nprocs);
20 MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
26 cout <<
"Usage: ./ReadWriteMtx <InputMTX> <OutputMTX> <0|1> <permute>" << endl;
27 cout <<
"<InputMTX> can have reverse edges missing or with different values, but the reader will choose the edge with maximum value when that happens (common in dna/protein sequence search)" << endl;
28 cout <<
"<OutputMTX> is just the name of the output after such incompatibilities in MTX file are removed and all bidirectional edges now have the same value" << endl;
29 cout <<
"<0|1>: zero or one indexed (for inputs)" << endl;
30 cout <<
"<permute> randomly permute the matrix (default: 0 - meaning false)" << endl;
37 string Aname(argv[1]);
38 string Bname(argv[2]);
40 bool index =
static_cast<bool>(atoi(argv[3]));
44 cout <<
"Reading file " << Aname <<
" that is " << index <<
" indexed" << endl;
48 permute =
static_cast<bool>(atoi(argv[4]));
52 cout <<
"Randomly permuting" << endl;
63 perm.
iota(
A.getnrow(), 0);
68 A.ParallelWriteMM(Bname,
true);
int main(int argc, char *argv[])
void iota(IT globalsize, NT first)
Compute the maximum of two values.