= Specifying plan classes in C++ == The scheduler is linked with a function {{{ bool app_plan(SCHEDULER_REQUEST &sreq, char* plan_class, HOST_USAGE&); }}} The '''sreq''' argument describes the host. It contains: * in '''sreq.host''' field, a description of the host's hardware, including: * In p_vendor and p_model, the processor type * In p_features, the processor features (e.g., fpu tsc pae nx sse sse2 mmx) * In m_nbytes, the amount of RAM * in '''sreq.coprocs''', a list of the hosts's coprocessors. * in '''core_client_version''', the client's version number in MMmmRR form. When called with a particular SCHEDULER_REQUEST and plan class, the function returns true if the host's resources are sufficient for apps of that class. If true, it populates the HOST_USAGE structure: {{{ struct HOST_USAGE { double ncudas; // number of NVIDIA GPUs used double natis; // number of ATI GPUs used double gpu_ram; // max amount of GPU RAM used double avg_ncpus; // avg #CPUs used by app (may be fractional) double max_ncpus; // max #CPUs used (not currently used for anything) double projected_flops; // an estimate of the actual FLOPS. // used to select versions, so make it higher for the preferred version double peak_flops; // the peak FLOPS of the devices to be used char cmdline[256]; // passed to the app as a cmdline argument; // this can be used, e.g. to control the # of threads used }; }}} You are free to define your own set of plan classes, and to link your own '''app_plan()''' function with the scheduler. The BOINC scheduler comes with a default '''app_plan()''' (in sched/sched_customize.cpp).