From 46e9e6977149b9e0096b48f3125a7b287a1040f7 Mon Sep 17 00:00:00 2001 From: Bruce Allen Date: Mon, 3 Jan 2005 10:49:38 +0000 Subject: [PATCH] Documentation http://boinc.berkeley.edu/hier_dir.php says: "Secondly, your validator and assimilator should call int get_output_file_path(RESULT const& result, string& path);" I've updated the example code to do this, and modified Makefile.am so that the correct objects are linked. svn path=/trunk/boinc/; revision=4984 --- sched/Makefile.am | 4 ++-- sched/assimilator_placeholder.C | 9 +++++++-- sched/sample_dummy_assimilator.C | 7 +++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sched/Makefile.am b/sched/Makefile.am index 780a13d741..210d9b5e2b 100644 --- a/sched/Makefile.am +++ b/sched/Makefile.am @@ -104,10 +104,10 @@ sample_trivial_validator_DEPENDENCIES = $(LIB_SCHED) validator_placeholder_SOURCES = validator.C validator_placeholder.C validate_util.C validate_util.h validator_placeholder_DEPENDENCIES = $(LIB_SCHED) -sample_dummy_assimilator_SOURCES = assimilator.C sample_dummy_assimilator.C +sample_dummy_assimilator_SOURCES = assimilator.C sample_dummy_assimilator.C validate_util.C validate_util.h sample_dummy_assimilator_DEPENDENCIES = $(LIB_SCHED) -assimilator_placeholder_SOURCES = assimilator.C assimilator_placeholder.C +assimilator_placeholder_SOURCES = assimilator.C assimilator_placeholder.C validate_util.C validate_util.h assimilator_placeholder_DEPENDENCIES = $(LIB_SCHED) db_dump_SOURCES = db_dump.C diff --git a/sched/assimilator_placeholder.C b/sched/assimilator_placeholder.C index 565657d134..3bcc07d780 100644 --- a/sched/assimilator_placeholder.C +++ b/sched/assimilator_placeholder.C @@ -3,8 +3,6 @@ // replace it with your own code and then 'make' in this Directory // will build it. - - // The contents of this file are subject to the BOINC Public License // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at @@ -32,8 +30,10 @@ #include "sched_msgs.h" #include "sched_util.h" #include "assimilate_handler.h" +#include "validate_util.h" using std::vector; +using std::string; int assimilate_handler( WORKUNIT& wu, vector& results, RESULT& canonical_result @@ -41,11 +41,16 @@ int assimilate_handler( SCOPE_MSG_LOG scope_messages(log_messages, SCHED_MSG_LOG::NORMAL); scope_messages.printf("[%s] Assimilating\n", wu.name); if (wu.canonical_resultid) { + string output_file_name; + scope_messages.printf("[%s] Found canonical result\n", wu.name); log_messages.printf_multiline( SCHED_MSG_LOG::DEBUG, canonical_result.xml_doc_out, "[%s] canonical result", wu.name ); + if (!(get_output_file_path(canonical_result, output_file_name))) { + scope_messages.printf("[%s] Output file path %s\n", wu.name, output_file_name.c_str()); + } } else { scope_messages.printf("[%s] No canonical result\n", wu.name); } diff --git a/sched/sample_dummy_assimilator.C b/sched/sample_dummy_assimilator.C index ad7cbb52cb..5a8e32166c 100644 --- a/sched/sample_dummy_assimilator.C +++ b/sched/sample_dummy_assimilator.C @@ -25,8 +25,10 @@ #include "sched_msgs.h" #include "sched_util.h" #include "assimilate_handler.h" +#include "validate_util.h" using std::vector; +using std::string; int assimilate_handler( WORKUNIT& wu, vector& results, RESULT& canonical_result @@ -34,11 +36,16 @@ int assimilate_handler( SCOPE_MSG_LOG scope_messages(log_messages, SCHED_MSG_LOG::NORMAL); scope_messages.printf("[%s] Assimilating\n", wu.name); if (wu.canonical_resultid) { + string output_file_name; + scope_messages.printf("[%s] Found canonical result\n", wu.name); log_messages.printf_multiline( SCHED_MSG_LOG::DEBUG, canonical_result.xml_doc_out, "[%s] canonical result", wu.name ); + if (!(get_output_file_path(canonical_result, output_file_name))) { + scope_messages.printf("[%s] Output file path %s\n", wu.name, output_file_name.c_str()); + } } else { scope_messages.printf("[%s] No canonical result\n", wu.name); }