+ #ifdef USE_MPI
+
+ int pid, num, num2, processors;
+ vector<unsigned long long> positions;
+ vector<unsigned long long> positions2;
+
+ MPI_Status status;
+ MPI_File inMPI;
+ MPI_File inMPI2;
+ MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
+ MPI_Comm_size(MPI_COMM_WORLD, &processors);
+ int tag = 2001;
+
+ char inFileName[1024];
+ strcpy(inFileName, inNumName.c_str());
+
+ char inFileName2[1024];
+ strcpy(inFileName2, inName.c_str());
+
+ MPI_File_open(MPI_COMM_WORLD, inFileName, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI); //comm, filename, mode, info, filepointer
+ MPI_File_open(MPI_COMM_WORLD, inFileName2, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI2); //comm, filename, mode, info, filepointer
+
+ if (pid == 0) {
+ positions = m->setFilePosEachLine(inNumName, num);
+ positions2 = m->setFilePosEachLine(inName, num2);
+
+ for(int i = 1; i < processors; i++) {
+ MPI_Send(&num, 1, MPI_INT, i, tag, MPI_COMM_WORLD);
+ MPI_Send(&positions[0], (num+1), MPI_LONG, i, tag, MPI_COMM_WORLD);
+
+ MPI_Send(&num2, 1, MPI_INT, i, tag, MPI_COMM_WORLD);
+ MPI_Send(&positions2[0], (num2+1), MPI_LONG, i, tag, MPI_COMM_WORLD);
+ }
+
+ }else{
+ MPI_Recv(&num, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);
+ positions.resize(num+1);
+ MPI_Recv(&positions[0], (num+1), MPI_LONG, 0, tag, MPI_COMM_WORLD, &status);
+
+ MPI_Recv(&num2, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);
+ positions2.resize(num2+1);
+ MPI_Recv(&positions2[0], (num2+1), MPI_LONG, 0, tag, MPI_COMM_WORLD, &status);
+ }
+
+ //read version
+ int length = positions2[1] - positions2[0];
+ char* buf5 = new char[length];
+
+ MPI_File_read_at(inMPI2, positions2[0], buf5, length, MPI_CHAR, &status);
+ delete buf5;
+
+ //read numKmers
+ length = positions2[2] - positions2[1];
+ char* buf = new char[length];
+
+ MPI_File_read_at(inMPI2, positions2[1], buf, length, MPI_CHAR, &status);
+
+ string tempBuf = buf;
+ if (tempBuf.length() > length) { tempBuf = tempBuf.substr(0, length); }
+ delete buf;
+
+ istringstream iss (tempBuf,istringstream::in);
+ iss >> numKmers;