//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
process++;
}else if (pid == 0){
//clear old file because we append in driver
- m->mothurRemove(newSummaryFile + toString(getpid()) + ".temp");
+ m->mothurRemove(newSummaryFile + m->mothurGetpid(process) + ".temp");
- otusToRemove = driver(newSummaryFile + toString(getpid()) + ".temp", minTms, maxTms, primers, conSeqs, lines[process].start, lines[process].end, numBinsProcessed, binIndex);
+ otusToRemove = driver(newSummaryFile + m->mothurGetpid(process) + ".temp", minTms, maxTms, primers, conSeqs, lines[process].start, lines[process].end, numBinsProcessed, binIndex);
- string tempFile = toString(getpid()) + ".otus2Remove.temp";
+ string tempFile = m->mothurGetpid(process) + ".otus2Remove.temp";
ofstream outTemp;
m->openOutputFile(tempFile, outTemp);
//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
}else if (pid == 0){
counts = driverGetCounts(nameMap, fastaCount, otuCounts, lines[process].start, lines[process].end);
- string tempFile = toString(getpid()) + ".cons_counts.temp";
+ string tempFile = m->mothurGetpid(process) + ".cons_counts.temp";
ofstream outTemp;
m->openOutputFile(tempFile, outTemp);