2003-01-23 08:07:48 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2003-04-07 19:06:00 +00:00
|
|
|
#include "boinc_db.h"
|
2004-04-08 08:15:23 +00:00
|
|
|
#include "sched_msgs.h"
|
2003-06-14 20:25:37 +00:00
|
|
|
#include "sched_util.h"
|
2004-04-08 08:15:23 +00:00
|
|
|
#include "assimilate_handler.h"
|
2003-01-23 08:07:48 +00:00
|
|
|
|
2004-06-30 18:17:21 +00:00
|
|
|
using std::vector;
|
|
|
|
|
2003-01-23 08:07:48 +00:00
|
|
|
void assimilate_handler(
|
|
|
|
WORKUNIT& wu, vector<RESULT>& results, RESULT& canonical_result
|
2003-08-12 20:58:24 +00:00
|
|
|
) {
|
2004-04-08 08:15:23 +00:00
|
|
|
SCOPE_MSG_LOG scope_messages(log_messages, SCHED_MSG_LOG::NORMAL);
|
2003-07-02 20:57:59 +00:00
|
|
|
scope_messages.printf("[%s] Assimilating\n", wu.name);
|
2003-01-23 08:07:48 +00:00
|
|
|
if (wu.canonical_resultid) {
|
2003-07-02 20:57:59 +00:00
|
|
|
scope_messages.printf("[%s] Found canonical result\n", wu.name);
|
2003-08-12 20:58:24 +00:00
|
|
|
log_messages.printf_multiline(
|
2004-04-08 08:15:23 +00:00
|
|
|
SCHED_MSG_LOG::DEBUG, canonical_result.xml_doc_out,
|
2003-08-12 20:58:24 +00:00
|
|
|
"[%s] canonical result", wu.name
|
|
|
|
);
|
2003-01-23 08:07:48 +00:00
|
|
|
} else {
|
2003-07-02 20:57:59 +00:00
|
|
|
scope_messages.printf("[%s] No canonical result\n", wu.name);
|
2003-01-23 08:07:48 +00:00
|
|
|
}
|
|
|
|
if (wu.error_mask&WU_ERROR_COULDNT_SEND_RESULT) {
|
2004-04-08 08:15:23 +00:00
|
|
|
log_messages.printf(SCHED_MSG_LOG::CRITICAL, "[%s] Error: couldn't send a result\n", wu.name);
|
2003-01-23 08:07:48 +00:00
|
|
|
}
|
|
|
|
if (wu.error_mask&WU_ERROR_TOO_MANY_ERROR_RESULTS) {
|
2004-04-08 08:15:23 +00:00
|
|
|
log_messages.printf(SCHED_MSG_LOG::CRITICAL, "[%s] Error: too many error results\n", wu.name);
|
2003-01-23 08:07:48 +00:00
|
|
|
}
|
2003-08-15 20:35:44 +00:00
|
|
|
if (wu.error_mask&WU_ERROR_TOO_MANY_TOTAL_RESULTS) {
|
2004-04-08 08:15:23 +00:00
|
|
|
log_messages.printf(SCHED_MSG_LOG::CRITICAL, "[%s] Error: too many total results\n", wu.name);
|
2003-01-23 08:07:48 +00:00
|
|
|
}
|
2003-08-15 20:35:44 +00:00
|
|
|
if (wu.error_mask&WU_ERROR_TOO_MANY_SUCCESS_RESULTS) {
|
2004-04-08 08:15:23 +00:00
|
|
|
log_messages.printf(SCHED_MSG_LOG::CRITICAL, "[%s] Error: too many success results\n", wu.name);
|
2003-08-15 20:35:44 +00:00
|
|
|
}
|
2003-01-23 08:07:48 +00:00
|
|
|
}
|