// fscanf reads 3 parameters succesfully  and returns:*  n = 3*

  if (3 != 2) return 0;


// it will always  *FAIL and return 0 here,  if all three are read!!!*

   It will *NOT  * overwrite those  "mutable"  parameters:


*ntasks_completed = nt;cpu = c;rt = r;*



//  I  * seriously doubt * that  this is *what we want* *and expect * it to
do!


FIlip

2015-04-21 7:34 GMT+02:00 Kevin Vinsen <[email protected]>:

> I think I’ve found a bug in the BOINC wrapper for checkpointing
>
> Line 973 of wrapper.c is the read_checkpoint function.
>
>
> int read_checkpoint(int& ntasks_completed, double& cpu, double& rt) {
>     int nt;
>     double c, r;
>
>     ntasks_completed = 0;
>     cpu = 0;
>     FILE* f = fopen(CHECKPOINT_FILENAME, "r");
>     if (!f) return ERR_FOPEN;
>     int n = fscanf(f, "%d %lf %lf", &nt, &c, &r);
>     fclose(f);
>     if (n != 2) return 0;
>     ntasks_completed = nt;
>     cpu = c;
>     rt = r;
>     return 0;
> }
>
> The fscanf is scanning 3 parameters not 2.
>
> Regards
> Kevin
>
>
>
> _______________________________________________
> 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