Changes between Version 2 and Version 3 of PlanClassFunc
- Timestamp:
- Jun 6, 2012, 11:20:37 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PlanClassFunc
v2 v3 1 1 = Specifying plan classes in C++ = 2 3 If you need more generality than is provided by 4 [AppPlanSpec XML-based plan class specification], 5 you can specify plan classes in C++. 2 6 3 7 The scheduler is linked with a function … … 34 38 }}} 35 39 36 You are free todefine your own set of plan classes,37 and tolink your own '''app_plan()''' function with the scheduler.40 You can define your own set of plan classes, 41 and link your own '''app_plan()''' function with the scheduler. 38 42 The BOINC scheduler comes with a default '''app_plan()''' (in sched/sched_customize.cpp). 43 44 == Example: a plan class for multithread apps == 45 46 Here's a plan class function for a multicore app that it achieves a linear speedup on up to 64 processors, 47 and no additional speedup beyond that. 48 49 {{{ 50 bool app_plan_mt( 51 SCHEDULER_REQUEST& sreq, HOST_USAGE& hu 52 ) { 53 double ncpus = g_wreq->effective_ncpus; 54 // number of usable CPUs, taking user prefs into account 55 int nthreads = (int)ncpus; 56 if (nthreads > 64) nthreads = 64; 57 hu.avg_ncpus = nthreads; 58 hu.max_ncpus = nthreads; 59 sprintf(hu.cmdline, "--nthreads %d", nthreads); 60 hu.projected_flops = sreq.host.p_fpops*hu.avg_ncpus*.99; 61 // the .99 ensures that on uniprocessors a sequential app 62 // will be used in preferences to this 63 hu.peak_flops = sreq.host.p_fpops*hu.avg_ncpus; 64 return true; 65 } 66 }}} 39 67 40 68 == Defining GPU plan classes ==