X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=engine.cpp;h=9e5801b1b057b2f2a1cc4a986e105ae3e73f14b5;hb=5c80ce8b80938d41cf6c64a017fa6fd50d45de5b;hp=2d5fd75959d479826f5239b364879ff316f4eaca;hpb=17a6a53298a907c005fa93fb82af9e533adcda09;p=mothur.git diff --git a/engine.cpp b/engine.cpp index 2d5fd75..9e5801b 100644 --- a/engine.cpp +++ b/engine.cpp @@ -54,18 +54,8 @@ bool InteractEngine::getInput(){ mout->mothurOutEndLine(); input = getCommand(); - #ifdef USE_MPI - int pid; - MPI_Comm_rank(MPI_COMM_WORLD, &pid); - - if (pid == 0) { - #endif mout->mothurOutEndLine(); - #ifdef USE_MPI - } - #endif - if (mout->control_pressed) { input = "quit()"; } //allow user to omit the () on the quit command @@ -117,89 +107,29 @@ string Engine::getCommand() { if(nextCommand != NULL) { add_history(nextCommand); } else{ //^D causes null string and we want it to quit mothur nextCommand = "quit"; - cout << nextCommand << endl; + mout->mothurOut(nextCommand); } - #ifdef USE_MPI - int pid; - MPI_Comm_rank(MPI_COMM_WORLD, &pid); - - if (pid == 0) { //only one process should output to screen - #endif - mout->mothurOutJustToLog("mothur > " + toString(nextCommand)); - - #ifdef USE_MPI - } - #endif - return nextCommand; #else string nextCommand = ""; - #ifdef USE_MPI - int pid; - MPI_Comm_rank(MPI_COMM_WORLD, &pid); - - if (pid == 0) { //only one process should output to screen - #endif - mout->mothurOut("mothur > "); - - #ifdef USE_MPI - } - #endif - getline(cin, nextCommand); - - #ifdef USE_MPI - int pid; - MPI_Comm_rank(MPI_COMM_WORLD, &pid); - - if (pid == 0) { //only one process should output to screen - #endif - mout->mothurOutJustToLog("mothur > " + toString(nextCommand)); - #ifdef USE_MPI - } - #endif - return nextCommand; #endif #else - string nextCommand = ""; - #ifdef USE_MPI - int pid; - MPI_Comm_rank(MPI_COMM_WORLD, &pid); - - if (pid == 0) { //only one process should output to screen - #endif - - mout->mothurOut("mothur > "); - - #ifdef USE_MPI - } - #endif + string nextCommand = ""; + mout->mothurOut("mothur > "); getline(cin, nextCommand); - - #ifdef USE_MPI - int pid; - MPI_Comm_rank(MPI_COMM_WORLD, &pid); - - if (pid == 0) { //only one process should output to screen - #endif - mout->mothurOutJustToLog(toString(nextCommand)); - #ifdef USE_MPI - } - #endif - return nextCommand; #endif - - mout->mothurOutEndLine(); + } catch(exception& e) { @@ -252,21 +182,10 @@ bool BatchEngine::getInput(){ if (input[0] != '#') { - #ifdef USE_MPI - int pid; - MPI_Comm_rank(MPI_COMM_WORLD, &pid); - - if (pid == 0) { //only one process should output to screen - #endif - mout->mothurOutEndLine(); mout->mothurOut("mothur > " + input); mout->mothurOutEndLine(); - - #ifdef USE_MPI - } - #endif - + if (mout->control_pressed) { input = "quit()"; } //allow user to omit the () on the quit command @@ -354,21 +273,10 @@ bool ScriptEngine::getInput(){ if (input == "") { input = "quit()"; } - #ifdef USE_MPI - int pid; - MPI_Comm_rank(MPI_COMM_WORLD, &pid); - - if (pid == 0) { - #endif - mout->mothurOutEndLine(); mout->mothurOut("mothur > " + input); mout->mothurOutEndLine(); - #ifdef USE_MPI - } - #endif - if (mout->control_pressed) { input = "quit()"; } //allow user to omit the () on the quit command