X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bellerophon.cpp;h=f4d04ea074b1d2d95cb9bcff4fcc3084e7f234c6;hb=9bc68cbe7fd7c5cf00b66d73d60624de80fb7933;hp=743c6d779c8042ea2d47690cdc77ec839bf21bab;hpb=956cdff34f2d609a7736838b1631cd7957580b8b;p=mothur.git diff --git a/bellerophon.cpp b/bellerophon.cpp index 743c6d7..f4d04ea 100644 --- a/bellerophon.cpp +++ b/bellerophon.cpp @@ -75,7 +75,7 @@ Bellerophon::Bellerophon(string name, bool filterSeqs, bool c, int win, int inc } //*************************************************************************************************************** -int Bellerophon::print(ostream& out, ostream& outAcc) { +int Bellerophon::print(ostream& out, ostream& outAcc, string s) { try { int above1 = 0; @@ -130,7 +130,7 @@ int Bellerophon::print(ostream& out, ostream& outAcc) { } #ifdef USE_MPI //*************************************************************************************************************** -int Bellerophon::print(MPI_File& out, MPI_File& outAcc) { +int Bellerophon::print(MPI_File& out, MPI_File& outAcc, string s) { try { int pid; @@ -373,7 +373,11 @@ int Bellerophon::createProcesses(vector mid) { string tempOut = outputDir + toString(getpid()) + ".temp"; writePrefs(tempOut, lines[process]); exit(0); - }else { m->mothurOut("unable to spawn the necessary processes."); m->mothurOutEndLine(); exit(0); } + }else { + m->mothurOut("[ERROR]: unable to spawn the necessary processes."); m->mothurOutEndLine(); + for (int i = 0; i < processIDS.size(); i++) { kill (processIDS[i], SIGINT); } + exit(0); + } } //force parent to wait until all the processes are done @@ -531,7 +535,6 @@ int Bellerophon::createSparseMatrix(int startSeq, int endSeq, SparseMatrix* spar int Bellerophon::generatePreferences(vector left, vector right, int mid){ try { - float dme = 0.0; SeqMap::iterator itR; SeqMap::iterator itL; @@ -665,7 +668,7 @@ int Bellerophon::writePrefs(string file, linePair tempLine) { try { ofstream outTemp; - openOutputFile(file, outTemp); + m->openOutputFile(file, outTemp); //lets you know what part of the pref matrix you are writing outTemp << tempLine.start << '\t' << tempLine.num << endl; @@ -695,12 +698,12 @@ int Bellerophon::readPrefs(string file) { try { ifstream inTemp; - openInputFile(file, inTemp); + m->openInputFile(file, inTemp); int start, num; //lets you know what part of the pref matrix you are writing - inTemp >> start >> num; gobble(inTemp); + inTemp >> start >> num; m->gobble(inTemp); for (int i = start; i < num; i++) { @@ -710,7 +713,7 @@ int Bellerophon::readPrefs(string file) { inTemp >> pref[i][j].name >> pref[i][j].leftParent >> pref[i][j].rightParent; inTemp >> pref[i][j].score >> pref[i][j].closestLeft >> pref[i][j].closestRight >> pref[i][j].midpoint; - gobble(inTemp); + m->gobble(inTemp); } }