X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=screenseqscommand.cpp;h=65b5956cce5c0a6418d5d9524218b35b0b335aa8;hb=dfa69e4bbb18b2313495822f36b80cb475b7fb08;hp=30dda1f68518bf395ae0cbb892cf71a3a7ded4d5;hpb=134a9c1275862a6b3ea10a2c0f11965c0a535854;p=mothur.git diff --git a/screenseqscommand.cpp b/screenseqscommand.cpp index 30dda1f..65b5956 100644 --- a/screenseqscommand.cpp +++ b/screenseqscommand.cpp @@ -267,7 +267,7 @@ int ScreenSeqsCommand::execute(){ int start = time(NULL); #ifdef USE_MPI - int pid, end, numSeqsPerProcessor; + int pid, numSeqsPerProcessor; int tag = 2001; vector MPIPos; @@ -507,13 +507,13 @@ int ScreenSeqsCommand::screenNameGroupFile(set badSeqNames){ outputNames.push_back(goodNameFile); outputTypes["name"].push_back(goodNameFile); ofstream goodNameOut; m->openOutputFile(goodNameFile, goodNameOut); - + while(!inputNames.eof()){ if (m->control_pressed) { goodNameOut.close(); inputNames.close(); remove(goodNameFile.c_str()); return 0; } inputNames >> seqName >> seqList; it = badSeqNames.find(seqName); - + if(it != badSeqNames.end()){ badSeqNames.erase(it); @@ -558,7 +558,7 @@ int ScreenSeqsCommand::screenNameGroupFile(set badSeqNames){ if (m->control_pressed) { goodGroupOut.close(); inputGroups.close(); remove(goodNameFile.c_str()); remove(goodGroupFile.c_str()); return 0; } inputGroups >> seqName >> group; - + it = badSeqGroups.find(seqName); if(it != badSeqGroups.end()){ @@ -580,7 +580,8 @@ int ScreenSeqsCommand::screenNameGroupFile(set badSeqNames){ } } } - + + return 0; } @@ -721,7 +722,11 @@ int ScreenSeqsCommand::createProcessesCreateSummary(vector& startPosition, out.close(); 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); + } } num = driverCreateSummary(startPosition, endPosition, seqLength, ambigBases, longHomoPolymer, fastafile, lines[0]); @@ -1046,7 +1051,11 @@ int ScreenSeqsCommand::createProcesses(string goodFileName, string badAccnos, st out.close(); 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