Dr. Dobb's Journal - September 2008 - (Page 51) d09levent_p3db 7/14/08 10:01 AM Page 51 The goal of the governor’s algorithm is not to prevent oversubscription, but rather to allow applications to finish as soon as possible. The reflection of the algorithm on the applications can be described as “slow start fast finish” with the exception of the first multithreaded application that contacts the governor, because the first application is guaranteed to start with as many threads as the number of cores. (The assumption here is that when the first application starts, the utilization of all the cores is less than the defined threshold.) The Thread Count Library The second part in this framework is the library providing the API calls to communicate to the governor, and API calls to adjust the number of threads based on the number of available cores received as a response. The applications increment their thread count by the number of available cores returned, with the ceiling being the number of physically available cores. The modifications to the original applications are minimal: 1. Include two header files. One for the thread count and governor communication, and one for the timing calculations. The header file for the timing calculations is not necessary but is used during the simulation. 2. Link with library. 3. Modify the code so that just before entering a parallel region, thread count is updated. Also, the applications were instrumented to run many iterations rather than just one. And before entering a parallel region, each application sets its thread count, which was updated by this sample OpenMP (www .openmp.org) code segment: init_thread_count ( ); // initialize thread count while ( iter < ITERATION ) { set_thread_count(); // update thread count start_timer(); PARALLEL_REGION //original benchmark #pragma omp parallel for for ( ) { WORK ( ); } stop_timer(); } Figure 3: Uniform test results combined (4 instances of each benchmark; idle threshold 10). Methodology To simulate multiple multithreaded applications running in parallel, I used benchmarks parallelized via OpenMP. I chose OpenMP because it is easy to prototype with and easy to implement the proposed framework. Some of the benchmarks were taken from the OpenMP source code repository (SCR) project (http://sourceforge.net/projects/ ompscr) and others were written from scratch. All the benchmarks are CPU-bound and scale well. The simulation is performed in two different scenarios: • In the uniform run, two or more instances of the same benchmark were executed. • In the mix run, one or more instances of all benchmarks were run together simultaneously. Again, the first benchmark that is started gets the maximum thread count, which is equal to the number of physically available processors. The baseline measurement for both uniform and mix scenarios is taken when any running benchmark sets the number of threads as the number of processors available on the system, rather than changing their thread count during runtime (no load governor is running). In other words, if n different benchmarks or n instances of any benchmarks are executed simultaneously, there is a total of (n * the number of cores) threads. Test Results In this simulation, I used a 2.67-GHz Intel Core 2 quad-core processor-based DP server with a total of 16-GB RAM running on Fedora Core 6. This platform provided 8 cores for the simulation. The load governor was set to run every 1 second to read the processor statistics from /proc/stats. Each benchmark communicated with the load governor every 10 seconds to update their thread count. The iteration count (ITERATION) was set as 100. Idle time threshold was set to 5, 10, 15, and 20 during the simulation for each test setup. The benchmarks I used in the simulation were: Prime, which finds the prime numbers within a range; Mandel, OpenMP SCR’s Mandelbrot implementation that computes an estimation to the Mandelbrot Set area using MonteCarlo sampling; MD, OpenMP SCR’s molecular dynamic simulation; and Matvec, matrix vector multiplication. All benchmarks were compiled using Intel C++ compiler version 10.0. 51 September 2008 l www.ddj.com l Dr. Dobb’s Journal http://sourceforge.net/projects/ompscr http://sourceforge.net/projects/ompscr http://www.openmp.org http://www.openmp.org http://www.ddj.com
Table of Contents Feed for the Digital Edition of Dr. Dobb's Journal - September 2008 Dr. Dobb's Journal - September 2008 Contents Friday Night Fish Fry Alia Vox Developer Diaries Developer’s Notebook A Conversation With Erik Demaine Application Lifecycle Management Meets Model-Driven Development Building a Robust Development Environment Real Users Really Matter Matching Wildcards: An Algorithm The Android Mobile Phone Platform Managing Application Thread Use Signalling Integer Overflows in Java .NET Development & the IBM WebSphere Portal Server The Agile Edge Effective Concurrency Swaine’s Flames Dr. Dobb's Journal - September 2008 Dr. Dobb's Journal - September 2008 - Dr. Dobb's Journal - September 2008 (Page Cover1) Dr. Dobb's Journal - September 2008 - Dr. Dobb's Journal - September 2008 (Page Cover2) Dr. Dobb's Journal - September 2008 - Dr. Dobb's Journal - September 2008 (Page 1) Dr. Dobb's Journal - September 2008 - Dr. Dobb's Journal - September 2008 (Page 2) Dr. Dobb's Journal - September 2008 - Dr. Dobb's Journal - September 2008 (Page 3) Dr. Dobb's Journal - September 2008 - Contents (Page 4) Dr. Dobb's Journal - September 2008 - Contents (Page 5) Dr. Dobb's Journal - September 2008 - Friday Night Fish Fry (Page 6) Dr. Dobb's Journal - September 2008 - Friday Night Fish Fry (Page 7) Dr. Dobb's Journal - September 2008 - Friday Night Fish Fry (Page 8) Dr. Dobb's Journal - September 2008 - Friday Night Fish Fry (Page 9) Dr. Dobb's Journal - September 2008 - Alia Vox (Page 10) Dr. Dobb's Journal - September 2008 - Alia Vox (Page 11) Dr. Dobb's Journal - September 2008 - Developer Diaries (Page 12) Dr. Dobb's Journal - September 2008 - Developer Diaries (Page 13) Dr. Dobb's Journal - September 2008 - Developer’s Notebook (Page 14) Dr. Dobb's Journal - September 2008 - Developer’s Notebook (Page 15) Dr. Dobb's Journal - September 2008 - A Conversation With Erik Demaine (Page 16) Dr. Dobb's Journal - September 2008 - A Conversation With Erik Demaine (Page 17) Dr. Dobb's Journal - September 2008 - A Conversation With Erik Demaine (Page 18) Dr. Dobb's Journal - September 2008 - A Conversation With Erik Demaine (Page 19) Dr. Dobb's Journal - September 2008 - Application Lifecycle Management Meets Model-Driven Development (Page 20) Dr. Dobb's Journal - September 2008 - Application Lifecycle Management Meets Model-Driven Development (Page 21) Dr. Dobb's Journal - September 2008 - Application Lifecycle Management Meets Model-Driven Development (Page 22) Dr. Dobb's Journal - September 2008 - Application Lifecycle Management Meets Model-Driven Development (Page 23) Dr. Dobb's Journal - September 2008 - Application Lifecycle Management Meets Model-Driven Development (Page 24) Dr. Dobb's Journal - September 2008 - Application Lifecycle Management Meets Model-Driven Development (Page 25) Dr. Dobb's Journal - September 2008 - Building a Robust Development Environment (Page 26) Dr. Dobb's Journal - September 2008 - Building a Robust Development Environment (Page 27) Dr. Dobb's Journal - September 2008 - Building a Robust Development Environment (Page 28) Dr. Dobb's Journal - September 2008 - Building a Robust Development Environment (Page 29) Dr. Dobb's Journal - September 2008 - Building a Robust Development Environment (Page 30) Dr. Dobb's Journal - September 2008 - Building a Robust Development Environment (Page 31) Dr. Dobb's Journal - September 2008 - Real Users Really Matter (Page 32) Dr. Dobb's Journal - September 2008 - Real Users Really Matter (Page 33) Dr. Dobb's Journal - September 2008 - Real Users Really Matter (Page 34) Dr. Dobb's Journal - September 2008 - Real Users Really Matter (Page 35) Dr. Dobb's Journal - September 2008 - Real Users Really Matter (Page 36) Dr. Dobb's Journal - September 2008 - Matching Wildcards: An Algorithm (Page 37) Dr. Dobb's Journal - September 2008 - Matching Wildcards: An Algorithm (Page 38) Dr. Dobb's Journal - September 2008 - Matching Wildcards: An Algorithm (Page 39) Dr. Dobb's Journal - September 2008 - The Android Mobile Phone Platform (Page 40) Dr. Dobb's Journal - September 2008 - The Android Mobile Phone Platform (Page 41) Dr. Dobb's Journal - September 2008 - The Android Mobile Phone Platform (Page 42) Dr. Dobb's Journal - September 2008 - The Android Mobile Phone Platform (Page 43) Dr. Dobb's Journal - September 2008 - The Android Mobile Phone Platform (Page 44) Dr. Dobb's Journal - September 2008 - The Android Mobile Phone Platform (Page 45) Dr. Dobb's Journal - September 2008 - The Android Mobile Phone Platform (Page 46) Dr. Dobb's Journal - September 2008 - The Android Mobile Phone Platform (Page 47) Dr. Dobb's Journal - September 2008 - Managing Application Thread Use (Page 48) Dr. Dobb's Journal - September 2008 - Managing Application Thread Use (Page 49) Dr. Dobb's Journal - September 2008 - Managing Application Thread Use (Page 50) Dr. Dobb's Journal - September 2008 - Managing Application Thread Use (Page 51) Dr. Dobb's Journal - September 2008 - Managing Application Thread Use (Page 52) Dr. Dobb's Journal - September 2008 - Managing Application Thread Use (Page 53) Dr. Dobb's Journal - September 2008 - Signalling Integer Overflows in Java (Page 54) Dr. Dobb's Journal - September 2008 - Signalling Integer Overflows in Java (Page 55) Dr. Dobb's Journal - September 2008 - Signalling Integer Overflows in Java (Page 56) Dr. Dobb's Journal - September 2008 - Signalling Integer Overflows in Java (Page 57) Dr. Dobb's Journal - September 2008 - Signalling Integer Overflows in Java (Page 58) Dr. Dobb's Journal - September 2008 - .NET Development & the IBM WebSphere Portal Server (Page 59) Dr. Dobb's Journal - September 2008 - .NET Development & the IBM WebSphere Portal Server (Page 60) Dr. Dobb's Journal - September 2008 - .NET Development & the IBM WebSphere Portal Server (Page 61) Dr. Dobb's Journal - September 2008 - .NET Development & the IBM WebSphere Portal Server (Page 62) Dr. Dobb's Journal - September 2008 - .NET Development & the IBM WebSphere Portal Server (Page 63) Dr. Dobb's Journal - September 2008 - .NET Development & the IBM WebSphere Portal Server (Page 64) Dr. Dobb's Journal - September 2008 - The Agile Edge (Page 65) Dr. Dobb's Journal - September 2008 - The Agile Edge (Page 66) Dr. Dobb's Journal - September 2008 - The Agile Edge (Page 67) Dr. Dobb's Journal - September 2008 - Effective Concurrency (Page 68) Dr. Dobb's Journal - September 2008 - Effective Concurrency (Page 69) Dr. Dobb's Journal - September 2008 - Effective Concurrency (Page 70) Dr. Dobb's Journal - September 2008 - Effective Concurrency (Page 71) Dr. Dobb's Journal - September 2008 - Swaine’s Flames (Page 72) Dr. Dobb's Journal - September 2008 - Swaine’s Flames (Page Cover3) Dr. Dobb's Journal - September 2008 - Swaine’s Flames (Page Cover4)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.