remote job submission: improve error reporting

This commit is contained in:
David Anderson 2014-04-12 10:05:59 -07:00
parent 1e6e22449d
commit 39edd6d3f8
2 changed files with 9 additions and 2 deletions

View File

@ -181,10 +181,13 @@ function submit_jobs($jobs, $template, $app, $batch_id, $priority) {
$cmd = "cd ../..; ./bin/create_work --appname $app->name --batch $batch_id --rsc_fpops_est $job->rsc_fpops_est --priority $priority --stdin";
$h = popen($cmd, "w");
if ($h === false) {
xml_error(-1, "BOINC server: can't run create_work");
}
fwrite($h, $x);
$ret = pclose($h);
if ($ret < 0) {
xml_error(-1, "BOINC server: can't create job");
xml_error(-1, "BOINC server: create_work failed");
}
}

View File

@ -331,7 +331,7 @@ int main(int argc, char** argv) {
if (!strlen(jd2.wu.name)) {
sprintf(jd2.wu.name, "%s_%d", jd.wu.name, j);
}
create_work(
retval = create_work(
jd2.wu,
jd2.wu_template,
jd2.result_template_file,
@ -343,6 +343,10 @@ int main(int argc, char** argv) {
jd2.additional_xml,
value_buf
);
if (retval) {
fprintf(stderr, "create_work() failed: %d\n", retval);
exit(1);
}
if (values.size()) {
values += ",";
values += value_buf;