string tempOut = outputDir + toString(getpid()) + ".temp";
writePrefs(tempOut, lines[process]);
exit(0);
- }else { m->mothurOut("unable to spawn the necessary processes."); m->mothurOutEndLine(); exit(0); }
+ }else {
+ m->mothurOut("[ERROR]: unable to spawn the necessary processes."); m->mothurOutEndLine();
+ for (int i = 0; i < processIDS.size(); i++) { kill (processIDS[i], SIGINT); }
+ exit(0);
+ }
}
//force parent to wait until all the processes are done
try {
ofstream outTemp;
- openOutputFile(file, outTemp);
+ m->openOutputFile(file, outTemp);
//lets you know what part of the pref matrix you are writing
outTemp << tempLine.start << '\t' << tempLine.num << endl;
try {
ifstream inTemp;
- openInputFile(file, inTemp);
+ m->openInputFile(file, inTemp);
int start, num;
//lets you know what part of the pref matrix you are writing
- inTemp >> start >> num; gobble(inTemp);
+ inTemp >> start >> num; m->gobble(inTemp);
for (int i = start; i < num; i++) {
inTemp >> pref[i][j].name >> pref[i][j].leftParent >> pref[i][j].rightParent;
inTemp >> pref[i][j].score >> pref[i][j].closestLeft >> pref[i][j].closestRight >> pref[i][j].midpoint;
- gobble(inTemp);
+ m->gobble(inTemp);
}
}