Changes between Version 32 and Version 33 of AppMultiThread


Ignore:
Timestamp:
Jun 6, 2012, 11:16:27 AM (12 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AppMultiThread

    v32 v33  
    3939and setThreadPriority() is then called by each worker thread.
    4040
    41 == Deploying a multicore app version ==
     41== Specifying a plan class ==
    4242
    43 BOINC uses the [AppPlan application planning] mechanism to
    44 coordinate the scheduling of multicore applications.
     43Multicore apps must the [AppPlan plan class] mechanism to
     44specify their properties.
     45You may be able to use the [AppPlan predefined "mt" class].
     46Otherwise you must specify your own,
     47using either [AppPlanSpec XML] or [PlanClassFunc C++].
    4548
    46 Suppose you've developed a multicore program,
    47 and that it achieves a linear speedup on up to 64 processors, and no additional speedup beyond that.
    48 To deploy it:
    49 
    50  * Choose a "plan class" name for the program, say "mt" (see below).
    51  * Create an [AppVersionNew app version], specifying its plan class as "mt".
    52  * Edit the following in sched/sched_customize.cpp if needed:
    53 {{{
    54 // the following is for an app that can use anywhere from 1 to 64 threads
    55 //
    56 static inline bool app_plan_mt(
    57     SCHEDULER_REQUEST& sreq, HOST_USAGE& hu
    58 ) {
    59     double ncpus = g_wreq->effective_ncpus;
    60         // number of usable CPUs, taking user prefs into account
    61     int nthreads = (int)ncpus;
    62     if (nthreads > 64) nthreads = 64;
    63     hu.avg_ncpus = nthreads;
    64     hu.max_ncpus = nthreads;
    65     sprintf(hu.cmdline, "--nthreads %d", nthreads);
    66     hu.projected_flops = sreq.host.p_fpops*hu.avg_ncpus*.99;
    67         // the .99 ensures that on uniprocessors a sequential app
    68         // will be used in preferences to this
    69     hu.peak_flops = sreq.host.p_fpops*hu.avg_ncpus;
    70     return true;
    71 }
    72 
    73 }}}