From 4fd244d5d8bf6956e3456cca1852539f12b9698d Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 27 Sep 2004 04:26:51 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4249 --- checkin_notes | 32 ++++++++++++++++++++--- db/boinc_db.C | 5 ++-- db/boinc_db.h | 4 ++- db/schema.sql | 15 +++++++---- doc/gui_rpc.php | 46 +++++++++++++++++++++++----------- doc/homogeneous_redundancy.php | 6 ++++- html/inc/db_ops.inc | 3 +++ html/ops/db_update.php | 8 +++++- py/Boinc/database.py | 5 +++- sched/db_dump.C | 2 +- sched/sched_send.C | 2 +- 11 files changed, 96 insertions(+), 32 deletions(-) diff --git a/checkin_notes b/checkin_notes index 86025093f6..2ee3b9aa62 100755 --- a/checkin_notes +++ b/checkin_notes @@ -17734,10 +17734,10 @@ David 24 Sept 2004 process_result_template.C Rom 24 Sept 2004 - - NEWGUI: Hook up the rest of the html panes for the transfers, messages, work, - and resources tabs. - - Kick start the CPU scheduler on startup by setting must_reschedule_cpus to true, - in case the scheduler is stuck in a funky state. + - NEWGUI: Hook up the rest of the html panes for the transfers, + messages, work, and resources tabs. + - Kick start the CPU scheduler on startup by setting must_reschedule_cpus + in case the scheduler is stuck in a funky state. client/ client_state.C @@ -17788,3 +17788,27 @@ David 25 Sept 2004 lib/ gui_rpc_client.C,h gui_test.C + +David 26 Sept 2004 + - Added the ability to turn homogeneous redundancy on/off + on a per-application basis. + + NOTE: this involved adding a homogeneous_redundancy field to + the app table in the database. + To upgrade to this server software, + you must run the SQL query in html/ops/db_update.php, + which adds this database field. + + db/ + boinc_db.C,h + schema.sql + html/ + inc/ + db_ops.inc + ops/ + db_update.php + py/Boinc/ + database.py + sched/ + db_dump.C + sched_send.C diff --git a/db/boinc_db.C b/db/boinc_db.C index d332a43a2d..c5b2a69869 100644 --- a/db/boinc_db.C +++ b/db/boinc_db.C @@ -125,9 +125,9 @@ void DB_CORE_VERSION::db_parse(MYSQL_ROW &r) { void DB_APP::db_print(char* buf){ sprintf(buf, "create_time=%d, name='%s', min_version=%d, " - "deprecated=%d, user_friendly_name='%s'", + "deprecated=%d, user_friendly_name='%s', homogeneous_redundancy=%d", create_time, name, min_version, - deprecated, user_friendly_name + deprecated?1:0, user_friendly_name, homogeneous_redundancy?1:0 ); } @@ -140,6 +140,7 @@ void DB_APP::db_parse(MYSQL_ROW &r) { min_version = atoi(r[i++]); deprecated = atoi(r[i++]); strcpy2(user_friendly_name, r[i++]); + homogeneous_redundancy = atoi(r[i++]); } void DB_APP_VERSION::db_print(char* buf){ diff --git a/db/boinc_db.h b/db/boinc_db.h index 9418849e25..5f7ffa2495 100755 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -79,8 +79,10 @@ struct APP { int create_time; char name[256]; // application name, preferably short int min_version; // don't use app versions before this - int deprecated; + bool deprecated; char user_friendly_name[256]; + bool homogeneous_redundancy; + int write(FILE*); void clear(); }; diff --git a/db/schema.sql b/db/schema.sql index 2f88ae71a9..08996177ca 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -1,10 +1,14 @@ /* If you add/change anything, update boinc_db.C,h and if needed: - py/Boinc/database.py - html_user/ - create_account_action.php - team_create_action.php + py/Boinc/ + database.py + html/ + ops/ + db_ops.inc + user/ + create_account_action.php + team_create_action.php sched/ db_dump.C */ @@ -42,8 +46,9 @@ create table app ( create_time integer not null, name varchar(254) not null, min_version integer not null, - deprecated integer not null, + deprecated smallint not null, user_friendly_name varchar(254) not null, + homogeneous_redundancy smallint not null, primary key (id) ) type=InnoDB; diff --git a/doc/gui_rpc.php b/doc/gui_rpc.php index 897c8b2b05..b5f0d46c67 100644 --- a/doc/gui_rpc.php +++ b/doc/gui_rpc.php @@ -14,7 +14,8 @@ to having GUI code in the core client. BOINC provides a C++ interface to these RPCs. The interface is based on the GUI_RPC class, which provides the following functions -(the program gui_test.C gives an example of their use): +(the code is in lib/gui_rpc_client.h, + and the program gui_test.C gives a usage example):

"; list_start(); @@ -46,8 +47,7 @@ list_item_func( "get_file_transfers(FILE_TRANSFERS&)", "Get a list of file transfers in progress. Each is linked by name to a project; - use CC_STATE::lookup_project() to find this project in - the current state; + use CC_STATE::lookup_project() to find this project in the current state; if it's not there, call get_state() again." ); list_item_func( @@ -64,21 +64,20 @@ list_item_func( create a graphics window" ); list_item_func( - "project_reset(char* url)", - "Reset the given project" + "project_op(PROJECT&, char* op)", + "Perform a control operation on the given project. + op is one of + \"suspend\", + \"resume\", + \"reset\", + \"detach\", or + \"update\". + " ); list_item_func( "project_attach(char* url, char* account_id)", "Attach to the given project" ); -list_item_func( - "project_detach(char* url)", - "Detach from the given project" -); -list_item_func( - "project_update(char* url)", - "Update the given project" -); list_item_func( "set_run_mode(int mode)", "Set the run mode (never/auto/always)." @@ -99,6 +98,10 @@ list_item_func( "set_proxy_settings(PROXY_INFO&)", "Set proxy settings" ); +list_item_func( + "get_proxy_settings(PROXY_INFO&)", + "Get proxy settings" +); list_item_func( "get_messages( int nmessages, @@ -114,8 +117,21 @@ list_item_func( They are returned in order of decreasing sequence number." ); list_item_func( - "retry_file_transfer(FILE_TRANSFER&)", - "Retry file transfer" + "file_transfer_op(FILE_TRANSFER&, char* op)", + "Perform a control operation on a file transfer. + op is one of + \"abort\" or + \"retry\". + " +); +list_item_func( + "result_op(FILE_TRANSFER&, char* op)", + "Perform a control operation on an active result. + op is one of + \"suspend\", + \"resume\", or + \"abort\". + " ); list_end(); echo " diff --git a/doc/homogeneous_redundancy.php b/doc/homogeneous_redundancy.php index a1fd619e11..5d7537f402 100644 --- a/doc/homogeneous_redundancy.php +++ b/doc/homogeneous_redundancy.php @@ -13,12 +13,16 @@ and results that are erroneous.

BOINC provides a feature called homogeneous redundancy for such applications. -This is enabled by including the line +You can enable it for a project by including the line

 <homogeneous_redundancy/>
 
in the config.xml file. +

+Alternatively, you can enable it selectively for a single +application by setting the +homogeneous_redundancy field in its database record.

When this feature is enabled, the BOINC scheduler will send results for a given workunit diff --git a/html/inc/db_ops.inc b/html/inc/db_ops.inc index ec09a66c45..15bdce1f7a 100644 --- a/html/inc/db_ops.inc +++ b/html/inc/db_ops.inc @@ -382,6 +382,9 @@ function show_app($app) { row("ID", $app->id); row("Created", time_str($app->create_time)); row("Name", $app->name); + row("User-friendly name", $app->user_friendly_name); + row("Deprecated", $app->deprecated); + row("Homogeneous redundancy", $app->homogeneous_redundancy); row("","id>App Versions for this application"); row("","id&detail=low>Workunits for this application"); end_table(); diff --git a/html/ops/db_update.php b/html/ops/db_update.php index f2181322b2..25d6349570 100644 --- a/html/ops/db_update.php +++ b/html/ops/db_update.php @@ -100,6 +100,12 @@ function update_9_05_2004() { ); } -//update_9_05_2004(); +function update_9_26_2004() { + mysql_query( + "alter table app add homogeneous_redundancy smallint not null" + ); +} + +//update_9_26_2004(); ?> diff --git a/py/Boinc/database.py b/py/Boinc/database.py index ef862a95e4..0acf166ed3 100644 --- a/py/Boinc/database.py +++ b/py/Boinc/database.py @@ -58,7 +58,10 @@ class App(DatabaseObject): table = 'app', columns = [ 'create_time', 'name', - 'min_version' ]) + 'min_version', + 'deprecated', + 'user_friendly_name', + 'homogeneous_redundancy' ]) class AppVersion(DatabaseObject): _table = DatabaseTable( diff --git a/sched/db_dump.C b/sched/db_dump.C index 56ca4a2830..54b442495d 100644 --- a/sched/db_dump.C +++ b/sched/db_dump.C @@ -357,7 +357,6 @@ void write_host(HOST& host, FILE* f, bool detail) { } void write_user(USER& user, FILE* f, bool detail) { - DB_HOST host; char buf[1024]; char cpid[MD5_LEN]; @@ -407,6 +406,7 @@ void write_user(USER& user, FILE* f, bool detail) { } #if 0 if (detail && user.show_hosts) { + DB_HOST host; sprintf(buf, "where userid=%d", user.id); while (!host.enumerate(buf)) { if (host.total_credit > 0) { diff --git a/sched/sched_send.C b/sched/sched_send.C index 32f3456fca..db4127fa8f 100644 --- a/sched/sched_send.C +++ b/sched/sched_send.C @@ -642,7 +642,7 @@ static void scan_work_array( // if desired, make sure redundancy is homogeneous // - if (config.homogeneous_redundancy) { + if (config.homogeneous_redundancy || app->homogeneous_redundancy) { if (already_sent_to_different_platform( sreq, wu_result.workunit, wreq )) {