+ }
+ 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){
+
+ int pid = fork();
+ if(pid > 0){
+ driver(distCalculator, seqDB, 0, (numSeqs/sqrt(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/sqrt(2)), numSeqs, distFile + "tempb", phylipFile + "tempPhylipB", cutoff);
+ appendFiles((distFile+"tempb"), distFile);
+ appendFiles((phylipFile + "tempPhylipB"), phylipFile);
+ remove((distFile + "tempb").c_str());
+ remove((phylipFile + "tempPhylipB").c_str());
+ }
+ wait();
+
+ }
+ else if(processors == 3){
+ int pid1 = fork();
+ if(pid1 > 0){
+ int pid2 = fork();
+ if(pid2 > 0){
+ driver(distCalculator, seqDB, 0, (numSeqs/sqrt(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/sqrt(2)), numSeqs, distFile + "tempb", phylipFile + "tempPhylipB", cutoff);
+ appendFiles((distFile+"tempb"), distFile);
+ appendFiles((phylipFile + "tempPhylipB"), phylipFile);
+ remove((distFile + "tempb").c_str());
+ remove((phylipFile + "tempPhylipB").c_str());
+ }
+ wait();
+ }
+ 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();
+ }
+ else if(processors == 4){
+ int pid1 = fork();
+ if(pid1 > 0){
+ int pid2 = fork();
+ if(pid2 > 0){
+ driver(distCalculator, seqDB, 0, (numSeqs/sqrt(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/sqrt(2)), numSeqs, distFile + "tempb", phylipFile + "tempPhylipB", cutoff);
+ appendFiles((distFile+"tempb"), distFile);
+ appendFiles((phylipFile + "tempPhylipB"), phylipFile);
+ remove((distFile + "tempb").c_str());
+ remove((phylipFile + "tempPhylipB").c_str());
+ }
+ wait();
+ }
+ else{
+ int pid3 = fork();
+ if(pid3 > 0){
+ 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());
+ }
+ 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();
+ }
+ wait();
+ }
+ wait();
+
+#else
+ driver(distCalculator, seqDB, 0, numSeqs, distFile, phylipFile + "tempPhylipA", cutoff);
+ appendFiles((phylipFile + "tempPhylipA"), phylipFile);
+ remove((phylipFile + "tempPhylipA").c_str());
+#endif
+