Skip to content

Commit

Permalink
- server: add support for having a mixture of CPU-intensive
Browse files Browse the repository at this point in the history
    and non-CPU-intensive applications.
    An app can be specified as non-CPU-intensive in project.xml,
    and this attribute can be set or cleared using the admin web interface.
    Note: support for this was added to the client in 2011,
    but we didn't add server-side support at that time.
    This change is in 6.12 and later clients.


svn path=/trunk/boinc/; revision=26060
  • Loading branch information
davidpanderson committed Aug 25, 2012
1 parent a9e78b6 commit 32da1a7
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 14 deletions.
24 changes: 24 additions & 0 deletions checkin_notes
Original file line number Diff line number Diff line change
Expand Up @@ -5724,3 +5724,27 @@ David 24 Aug 2012
sched_vda.cpp
sched/
sched_config.cpp,h

David 24 Aug 2012
- server: add support for having a mixture of CPU-intensive
and non-CPU-intensive applications.
An app can be specified as non-CPU-intensive in project.xml,
and this attribute can be set or cleared using the admin web interface.
Note: support for this was added to the client in 2011,
but we didn't add server-side support at that time.
This change is in 6.12 and later clients.

py/Boinc/
database.py
vda/
vda_lib.cpp,h
db/
boinc_db_types.h
boinc_db.cpp
db/
schema.sql
sched/
sched_types.cpp
html/ops/
db_update.php
manage_apps.php
7 changes: 5 additions & 2 deletions db/boinc_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ void DB_APP::db_print(char* buf){
"target_nresults=%d, "
"min_avg_pfc=%.15e, "
"host_scale_check=%d, "
"homogeneous_app_version=%d, ",
"homogeneous_app_version=%d, "
"non_cpu_intensive=%d ",
create_time,
name,
min_version,
Expand All @@ -215,7 +216,8 @@ void DB_APP::db_print(char* buf){
target_nresults,
min_avg_pfc,
host_scale_check?1:0,
homogeneous_app_version?1:0
homogeneous_app_version?1:0,
non_cpu_intensive?1:0
);
}

Expand All @@ -235,6 +237,7 @@ void DB_APP::db_parse(MYSQL_ROW &r) {
min_avg_pfc = atof(r[i++]);
host_scale_check = (atoi(r[i++]) != 0);
homogeneous_app_version = (atoi(r[i++]) != 0);
non_cpu_intensive = (atoi(r[i++]) != 0);
}

void DB_APP_VERSION::db_print(char* buf){
Expand Down
1 change: 1 addition & 0 deletions db/boinc_db_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ struct APP {
// use host scaling cautiously, to thwart cherry picking
bool homogeneous_app_version;
// do all instances of each job using the same app version
bool non_cpu_intensive;

int write(FILE*);
void clear();
Expand Down
1 change: 1 addition & 0 deletions db/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ create table app (
min_avg_pfc double not null default 1,
host_scale_check tinyint not null default 0,
homogeneous_app_version tinyint not null default 0,
non_cpu_intensive tinyint not null default 0,
primary key (id)
) engine=InnoDB;

Expand Down
8 changes: 8 additions & 0 deletions html/ops/db_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,13 @@ function update_6_4_2012() {
");
}

function update_8_24_2012() {
do_query("
alter table app
add non_cpu_intensive tinyint not null default 0
");
}

// Updates are done automatically if you use "upgrade".
//
// If you need to do updates manually,
Expand All @@ -840,6 +847,7 @@ function update_6_4_2012() {
array(24248, "update_9_20_2011"),
array(25169, "update_1_30_2012"),
array(25734, "update_6_4_2012"),
array(26060, "update_8_24_2012"),
);

?>
19 changes: 17 additions & 2 deletions html/ops/manage_apps.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ function do_updates() {
if ($new_v != $old_v ) {
$app->update("homogeneous_app_version=$new_v");
}

$field = "non_cpu_intensive_".$id;
$new_v = (post_str($field, true)=='on') ? 1 : 0;
$old_v = $app->non_cpu_intensive;
if ($new_v != $old_v ) {
$app->update("non_cpu_intensive=$new_v");
}
}

// Adding a new application
Expand Down Expand Up @@ -119,7 +126,8 @@ function show_form($updated) {
"weight<br><a href=http://boinc.berkeley.edu/trac/wiki/BackendPrograms#feeder><span class=note>details</span></a>",
"homogeneous redundancy type<br><a href=http://boinc.berkeley.edu/trac/wiki/HomogeneousRedundancy><span class=note>details</span></a>",
"homogeneous app version?<br><a href=http://boinc.berkeley.edu/trac/wiki/HomogeneousAppVersion><span class=note>details</span></a>",
"deprecated?"
"deprecated?",
"Non-CPU-intensive?"
);

$total_weight = mysql_query('SELECT SUM(weight) AS total_weight FROM app WHERE deprecated=0');
Expand Down Expand Up @@ -174,10 +182,17 @@ function show_form($updated) {
<input name='$field' type='checkbox' $v></TD>
";

$field = "non_cpu_intensive_".$id;
$v = '';
if ($item->non_cpu_intensive) $v = ' CHECKED ';
echo " <TD align='center'>
<input name='$field' type='checkbox' $v></TD>
";

echo "</tr> ";
}
mysql_free_result($result);
echo "<tr><td colspan=6></td><td><input type='submit' name='update' value='Update'></td></tr>";
echo "<tr><td colspan=7></td><td><input type='submit' name='update' value='Update'></td></tr>";

end_table();

Expand Down
4 changes: 3 additions & 1 deletion py/Boinc/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ class App(DatabaseObject):
'beta',
'target_nresults',
'min_avg_pfc',
'host_scale_check'
'host_scale_check',
'homogeneous_app_version',
'non_cpu_intensive'
])

class AppVersion(DatabaseObject):
Expand Down
4 changes: 3 additions & 1 deletion sched/sched_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -993,8 +993,10 @@ int APP::write(FILE* fout) {
"<app>\n"
" <name>%s</name>\n"
" <user_friendly_name>%s</user_friendly_name>\n"
" <non_cpu_intensive>%d</non_cpu_intensive>\n"
"</app>\n",
name, user_friendly_name
name, user_friendly_name,
non_cpu_intensive?1:0
);
return 0;
}
Expand Down
7 changes: 0 additions & 7 deletions vda/vda_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,6 @@ const char* status_str(int status) {
return "unknown";
}

bool outdated_client(HOST& h) {
char* p = strstr(h.serialnum, "BOINC|");
if (!p) return true;
int n = atoi(p + strlen("BOINC|"));
return (n < 7);
}

///////////////// META_CHUNK ///////////////////////

META_CHUNK::META_CHUNK(
Expand Down
7 changes: 6 additions & 1 deletion vda/vda_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
extern void show_msg(char*);
extern char* time_str(double);
extern const char* status_str(int status);
extern bool outdated_client(HOST&);
inline bool outdated_client(HOST& h) {
char* p = strstr(h.serialnum, "BOINC|");
if (!p) return true;
int n = atoi(p + strlen("BOINC|"));
return (n < 7);
}

struct META_CHUNK;

Expand Down

0 comments on commit 32da1a7

Please sign in to comment.