]> git.donarmstrong.com Git - mothur.git/blobdiff - chimeracheckcommand.cpp
paralellized phylo.diversity
[mothur.git] / chimeracheckcommand.cpp
index 18554399e43220b596723a745142b49d2d8c123e..ac092083a53944207b926a6bb9d725a2249b571a 100644 (file)
@@ -217,6 +217,7 @@ int ChimeraCheckCommand::execute(){
 
                        if (m->control_pressed) { delete chimera;       return 0;       }
                        
+                       if (outputDir == "") { outputDir = m->hasPath(fastaFileNames[i]);  }//if user entered a file with a path then preserve it
                        string outputFileName = outputDir + m->getRootName(m->getSimpleName(fastaFileNames[i]))  + "chimeracheck.chimeras";
                        outputNames.push_back(outputFileName);
                        
@@ -269,8 +270,8 @@ int ChimeraCheckCommand::execute(){
                                        
                                        //wait on chidren
                                        for(int j = 1; j < processors; j++) { 
-                                               char buf[4];
-                                               MPI_Recv(buf, 4, MPI_CHAR, j, tag, MPI_COMM_WORLD, &status); 
+                                               char buf[5];
+                                               MPI_Recv(buf, 5, MPI_CHAR, j, tag, MPI_COMM_WORLD, &status); 
                                        }
                                }else{ //you are a child process
                                        MPI_Recv(&numSeqs, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);
@@ -288,9 +289,9 @@ int ChimeraCheckCommand::execute(){
                                        if (m->control_pressed) {  MPI_File_close(&inMPI);  MPI_File_close(&outMPI);   for (int j = 0; j < outputNames.size(); j++) {   remove(outputNames[j].c_str()); }  delete chimera; return 0;  }
                                        
                                        //tell parent you are done.
-                                       char buf[4];
+                                       char buf[5];
                                        strcpy(buf, "done"); 
-                                       MPI_Send(buf, 4, MPI_CHAR, 0, tag, MPI_COMM_WORLD);
+                                       MPI_Send(buf, 5, MPI_CHAR, 0, tag, MPI_COMM_WORLD);
                                }
                                
                                //close files