]> git.donarmstrong.com Git - mothur.git/blobdiff - mothur.cpp
added MPI to dist.seqs command
[mothur.git] / mothur.cpp
index a3eef76a2766d5ae69c824b0ee4cf4b5e3f14a51..75d03e16d62a4c01b20236b42c00c1e00cd0bfc0 100644 (file)
@@ -12,6 +12,7 @@
 #include "globaldata.hpp"
 #include "mothurout.h"
 
+
 /**************************************************************************************************/
 
 GlobalData* GlobalData::_uniqueInstance = 0;
@@ -42,8 +43,13 @@ int main(int argc, char *argv[]){
                time_t ltime = time(NULL); /* calendar time */  
                string logFileName = "mothur." + toString(ltime) + ".logfile";
                
+               #ifdef USE_MPI
+                       MPI_Init(&argc, &argv); 
+               #endif
+
                m->setFileName(logFileName);
                
+                               
                //version
                #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
                        system("clear");
@@ -99,8 +105,11 @@ int main(int argc, char *argv[]){
                m->mothurOutEndLine();                  
                m->mothurOut("Type 'quit()' to exit program");
                m->mothurOutEndLine();  
-
-                               
+               
+               #ifdef USE_MPI
+                       m->mothurOutJustToLog("Using MPI\n");
+               #endif
+               
                //srand(54321);
                srand( (unsigned)time( NULL ) );
                
@@ -130,7 +139,7 @@ int main(int argc, char *argv[]){
                        mothur = new InteractEngine(argv[0]);   
                }
                
-               while(bail == 0)                {       bail = mothur->getInput();                      }
+               while(bail == 0)        {       bail = mothur->getInput();      }
                
                string outputDir = mothur->getOutputDir();
                string newlogFileName = outputDir + logFileName;
@@ -139,7 +148,11 @@ int main(int argc, char *argv[]){
                rename(logFileName.c_str(), newlogFileName.c_str()); //logfile with timestamp
                
                delete mothur;
-
+               
+               #ifdef USE_MPI
+                       MPI_Finalize();
+               #endif
+               
                return 0;
        }
        catch(exception& e) {