]> git.donarmstrong.com Git - mothur.git/blobdiff - mothurout.cpp
paralellized seq.error and dist.shared added some error checks to libshuff and dist...
[mothur.git] / mothurout.cpp
index 5a0ea1281b3644e1c0b42035054f9f7f2e0cf0f6..a56a6217a8c136e1fcb9f3f3078c5418547220fa 100644 (file)
@@ -247,6 +247,53 @@ void MothurOut::mothurOutEndLine() {
        }
 }
 /*********************************************************************************************/
+void MothurOut::mothurOut(string output, ofstream& outputFile) {
+       try {
+               
+#ifdef USE_MPI
+               int pid;
+               MPI_Comm_rank(MPI_COMM_WORLD, &pid); 
+               
+               if (pid == 0) { //only one process should output to screen
+#endif
+                       
+                       cout << output;
+                       out << output;
+                       outputFile << output;
+                       
+#ifdef USE_MPI
+               }
+#endif
+       }
+       catch(exception& e) {
+               errorOut(e, "MothurOut", "MothurOut");
+               exit(1);
+       }
+}
+/*********************************************************************************************/
+void MothurOut::mothurOutEndLine(ofstream& outputFile) {
+       try {
+#ifdef USE_MPI
+               int pid;
+               MPI_Comm_rank(MPI_COMM_WORLD, &pid); 
+               
+               if (pid == 0) { //only one process should output to screen
+#endif
+                       
+                       cout << endl;
+                       out << endl;
+                       outputFile << endl;
+                       
+#ifdef USE_MPI
+               }
+#endif
+       }
+       catch(exception& e) {
+               errorOut(e, "MothurOut", "MothurOutEndLine");
+               exit(1);
+       }
+}
+/*********************************************************************************************/
 void MothurOut::mothurOutJustToLog(string output) {
        try {
                #ifdef USE_MPI