X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=weighted.cpp;h=85eed5207ff20d586bd999f670d59a4c8e840c67;hb=f509429e06e545bde69c97cacc0eb436775bd329;hp=7a31da4d55d398f47d022de7b80396bb44f6c6b4;hpb=91a27e0483827c06c21c4fe89558923bbfe86573;p=mothur.git diff --git a/weighted.cpp b/weighted.cpp index 7a31da4..85eed52 100644 --- a/weighted.cpp +++ b/weighted.cpp @@ -18,6 +18,8 @@ EstOutput Weighted::getValues(Tree* t, int p, string o) { vector D; processors = p; outputDir = o; + + TreeMap* tmap = t->getTreeMap(); numGroups = m->getNumGroups(); @@ -36,7 +38,7 @@ EstOutput Weighted::getValues(Tree* t, int p, string o) { #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) if(processors == 1){ - data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size()); + data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size(), tmap); }else{ int numPairs = namesOfGroupCombos.size(); @@ -50,12 +52,12 @@ EstOutput Weighted::getValues(Tree* t, int p, string o) { lines.push_back(linePair(startPos, numPairsPerProcessor)); } - data = createProcesses(t, namesOfGroupCombos); + data = createProcesses(t, namesOfGroupCombos, tmap); lines.clear(); } #else - data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size()); + data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size(), tmap); #endif return data; @@ -67,7 +69,7 @@ EstOutput Weighted::getValues(Tree* t, int p, string o) { } /**************************************************************************************************/ -EstOutput Weighted::createProcesses(Tree* t, vector< vector > namesOfGroupCombos) { +EstOutput Weighted::createProcesses(Tree* t, vector< vector > namesOfGroupCombos, TreeMap* tmap) { try { #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) int process = 1; @@ -85,9 +87,9 @@ EstOutput Weighted::createProcesses(Tree* t, vector< vector > namesOfGro }else if (pid == 0){ EstOutput Myresults; - Myresults = driver(t, namesOfGroupCombos, lines[process].start, lines[process].num); + Myresults = driver(t, namesOfGroupCombos, lines[process].start, lines[process].num, tmap); - m->mothurOut("Merging results."); m->mothurOutEndLine(); + //m->mothurOut("Merging results."); m->mothurOutEndLine(); //pass numSeqs to parent ofstream out; @@ -108,7 +110,7 @@ EstOutput Weighted::createProcesses(Tree* t, vector< vector > namesOfGro } } - results = driver(t, namesOfGroupCombos, lines[0].start, lines[0].num); + results = driver(t, namesOfGroupCombos, lines[0].start, lines[0].num, tmap); //force parent to wait until all the processes are done for (int i=0;i<(processors-1);i++) { @@ -142,7 +144,7 @@ EstOutput Weighted::createProcesses(Tree* t, vector< vector > namesOfGro m->mothurRemove(s); } - m->mothurOut("DONE."); m->mothurOutEndLine(); m->mothurOutEndLine(); + //m->mothurOut("DONE."); m->mothurOutEndLine(); m->mothurOutEndLine(); return results; #endif @@ -153,7 +155,7 @@ EstOutput Weighted::createProcesses(Tree* t, vector< vector > namesOfGro } } /**************************************************************************************************/ -EstOutput Weighted::driver(Tree* t, vector< vector > namesOfGroupCombos, int start, int num) { +EstOutput Weighted::driver(Tree* t, vector< vector > namesOfGroupCombos, int start, int num, TreeMap* tmap) { try { EstOutput results; vector D; @@ -267,6 +269,8 @@ EstOutput Weighted::getValues(Tree* t, string groupA, string groupB) { try { data.clear(); //clear out old values + + TreeMap* tmap = t->getTreeMap(); if (m->control_pressed) { return data; }