13 int 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: ./VectorIndexing <BASEADDRESS> <VectorOne> <VectorTwo>" << endl;
25 cout <<
"Example: ./VectorIndexing ../TESTDATA sp10outta100.txt sp30outta100.txt" << endl;
26 cout <<
"Input files should be under <BASEADDRESS> in tuples format" << endl;
32 string directory(argv[1]);
33 string vec1name(argv[2]);
34 string vec2name(argv[3]);
35 vec1name = directory+
"/"+vec1name;
36 vec2name = directory+
"/"+vec2name;
38 ifstream inputvec1(vec1name.c_str());
39 ifstream inputvec2(vec2name.c_str());
43 if(inputvec1.fail() || inputvec2.fail())
45 cout <<
"One of the input vector files do not exist, aborting" << endl;
46 MPI_Abort(MPI_COMM_WORLD,
NOFILE);
50 MPI_Barrier(MPI_COMM_WORLD);
66 auto subvec1 = dvec(vec1);
69 auto subvec2 = dvec(vec2);
74 MPI_Barrier(MPI_COMM_WORLD);
79 auto subvecA = dvecA(vecA);
void SetElement(IT indx, NT numx)
Indexing is performed 0-based.
int main(int argc, char *argv[])
void PrintInfo(std::string vecname) const
void iota(IT globalsize, NT first)
std::ifstream & ReadDistribute(std::ifstream &infile, int master, HANDLER handler)
Totally obsolete version that only accepts an ifstream object and ascii files.
void PrintInfo(std::string vectorname) const