diff --git a/checkin_notes b/checkin_notes index 3c20bc70b2..aa5b633cd9 100644 --- a/checkin_notes +++ b/checkin_notes @@ -3233,3 +3233,10 @@ Charlie 28 Apr 2010 clientgui/ DlgEventLog.cpp DlgEventLogListCtrl.cpp + +David 28 Apr 2010 + - client: network bandwidth total was counting 1 day too many + - client simulator: start GPU support + + client/ + net_stats.cpp diff --git a/client/makefile_sim b/client/makefile_sim index 5c89dd0fba..4ef7140cfe 100644 --- a/client/makefile_sim +++ b/client/makefile_sim @@ -28,5 +28,5 @@ OBJS = \ all: sim -sim: $(OBJS) +sim: $(OBJS) sim.h $(CXX) $(CXXFLAGS) $(OBJS) -o sim -ldl diff --git a/client/net_stats.cpp b/client/net_stats.cpp index 972f7e8e0a..ff90b58f98 100644 --- a/client/net_stats.cpp +++ b/client/net_stats.cpp @@ -378,7 +378,7 @@ void DAILY_XFER_HISTORY::totals(int ndays, double& up, double& down) { up = down = 0; for (unsigned int i=0; icount; j++) { + fprintf(gstate.html_out, "%s %d", cp->type, j); + } + } +} +void gpu_off() { + for (unsigned int i=0; icount; j++) { + fprintf(gstate.html_out, "OFF"); + } + } +} +void gpu_on() { + for (unsigned int i=0; icount; j++) { + for (unsigned int k=0; kresult; + if (!uses_coproc(rp, cp)) continue; + if (atp->task_state() != PROCESS_EXECUTING) continue; + if (!using_instance(rp, j)) continue; + SIM_PROJECT* p = (SIM_PROJECT*)rp->project; + fprintf(gstate.html_out, "%s%s: %.2f", + colors[p->index], + atp->result->rr_sim_misses_deadline?"*":"", + atp->result->name, atp->cpu_time_left + ); + } + } + } +} + void CLIENT_STATE::html_start(bool show_prev) { char buf[256]; @@ -583,6 +626,7 @@ void CLIENT_STATE::html_start(bool show_prev) { "CPU %d
Job name and estimated time left
color denotes project
* means EDF mode
", i ); } + gpu_header(); fprintf(html_out, "Notes\n"); } @@ -595,6 +639,7 @@ void CLIENT_STATE::html_rec() { for (int j=0; jOFF"); } + gpu_off(); } else { int n=0; for (unsigned int i=0; i%s\n", html_msg.c_str()); + fprintf(html_out, + "%s\n", html_msg.c_str() + ); html_msg = ""; if (++line_num == line_limit) { diff --git a/client/sim.h b/client/sim.h index 05e4fc7142..83bfb052ab 100644 --- a/client/sim.h +++ b/client/sim.h @@ -64,16 +64,14 @@ struct PROJECT_RESULTS { int nresults_missed_deadline; }; -class NORMAL_DIST { -public: +struct NORMAL_DIST { double mean; double stdev; int parse(XML_PARSER&, char* end_tag); double sample(); }; -class UNIFORM_DIST { -public: +struct UNIFORM_DIST { double lo; double hi; int parse(XML_PARSER&, char* end_tag); @@ -94,8 +92,7 @@ public: RANDOM_PROCESS(); }; -class SIM_APP: public APP { -public: +struct SIM_APP: public APP { double latency_bound; double fpops_est; NORMAL_DIST fpops; @@ -107,8 +104,7 @@ public: int parse(XML_PARSER&); }; -class SIM_PROJECT: public PROJECT { -public: +struct SIM_PROJECT: public PROJECT { RANDOM_PROCESS available; int index; int result_index; @@ -131,8 +127,12 @@ public: void update_dcf_stats(RESULT*); }; -class SIM_HOST: public HOST_INFO { -public: +struct SIM_GPU : public COPROC { + double flops; + int parse(XML_PARSER&, const char*); +}; + +struct SIM_HOST: public HOST_INFO { RANDOM_PROCESS available; RANDOM_PROCESS idle; double connection_interval; diff --git a/client/sim_util.cpp b/client/sim_util.cpp index 7facaf93c3..17f0bae054 100644 --- a/client/sim_util.cpp +++ b/client/sim_util.cpp @@ -502,6 +502,20 @@ int SIM_PROJECT::parse(XML_PARSER& xp) { return ERR_XML_PARSE; } +int SIM_GPU::parse(XML_PARSER& xp, const char* end_tag) { + char tag[256]; + bool is_tag; + while(!xp.get(tag, sizeof(tag), is_tag)) { + if (!is_tag) return ERR_XML_PARSE; + if (!strcmp(tag, end_tag)) return 0; + else if (xp.parse_int(tag, "count", count)) continue; + else if (xp.parse_double(tag, "flops", flops)) continue; + else if (xp.parse_str(tag, "type", type, sizeof(type))) continue; + else return ERR_XML_PARSE; + } + return ERR_XML_PARSE; +} + int SIM_HOST::parse(XML_PARSER& xp) { char tag[256]; bool is_tag; @@ -524,6 +538,14 @@ int SIM_HOST::parse(XML_PARSER& xp) { retval = idle.parse(xp, "/idle"); if (retval) return retval; idle.init(START_TIME); + } else if (!strcmp(tag, "gpu")) { + SIM_GPU* sgp = new SIM_GPU; + retval = sgp->parse(xp, "/gpu"); + if (retval) { + delete sgp; + return retval; + } + coprocs.coprocs.push_back(sgp); } else { printf("unrecognized: %s\n", tag); return ERR_XML_PARSE;