]> git.donarmstrong.com Git - mothur.git/blobdiff - engine.cpp
added MPI to dist.seqs command
[mothur.git] / engine.cpp
index 2d5fd75959d479826f5239b364879ff316f4eaca..c6ceb59d051d6fb88fe1e169bdd9206da9d58ef8 100644 (file)
@@ -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,85 +107,26 @@ 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
                
@@ -252,21 +183,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 +274,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