//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
for(int i=0;i<tempBarcodePrimerComboFileNames.size();i++){
for(int j=0;j<tempBarcodePrimerComboFileNames[0].size();j++){
if (tempBarcodePrimerComboFileNames[i][j] != "") {
- tempBarcodePrimerComboFileNames[i][j] += toString(getpid()) + ".temp";
+ tempBarcodePrimerComboFileNames[i][j] += m->mothurGetpid(process) + ".temp";
ofstream temp;
m->openOutputFile(tempBarcodePrimerComboFileNames[i][j], temp);
temp.close();
}
}
driverCreateTrim(flowFileName,
- (trimFlowFileName + toString(getpid()) + ".temp"),
- (scrapFlowFileName + toString(getpid()) + ".temp"),
- (fastaFileName + toString(getpid()) + ".temp"),
+ (trimFlowFileName + m->mothurGetpid(process) + ".temp"),
+ (scrapFlowFileName + m->mothurGetpid(process) + ".temp"),
+ (fastaFileName + m->mothurGetpid(process) + ".temp"),
tempBarcodePrimerComboFileNames, lines[process]);
exit(0);