X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=rarefact.cpp;h=83a6306db7568ac228fb110f1ad1c405cec9c7ec;hb=fefd5ee1517abd3bc38b469cb2dffc85a1571c7e;hp=6a9cb3180172b8aa06aed0039d252de8bdd8873d;hpb=0caf3fbabaa3ece404f8ce77f4c883dc5b1bf1dc;p=mothur.git diff --git a/rarefact.cpp b/rarefact.cpp index 6a9cb31..83a6306 100644 --- a/rarefact.cpp +++ b/rarefact.cpp @@ -86,12 +86,12 @@ int Rarefact::driver(RarefactionCurveData* rcd, int increment, int nIters = 1000 lookup->set(binNumber, abundance); rank->set(abundance, rank->get(abundance)+1); - if((i == 0) || (i+1) % increment == 0){ + if((i == 0) || ((i+1) % increment == 0) || (ends.count(i+1) != 0)){ rcd->updateRankData(rank); } } - if(numSeqs % increment != 0){ + if((numSeqs % increment != 0) || (ends.count(numSeqs) != 0)){ rcd->updateRankData(rank); } @@ -123,7 +123,7 @@ int Rarefact::createProcesses(vector& procIters, RarefactionCurveData* rcd, //loop through and create all the processes you want while (process != processors) { - int pid = fork(); + pid_t pid = fork(); if (pid > 0) { processIDS.push_back(pid); //create map from line number to pid so you can append files in correct order later @@ -133,7 +133,7 @@ int Rarefact::createProcesses(vector& procIters, RarefactionCurveData* rcd, //pass numSeqs to parent for(int i=0;imothurGetpid(process) + toString(i) + ".rarefact.temp"; displays[i]->outputTempFiles(tempFile); } exit(0);