Skip to content

Commit

Permalink
- client: write log flags in alpha order
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpanderson authored and Oliver Bock committed Mar 15, 2013
1 parent f431c28 commit 033a476
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 21 deletions.
15 changes: 11 additions & 4 deletions client/log_flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,17 @@ int read_config_file(bool init, const char* fname) {
}

// Do stuff involving GPU exclusions.
// - Count excluded GPUS per project.
// NOTE: this is currently done just on the project level.
// Could do it at the app level also.
// - Flag app versions and results for which all GPUs are excluded
// - check syntax
// - set APP::non_excluded_instances[rsc_type]
// (used in RR sim)
// - set PROJECT::rsc_pwf[rsc_type].non_excluded_instances
// (used in work fetch)
// - set PROJECT::rsc_pwf[rsc_type].ncoprocs_excluded
// (used in RR sim and work fetch)
// - set APP_VERSION::coproc_missing for app versions where
// all instances are excluded
// - set RESULT::coproc_missing for results for which
// APP_VERSION::coproc_missing is set.
//
void process_gpu_exclusions() {
unsigned int i, j, a;
Expand Down
5 changes: 5 additions & 0 deletions db/boinc_db_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ struct CREDITED_JOB {
// the database will become inconsistent

// values of result.server_state
// see html/inc/common_defs.inc
//
//#define RESULT_SERVER_STATE_INACTIVE 1
#define RESULT_SERVER_STATE_UNSENT 2
Expand All @@ -474,6 +475,7 @@ struct CREDITED_JOB {
// Note: we could get a reply even after timing out.

// values of result.outcome
// see html/inc/common_defs.inc
//
#define RESULT_OUTCOME_INIT 0
#define RESULT_OUTCOME_SUCCESS 1
Expand All @@ -493,6 +495,7 @@ struct CREDITED_JOB {
// we believe that the client detached

// values of result.validate_state
// see html/inc/common_defs.inc
//
#define VALIDATE_STATE_INIT 0
#define VALIDATE_STATE_VALID 1
Expand All @@ -516,6 +519,7 @@ struct CREDITED_JOB {
#define ASSIGN_TEAM 3

// values for RESULT.app_version_id for anonymous platform
// see html/inc/common_defs.inc
#define ANON_PLATFORM_UNKNOWN -1 // relic of old scheduler
#define ANON_PLATFORM_CPU -2
#define ANON_PLATFORM_NVIDIA -3
Expand Down Expand Up @@ -608,6 +612,7 @@ struct BATCH {
};

// values of batch.state
// see html/inc/common_defs.inc
//
#define BATCH_STATE_INIT 0
#define BATCH_STATE_IN_PROGRESS 1
Expand Down
39 changes: 38 additions & 1 deletion html/inc/common_defs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.

// defines needed by multiple pieces of code
// values for various database fields

// see db/boinc_db.h
//
Expand All @@ -26,4 +26,41 @@ define('BATCH_STATE_COMPLETE', 2);
define('BATCH_STATE_ABORTED', 3);
define('BATCH_STATE_RETIRED', 4);

define('ANON_PLATFORM_UNKNOWN', -1);
define('ANON_PLATFORM_CPU', -2);
define('ANON_PLATFORM_NVIDIA', -3);
define('ANON_PLATFORM_ATI', -4);
define('ANON_PLATFORM_INTEL', -5);

define('RESULT_SERVER_STATE_UNSENT', 2);
define('RESULT_SERVER_STATE_IN_PROGRESS', 4);
define('RESULT_SERVER_STATE_OVER', 5);

define('RESULT_OUTCOME_INIT', 0);
define('RESULT_OUTCOME_SUCCESS', 1);
define('RESULT_OUTCOME_COULDNT_SEND', 2);
define('RESULT_OUTCOME_CLIENT_ERROR', 3);
define('RESULT_OUTCOME_NO_REPLY', 4);
define('RESULT_OUTCOME_DIDNT_NEED', 5);
define('RESULT_OUTCOME_VALIDATE_ERROR', 6);
define('RESULT_OUTCOME_CLIENT_DETACHED', 7);

define('VALIDATE_STATE_INIT', 0);
define('VALIDATE_STATE_VALID', 1);
define('VALIDATE_STATE_INVALID', 2);
define('VALIDATE_STATE_NO_CHECK', 3);
define('VALIDATE_STATE_INCONCLUSIVE',4);
define('VALIDATE_STATE_TOO_LATE', 5);

// from lib/common_defs.h
//
define('RESULT_NEW', 0);
define('RESULT_FILES_DOWNLOADING', 1);
define('RESULT_FILES_DOWNLOADED', 2);
define('RESULT_COMPUTE_ERROR', 3);
define('RESULT_FILES_UPLOADING', 4);
define('RESULT_FILES_UPLOADED', 5);
define('RESULT_ABORTED', 6);
define('RESULT_UPLOAD_FAILED', 7);

?>
29 changes: 19 additions & 10 deletions html/inc/result.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

require_once("../inc/translation.inc");
require_once("../inc/dir_hier.inc");
require_once("../inc/common_defs.inc");

// used by app_version_string(), see below
//
Expand All @@ -42,11 +43,19 @@ function app_version_string($result) {
global $apps, $app_versions;

$id = $result->app_version_id;
if ($id == 0) return "";
if ($id == -1) return anon_platform_string($result);
if ($id == -2) return anon_platform_string($result, tra("CPU"));
if ($id == -3) return anon_platform_string($result, tra("NVIDIA GPU"));
if ($id == -4) return anon_platform_string($result, tra("ATI GPU"));
switch ($id) {
case 0: return "";
case ANON_PLATFORM_UNKNOWN:
return anon_platform_string($result);
case ANON_PLATFORM_CPU:
return anon_platform_string($result, tra("CPU"));
case ANON_PLATFORM_NVIDIA:
return anon_platform_string($result, tra("NVIDIA GPU"));
case ANON_PLATFORM_ATI:
return anon_platform_string($result, tra("ATI GPU"));
case ANON_PLATFORM_INTEL:
return anon_platform_string($result, tra("Intel GPU"));
}
if (array_key_exists($id, $app_versions)) {
$av = $app_versions[$id];
$app = $apps[$av->appid];
Expand All @@ -70,15 +79,15 @@ function app_version_string($result) {
}

function result_granted_credit_string($result, $string_to_show) {
if ($result->server_state == 4 && $result->granted_credit > 0) {
if ($result->server_state == RESULT_SERVER_STATE_IN_PROGRESS && $result->granted_credit > 0) {
return $string_to_show;
}
if ($result->server_state <> 5) return "---";
if ($result->server_state <> RESULT_SERVER_STATE_OVER) return "---";
switch($result->outcome) {
case 1: //Success
case RESULT_OUTCOME_SUCCESS:
switch ($result->validate_state) {
case 0:
case 4:
case VALIDATE_STATE_INIT:
case VALIDATE_STATE_INCONCLUSIVE:
return tra("pending");
}
return $string_to_show;
Expand Down
4 changes: 2 additions & 2 deletions html/ops/app_reset.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
function reset_app($app) {
$avs = BoincAppVersion::enum("appid=$app->id");
foreach ($avs as $av) {
$av->update("pfc_n=0, pfc_avg=0, pfc_scale=0, et_n=0, et_avg=0, et_var=0, et_q=0, expavg_credit=0, expavg_time=0");
BoincHostAppVersion::update_aux("pfc_n=0, pfc_avg=0 where app_version_id=$av->id");
$av->update("pfc_n=0, pfc_avg=0, pfc_scale=0, expavg_credit=0, expavg_time=0");
BoincHostAppVersion::update_aux("pfc_n=0, pfc_avg=0, et_n=0, et_avg=0, et_var=0, et_q=0 where app_version_id=$av->id");
}
$app->update("min_avg_pfc = 0");
}
Expand Down
8 changes: 4 additions & 4 deletions lib/cc_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ int LOG_FLAGS::parse(XML_PARSER& xp) {
if (xp.parse_bool("http_xfer_debug", http_xfer_debug)) continue;
if (xp.parse_bool("mem_usage_debug", mem_usage_debug)) continue;
if (xp.parse_bool("network_status_debug", network_status_debug)) continue;
if (xp.parse_bool("notice_debug", notice_debug)) continue;
if (xp.parse_bool("poll_debug", poll_debug)) continue;
if (xp.parse_bool("proxy_debug", proxy_debug)) continue;
if (xp.parse_bool("rr_simulation", rr_simulation)) continue;
Expand All @@ -97,7 +98,6 @@ int LOG_FLAGS::parse(XML_PARSER& xp) {
if (xp.parse_bool("trickle_debug", trickle_debug)) continue;
if (xp.parse_bool("unparsed_xml", unparsed_xml)) continue;
if (xp.parse_bool("work_fetch_debug", work_fetch_debug)) continue;
if (xp.parse_bool("notice_debug", notice_debug)) continue;
xp.skip_unexpected(true, "LOG_FLAGS::parse");
}
return ERR_XML_PARSE;
Expand Down Expand Up @@ -128,6 +128,7 @@ int LOG_FLAGS::write(MIOFILE& out) {
" <http_xfer_debug>%d</http_xfer_debug>\n"
" <mem_usage_debug>%d</mem_usage_debug>\n"
" <network_status_debug>%d</network_status_debug>\n"
" <notice_debug>%d</notice_debug>\n"
" <poll_debug>%d</poll_debug>\n"
" <proxy_debug>%d</proxy_debug>\n"
" <rr_simulation>%d</rr_simulation>\n"
Expand All @@ -143,7 +144,6 @@ int LOG_FLAGS::write(MIOFILE& out) {
" <trickle_debug>%d</trickle_debug>\n"
" <unparsed_xml>%d</unparsed_xml>\n"
" <work_fetch_debug>%d</work_fetch_debug>\n"
" <notice_debug>%d</notice_debug>\n"
" </log_flags>\n",
file_xfer ? 1 : 0,
sched_ops ? 1 : 0,
Expand All @@ -167,6 +167,7 @@ int LOG_FLAGS::write(MIOFILE& out) {
http_xfer_debug ? 1 : 0,
mem_usage_debug ? 1 : 0,
network_status_debug ? 1 : 0,
notice_debug ? 1 : 0,
poll_debug ? 1 : 0,
proxy_debug ? 1 : 0,
rr_simulation ? 1 : 0,
Expand All @@ -181,8 +182,7 @@ int LOG_FLAGS::write(MIOFILE& out) {
time_debug ? 1 : 0,
trickle_debug ? 1 : 0,
unparsed_xml ? 1 : 0,
work_fetch_debug ? 1 : 0,
notice_debug ? 1 : 0
work_fetch_debug ? 1 : 0
);

return 0;
Expand Down
1 change: 1 addition & 0 deletions lib/common_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ enum BATTERY_STATE {
// Values of RESULT::state in client.
// THESE MUST BE IN NUMERICAL ORDER
// (because of the > comparison in RESULT::computing_done())
// see html/inc/common_defs.inc
//
#define RESULT_NEW 0
// New result
Expand Down

0 comments on commit 033a476

Please sign in to comment.