Changeset 15148
- Timestamp:
- 05/08/08 10:48:40 (7 months ago)
- Files:
-
- trunk/boinc/api/graphics2.h (modified) (3 diffs)
- trunk/boinc/checkin_notes (modified) (1 diff)
- trunk/boinc/client/makefile_sim (modified) (2 diffs)
- trunk/boinc/lib/diagnostics.C (modified) (2 diffs)
- trunk/boinc/sched/edf_sim.C (modified) (9 diffs)
- trunk/boinc/sched/sched_array.C (modified) (1 diff)
- trunk/boinc/sched/sched_config.C (modified) (1 diff)
- trunk/boinc/sched/sched_config.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/boinc/api/graphics2.h
r14987 r15148 1 1 #ifndef _GRAPHICS2_H_ 2 2 #define _GRAPHICS2_H_ 3 4 #ifdef __cplusplus5 extern "C" {6 #endif7 8 9 3 10 4 // Functions that must be supplied by the app … … 26 20 extern void boinc_close_window_and_quit(); 27 21 28 #ifdef __cplusplus29 }30 #endif31 32 22 // Implementation stuff 33 23 // … … 37 27 extern bool throttled_app_render(int, int, double); 38 28 39 40 29 #endif trunk/boinc/checkin_notes
r15146 r15148 3699 3699 lib/ 3700 3700 coproc.C 3701 3702 David May 8 2008 3703 - scheduler: add new log flags debug_edf_sim_workload, debug_edf_sim_details 3704 for getting info on EDF simulation; 3705 change output from seconds to hours 3706 - API: remove extern "C" from graphics API 3707 (convince me it's needed before restoring) 3708 3709 api/ 3710 graphics2.h 3711 client/ 3712 makefile_sim 3713 lib/ 3714 diagnostics.C 3715 sched/ 3716 edf_sim.C 3717 sched_array.C 3718 sched_config.C,h trunk/boinc/client/makefile_sim
r12604 r15148 13 13 time_stats.o \ 14 14 work_fetch.o \ 15 ../sched/edf_sim.o \ 15 edf_sim.o \ 16 ../lib/coproc.o \ 16 17 ../lib/mfile.o \ 17 18 ../lib/miofile.o \ … … 23 24 24 25 sim: $(OBJS) 25 $(CXX) $(CXXFLAGS) $(OBJS) -o sim 26 $(CXX) $(CXXFLAGS) $(OBJS) -o sim -ldl trunk/boinc/lib/diagnostics.C
r15105 r15148 117 117 118 118 119 // stub function for initializing the workerdiagnostic environment.119 // initialize the app diagnostic environment. 120 120 // 121 121 int boinc_init_diagnostics(int _flags) { … … 125 125 126 126 127 // stub function for initializingthe graphic diagnostic environment.127 // initialize the graphic diagnostic environment. 128 128 // 129 129 int boinc_init_graphics_diagnostics(int _flags) { 130 int modified_flags = BOINC_DIAG_BOINCAPPLICATION | _flags; 131 return diagnostics_init(modified_flags, BOINC_DIAG_GFX_STDOUT, BOINC_DIAG_GFX_STDERR); 130 return diagnostics_init( 131 BOINC_DIAG_BOINCAPPLICATION | _flags, 132 BOINC_DIAG_GFX_STDOUT, BOINC_DIAG_GFX_STDERR 133 ); 132 134 } 133 135 trunk/boinc/sched/edf_sim.C
r14811 r15148 27 27 #endif 28 28 29 #ifdef SIM 30 #include <stdarg.h> 31 #else 32 #include "sched_config.h" 33 #include "sched_msgs.h" 34 #endif 35 29 36 #include "edf_sim.h" 30 37 31 38 using std::vector; 32 39 33 //#define TEST 34 //#define DEBUG 35 36 // 0 shows initial workload and candidate decisions 37 // 1 shows function calls results of sim: make/miss deadline 38 // 2 shows every step of sim 40 #define SUMMARY 0 41 // show candidate decision 42 #define WORKLOAD 1 43 // show workload 44 #define DETAIL 2 45 // show every step of simulation 46 47 static void log_msg(int level, const char* format, ...) { 48 #ifdef SIM 49 #else 50 switch(level) { 51 case SUMMARY: 52 if (!config.debug_send) return; 53 break; 54 case WORKLOAD: 55 if (!config.debug_edf_sim_workload) return; 56 break; 57 case DETAIL: 58 if (!config.debug_edf_sim_detail) return; 59 break; 60 } 61 #endif 62 va_list va; 63 va_start(va, format); 64 #ifdef SIM 65 vfprintf(stderr, format, va); 66 #else 67 log_messages.vprintf(MSG_DEBUG, format, va); 68 #endif 69 va_end(va); 70 } 39 71 40 72 bool lessthan_deadline(const IP_RESULT& p1, const IP_RESULT& p2) { … … 51 83 int j; 52 84 53 #ifdef DEBUG 54 fprintf(stderr, "mark_edf_misses\n"); 55 #endif 85 log_msg(DETAIL, "mark_edf_misses\n"); 56 86 57 87 // keeps track of when each cpu is next free … … 82 112 83 113 booked_to[lowest_booked_cpu] += r.cpu_time_remaining; 84 #ifdef DEBUG 85 fprintf(stderr, " running %s on cpu %d; finishes at %f\n", 86 r.name, lowest_booked_cpu, booked_to[lowest_booked_cpu] 114 log_msg(DETAIL, " running %s on cpu %d; finishes at %.2f\n", 115 r.name, lowest_booked_cpu, booked_to[lowest_booked_cpu]/3600 87 116 ); 88 #endif89 117 if (booked_to[lowest_booked_cpu] > r.computation_deadline) { 90 118 r.misses_deadline = true; 91 119 r.estimated_completion_time = booked_to[lowest_booked_cpu]; 92 #ifdef DEBUG 93 fprintf(stderr, " %s misses_deadline; est completion %f\n", 94 r.name, booked_to[lowest_booked_cpu] 120 log_msg(DETAIL, " %s misses_deadline; est completion %.2f\n", 121 r.name, booked_to[lowest_booked_cpu]/3600 95 122 ); 96 #endif97 123 } else { 98 124 r.misses_deadline = false; 99 #ifdef DEBUG 100 fprintf(stderr, " %s makes deadline; est completion %f\n", 101 r.name, booked_to[lowest_booked_cpu] 125 log_msg(DETAIL, " %s makes deadline; est completion %.2f\n", 126 r.name, booked_to[lowest_booked_cpu]/3600 102 127 ); 103 #endif104 128 // if result doesn't miss its deadline, 105 129 // then the estimated_completion_time is of no use … … 108 132 } 109 133 110 // For each ip_result, compute scomputation_deadline from report_deadline,111 // and determine s if the deadline would be missed by simulating edf134 // For each ip_result, compute computation_deadline from report_deadline, 135 // and determine if the deadline would be missed by simulating EDF 112 136 // 113 137 void init_ip_results( … … 118 142 unsigned int i; 119 143 120 #ifdef DEBUG 121 fprintf(stderr, "init_ip_results; work_buf_min %f ncpus %d:\n", work_buf_min, ncpus); 122 #endif 144 log_msg(DETAIL, 145 "init_ip_results; work_buf_min %.2f ncpus %d:\n", 146 work_buf_min/3600, ncpus 147 ); 123 148 for (i=0; i<ip_results.size(); i++) { 124 149 IP_RESULT& r = ip_results[i]; 125 150 r.computation_deadline = r.report_deadline - work_buf_min; 126 #ifdef DEBUG 127 fprintf(stderr, " %s: deadline %.2f cpu %.2f\n", 128 r.name, r.computation_deadline, r.cpu_time_remaining 151 log_msg(DETAIL, " %s: deadline %.2f cpu %.2f\n", 152 r.name, r.computation_deadline/3600, r.cpu_time_remaining/3600 129 153 ); 130 #endif131 154 } 132 155 … … 199 222 int j; 200 223 201 #ifdef DEBUG 202 fprintf(stderr, "check_candidate %s: dl %f cpu %f\n", 203 candidate.name, candidate.computation_deadline, 204 candidate.cpu_time_remaining 224 log_msg(DETAIL, "check_candidate %s: dl %.2f cpu %.2f\n", 225 candidate.name, candidate.computation_deadline/3600, 226 candidate.cpu_time_remaining/3600 205 227 ); 206 #endif207 228 208 229 for (j=0; j<ncpus; j++) { … … 231 252 } 232 253 booked_to[lowest_booked_cpu] += r.cpu_time_remaining; 233 #ifdef DEBUG 234 fprintf(stderr, " running %s on cpu %d; finishes at %f\n", 235 r.name, lowest_booked_cpu, booked_to[lowest_booked_cpu] 254 log_msg(DETAIL, " running %s on cpu %d; finishes at %.2f\n", 255 r.name, lowest_booked_cpu, booked_to[lowest_booked_cpu]/3600 236 256 ); 237 #endif238 257 239 258 // return false if completion time if > computation_deadline AND … … 243 262 && !r.misses_deadline 244 263 ) { 245 #ifdef DEBUG 246 fprintf(stderr, " cand. fails; %s now misses deadline: %f > %f\n", 247 r.name, booked_to[lowest_booked_cpu], r.computation_deadline 264 log_msg(SUMMARY, 265 " cand. fails; %s now misses deadline: %.2f > %.2f\n", 266 r.name, booked_to[lowest_booked_cpu]/3600, 267 r.computation_deadline/3600 248 268 ); 249 #endif250 269 return false; 251 270 } … … 256 275 && booked_to[lowest_booked_cpu] > r.estimated_completion_time 257 276 ){ 258 #ifdef DEBUG 259 fprintf(stderr, " cand. fails; late result %s to be returned even later\n", r.name); 260 #endif 277 log_msg(SUMMARY, 278 " cand. fails; late result %s would be returned even later\n", 279 r.name 280 ); 261 281 return false; 262 282 } 263 283 } 264 #ifdef DEBUG 265 fprintf(stderr, " cand. succeeds\n"); 266 #endif 284 log_msg(SUMMARY, " cand. succeeds\n"); 267 285 return true; 268 286 } 269 287 270 #if def TEST288 #if 0 271 289 int main() { 272 290 vector<IP_RESULT> ip_results; trunk/boinc/sched/sched_array.C
r15109 r15148 134 134 retval = wu_is_infeasible_fast(wu, sreq, reply, *app); 135 135 if (retval) { 136 log_messages.printf(MSG_DEBUG, 137 "[HOST#%d] [WU#%d %s] WU is infeasible: %s\n", 138 reply.host.id, wu.id, wu.name, infeasible_string(retval) 139 ); 136 if (config.debug_send) { 137 log_messages.printf(MSG_DEBUG, 138 "[HOST#%d] [WU#%d %s] WU is infeasible: %s\n", 139 reply.host.id, wu.id, wu.name, infeasible_string(retval) 140 ); 141 } 140 142 continue; 141 143 } trunk/boinc/sched/sched_config.C
r15136 r15148 194 194 if (xp.parse_bool(tag, "debug_request_details", debug_request_details)) continue; 195 195 if (xp.parse_bool(tag, "debug_handle_results", debug_handle_results)) continue; 196 if (xp.parse_bool(tag, "debug_edf_sim_workload", debug_edf_sim_workload)) continue; 197 if (xp.parse_bool(tag, "debug_edf_sim_detail", debug_edf_sim_detail)) continue; 196 198 197 199 // don't complain about unparsed XML; trunk/boinc/sched/sched_config.h
r15136 r15148 132 132 bool debug_request_details; 133 133 bool debug_handle_results; 134 bool debug_edf_sim_workload; // show workload for EDF sim 135 bool debug_edf_sim_detail; // show details of EDF sim 134 136 135 137 int parse(FILE*);
