Changes between Initial Version and Version 1 of AppMultiThread


Ignore:
Timestamp:
Oct 2, 2007, 8:58:17 AM (17 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AppMultiThread

    v1 v1  
     1= API for multi-thread apps =
     2
     3The following is a design document, not implemented yet.
     4
     5== Assumptions ==
     6
     7A 'multi-thread app' A uses multiple threads, say Nthreads(A).
     8The average number of processors used, Ncpus(A), may be less
     9(because of I/O or synchronization).
     10
     11Ideally, on a host with N CPUs, we want
     12Ncpus(A), summed over running apps, to be about N.
     13If it's less, we're not using CPU time.
     14If it's more:
     15 * we increase latency without increasing throughput
     16 * we use more RAM than needed
     17 * higher synchronization overhead
     18
     19We assume that applications may be able to change Nthreads(A) dynamically
     20in response to hints from BOINC.
     21Nthreads(A) need not be equal to the hint.
     22
     23Example: suppose
     24 * we have an 80-core CPU
     25 * app A can use 1,2,4,8,16,32 threads
     26 * app B can use 1,2,4,8,16,32,64 threads
     27
     28Then we want to have either (16,64) or (32,32) threads most of the time.
     29
     30== Proposal ==
     31
     32{{{
     33int boinc_target_nthreads();
     34void boinc_actual_nthreads(int);
     35}}}
     36
     37An application calls boinc_target_nthreads() periodically,
     38at points where it is able to change its number of threads.
     39It calls boinc_actual_nthreads() to report its actual number of threads.
     40
     41Shared-memory messages:
     42 * core->app (process control channel): <target_nthreads>
     43 * app->core (process control channel): <actual_nthreads>
     44
     45Client maintains estimates of CPU effiency per job,
     46uses this to scale target_nthreads.
     47
     48A WU can specify "max average nthreads"; this is used
     49by the client and scheduler to estimate completion time.
     50
     51Implementation (enforce_schedule()):
     52as we schedule jobs, decrement CPU count by scaled actual_nthreads.
     53rr_simulation() needs to be modified too.