- }
- else if(processors == 3){
- int pid1 = fork();
- if(pid1 > 0){
- int pid2 = fork();
- if(pid2 > 0){
- driver(distCalculator, seqDB, 0, sqrt(3) * numSeqs / 3, distFile + "tempa", phylipFile + "tempPhylipA", cutoff);
- appendFiles(distFile+"tempa", distFile);
- appendFiles((phylipFile + "tempPhylipA"), phylipFile);
- remove((distFile + "tempa").c_str());
- remove((phylipFile + "tempPhylipA").c_str());
- }
- else{
- driver(distCalculator, seqDB, sqrt(3) * numSeqs / 3, sqrt(6) * numSeqs / 3, distFile + "tempb", phylipFile + "tempPhylipB", cutoff);
- appendFiles(distFile+"tempb", distFile);
- appendFiles((phylipFile + "tempPhylipB"), phylipFile);
- remove((distFile + "tempb").c_str());
- remove((phylipFile + "tempPhylipB").c_str());
- }
- wait(NULL);
- }
- else{
- driver(distCalculator, seqDB, sqrt(6) * numSeqs / 3, numSeqs, distFile + "tempc", phylipFile + "tempPhylipC", cutoff);
- appendFiles(distFile+"tempc", distFile);
- appendFiles((phylipFile + "tempPhylipC"), phylipFile);
- remove((distFile + "tempc").c_str());
- remove((phylipFile + "tempPhylipC").c_str());
- }
- wait(NULL);
- }
- else if(processors == 4){
- int pid1 = fork();
- if(pid1 > 0){
- int pid2 = fork();
- if(pid2 > 0){
- driver(distCalculator, seqDB, 0, numSeqs / 2, distFile + "tempa", phylipFile + "tempPhylipA", cutoff);
- appendFiles(distFile+"tempa", distFile);
- appendFiles((phylipFile + "tempPhylipA"), phylipFile);
- remove((distFile + "tempa").c_str());
- remove((phylipFile + "tempPhylipA").c_str());
- }
- else{
- driver(distCalculator, seqDB, numSeqs / 2, (numSeqs/sqrt(2)), distFile + "tempb", phylipFile + "tempPhylipB", cutoff);
- appendFiles(distFile+"tempb", distFile);
- appendFiles((phylipFile + "tempPhylipB"), phylipFile);
- remove((distFile + "tempb").c_str());
- remove((phylipFile + "tempPhylipB").c_str());
- }
- wait(NULL);
- }
- else{
- int pid3 = fork();
- if(pid3 > 0){
- driver(distCalculator, seqDB, (numSeqs/sqrt(2)), (sqrt(3) * numSeqs / 2), distFile + "tempc", phylipFile + "tempPhylipC", cutoff);
- appendFiles(distFile+"tempc", distFile);
- appendFiles((phylipFile + "tempPhylipC"), phylipFile);
- remove((distFile + "tempc").c_str());
- remove((phylipFile + "tempPhylipC").c_str());
-
- }
- else{
- driver(distCalculator, seqDB, (sqrt(3) * numSeqs / 2), numSeqs, distFile + "tempd", phylipFile + "tempPhylipD", cutoff);
- appendFiles(distFile+"tempd", distFile);
- appendFiles((phylipFile + "tempPhylipD"), phylipFile);
- remove((distFile + "tempd").c_str());
- remove((phylipFile + "tempPhylipD").c_str());
- }
- wait(NULL);
- }
- wait(NULL);
- }
- wait(NULL);
-#elif (linux) || (__linux)
- if(processors == 1){
- driver(distCalculator, seqDB, 0, numSeqs, distFile, phylipFile + "tempPhylipA", cutoff);
- appendFiles((phylipFile + "tempPhylipA"), phylipFile);
- remove((phylipFile + "tempPhylipA").c_str());
- }
- else if(processors == 2){