]> git.donarmstrong.com Git - mothur.git/blobdiff - phylodiversitycommand.cpp
nmds command done
[mothur.git] / phylodiversitycommand.cpp
index efa14cd7069266ebfedb41018de0120327a145a9..80d909016103f3b579f9096f342cf3a8acbb677b 100644 (file)
@@ -290,7 +290,7 @@ int PhyloDiversityCommand::createProcesses(vector<int>& procIters, Tree* t, map<
        try {
                #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
                int process = 1;
-               int num = 0;
+               
                vector<int> processIDS;
                map< string, vector<float> >::iterator itSum;
                
@@ -322,7 +322,11 @@ int PhyloDiversityCommand::createProcesses(vector<int>& procIters, Tree* t, map<
                                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);
+                       }
                }
                
                driver(t, div, sumDiv, procIters[0], increment, randomLeaf, numSampledList, outCollect, outSum, true);