X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=weighted.cpp;h=85eed5207ff20d586bd999f670d59a4c8e840c67;hb=2c97dd48b8e27ee0a6a86c7a082f4c504c3357c6;hp=b0a642b1b5024710530e95de5b2a57cc87a7accd;hpb=03dca3b32a903c3f29fbcf5b410b19d6ab6dae63;p=mothur.git diff --git a/weighted.cpp b/weighted.cpp index b0a642b..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,7 +87,7 @@ 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(); @@ -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++) { @@ -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; }