]> git.donarmstrong.com Git - mothur.git/blobdiff - distancecommand.cpp
added groups option to get.oturep command
[mothur.git] / distancecommand.cpp
index 10a99dd240ee862884d59b8570581ebbe129ef32..503f64b21cfd0ae64ec7413c7bfc3dc993e7e2d3 100644 (file)
@@ -278,8 +278,7 @@ int DistanceCommand::execute(){
                                        delete buf;
 
                                        int count = 0;
-                                       while (count < fileSize) { //read 1000 characters at a time
-                                               //send freqs
+                                       while (count < fileSize) { 
                                                char buf2[1];
                                                MPI_File_read(inMPI, buf2, 1, MPI_CHAR, &status);
                                                MPI_File_write(outMPI, buf2, 1, MPI_CHAR, &status);
@@ -301,6 +300,7 @@ int DistanceCommand::execute(){
                                MPI_Send(&size, 1, MPI_LONG, 0, tag, MPI_COMM_WORLD);
                        }
                }
+               MPI_Barrier(MPI_COMM_WORLD); //make everyone wait - just in case
 #else          
                                
        #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
@@ -343,6 +343,14 @@ int DistanceCommand::execute(){
                
                if (output == "square") {  convertMatrix(outputFile); }
                
+               ifstream fileHandle;
+               fileHandle.open(outputFile.c_str());
+               if(fileHandle) {
+                       gobble(fileHandle);
+                       if (fileHandle.eof()) { m->mothurOut(outputFile + " is blank. This can result if there are no distances below your cutoff.");  m->mothurOutEndLine(); }
+               }
+
+               
                #ifdef USE_MPI
                        }
                #endif