X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=rarefact.cpp;h=ca105b7f82fad6be8cc45e7b9e7953da3f4471e4;hb=2bb9267aa4b4ecdf8488b06605cc9f3f36fa4332;hp=d04885f4333e3f224bddbfa99aa9614e9f171b4c;hpb=a537fefa3bd2c2eba7d532249375b6a11b295e25;p=mothur.git diff --git a/rarefact.cpp b/rarefact.cpp index d04885f..ca105b7 100644 --- a/rarefact.cpp +++ b/rarefact.cpp @@ -116,7 +116,7 @@ int Rarefact::createProcesses(vector& procIters, RarefactionCurveData* rcd, try { #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) int process = 1; - int num = 0; + vector processIDS; EstOutput results; @@ -137,7 +137,11 @@ int Rarefact::createProcesses(vector& procIters, RarefactionCurveData* rcd, displays[i]->outputTempFiles(tempFile); } 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(rcd, increment, procIters[0]); @@ -153,7 +157,7 @@ int Rarefact::createProcesses(vector& procIters, RarefactionCurveData* rcd, for(int j=0;jinputTempFiles(s); - remove(s.c_str()); + m->mothurRemove(s); } } @@ -179,7 +183,7 @@ try { } //if jumble is false all iters will be the same - if (globaldata->jumble == false) { nIters = 1; } + if (m->jumble == false) { nIters = 1; } //convert freq percentage to number int increment = 1; @@ -192,7 +196,7 @@ try { displays[i]->init(label); } - if (globaldata->jumble == true) { + if (m->jumble == true) { //randomize the groups random_shuffle(lookup.begin(), lookup.end()); }