X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bayesian.cpp;h=e5ab89e6216426e2cd9ca1c8a7eca16db203cd00;hb=9013e13ecfb2fda3c2664a76f76cc99b8c7fa74c;hp=d0c0a16fe834b1a2e8a5c87698e0b02fba41fbf8;hpb=cd4c86f68cb53017f0f98a82dd2c2e56a64c67bd;p=mothur.git diff --git a/bayesian.cpp b/bayesian.cpp index d0c0a16..e5ab89e 100644 --- a/bayesian.cpp +++ b/bayesian.cpp @@ -71,6 +71,8 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i) { for (int j = 0; j < wordGenusProb.size(); j++) { wordGenusProb[j].resize(genusNodes.size()); } + ofstream out; + ofstream out2; #ifdef USE_MPI int pid; @@ -79,12 +81,11 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i) { if (pid == 0) { #endif - ofstream out; + openOutputFile(probFileName, out); out << numKmers << endl; - ofstream out2; openOutputFile(probFileName2, out2); #ifdef USE_MPI @@ -94,7 +95,7 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i) { //for each word for (int i = 0; i < numKmers; i++) { - if (m->control_pressed) { break; } + if (m->control_pressed) { break; } #ifdef USE_MPI MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are @@ -128,7 +129,9 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i) { wordGenusProb[i][k] = log((count[genusNodes[k]] + probabilityInTemplate) / (float) (genusTotals[k] + 1)); if (count[genusNodes[k]] != 0) { #ifdef USE_MPI + int pid; MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are + if (pid == 0) { #endif @@ -144,6 +147,7 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i) { #ifdef USE_MPI MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are + if (pid == 0) { #endif @@ -157,6 +161,7 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i) { #ifdef USE_MPI MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are + if (pid == 0) { #endif