. // generate XML showing the average PFC of GPU versions // relative to CPU versions. // This can be used to scale GPU credit // for projects that have only GPU versions require_once("../inc/boinc_db.inc"); require_once("../inc/xml.inc"); $cpu_scale_sum = 0; $cpu_credit_sum = 0; $ati_scale_sum = 0; $ati_credit_sum = 0; $nvidia_scale_sum = 0; $nvidia_credit_sum = 0; $total_credit_sum= 0; $apps = BoincApp::enum("deprecated=0"); foreach ($apps as $app) { $avs = BoincAppVersion::enum("appid=$app->id and deprecated=0"); foreach ($avs as $av) { if (strstr($av->plan_class, "ati")) { $ati_scale_sum += $av->pfc_scale * $av->expavg_credit; $ati_credit_sum += $av->expavg_credit; } else if (strstr($av->plan_class, "nvidia") || strstr($av->plan_class, "cuda")) { $nvidia_scale_sum += $av->pfc_scale * $av->expavg_credit; $nvidia_credit_sum += $av->expavg_credit; } else { $cpu_scale_sum += $av->pfc_scale * $av->expavg_credit; $cpu_credit_sum += $av->expavg_credit; } $total_credit_sum += $av->expavg_credit; } } xml_header(); echo " $total_credit_sum "; if ($cpu_credit_sum) { echo " ", $cpu_scale_sum/$cpu_credit_sum, "\n"; } if ($ati_credit_sum) { echo " ", $ati_scale_sum/$ati_credit_sum, "\n"; } if ($nvidia_credit_sum) { echo " ", $nvidia_scale_sum/$nvidia_credit_sum, "\n"; } echo "\n"; ?>