diff --git a/checkin_notes b/checkin_notes index 8f3d403f80..fe13af90da 100644 --- a/checkin_notes +++ b/checkin_notes @@ -10147,3 +10147,20 @@ David 16 Dec 2008 login_action.php manage_user.php team_import.php + +David 16 Dec 2008 + - scheduler: if client has coprocs, + put a textual summary of them in host.serialnum (currently unused) + - web: show coprocs on host detail page + - db_dump: include coproc info in host XML + + db/ + boinc_db.h + html/inc/ + hostl.inc + lib/ + coproc.cpp,h + sched/ + db_dump.cpp + handle_request.cpp + server_types.cpp diff --git a/db/boinc_db.h b/db/boinc_db.h index 19f4f12ea3..351d7df643 100644 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -228,7 +228,7 @@ struct HOST { int timezone; // local STANDARD time at host - UTC time // (in seconds) char domain_name[256]; - char serialnum[256]; + char serialnum[256]; // textual description of coprocessors char last_ip_addr[256]; // internal IP address as of last RPC int nsame_ip_addr; // # of RPCs with same IP address diff --git a/html/inc/host.inc b/html/inc/host.inc index f08b188570..c24d85fdbe 100644 --- a/html/inc/host.inc +++ b/html/inc/host.inc @@ -95,6 +95,9 @@ function show_host($host, $user, $ipprivate) { row2("Avg. credit", format_credit($host->expavg_credit)); row2("CPU type", "$host->p_vendor
$host->p_model"); row2("Number of CPUs", $host->p_ncpus); + if ($host->serialnum) { + row2("Coprocessors", $host->serialnum); + } row2("Operating System", "$host->os_name
$host->os_version"); $x = $host->m_nbytes/(1024*1024); $y = round($x, 2); diff --git a/lib/coproc.cpp b/lib/coproc.cpp index 8d322c700c..44d27f9480 100644 --- a/lib/coproc.cpp +++ b/lib/coproc.cpp @@ -30,6 +30,7 @@ #include "error_numbers.h" #include "filesys.h" #include "parse.h" +#include "str_util.h" #include "coproc.h" @@ -64,6 +65,23 @@ int COPROC::parse(MIOFILE& fin) { return ERR_XML_PARSE; } +void COPROCS::summary_string(char* buf, int len) { + char bigbuf[8192], buf2[1024]; + + strcpy(bigbuf, ""); + for (unsigned int i=0; itype, "CUDA")) { + COPROC_CUDA* cp2 = (COPROC_CUDA*) cp; + int mem = (int)(cp2->prop.totalGlobalMem/MEGA); + sprintf(buf2, "[CUDA|%s|%d|%dMB]", cp2->prop.name, cp2->count, mem); + strcat(bigbuf, buf2); + } + } + bigbuf[len-1] = 0; + strcpy(buf, bigbuf); +} + vector COPROCS::get() { vector strings; string s = COPROC_CUDA::get(*this); diff --git a/lib/coproc.h b/lib/coproc.h index 543661b999..35566ccffe 100644 --- a/lib/coproc.h +++ b/lib/coproc.h @@ -70,6 +70,7 @@ struct COPROCS { #endif std::vector get(); int parse(FILE*); + void summary_string(char*, int); COPROC* lookup(char*); bool sufficient_coprocs(COPROCS&, bool log_flag, const char* prefix); void reserve_coprocs(COPROCS&, void*, bool log_flag, const char* prefix); diff --git a/sched/db_dump.cpp b/sched/db_dump.cpp index 9cad2aecd6..68b2c04050 100644 --- a/sched/db_dump.cpp +++ b/sched/db_dump.cpp @@ -337,6 +337,16 @@ void write_host(HOST& host, FILE* f, bool detail) { os_name, os_version ); + + // host.serialnum stores coprocessor description + // + if (strlen(host.serialnum)) { + char serialnum[1024]; + xml_escape(host.serialnum, serialnum, sizeof(serialnum)); + fprintf(f, + " %s\n", serialnum + ); + } if (detail) { fprintf(f, " %d\n" diff --git a/sched/handle_request.cpp b/sched/handle_request.cpp index 46a3c1603e..9d5e014ca9 100644 --- a/sched/handle_request.cpp +++ b/sched/handle_request.cpp @@ -610,7 +610,7 @@ static void compute_credit_rating(HOST& host) { static int modify_host_struct(SCHEDULER_REQUEST& sreq, HOST& host) { host.timezone = sreq.host.timezone; strncpy(host.domain_name, sreq.host.domain_name, sizeof(host.domain_name)); - strncpy(host.serialnum, sreq.host.serialnum, sizeof(host.serialnum)); + sreq.coprocs.summary_string(host.serialnum, sizeof(host.serialnum)); if (strcmp(host.last_ip_addr, sreq.host.last_ip_addr)) { strncpy(host.last_ip_addr, sreq.host.last_ip_addr, sizeof(host.last_ip_addr)); } else { diff --git a/sched/server_types.cpp b/sched/server_types.cpp index 8d2502efef..85621f52ed 100644 --- a/sched/server_types.cpp +++ b/sched/server_types.cpp @@ -991,7 +991,6 @@ int HOST::parse(FILE* fin) { if (match_tag(buf, "")) return 0; if (parse_int(buf, "", timezone)) continue; if (parse_str(buf, "", domain_name, sizeof(domain_name))) continue; - if (parse_str(buf, "", serialnum, sizeof(serialnum))) continue; if (parse_str(buf, "", last_ip_addr, sizeof(last_ip_addr))) continue; if (parse_str(buf, "", host_cpid, sizeof(host_cpid))) continue; if (parse_int(buf, "", p_ncpus)) continue;