13int main(
int argc,
char* argv[])
16 MPI_Init(&argc, &argv);
17 MPI_Comm_size(MPI_COMM_WORLD,&
nprocs);
18 MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
24 cout <<
"Usage: ./PermuteVectors <VectorOne> <VectorTwo> ... (as many vectors as needed)\n" << endl;
25 cout <<
"Permutes all the vector inputs with the same random order\n" << endl;
31 bool randpermed =
false;
32 FullyDistVec<int,int> randperm;
33 for(
int i=1; i < argc; ++i)
35 string vecname(argv[i]);
36 ifstream inputvec(vecname.c_str());
42 cout <<
"One of the input vector files do not exist, aborting" << endl;
43 MPI_Abort(MPI_COMM_WORLD,
NOFILE);
47 FullyDistVec<int,int> vec;
48 vec.ReadDistribute(inputvec, 0);
52 randperm.iota(vec.TotalLength(), 0);