mirror of https://github.com/BOINC/boinc.git
- 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 svn path=/trunk/boinc/; revision=16697
This commit is contained in:
parent
0b9bb93278
commit
4a65681176
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -95,6 +95,9 @@ function show_host($host, $user, $ipprivate) {
|
|||
row2("Avg. credit", format_credit($host->expavg_credit));
|
||||
row2("CPU type", "$host->p_vendor <br> $host->p_model");
|
||||
row2("Number of CPUs", $host->p_ncpus);
|
||||
if ($host->serialnum) {
|
||||
row2("Coprocessors", $host->serialnum);
|
||||
}
|
||||
row2("Operating System", "$host->os_name <br> $host->os_version");
|
||||
$x = $host->m_nbytes/(1024*1024);
|
||||
$y = round($x, 2);
|
||||
|
|
|
@ -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; i<coprocs.size(); i++) {
|
||||
COPROC* cp = coprocs[i];
|
||||
if (!strcmp(cp->type, "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<string> COPROCS::get() {
|
||||
vector<string> strings;
|
||||
string s = COPROC_CUDA::get(*this);
|
||||
|
|
|
@ -70,6 +70,7 @@ struct COPROCS {
|
|||
#endif
|
||||
std::vector<std::string> 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);
|
||||
|
|
|
@ -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,
|
||||
" <coprocs>%s</coprocs>\n", serialnum
|
||||
);
|
||||
}
|
||||
if (detail) {
|
||||
fprintf(f,
|
||||
" <create_time>%d</create_time>\n"
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -991,7 +991,6 @@ int HOST::parse(FILE* fin) {
|
|||
if (match_tag(buf, "</host_info>")) return 0;
|
||||
if (parse_int(buf, "<timezone>", timezone)) continue;
|
||||
if (parse_str(buf, "<domain_name>", domain_name, sizeof(domain_name))) continue;
|
||||
if (parse_str(buf, "<serialnum>", serialnum, sizeof(serialnum))) continue;
|
||||
if (parse_str(buf, "<ip_addr>", last_ip_addr, sizeof(last_ip_addr))) continue;
|
||||
if (parse_str(buf, "<host_cpid>", host_cpid, sizeof(host_cpid))) continue;
|
||||
if (parse_int(buf, "<p_ncpus>", p_ncpus)) continue;
|
||||
|
|
Loading…
Reference in New Issue