Ticket #1034: sched_credit.patch

File sched_credit.patch, 1.2 KB (added by dhardy, 13 years ago)

patch against boinc/sched/credit.cpp

  • sched/credit.cpp

     
    732732                );
    733733            }
    734734        }
    735         if (max_granted_credit && pfc*COBBLESTONE_SCALE > max_granted_credit) {
     735        if (pfc > wu.rsc_fpops_bound) {
    736736            log_messages.printf(MSG_NORMAL,
    737                 "[credit] Credit too high: %f\n", pfc*COBBLESTONE_SCALE
     737                "[credit] PFC too high: %f\n", pfc*COBBLESTONE_SCALE
    738738            );
    739739            pfc = wu_estimated_pfc(wu, app);
    740740        }
    741         if (pfc > wu.rsc_fpops_bound) {
     741        if (max_granted_credit && pfc*COBBLESTONE_SCALE > max_granted_credit) {
    742742            log_messages.printf(MSG_NORMAL,
    743                 "[credit] PFC too high: %f\n", pfc*COBBLESTONE_SCALE
     743                "[credit] Credit too high: %f\n", pfc*COBBLESTONE_SCALE
    744744            );
    745             pfc = wu_estimated_pfc(wu, app);
     745            // Don't use the fallback wu_estimated_pfc() here, since it's not necessarily any more correct.
     746            pfc = max_granted_credit / COBBLESTONE_SCALE;
    746747        }
    747748        if (mode == PFC_MODE_NORMAL) {
    748749            normal.push_back(pfc);