X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothurout.cpp;h=a56a6217a8c136e1fcb9f3f3078c5418547220fa;hb=f06fdb807822f8e06db003ed809c87250905cfc8;hp=5a0ea1281b3644e1c0b42035054f9f7f2e0cf0f6;hpb=ec1b5bc7460ac8ad40f54f0729900d9ed98e7292;p=mothur.git diff --git a/mothurout.cpp b/mothurout.cpp index 5a0ea12..a56a621 100644 --- a/mothurout.cpp +++ b/mothurout.cpp @@ -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