X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=distancecommand.cpp;h=9243df3873a9687d43da9da940b32da1ce9a5091;hp=73a38bfe023025be8b5533e20f72d28539a09cde;hb=cf9987b67aa49777a4c91c2d21f96e58bf17aa82;hpb=deba0af0ccdcb6005ed5b2b82649b137c63fbdf7 diff --git a/distancecommand.cpp b/distancecommand.cpp index 73a38bf..9243df3 100644 --- a/distancecommand.cpp +++ b/distancecommand.cpp @@ -594,6 +594,9 @@ void DistanceCommand::createProcesses(string filename) { //Close all thread handles and free memory allocations. for(int i=0; i < pDataArray.size(); i++){ + if (pDataArray[i]->count != (pDataArray[i]->endLine-pDataArray[i]->startLine)) { + m->mothurOut("[ERROR]: process " + toString(i) + " only processed " + toString(pDataArray[i]->count) + " of " + toString(pDataArray[i]->endLine-pDataArray[i]->startLine) + " sequences assigned to it, quitting. \n"); m->control_pressed = true; + } CloseHandle(hThreadArray[i]); delete pDataArray[i]; } @@ -672,11 +675,11 @@ int DistanceCommand::driver(int startLine, int endLine, string dFileName, float if (output == "lt") { outFile << endl; } if(i % 100 == 0){ - m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine(); + m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); } } - m->mothurOut(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine(); + m->mothurOutJustToScreen(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)+"\n"); outFile.close(); delete distCalculator; @@ -742,11 +745,11 @@ int DistanceCommand::driver(int startLine, int endLine, string dFileName, string outFile << endl; if(i % 100 == 0){ - m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine(); + m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); } } - m->mothurOut(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine(); + m->mothurOutJustToScreen(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)+"\n"); outFile.close(); delete distCalculator; @@ -809,8 +812,7 @@ int DistanceCommand::driverMPI(int startLine, int endLine, MPI_File& outMPI, flo } if(i % 100 == 0){ - //m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine(); - cout << i << '\t' << (time(NULL) - startTime) << endl; + m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); } @@ -826,8 +828,7 @@ int DistanceCommand::driverMPI(int startLine, int endLine, MPI_File& outMPI, flo } - //m->mothurOut(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine(); - cout << (endLine-1) << '\t' << (time(NULL) - startTime) << endl; + m->mothurOutJustToScreen(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)+"\n"); delete distCalculator; return 1; } @@ -904,9 +905,7 @@ int DistanceCommand::driverMPI(int startLine, int endLine, string file, unsigned if(i % 100 == 0){ - //m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine(); - cout << i << '\t' << (time(NULL) - startTime) << endl; - } + m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); } //send results to parent @@ -920,8 +919,8 @@ int DistanceCommand::driverMPI(int startLine, int endLine, string file, unsigned delete buf; } - //m->mothurOut(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine(); - cout << (endLine-1) << '\t' << (time(NULL) - startTime) << endl; + m->mothurOutJustToScreen(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)+"\n"); + MPI_File_close(&outMPI); delete distCalculator; @@ -999,8 +998,7 @@ int DistanceCommand::driverMPI(int startLine, int endLine, string file, unsigned if(i % 100 == 0){ - //m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine(); - cout << i << '\t' << (time(NULL) - startTime) << endl; + m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); } @@ -1015,8 +1013,8 @@ int DistanceCommand::driverMPI(int startLine, int endLine, string file, unsigned delete buf; } - //m->mothurOut(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine(); - cout << (endLine-1) << '\t' << (time(NULL) - startTime) << endl; + m->mothurOutJustToScreen(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)+"\n"); + MPI_File_close(&outMPI); delete distCalculator; return 1;