Changes between Version 19 and Version 20 of AppMultiThread
- Timestamp:
- Apr 1, 2008, 3:35:16 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AppMultiThread
v19 v20 1 1 = API for multi-thread apps = 2 3 [[T(DesignDocument)]]4 2 5 3 == Why write a multi-threaded app? == … … 25 23 26 24 Suppose you've developed a multi-threaded program, 27 and that it achieves a linear speedup on up to 16processors, and no additional speedup beyond that.25 and that it achieves a linear speedup on up to 64 processors, and no additional speedup beyond that. 28 26 To deploy it: 29 27 … … 33 31 {{{ 34 32 bool app_plan(SCHEDULER_REQUEST& sreq, const char* plan_class, HOST_USAGE& hu) { 35 if (!strcmp(plan_class, "par16")) { 36 if (host.ncpus < 16) { 37 hu.ncpus = sreq.host.ncpus; 38 hu.flops = sreq.host.p_fpops*sreq.host.p_ncpus; 39 } else { 40 hu.ncpus = 16; 41 hu.flops = sreq.host.p_fpops*16; 42 } 33 // clients before 6.1.11 don't understand plan_class 34 // 35 int v = sreq.core_client_major_version*10000 36 + sreq.core_client_minor_version*100 37 + sreq.core_client_release; 38 if (v < 60111) return false; 39 40 if (!strcmp(plan_class, "par64")) { 41 int ncpus, nthreads; 42 bool bounded; 43 44 get_ncpus(sreq, ncpus, bounded); 45 nthreads = ncpus; 46 if (nthreads > 64) nthreads = 64; 47 hu.avg_ncpus = nthreads; 48 hu.max_ncpus = nthreads; 49 sprintf(hu.cmdline, "--nthreads %d", nthreads); 50 hu.flops = 0.95*sreq.host.p_fpops*nthreads; 43 51 return true; 52 44 53 } 45 54 return false;