]> git.donarmstrong.com Git - mothur.git/blobdiff - unweighted.cpp
modified shhhercommand to make buildable with windows
[mothur.git] / unweighted.cpp
index 0ac7147d7d8b0b288789267c18c43e1867b43e93..24b41a1d03317e343e05c65c7516e94778cd557c 100644 (file)
@@ -87,7 +87,6 @@ EstOutput Unweighted::createProcesses(Tree* t, vector< vector<string> > namesOfG
        try {
 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
                int process = 1;
-               int num = 0;
                vector<int> processIDS;
                
                EstOutput results;
@@ -116,7 +115,11 @@ EstOutput Unweighted::createProcesses(Tree* t, vector< vector<string> > namesOfG
                                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); 
+                       }
                }
                
                results = driver(t, namesOfGroupCombos, lines[0].start, lines[0].num);
@@ -336,7 +339,6 @@ EstOutput Unweighted::createProcesses(Tree* t, vector< vector<string> > namesOfG
        try {
 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
                int process = 1;
-               int num = 0;
                vector<int> processIDS;
                
                EstOutput results;
@@ -363,7 +365,11 @@ EstOutput Unweighted::createProcesses(Tree* t, vector< vector<string> > namesOfG
                                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); 
+                       }
                }
                
                results = driver(t, namesOfGroupCombos, lines[0].start, lines[0].num, usingGroups);
@@ -415,8 +421,6 @@ EstOutput Unweighted::driver(Tree* t, vector< vector<string> > namesOfGroupCombo
                EstOutput results; results.resize(num);
                
                int count = 0;
-               int total = num;
-               int twentyPercent = (total * 0.20);
                int numLeaves = t->getNumLeaves();
                
                Tree* copyTree = new Tree;