diff --git a/checkin_notes b/checkin_notes
index efd4a66b73..0ab8a478a7 100755
--- a/checkin_notes
+++ b/checkin_notes
@@ -11287,3 +11287,20 @@ David 20 Oct 2006
gui_rpc_server.C
lib/
filesys.C
+
+David 20 Oct 2006
+ - Output files can be tagged as "optional".
+ If the application doesn't generate an optional output file,
+ the client treats it as normal
+ (i.e. doesn't flag it as an error)
+ NOTES:
+ 1) to make an output file optional,
+ put in its
+ element in the result template file
+ 2) clients earlier than 5.8 don't recognize this attribute;
+ they will mark results as "compute error" if
+ any of their output files are missing
+
+ client/
+ client_types.C,h
+ cs_apps.C
diff --git a/client/client_types.C b/client/client_types.C
index c62c15d697..4e91302a12 100644
--- a/client/client_types.C
+++ b/client/client_types.C
@@ -1165,13 +1165,15 @@ int FILE_REF::parse(MIOFILE& in) {
fd = -1;
main_program = false;
copy_file = false;
+ optional = false;
while (in.fgets(buf, 256)) {
if (match_tag(buf, "")) return 0;
else if (parse_str(buf, "", file_name, sizeof(file_name))) continue;
else if (parse_str(buf, "", open_name, sizeof(open_name))) continue;
else if (parse_int(buf, "", fd)) continue;
- else if (match_tag(buf, "")) main_program = true;
- else if (match_tag(buf, "")) copy_file = true;
+ else if (parse_bool(buf, "main_program", main_program)) continue;
+ else if (parse_bool(buf, "copy_file", copy_file)) continue;
+ else if (parse_bool(buf, "optional", optional)) continue;
else {
if (log_flags.unparsed_xml) {
msg_printf(0, MSG_ERROR,
@@ -1202,6 +1204,9 @@ int FILE_REF::write(MIOFILE& out) {
if (copy_file) {
out.printf(" \n");
}
+ if (optional) {
+ out.printf(" \n");
+ }
out.printf(" \n");
return 0;
}
diff --git a/client/client_types.h b/client/client_types.h
index 5a421efb01..cba84431ab 100644
--- a/client/client_types.h
+++ b/client/client_types.h
@@ -126,7 +126,9 @@ struct FILE_REF {
bool main_program;
FILE_INFO* file_info;
bool copy_file; // if true, core client will copy the file instead of linking
-
+ bool optional;
+ // for output files: app may not generate file;
+ // don't treat as error if file is missing.
int parse(MIOFILE&);
int write(MIOFILE&);
};
diff --git a/client/cs_apps.C b/client/cs_apps.C
index 4a5d9b8dc6..34d838983c 100644
--- a/client/cs_apps.C
+++ b/client/cs_apps.C
@@ -65,11 +65,17 @@ int CLIENT_STATE::app_finished(ACTIVE_TASK& at) {
if (rp->exit_status != ERR_ABORTED_VIA_GUI) {
for (i=0; ioutput_files.size(); i++) {
- fip = rp->output_files[i].file_info;
+ FILE_REF& fref = rp->output_files[i];
+ fip = fref.file_info;
if (fip->uploaded) continue;
get_pathname(fip, path);
retval = file_size(path, size);
if (retval) {
+ if (fref.optional) {
+ fip->upload_when_present = false;
+ continue;
+ }
+
// an output file is unexpectedly absent.
//
fip->status = retval;