X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=distancecommand.cpp;h=70c0a7806c2902b73f20601ff1fda5b330aa8c10;hb=cdf9083dc32543cc640e72e9ca3aee0323cbad45;hp=edb6314427a423f216ab5ab6576305d8c0b51687;hpb=d4cd876bd09bfa1bcb137261700eae79f9e41fc0;p=mothur.git diff --git a/distancecommand.cpp b/distancecommand.cpp index edb6314..70c0a78 100644 --- a/distancecommand.cpp +++ b/distancecommand.cpp @@ -540,7 +540,7 @@ void DistanceCommand::createProcesses(string filename) { int pid = fork(); if (pid > 0) { - processIDS[lines[process]->end] = pid; //create map from line number to pid so you can append files in correct order later + processIDS.push_back(pid); //create map from line number to pid so you can append files in correct order later process++; }else if (pid == 0){ if (output != "square") { driver(lines[process]->start, lines[process]->end, filename + toString(getpid()) + ".temp", cutoff); } @@ -548,7 +548,8 @@ void DistanceCommand::createProcesses(string filename) { exit(0); }else { m->mothurOut("[ERROR]: unable to spawn the necessary processes. Error code: " + toString(pid)); m->mothurOutEndLine(); - for (map::iterator it = processIDS.begin(); it != processIDS.end(); it++) { int temp = it->second; kill (temp, SIGINT); } + perror(" : "); + for (int i=0;i::iterator it = processIDS.begin(); it != processIDS.end(); it++) { - int temp = it->second; + for (int i=0;i::iterator it = processIDS.begin(); it != processIDS.end(); it++) { - m->appendFiles((filename + toString(it->second) + ".temp"), filename); - remove((filename + toString(it->second) + ".temp").c_str()); + for (int i=0;iappendFiles((filename + toString(processIDS[i]) + ".temp"), filename); + remove((filename + toString(processIDS[i]) + ".temp").c_str()); } #endif }