My code is as below:  I set 'replication_factor = 1' in work generator and 
'grant_credit_wu' for the validator.

The validator is simply check whether a symbol '-' is in the last line (to 
prevent aborting tasks to cheat).


This system was working before I restore the database, and now it seems working 
again. Also I found a lots of tasks having validate_state as 'workunit error, 
skip it..'.. Would it possible there are some problems on database (Mysql) that 
cause the thing ? 


----------------------------------------------

#include "string.h" 
#include "error_numbers.h"
#include "boinc_db.h" 
#include "sched_util.h"
#include "validate_util.h" 
#include "sched_config.h" 
#include "sched_msgs.h"


int init_result(RESULT & result, void*& data) {

    FILE* f;
    FILE_INFO fi;
    int retval;
    
    retval = get_output_file_path(result, fi.path);
    if (retval) return retval;
    retval = try_fopen(fi.path.c_str(), f, "r");
    if (retval) return retval;
    
    char tempbuf[256];
    int len = 0;
    memset(tempbuf,0,256);

    int end = 0;

    while(fgets(tempbuf,256,f)!=NULL)
    { 
         if(end == 1)
         {  
                 log_messages.printf(MSG_CRITICAL,"validator: invalid end.\n");
                 return 1;
         }

         len = strlen(tempbuf);
        
         if(len > 256)
              return 1;

         tempbuf[len] = 0;
    
         if((tempbuf[0]!='@') && (tempbuf[0]!='>') && (tempbuf[0]!='-'))
         {   
               log_messages.printf(MSG_CRITICAL,"Validator: Invalid results 
from clients!\n");
               return 1;
         }
         else
         {
              /* Should be the end line */
              if(tempbuf[0] == '-')
              {
                  end = 1;
              }
         }
 
         memset(tempbuf,0,256);   
    }

    fclose(f);

    log_messages.printf(MSG_CRITICAL, "Validator: Valid result!\n");   
    return 0;
}

int compare_results(
    RESULT& r1, void* _data1, RESULT const& r2, void* _data2, bool& match
) {
     match = true;
     return 0;
}

int cleanup_result(RESULT const& r, void* data) {
   
    return 0;
}

double compute_granted_credit(WORKUNIT& wu, vector<RESULT>& results) {
    return get_credit_from_wu(wu, results);
}

---------------------------------------------











--- On Mon, 11/2/09, Nicolás Alvarez <[email protected]> wrote:

> From: Nicolás Alvarez <[email protected]>
> Subject: Re: [boinc_dev] Got a lots of Inconclusive validate state (=4) in 
> server side ?
> To: [email protected]
> Date: Monday, November 2, 2009, 9:31 PM
> On 11/2/09, Kunsheng Chen <[email protected]>
> wrote:
> > This is happening in the past week. The server starts
> to get around 20,000
> > results whose validate_state = 4; Which means
> inconclusive according to
> > boinc:
> >
> > ------------------------------------
> > Set by validator to INCONCLUSIVE (4) if check_set()
> didn't find a consensus
> > in a set of results containing this one.
> > --------------------------------
> >
> > I am a little bit confused about that since I set
> 'replication factor =1 '
> > inside WU and have a validator which only checks
> whether a certain end
> > symbol is in the result.
> >
> > So there should be no comparision between 'sets of
> results'  if I was doing
> > right, but this info seems telling a different story
> ?
> >
> >
> > Thanks,
> >
> > -Kun
> 
> Are you using the simple validator? If so, please post the
> code of
> your compare_results function.
> 
> -- 
> Nicolas
> _______________________________________________
> boinc_dev mailing list
> [email protected]
> http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
> To unsubscribe, visit the above URL and
> (near bottom of page) enter your email address.
> 


      
_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to