- client: don't print error message if output file with <copy_file>

attribute is missing.  That's the app's problem, not BOINC's
- sample assimilator: if a canonical instance has no output files,
    rather than quitting create a file named WU_NAME_no_output_files

svn path=/trunk/boinc/; revision=19082
This commit is contained in:
David Anderson 2009-09-17 21:06:11 +00:00
parent ba23e2fa83
commit 76583d54d9
3 changed files with 27 additions and 4 deletions

View File

@ -7801,3 +7801,14 @@ David 17 Sept 2009
generate_svn_version.sh generate_svn_version.sh
sched/ sched/
(most).cpp (most).cpp
David 17 Sept 2009
- client: don't print error message if output file with <copy_file>
attribute is missing. That's the app's problem, not BOINC's
- sample assimilator: if a canonical instance has no output files,
rather than quitting create a file named WU_NAME_no_output_files
client/
app_start.cpp
sched/
sample_assimilator.cpp

View File

@ -339,12 +339,18 @@ int ACTIVE_TASK::copy_output_files() {
sprintf(slotfile, "%s/%s", slot_dir, fref.open_name); sprintf(slotfile, "%s/%s", slot_dir, fref.open_name);
get_pathname(fip, projfile, sizeof(projfile)); get_pathname(fip, projfile, sizeof(projfile));
int retval = boinc_rename(slotfile, projfile); int retval = boinc_rename(slotfile, projfile);
#if 0
// this isn't a BOINC error.
// it just means the app didn't create an output file
// that it was supposed to.
//
if (retval) { if (retval) {
msg_printf(wup->project, MSG_INTERNAL_ERROR, msg_printf(wup->project, MSG_INTERNAL_ERROR,
"Can't rename output file %s to %s: %s", "Can't rename output file %s to %s: %s",
fip->name, projfile, boincerror(retval) fip->name, projfile, boincerror(retval)
); );
} }
#endif
} }
return 0; return 0;
} }

View File

@ -59,6 +59,7 @@ int assimilate_handler(
const char *copy_path; const char *copy_path;
get_output_file_infos(canonical_result, output_files); get_output_file_infos(canonical_result, output_files);
unsigned int n = output_files.size(); unsigned int n = output_files.size();
bool file_copied = false;
for (i=0; i<n; i++) { for (i=0; i<n; i++) {
FILE_INFO& fi = output_files[i]; FILE_INFO& fi = output_files[i];
if (n==1) { if (n==1) {
@ -67,12 +68,17 @@ int assimilate_handler(
copy_path = config.project_path("sample_results/%s_%d", wu.name, i); copy_path = config.project_path("sample_results/%s_%d", wu.name, i);
} }
retval = boinc_copy(fi.path.c_str() , copy_path); retval = boinc_copy(fi.path.c_str() , copy_path);
if (retval && !fi.optional) { if (!retval) {
sprintf(buf, "couldn't copy file %s\n", fi.path.c_str()); file_copied = true;
write_error(buf);
return retval;
} }
} }
if (!file_copied) {
copy_path = config.project_path(
"sample_results/%s_%s", wu.name, "no_output_files"
);
FILE* f = fopen(copy_path, "w");
fclose(f);
}
} else { } else {
sprintf(buf, "%s: 0x%x\n", wu.name, wu.error_mask); sprintf(buf, "%s: 0x%x\n", wu.name, wu.error_mask);
return write_error(buf); return write_error(buf);