<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated on Mon, 21 May 2012 04:11:20 -0700 -->
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <atom:link href="http://software.intel.com/en-us/articles/atom/type/technical-article/feed/" rel="self" type="application/rss+xml" />
    <title>Intel Software Network articles Feed</title>
    <link>http://software.intel.com/en-us/articles/atom/type/technical-article/</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>Designing Application Software for Energy-efficient Performance</title>
      <description><![CDATA[ <b>By Nancy Nicolaisen</b><br /><br />Personal computers are designed to be in processor idle 75% of the time but in fact might more realistically be estimated to be idle in excess of 90% of the time because of the effects of imposed waits for user input, server response, and resource availability. An idle processor is available to sleep and, while in a sleep state, can save most of the energy it would otherwise consume from actively executing. At least on the client side, if all of the theoretical energy-saving potential of processor sleep states were realized, end user energy use could shrink by fantastical amounts with no apparent sacrifice of functionality or productivity.<br /><br />This, however, is not today’s status quo. For various reasons, users sometimes intentionally configure client systems not to sleep, and it is not uncommon for application software to inadvertently (or intentionally) prevent CPUs from entering sleep states. Application developers can’t do anything about the former. However, there is a lot they can do to make sure the sophisticated laptop and tablet solutions they design, code, and deploy are energy efficient. In addition, if targeting a thin client, developers have to be aware of the back-end servers and how they could affect the operation and power envelope for that thin client.<br /><br />
<h2 class="sectionHeading">Follow Best Practices for Creating Energy-efficient Client Device Applications</h2>
From an application developer’s point of view, a key tactic for achieving energy-efficient software performance is effective handling of sleep state transitions. A few general rules can go a long way toward accomplishing this goal—for example:<br /><br />
<ul>
<li>Design applications that allow screens to darken and disks to idle by avoiding behaviors that unnecessarily prevent systems from remaining in a sleep state. Moving from sleep states to full activity states requires some energy, thus, develop algorithms to not keep waking idle processors unnecessarily.</li>
<li>Where possible, eliminate code that keeps processors from transitioning to sleep states.</li>
<li>Employ development frameworks that allow an app to be respectful of sleep status and resilient in handling nonessential workloads.</li>
<li>To prevent users from disabling sleep, become more context aware, and take steps to ensure that systems don’t enter sleep states when users are passively interacting with them (e.g., watching or listening).</li>
<li>Develop power-aware strategies for handling timers and looping. Investigate the use of compiler switches that unroll deterministic loops, and make other adjustments that reduce the overall number of instructions executed (e.g., remove polling).</li>
<li>Use energy-aware tools to identify patterns of processor use in your apps.</li>
</ul>
A well-designed app should have little impact on overall energy consumption when it is open but idle, as Figure 1 shows.<br /><br />
<p ><img src="http://software.intel.com/file/43251" /></p>
<br /><b>Figure 1.</b> A key energy management principle: Idle apps should have negligible impact on power use.<br /><br />
<h2 class="sectionHeading">Tools And Techniques for Evaluating and Optimizing Application Energy Consumption Performance</h2>
Unlike many types of optimization, developers can’t see or infer symptoms of poor application energy performance. To make real progress toward improved client-side application energy efficiency, you need to employ power performance optimization tools and techniques. Figure 2 shows the results for 15 applications in a study. The chart shows two things: the average power over baseline (in Watts) and the percentage impact of that power draw over baseline. For example, Instant Messenger-4 running at idle caused the platform power draw to increase to 1.7 Watts, or 21 percent higher than system idle without the application running. This idle power draw affected battery life by approximately 4 hours. The conclusion from this study is that applications within the same category can exhibit different idle power behaviors.<br /><br />
<p ><img src="http://software.intel.com/file/43252" /></p>
<br /><b>Figure 2.</b> Analyzing app power performance behaviors “in the wild” can be complex.<br /><br />Imbuing client-side applications with power awareness isn’t difficult, but it is something that must be done with deliberate intention. For app developers, this is a matter of finding and using frameworks and instrumentation that help validate good designs and discover the flaws in program logic that need remediation.<br /><br /><b><i>Intel® Energy Checker</i></b><br /><br />The Intel® Energy Checker software development kit (SDK) provides developers with a way to analyze how applications consume power. This information is key to optimization, because gross power usage is far from being the whole story. Real efficiency demands an understanding of exactly how an app’s power consumption relates to its work output. For example, power sinks can be the result of poorly integrated legacy code, duplication of effort in libraries and components, frivolous output activities, and the like.<br /><br />Finding app behaviors that waste energy can be as challenging as finding memory leaks and other sublethal application flaws. Symptoms can be so subtle that it’s impossible to diagnose problems without instrumented code and a controlled, self-documenting test environment. Fortunately, this is precisely what Intel® Energy Checker provides. This SDK allows developers to:<br /><br />
<ul>
<li>Evaluate app productivity versus power consumption</li>
<li>Instrument code to report specific metrics about operations performed, timings, and collateral conditions</li>
<li>Generate large performance data sets using a variety of execution regimes</li>
<li>Evaluate the power consumption impacts of alternative libraries, drivers, and frameworks</li>
<li>Validate optimizations and remediation</li>
<li>Instrument apps in ways that allow customers and third-party testers to certify apps as energy efficient</li>
</ul>
<i><b>What Intel® Energy Checker Offers Client App Developers</b></i><br /><br />The Intel® Energy Checker SDK is a full-featured testing and validation facility. Its fundamental layer comprises a counter application programming interface (API) that allows direct measurement of app productivity. The ability to export and import counters provides a mechanism for analyzing how efficiently apps work with one another and the system overall.<br /><br />Intel® Energy Checker’s companion build and scripting tools allow a means of analyzing code for which source is not available or can’t practically be built with inline instrumentation. Command-line utilities allow Intel® Energy Checker tools and data streams to interoperate with native Windows* and Linux* counters and utilities, making Oracle* Solaris 10–, Mac OS X*–, and Linux* MeeGo-based apps susceptible to evaluation by Intel® Energy Checker testing and validation.<br /><br />One of the biggest advantages the Intel® Energy Checker toolset offers is its support for a broad variety of application development regimes. To help developers get up to speed with their projects, the SDK shipped with sample applets demonstrating how to employ it in the following situations:<br /><br />
<ul>
<li>With threading</li>
<li>Called from Java*</li>
<li>Called from C#</li>
<li>Called from Objective-C</li>
<li>With Linux system information utilities</li>
<li>CPU use histogram generator tools</li>
<li>Cluster energy efficiency</li>
<li>PL sampling measurements</li>
</ul>
The suite supports a majority of the common application programming languages in use today, including C, C++, C#, Objective-C, Java*, PHP, and Perl.<br /><br /><i><b>Using Microsoft Joulemeter to Analyze Energy Efficiency Performance</b></i><br /><br />Joulemeter from Microsoft* Research is focused on creating modeling and optimization tools to assist system architects, administrators, and developers in improving the energy efficiency of computing infrastructures. The central concentrations of the Joulemeter Research Program are on modeling and optimizing power use by computational infrastructure of all types and scales. This information is critical, because to achieve real energy savings, systems have to be optimized from end to end. Even lightweight mobile clients have to be aware of the impacts of their behavior on back-end servers, such as whether they will affect the operation’s overall power performance.<br /><br />The Joulemeter Research Project has published the lightweight stand-alone Joulemeter application* for Windows* 7 laptops and desktops. The app estimates the power consumption of a single computer by tracking resource usage (CPU saturation, screen backlighting, antenna power use, and the like); from these measurements, Joulemeter forecasts system power consumption.<br /><br /><i><b>Intel® Battery Life Analyzer</b></i><br /><br />The Intel® Battery Life Analyzer (BLA) is a lightweight tool that monitors battery life on computers running the Windows* operating system. Empirically evaluating energy-related application performance on battery-powered systems can sometimes yield impressive gains with relatively minor changes in application code. BLA helps developers identify opportunities to create “application idle” state converge on platform idle states. In particular, BLA gets around a problem from which most power management and accounting application programming interfaces (APIs) suffer. Inherently, accounting APIs have to work with sampled data, recorded at timer tick intervals (on the order of 15.6 msec). Therefore, if a software operation starts on a timer tick but ends before the next tick, it can’t be detected by metrics that use full tick granularity.<br /><br />Although this sounds like a negligible shortcoming, it isn’t. Many isochronous operations (think media handling) fall into this category, and such operations can easily become huge fractions of a platform’s overall workload. In contrast, BLA uses fine-grained process information based on microsecond scale time stamps. BLA records both a given activity’s starts and stops. This precision provides not only a more accurate picture of power utilization; it is also a far more complete one. (For a rigorous treatment of this topic, you can find a link to the Intel white paper, “Energy Efficient Platforms—Considerations for Application Software and Services,” in the Helpful Links section.)<br /><br />
<h2 class="sectionHeading">Mobile Device Battery Life Conservation</h2>
More and more, batteries are a key source of power for computing platforms. In early 2011, smart phones outsold PCs 4 to 1 worldwide. Given this, expect to see the energy efficiency of mobile apps become a key concern for all types of software consumers. Fortunately, mobile developers are generally pretty savvy about energy efficiency, as battery-operated devices have always demanded that discipline of them.<br /><br />All mobile development frameworks include methods for detecting power states (connected to AC wall current or running on DC battery power), testing battery levels, and scaling system and application behaviors in response to energy regimes. Apple*, Symbian*, Microsoft*, RIM*, and other mobile device vendors have worked over the years to establish general guidelines that help app developers be good power-management citizens on small devices. Many of these rules translate easily to laptop and desktop apps that are being reworked to improve power performance:<br /><br />
<ul>
<li>Replace timer-based designs with event-driven or interrupt-driven logic.</li>
<li>Avoid using timers as a high-resolution time source. If there is no workable alternative, ensure that timer resolution is reset to the system default when it is not actively engaged in its specific task.</li>
<li>Apps designed to provide passive display of content should explicitly increase display dimming timeout to accommodate playback using power request or availability APIs. The requests should be explicitly rescinded when the app is minimized or inactive.</li>
<li>Screen savers and the like should not alter dimming timeouts. Unless there is an aesthetic reason for them, screen savers do nothing to maintain the health of LCD monitors and are simply wasting energy. Let screens dim, if practical.</li>
</ul>
Ineffective management of sleep states can dramatically multiply an app’s power consumption. Effective use of parallelization, coalescing tasks that are difficult to parallelize in a single thread, and avoidance of excessive requirement for synchronization among threads are all strategies that can help reduce the number of sleep state transitions an app triggers (see Figure 3).<br /><br />
<p ><img src="http://software.intel.com/file/43253" /></p>
<br /><b>Figure 3.</b> Effective management of sleep states is key to good app energy performance.<br /><br />
<h2 class="sectionHeading">Conclusion</h2>
Managing the energy performance of application software may reasonably be expected to become a core competency for developers in the fairly near term, as economic and environmental considerations shape thinking on software engineering best practices. Many good tools exist for this purpose, and the Intel® Energy Checker SDK can help to validate and refine energy-optimization efforts of client software developers targeting both the desktop and mobile platforms.<br /><br />
<h2 class="sectionHeading">Helpful Links and Additional information on Power Management Tools and Resources</h2>
<ul>
<li><a target="_blank" href="http://www.climatesaverscomputing.org/resources/information/software-development">Software development information from Climate Savers Computing</a>*</li>
<li><a href="http://software.intel.com/en-us/articles/intel-energy-checker-sdk/#FAQ">Intel® Energy Checker SDK and user guide</a></li>
<li><a target="_blank" href="http://www.thegreengrid.org/about-the-green-grid.aspx">Learn more about The Green Grid</a>*</li>
<li><a target="_blank" href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa373163(v=vs.85).aspx">Microsoft Power Management Functions* reference</a></li>
<li><a target="_blank" href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/Power_Management_Guide/index.html">Red Hat Linux 6 Power Management Guide</a>*</li>
<li><a target="_blank" href="http://www.elinux.org/Power_Management">Power Management for Linux</a>*</li>
<li>Fine-Grained Energy Profiling for Power-Aware Application Design: <a target="_blank" href="http://research.microsoft.com/apps/pubs/default.aspx?id=73662">http://research.microsoft.com/apps/pubs/default.aspx?id=73662</a>*</li>
<li>Intel white paper: “Energy Efficient Platforms—Considerations for Application Software and Services” (<a href="http://www.intel.com/content/www/us/en/green-it/energy-efficiency/energy-efficient-platforms-2011-white-paper.html?wapkw=considerations+for+application+software+and+services">http://www.intel.com/content/www/us/en/green-it/energy-efficiency/energy-efficient-platforms-2011-white-paper.html?wapkw=considerations+for+application+software+and+services</a>)</li>
<li>BLA requests, questions, and feedback: <a href="http://software.intel.commailto:BatteryLifeAnalyzer@intel.com">BatteryLifeAnalyzer@intel.com</a></li>
</ul>
<h2 class="sectionHeading">About the Author</h2>
Nancy Nicolaisen is an author, researcher, and veteran software developer specializing in mobile and embedded device technologies. Her feature articles, columns, and analyses have been internationally circulated in publications such as <i>BYTE, PC Magazine, Windows Sources, Computer Shopper, Dr. Dobbs Journal of Software Engineering, and Microsoft Systems Journal</i>. She is the author of three books—<i>Making Windows Portable: Porting Win32 to Win CE</i> (2002, John Wiley &amp; Sons); <i>The Practical Guide to Debugging 32 Bit Windows Applications</i> (1996, McGraw Hill); and <i>The Visual Guide to Visual C++</i> (1994, Ventana Press)—available in five foreign-language editions. In 2007, she served as technical advisor for the development of the Microsoft Professional Education course “Designing, Building and Managing Wireless Networks.” Ms. Nicolaisen is currently active in exploring open source technologies and trends for mobile, embedded, and wireless devices.<br /><br /> ]]></description>
      <link>http://software.intel.com/en-us/articles/designing-application-software-for-energy-efficient-performance/</link>
      <pubDate>Mon, 09 Apr 2012 00:00:00 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/designing-application-software-for-energy-efficient-performance/#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/designing-application-software-for-energy-efficient-performance/</guid>
      <category>Parallel Programming</category>
      <category>Tools</category>
      <category>Intel® AppUp(SM) Developer Community</category>
      <category>Intel SW Partner program</category>
      <category>Intel Software Network communities</category>
      <category>Power Efficiency</category>
      <category>Ultrabook</category>
      <category>Server Developer Community</category>
    </item>
    <item>
      <title>Using Intel® Power Checker to measure the energy performance of a compute-intensive application </title>
      <description><![CDATA[ <p>Intel® Power Checker provides developers with a quick and easy way to evaluate the idle power efficiency of their applications on mobile platforms with Intel® Core™ processor or Intel® Atom™ technology running the Microsoft Windows* operating system. Any compiled language application, especially those designed to run on technology based on Intel® products and Java Framework applications can be analyzed by Intel Power Checker. The checker can be used with or without a supported external power meter.</p>
<p>The Intel Power Checker 2.0 now supports measurement both on battery and with the system plugged into an external AC power source. External power measurement is only supported on Intel® Second Generation Core processors and if the Intel® Power Gadget software has been installed.</p>
<p>For this article, I took a very compute-intensive parallel application that I wrote to solve instances of the logic puzzle Akari. The code uses a backtracking algorithm to explore how to place light bulbs onto a grid under constraints dictated by the rules of the puzzle and the layout of the puzzle instance. Potentially millions of independent tasks can be generated by the code as the solution space is searched by threads executing those tasks. This solution method is eminently scalable to a large number of threads and is able to keep many cores running at peak speed for a sustained amount of time.</p>
<h2>How to Use Intel Power Checker</h2>
<p>The Intel Power Checker provides a GUI wizard that leads you through the four steps of power analysis. These four steps in the checker are described below. Before starting the assessment, be sure to know which section of your application (a workload) you want to be measured, as the Power Checker will only measure a 30 second execution interval. (If you want to measure the entire execution workload, you should try some other tool, like Intel Power Gadget.) Your workload could be a compute-intensive portion or an I/O-intense section or just some point in execution that typifies the majority of expected usage.</p>
<h3 >Step 1: Specifying the Power Meter device</h3>
<p>If you have an external power meter attached to your test system, you can select the model being used on the first screen of the wizard. The default is that no external device is being used. For this default case, Intel Power Checker will determine if the system is capable of providing power consumption data and if the correct power driver, EzPwr.sys, is installed. (The driver is part of the default installation of <a href="http://software.intel.com/en-us/articles/intel-power-gadget/">Intel Power Gadget</a>.)</p>
<h3 >Step 2: Measure System Baseline</h3>
<p>The first measurement that the Intel Power Checker will perform is on the next screen within the wizard. This is to measure the baseline power consumption of the hardware without your application running. Prior to this measurement phase any unnecessary processes such as operating system updates, Windows Indexing Service, virus scans, media players, and internet browsers should have been shut down. In other words, to get the most accurate results you should make your test system as idle as possible and ensure that nothing will become a foreground process during your measurement runs.</p>
<p>Once you have a quiescent system, click the “Start” button to begin this phase of the testing. The Intel Power Checker waits 15 seconds to allow the system to come to an idle state before starting the measurements. You need to be sure to position your mouse and the keyboard out of reach, or keep your hands away from them, to avoid any stray contact that might trigger some response from the platform. After the pause, the checker will observe the system for 30 seconds in this idle state. A progress bar will show the time remaining in each part of this phase. Once the baseline data collection is complete, click the “Next” button to proceed to the next phase.</p>
<h3 >Step 3: Measure Active Application</h3>
<p>Before you are taken to the next screen in the wizard, you are instructed to start the application you are interested in measuring. Start up your application and click the “OK” button to advance the GUI to the next screen. Once you have reached the Step 3 screen, use the scroll bar to locate your application in the process list and click on that line to select it. If your application is not listed, click the “Refresh List” button so that your application’s process will be available to select. In addition, you can use the “Apply Filter” button to narrow down the list in order to find your application’s process quickly. .After selecting your application from the list, click “Next” to move on to the data collection for this phase. Before starting the assessment, be sure your application has reached the desired point of measurement. If there are some initial setup computations that are not of interest, you will need to get past this point before letting Intel Power Checker begin measurement. For my Akari application, there is very little setup time. It was typically in the thick of computation by the time I had gotten to the point of selecting the process from the list.</p>
<p>As soon as I could, I clicked the “Start” button to begin capturing measurement data. Since this is one of the crucial power measurements for your application, always begin capturing data <b>after</b> the workload or critical section has begun and make sure this active execution will run longer than the 30 seconds needed to complete the measurement time.</p>
<h3 >Step 4: Measure Idle Application</h3>
<p>The final phase is to measure your application’s idle power consumption. This is another important phase of energy efficiency measurement of an application since your application must not only do efficient computation, but also not waste energy when sitting idle.</p>
<p>This step doesn’t make much sense within my compute-intensive application since there is no idle state of the application. Once you start the application on a given puzzle instance, it simply computes all legal solutions in parallel and then ends. As (multiple) solutions are found, they are printed out by the thread that found it. If there are no solutions, a message is printed just before the application terminates. This latter case describes the workload I used for my tests. Because you must have your application running in “idle” mode for this step, I left the application running at full speed and simply allowed Power Checker to take its measurements.</p>
<p>If your application does have an idle state, perhaps waiting for interaction from the user, the checker will give the system 15 seconds to calm down fully before taking a final 30 second measurement.</p>
<p>Upon completion of this last data collection phase, you will be able to proceed to the results screen within the Intel Power Checker wizard. After all three measurement phases have been completed; a Tool Report File will be generated containing all of the results for later analysis.</p>
<h3 >What data is presented</h3>
<p>The View Results screen of the Intel Power Checker wizard provides basic information about the software assessment. The type of processor in your system and the type and model of the power source that was used are given. Four numerical values for each of the three measurement phases are presented. These values are:</p>
<ul >
<li><b>Elapsed Time:</b> The exact number of seconds that each of the phases lasted.</li>
<li><b>Energy Consumption:</b> The rate that the battery was discharged during each of the three phases.</li>
<li><b>Average C3 State Residency:</b> The percentage of time that the system was in the C3 state during the data collection period.</li>
<li><b>Platform Timer Period:</b> The number of milliseconds that the platform timer collected</li>
</ul>
<p><img src="http://software.intel.com/file/42410" /></p>
<p>Typical results would hopefully show a larger percentage of time spent in the C3 State Residency for the application idle time measurement (the middle of the three columns on the View Results screen). As my puzzle solving application was still computing as much as it did in the active execution measurement step, this was not the case for my results. This is atypical for the intended type of applications Intel Power Checker assumes will be measured. Thus, the C3 State Residency values provided by the tool for the idle application were not valid for my particular application.</p>
<p>The name of the report file and the directory to which it will be found are listed on the View Results screen.</p>
<h2>Some Caveats</h2>
<p>Below are some things you should consider before and during a measurement run using Intel Power Checker.</p>
<ul >
<li>Before you start using Intel Power Checker, be sure your chosen workload will run for at least 30 seconds from the point you wish to measure power consumption. In my case, I required a data set that would force the application to run for at least 75 seconds (30 for active measurement, 15 for idle setup, and 30 for idle measurement) plus the time I needed to click boxes and find my application in the process list. Since I ran the application on several different numbers of threads, I needed to be sure that the fastest execution time was still large enough to get all the timings steps completed during a Intel Power Checker run.</li>
<li>Upon starting Intel Power Checker, the checker may first report that the platform timer period is invalid. In this case, some currently running (background) process has changed the default and it will be up to the user to determine which currently running application has changed the value. Once you have identified the culprit you must stop this process or service before restarting Intel Power Checker. If you are unsure about which active process is preventing Intel Power Checker from starting, you will need to turn off processes one at a time and try Intel Power Checker until the error message doesn’t come up. </li>
<li>Instructions on the Step 3 screen ask you not to touch the keyboard or mouse. If you are measuring an interactive application or you must interact with the application to generate activity for the full 30 seconds, you will need to touch the keyboard and/or mouse. If possible, a workload that can forego interactivity and still compute for the 30 seconds of measurement time would be best. However, if interaction by the user is part of how the application is utilized, interfacing through peripherals will give you a more accurate measure of the overall energy consumption for typical application usage.</li>
<li>A data file is created during each phase of the Intel Power Checker assessment to hold the current information. If you cancel the assessment in any of the three phases then a data file will not be created for that phase. After all three phases have been completed, a Tool Report File, in XML format, will be generated containing all of the results. You can find the name of the report file and where it is located on the View Results screen.</li>
<li>The “Submit Results” button on the View Results screen is optional and only intended for members of the <a href="http://software.intel.com/partner/overview">Intel® Software Partner Program</a> to submit their measurement results to the program. If you are not a member, do not submit your results. Simply click on the “Close” button after you have examined the results compiled by Intel Power Checker.</li>
</ul>
<h2>Some Results</h2>
<p>The purpose of this article is not to determine the best scenario for running my Akari solver application in the most energy efficient way. You will want to do this for your application, though, and this article has given you the background on Intel Power Checker to determine if this checker can help you quantify the current power consumption of your application. Also, as you make modifications to the application you will be able to determine if those changes improve the energy efficiency or cause your application to suck more power than before.</p>
<p>In addition to the average C3 State Residency percentage, the checker delivers the total number of Joules expended during the 30 seconds of execution time measured. From this I can compute the average Watts for execution parts of the application. I have found that a better metric for comparing different applications or different runs of the same application is milliwatt hours (mWh). You need the total execution time of the execution portion of the application to compute this value. Since Intel Power Checker only measures activity in 30 second segments, you will need to have some timing data available, which I happened to have for the different runs I made of my Akari application.</p>
<p>I found significant differences when running with and without Hyper-Threading Technology (HT) turned on. Also, if the platform was running on battery (DC) power or from the wall socket (AC) power, a difference in execution time and power usage was evident. For example, when running with HT on and a full complement of four threads on the 4 logical cores in my system, I saw the AC power run 1.19X faster that when running the same workload on DC power. However, the former run took 1.15X more power.</p>
<p>Comparing results between runs on DC power versus AC power is a not a good comparison, especially in this case. The power source is detected by the system and the processor is allowed to run with Intel® Turbo Boost Technology at a higher frequency if the platform is using external power. Even so, you may need to be concerned about power consumption of your application in both power source circumstances and you will need to run measurement experiments within each setup to gauge how well your application modifications affect overall power consumption.</p>
<h3 >System Requirements</h3>
<p>You can use Intel Power Checker on a laptop or netbook based on Intel® Core™ processor or Intel® Atom™ processor technology. A desktop with an external power meter or a desktop that is capable of providing the power consumption information can also be analyzed. A Java* Runtime Environment (JRE) (version 6 update 11 or higher) is also required to run the checker. Supported operating systems are Microsoft Windows* XP (Service Pack 3), Microsoft Windows Vista* (Service Pack 2), Microsoft Windows* 7 (Service Pack 1 [32-bit and 64-bit]), and Microsoft Windows* Server 2008 R2.</p>
<h3 >Download link</h3>
<p>To download the Intel Power Checker installation package, go to the following link:</p>
<p><a href="http://software.intel.com/partner/app/software-assessment">http://software.intel.com/partner/app/software-assessment/</a>. Click on the Intel Power Checker tab to move down to the download link.</p>
<h3 >Other supporting links</h3>
<p>There is a video demonstration of using Intel Power Checker, “A Look at Intel Power Checker,” at the link: <a href="http://software.intel.com/en-us/videos/channel/intel-software-partner-program/a-look-at-the-intel-power-checker/1127786023001">http://software.intel.com/en-us/videos/channel/intel-software-partner-program/a-look-at-the-intel-power-checker/1127786023001</a>. Dave Valdovinos and Taylor Kidd, both from Intel, show off the GUI wizard as it measures the power performance of a game-like application.</p> ]]></description>
      <link>http://software.intel.com/en-us/articles/using-intel-power-checker-to-measure-the-energy-performance-of-a-compute-intensive-application/</link>
      <pubDate>Mon, 12 Mar 2012 00:00:00 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/using-intel-power-checker-to-measure-the-energy-performance-of-a-compute-intensive-application/#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/using-intel-power-checker-to-measure-the-energy-performance-of-a-compute-intensive-application/</guid>
      <category>Mobility</category>
      <category>Parallel Programming</category>
      <category>Intel® AppUp(SM) Developer Community</category>
      <category>Intel Software Network communities</category>
      <category>Intel SW Partner program</category>
      <category>Intel Software Network communities</category>
      <category>Game Development</category>
      <category>Power Efficiency</category>
      <category>Intel® vPro™ Developer Community</category>
      <category>Resources For Software Developers</category>
      <category>Ultrabook</category>
      <category>Server Developer Community</category>
    </item>
    <item>
      <title>Getting Started with Networking and Internet in MeeGo* using Qt</title>
      <description><![CDATA[ <h2 class="sectionHeading">Introduction</h2>
With so many connected devices in the market today, enabling connectivity to online resources is becoming a vital part of application development. Since MeeGo* supports a breadth of platforms, making the effort to write robust, connected applications that run within the MeeGo framework can pay off in multiple segments with few platform specific modifications. Below I will use two examples to describe how the MeeGo application framework and Qt* provide the appropriate level of abstraction to enable rapid and reliable development while still giving the flexibility to accommodate those corner cases that can affect network communication.<br /><br />The first example is a very simple web browser using the <a target="_blank" href="http://www.webkit.org/">WebKit</a>* based <a target="_blank" href="http://doc.qt.nokia.com/latest/qwebview.html">QWebView</a> class that demonstrates the power and flexibility of using Qt when creating cross-platform, Internet enabled applications. The second example demonstrates using a lower-level class, <a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkaccessmanager.html">QNetworkAccessManager</a> that provides flexible access to network resources independent of WebKit. In these examples we'll focus on the most common protocols such as HTTP over TCP/IP, but many of the classes used support other protocols as well.<br /><br />Throughout this discussion it is assumed that you have a Qt SDK installed and configured for your target devices. This may be part of your MeeGo SDK installation but the examples shown here do not require that you are building for a MeeGo target. You should have a basic understanding of using Qt Creator* and Qt Designer* as well as the Qt framework including concepts like signals and slots. You need not have an extensive knowledge of networking or the networking classes in Qt. You only need to be able to set up a test system on an active network, preferably with Internet access. We'll go into a few examples of Potential Issues that can be encountered when connecting to networked resources and how to address them in the examples.<br /><br />
<h2 class="sectionHeading">Overview of MeeGo Networking</h2>
On MeeGo, the key components related to network and Internet communications are the oFono* modem plugin/driver and the Linux* network interface for the Linux* TCP/IP stack. The MeeGo WLAN architecture is based on the Linux wireless (IEEE-802.11) specification. The details of these core components are abstracted by the Qt framework so a deep understanding of these drivers and specifications is not necessary in order to rapidly develop networked applications.<br /><br /><b>Example: QWebView</b><br /><br />You can create a quick application in Qt to access and display standard HTTP resources without any prior knowledge of the network environment in which a device is operating. This example will walk through creating a simple WebKit based browser window as shown in Figure 1.<br /><br /><img src="http://software.intel.com/file/35120/" /><br /><br /><b>Figure 1.</b><br /><br />We'll start by creating a new Qt C++ GUI application in Qt Creator/Designer named QWebView accepting all default names for files. The project should now contain:<br /><br />
<ul>
<li>QWebView.pro - the Qt project file </li>
<li>mainwindow.ui - the definition of the main window GUI </li>
<li>mainwindow.h - the header file for the main window </li>
<li>main.cpp - the source file for the application </li>
<li>mainwindow.cpp - the source file for the main window </li>
</ul>
In the default form created by Qt Creator/Designer, we'll place four objects.<br /><br />
<ul>
<li><a target="_blank" href="http://doc.qt.nokia.com/latest/qlineedit.html">QLineEdit</a> named <i>urlEdit</i></li>
<li><a target="_blank" href="http://doc.qt.nokia.com/latest/qpushbutton.html">QPushButton</a> named <i>refreshButton</i></li>
<li><a target="_blank" href="http://doc.qt.nokia.com/latest/qwebview.html">QWebView</a> named <i>webView</i></li>
<li><a target="_blank" href="http://doc.qt.nokia.com/latest/qtextedit.html">QTextEdit</a> named <i>debugTextView</i></li>
</ul>
To successfully compile with network and WebKit based objects (e.g. <a target="_blank" href="http://doc.qt.nokia.com/latest/qwebview.html">QWebView</a>), you must add <i>network</i> and <i>webkit</i> to the <i>QT</i> line in your Qt project file. Not doing so can result in this build error:<br /><br />
<blockquote>
<pre>:: error: collect2: ld returned 1 exit status</pre>
</blockquote>
<br /><br />Your project file should contain the following line:<br /><br />
<blockquote>
<pre>QT       += core gui network webkit</pre>
</blockquote>
<br /><br />You will also need to include the QtWebKit module in the header file for your main window class, mainwindow.h.<br /><br />
<pre name="code" class="cpp">#include &lt;QtWebKit&gt;
</pre>
To show just how simple it is to create a feature rich, networked application, we will simply have the <i>refreshButton</i> load a website address. To illustrate a few other options of the QWebView class, we will also add some basic debug information to the <i>debugTextView</i> box. The code below should be added to the source file for the window class, <i>mainwindow.cpp</i>.<br /><br />
<pre name="code" class="cpp">void MainWindow::on_refreshButton_clicked()
{
    QString targetURL = ui-&gt;urlEdit-&gt;text();
    ui-&gt;debugTextView-&gt;append("URL Entered: " + targetURL);
    ui-&gt;webView-&gt;load(QUrl(targetURL));
}
void MainWindow::on_webView_loadStarted()
{
    ui-&gt;debugTextView-&gt;append("Load Started");
}
void MainWindow::on_webView_loadFinished(bool )
{
    ui-&gt;debugTextView-&gt;append("Load Finished");
}
</pre>
We also need to add the corresponding function declarations to the <i>mainwindow.h</i> header file.<br /><br />
<pre name="code" class="cpp">private slots:
    void on_webView_loadFinished(bool );
    void on_webView_loadStarted();
    void on_refreshButton_clicked();
</pre>
<i>Tip: The function declarations and definition templates are added to your code automatically if you use the "Go to slot..." feature in Qt Designer to. This is done by right-clicking an object in Qt Designer, selecting "Go to slot…" and choosing from the available slots for that object.</i><br /><br />Notice that much of the code is for the debug information. Only a few lines are actually required to create our functional web browser.<br /><br />After building and running the project, you should see that a valid URL entered in the <i>urlEdit</i> box will display the corresponding page in the <i>webView</i> window once the <i>refreshButton</i> is clicked. You should also see some basic information in the <i>debugTextView</i> box. In some environments the application may not function correctly. We'll address Potential Issues below. You can jump there now if your example is not working.<br /><br />What we've seen so far is that the <a target="_blank" href="http://doc.qt.nokia.com/latest/qwebview.html">QWebView</a> class gives us a functional web browser with very little effort. If you explore the <a target="_blank" href="http://doc.qt.nokia.com/latest/qwebview.html">QWebView</a> class, you'll see that without adding additional controls, you even have some navigation capabilities such as "Go Back" and "Refresh" that are presented when you right-click within the <a target="_blank" href="http://doc.qt.nokia.com/latest/qwebview.html">QWebView</a> object as the application is running. There are even more properties and functions you can access for creating a richer web browsing experience which are described in the QWebView documentation. Two examples are the <i>loadStarted</i> and <i>loadFinished</i> slots. These can give the user some indication that network operations are occurring and that they should not yet expect to see a result. You could add many enhancements to this example to make it more user friendly and robust, but that is outside the scope of this discussion. The key here is that many of the abstract objects available in Qt can provide rich network functions without requiring direct access to the underlying network infrastructure. But what if you don't need such a feature rich object for the purposes of your project?<br /><br /><b>Example: QNetworkAccessManager</b><br /><br />Perhaps you just want to access an online resource and grab some basic information to use in your application. An example could be accessing RSS (Real Simple Syndication) data to dynamically drive the content displayed in your application. For this purpose, you may not want the overhead of a complete web browser but you still need not worry about the details of the underlying network infrastructure - at least not always.<br /><br /><a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkaccessmanager.html">QNetworkAccessManager</a> is a convenient class for interacting with network resources but at a lower level than that of something like the <a target="_blank" href="http://doc.qt.nokia.com/latest/qwebview.html">QWebView</a> class. To demonstrate this, we create a new example that connects to a website URL and just reads and displays the network response of an HTTP get operation as shown in Figure 2.<br /><br /><img src="http://software.intel.com/file/35126/" /><br /><br /><b>Figure 2.</b><br /><br />We'll start this example by again creating a simple Qt C++ GUI project named <i>QNetworkAccessManager</i> accepting all default names for files. The project should now contain:<br /><br />
<ul>
<li>QNetworkAccessManager.pro - the Qt project file</li>
<li>mainwindow.ui - the definition of the main window GUI</li>
<li>mainwindow.h - the header file for the main window</li>
<li>main.cpp - the source file for the application</li>
<li>mainwindow.cpp - the source file for the main window</li>
</ul>
In the default form created by Qt Creator/Designer, we'll place three objects:<br /><br />
<ul>
<li><a href="http://doc.qt.nokia.com/latest/qlineedit.html">QLineEdit</a> named <i>urlEdit</i></li>
<li><a href="http://doc.qt.nokia.com/latest/qpushbutton.html">QPushButton</a> named <i>fetchButton</i></li>
<li><a href="http://doc.qt.nokia.com/latest/qtextedit.html">QTextEdit</a> named <i>returnText</i></li>
</ul>
In this example, we'll add a private <a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkaccessmanager.html">QNetworkAccessManager</a> member to our window class called netmanager and a function called fetchURL. That section of our main window header file, <i>mainwindow.h</i>, will look like:<br /><br />
<pre name="code" class="cpp">private:
    Ui::MainWindow *ui;
    QNetworkAccessManager *netmanager;
    void fetchURL(QUrl);
</pre>
We must remember to also include the <a target="_blank" href="http://doc.qt.nokia.com/latest/qtnetwork.html">QNetwork</a> module before declaring our <a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkaccessmanager.html">QNetworkAccessManager</a> object in <i>mainwindow.h</i>.<br /><br />
<pre name="code" class="cpp">#include &lt;QtNetwork&gt;
</pre>
You also must add <i>network</i> to the <i>QT</i> line of your project file:<br /><br />
<pre name="code" class="cpp">QT       += core gui network
</pre>
<i>fetchURL</i> is going to take a URL passed to it and perform an HTTP get operation. The implementation in <i>mainwindow.cpp</i> looks like this:<br /><br />
<pre name="code" class="cpp">void MainWindow::fetchURL(QUrl targetURL)
{
    netmanager-&gt;get(QNetworkRequest(targetURL));
}
</pre>
I chose to create a separate function for this simple operation so that I can add more to it later to make the application more robust.<br /><br />When the main window is created, we will initialize the <a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkaccessmanager.html">QNetworkAccessManager</a> object and connect its <i>finished</i> signal to a slot in our window class that will process the reply. Many functions in the <a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkaccessmanager.html">QNetworkAccessManager</a> class are asynchronous so Qt signals and slots become very convenient. We first define a <i>fetchFinished</i> slot in the main window's header, <i>mainwindow.h.</i><br /><br />
<pre name="code" class="cpp">private slots:
    void fetchFinished(QNetworkReply*);
</pre>
Then we add this code to the window's constructor in <i>mainwindow.cpp</i>.<br /><br />
<pre name="code" class="cpp">MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui-&gt;setupUi(this);

// The following coded added for our example
    netmanager = new QNetworkAccessManager(this);
    connect(netmanager, SIGNAL(finished(QNetworkReply*)), this,
        SLOT(fetchFinished(QNetworkReply*)));
}
</pre>
The <i>fetchFinished</i> slot is implemented like this in <i>mainwindow.cpp</i>.<br /><br />
<pre name="code" class="cpp">void MainWindow::fetchFinished(QNetworkReply* reply)
{
    ui-&gt;returnText-&gt;append("Fetch Finished!");
    QString *replyText = new QString(reply-&gt;readAll());
    ui-&gt;returnText-&gt;append(*replyText);
}
</pre>
For simplicity, I'm just displaying a message indicating that the slot was called and then copying the byte array in the reply directly to our output window. In a real application, the reply would likely be parsed and acted on. For example, you might be writing a news aggregator and want to grab headlines from a particular news source. You can perform a <i>get</i> on a URL such as <a target="_blank" href="http://velonews.competitor.com/feed">http://velonews.competitor.com/feed</a> feed and parse out the <i>&lt;title&gt;</i> tags in the resulting XML to create a list of professional cycling headlines.<br /><br />The last thing to do for this example to be functional is to act on the <i>fetchButton clicked</i> signal. We'll do this by adding the following code to the <i>mainwindow.cpp</i> source file.<br /><br />
<pre name="code" class="cpp">void MainWindow::on_fetchButton_clicked()
{
    QUrl targetURL = QUrl(ui-&gt;urlEdit-&gt;text());
    fetchURL(targetURL);
}
</pre>
Don't forget to add the corresponding definition to <i>mainwindow.h</i> if you didn't use the "Go to slot…" feature of Qt Designer.<br /><br />
<pre name="code" class="cpp">void on_fetchButton_clicked();
</pre>
Now the example should compile and run. If a valid URL is entered, you should see the contents of the reply. Note that the default <a target="_blank" href="http://doc.qt.nokia.com/latest/qtextedit.html">QTextEdit</a> object may display HTML code as it would appear in a browser rather than in plain text. Just as you may have seen in the <a target="_blank" href="http://doc.qt.nokia.com/latest/qwebview.html">QWebView</a> example, things may not work exactly as expected in all network environments due to several Potential Issues addressed below.<br /><br />This example shows how to access lower level information from network resources to give finer control in your application. As you explore classes such as <a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkaccessmanager.html">QNetworkAccessManager</a>, <a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkreply.html">QNetworkReply</a> and others, you'll see that this is just the beginning of what these classes have to offer. You can choose to use as few or as many of these features to suit your application's needs.<br /><br />
<h2 class="sectionHeading">Potential Issues</h2>
<b>Am I Online?</b><br /><br />The most common issue that a network application will encounter is a lack of connectivity. Unfortunately, the only sure way to determine if network connectivity is sufficient to reach a specific resource is to try to access that resource. This trial and error method can take a significant amount of time and frustrate users. Qt offers several classes that give control over network settings and insight into network connectivity. I've spent quite a bit of time exploring these classes on various platforms and in various networks and share some of that experience here.<br /><br />
<ul>
<li><a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkinterface.html">QNetworkInterface</a>, among many other things, provides a simple way to enumerate the network interfaces reported by the OS and their network settings such as IP addresses. You can also test flags associated with each interface to determine its state. It is important to keep in mind that just because an interface may be up, it may not be able to access a network resource across the globe or even on the same local network. On the other hand, if no interfaces with valid IP addresses are returned by this class, you can be fairly certain that no network resources will be reachable.</li>
<li><a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkconfigurationmanager.html">QNetworkConfigurationManager</a> and <a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkconfiguration.html">QNetworkConfiguration</a> classes provide detailed information about a specific network configuration. One of the more useful properties is the <a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkconfiguration.html#bearerTypeName">BearerTypeName</a> which may be Ethernet, WLAN, WiMAX, CDMA 2000, etc. Of course the OS must correctly report the type on any give platform.</li>
<li><a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkaccessmanager.html">QNetworkAccessManager</a> is the basis of the second example here but there are options not shown in the example for checking connectivity. In particular, the <a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkaccessmanager.html#networkAccessible-prop">networkAccessible()</a> function should return the general state of connectivity for the <a href="http://doc.qt.nokia.com/latest/qnetworkaccessmanager.html">QNetworkAccessManager</a> object.<br /><br /><i>Unfortunately, in my testing I was not able to get a return value other than QNetworkAccessManager::UnknownAccessibility.</i></li>
</ul>
As you can see by the above examples, the only sure way to determine connectivity to a specific resource on all platforms is to try and access it but there are a few sanity checks that may be work performing to improve the performance of the application.<br /><br /><b>Redirection</b><br /><br />Many Internet URLs redirect to another address meaning that you may need to connect to multiple locations. This is not necessarily an issue for something like the <a target="_blank" href="http://doc.qt.nokia.com/latest/qwebview.html">QWebView</a> class that can handle redirection automatically but for simple <i>get</i> operations in a <a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkaccessmanager.html">QNetworkAccessManager</a> object, you will need to detect and handle redirections manually.<br /><br />If in the QNetworkAccessManager example you are seeing a "301 Moved" response, you can add a redirection handler to automatically send the same get request to the new URL. For example, in the <i>fetchFinished</i> slot, you can add this simple check.<br /><br />
<pre name="code" class="cpp">void MainWindow::fetchFinished(QNetworkReply* reply)
{
    ui-&gt;returnText-&gt;append("Fetch Finished!");

// Redirection handler
    QUrl redirectURL = reply-&gt;attribute(
         QNetworkRequest::RedirectionTargetAttribute).toUrl();
    if(redirectURL.isValid())
         fetchURL(redirectURL);

    QString *replyText = new QString(reply-&gt;readAll());
    ui-&gt;returnText-&gt;append(*replyText);
}
</pre>
The QNetworkReply object, <i>reply</i> has a <a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkrequest.html#Attribute-enum">RedirectionTargetAttribute</a> from which we can obtain the redirection URL. If it exists, we can call the get operation in our <i>fetchURL</i> function again with this new address.<br /><br />
<h2 class="sectionHeading">Navigating Proxies</h2>
Proxy settings need to be considered in any network application, especially when the application may be used in a corporate environment. Qt offers some very simple methods to accommodate proxy settings. The simplest is to have the application use whatever proxy the system is configured to use assuming there exists a system-wide network configuration manager that the user has configured. In the QNetworkAccessManager example, you can add a single line to the <i>fetchURL</i> function that will cause the get operation to use the system proxy configuration. This line should be added before<br /><br />
<pre name="code" class="cpp">void MainWindow::fetchURL(QUrl targetURL)
{
// Addition to set system proxy
    QNetworkProxyFactory::setUseSystemConfiguration(true);

    netmanager-&gt;get(QNetworkRequest(targetURL));
}
</pre>
The same goes for the QWebView example. You can add the same call to the <i>on_refreshButton_clicked()</i> function.<br /><br />
<pre name="code" class="cpp">void MainWindow::on_refreshButton_clicked()
{
    QString targetURL = ui-&gt;urlEdit-&gt;text();
    ui-&gt;debugTextView-&gt;append("URL Entered: " + targetURL);

// Addition to set system proxy
    QNetworkProxyFactory::setUseSystemConfiguration(true);

    ui-&gt;webView-&gt;load(QUrl(targetURL));
}
</pre>
There are also options that allow finer control over proxy choice all the way down to specifying exact proxy settings for a given connection. It is far more convenient for a user to configure proxy settings at the system level rather than the application level however there may be cases when the user has configured multiple proxies and requires some level of control over which is used at the application level. The <a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkproxyfactory.html#systemProxyForQuery">systemProxyforQuery</a> function in the <a target="_blank" href="http://doc.qt.nokia.com/latest/qnetworkproxyfactory.html">QNetworkProxyFactory</a> class can return a list of proxies suitable for a given URL. With this function you can query the proxies for a given URL and display results as a user option.<br /><br /><b>Security</b><br /><br />The use of Secure Sockets Layer (SSL) in network communication is becoming more prevalent every day as people are becoming more aware of the need to protect information. Network resources that require SSL add another layer of complexity for network applications. Qt does a good job of hiding many of these complexities in classes like <a target="_blank" href="http://doc.qt.nokia.com/latest/qwebview.html">QWebView</a>. In the QWebView example, you may have noticed that some addresses or links just didn't open. This is often caused when no SSL support has been linked in the application and can be confirmed by debug messages displayed in the application output window of Qt Creator during runtime.<br /><br />On Windows*, the Qt SDK does not have SSL support by default. You must install and configure something like OpenSSL* to get this support. Running the QWebView example on Windows without SSL support can show the issues this will cause. If you try to load something like <a target="_blank" href="http://gmail.com/">http://gmail.com/</a>, you may see that nothing is displayed even after the load has finished. You should also notice errors in the Qt Creator application output window.<br /><br />
<blockquote>
<pre>QSslSocket: cannot call unresolved function SSLv3_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error
QSslSocket: cannot call unresolved function ERR_error_string
</pre>
</blockquote>
This is a case where Google* now enforces the use of SSL even if a non SSL address, such as <a target="_blank" href="http://gmail.com/">http://gmail.com/</a>, is used. The <a target="_blank" href="http://doc.qt.nokia.com/latest/qwebview.html">QWebView</a> object automatically handles the URL redirection to <a target="_blank" href="https://gmail.com/">https://gmail.com/</a> but there is no SSL support and so the load fails. If you are using the MeeGo SDK and building for a recent MeeGo target image, SSL support is included automatically and connections over SSL should succeed.<br /><br />For more information on SSL support in Qt, see the Qt FAQ at <a target="_blank" href="http://developer.qt.nokia.com/faq/answer/how_can_i_add_ssl_support_to_my_qt_application">http://developer.qt.nokia.com/faq/answer/how_can_i_add_ssl_support_to_my_qt_application</a>.<br /><br />
<h2 class="sectionHeading">Summary</h2>
Networking is a large and often complicated topic. The information and examples here show that a feature-rich application can be developed in Qt for MeeGo and many other platforms with very little effort. There are quite a few potential pitfalls to avoid, but the Qt framework offers many options to handle those cases as well. For further details on the classes discussed here, follow the Qt documentation links called out in the discussion.<br /><br />
<h2 class="sectionHeading">About the Author</h2>
<p><img src="http://software.intel.com/file/35156" align="left"  />Tom Propst is a Software Engineer at Intel focusing on mobile application development and optimization. Tom is defined outside of the office by his love for cycling.</p>
<br /><br /> ]]></description>
      <link>http://software.intel.com/en-us/articles/getting-started-with-networking-and-internet-in-meego-using-qt/</link>
      <pubDate>Wed, 30 Mar 2011 00:00:00 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/getting-started-with-networking-and-internet-in-meego-using-qt/#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/getting-started-with-networking-and-internet-in-meego-using-qt/</guid>
      <category>Intel® AppUp(SM) Developer Community</category>
    </item>
    <item>
      <title>An Introduction to Threading on Intel® Atom™ and MeeGo*</title>
      <description><![CDATA[ Most Intel Atom systems today offer hardware support for two or more threads of execution through multiple cores or Intel® Hyper-Threading Technology. It is worthwhile for developers to explore the advantages of multithreading in order to achieve better application performance or improve the user experience and responsiveness when running on Intel Atom. This paper describes the common Qt classes used to implement threaded applications on MeeGo, and also offers a brief summary of the performance of various threading primitives on Intel Atom processors.<br /><br />
<h2 class="sectionHeading">QThreads</h2>
On MeeGo, the Qt framework offers a full set of both high and low-level classes to support multithreading. The lowest-level class is the QThread. This class allows the user to directly create and manipulate an OS-level thread, such as one created by pthread_create() on Linux* and MeeGo or CreateThread() on Windows*.<br /><br />The advantage of using Qt is that it works cross-platform and abstracts away the underlying implementation. Using QThread to multithread code is quite easy as the simple example below shows:<br /><br />
<pre name="code" class="cpp">#include &lt;QCoreApplication&gt;
#include &lt;QThread&gt;
#include &lt;QtGui/QImage&gt;
#include &lt;QString&gt;
#include &lt;QDebug&gt;

class LoadThread : public QThread
{
public:
    LoadThread() { filename = ""; image = NULL; }
    LoadThread(QString str, QImage *img) { filename = str; image = img; }

protected:
    void run() { image-&gt;load(filename); }

private:
    QString filename;
    QImage *image;

};


int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QString filename1 = "1.jpg";
    QString filename2 = "2.jpg";
    QString filename3 = "3.jpg";

    QImage image1, image2, image3;

    LoadThread *thread1 = new LoadThread(filename1, &amp;image1);
    thread1-&gt;start();

    LoadThread *thread2 = new LoadThread(filename2, &amp;image2);
    thread2-&gt;start();

    LoadThread *thread3 = new LoadThread(filename3, &amp;image3);
    thread3-&gt;start();

    thread1-&gt;wait();
    thread2-&gt;wait();
    thread3-&gt;wait();

    if (!image1.isNull() &amp;&amp; !image2.isNull() &amp;&amp; !image3.isNull()) {
        qDebug("All pictures loaded!\n");
    }

    return 0;

}
</pre>
In this code example, we are multithreading the loading of three images. A single threaded implementation would require sequential loading, which means that when the CPU is blocked waiting for I/O from the disk, the program must wait for the operation to complete before continuing. By creating three threads that will each load one picture, we allow the MeeGo OS to switch to another thread when one becomes blocked. In order to use QThread, we need to create our own class that inherits from the QThread class and then override the run() function. This allows us to then create our own threads and begin executing the code within run() when we call start() on our thread. The overridden run() function cannot take any parameters, but we can pass data to and from the thread by storing it in members of the derived class. In the example code, this is done by setting the filename and image through LoadThread's constructor. After the thread starts executing, we need to wait on it to complete before we can access the pointer where the thread writes its result. This is done by calling wait() on our thread object. When the program encounters a call to wait() on a thread, it blocks there and waits for the indicated thread to finish executing before continuing on with the next line. QThreads require direct management as users are responsible for explicitly creating and waiting for them before they can use their results. They might be useful in situations where developers are actively trying to load balance their tasks with explicit knowledge of the differing characteristics of their threads and the number of threads supported by the hardware. <br /><br /><b>QtConcurrent</b><br />If direct management of threads is not needed, MeeGo developers can choose to use a thread pool. A thread pool allows users to queue up tasks that they need completed through threading, but a new thread is not created for every task. Rather, only a set number of threads are created and these threads pull new tasks from the queue and execute them to completion until they have exhausted the contents of the queue. <br /><br />This technique reduces the overhead caused by creating excessive numbers of system threads without direct hardware support. <br /><br />Qt determines the optimal number of threads to use for thread pool execution based on the number of threads supported by the underlying hardware. For example, on a hyper-threaded single-core Intel Atom system, the number of threads that would be created for the thread pool is two. The recommended way to implement task queuing is through the QtConcurrent namespace, which also offers higher-level features such as parallel maps over collections. If more control over the pool's scheduling algorithm, number of system threads created, etc. is desired, the QThreadPool object underlying the QtConcurrent framework can be accessed and modified (not demonstrated in this paper). <br /><br />Here we show an example of using QtConcurrent to load images using a thread pool:<br /><br />
<pre name="code" class="cpp">#include &lt;QCoreApplication&gt;
#include &lt;QtGui/QImage&gt;
#include &lt;QString&gt;
#include &lt;QtCore&gt;
#include &lt;QDebug&gt;

bool LoadImage(QString str, QImage *img) {
    return img-&gt;load(str);
}

void CheckResult(QFuture&lt;bool&gt; res1, QFuture&lt;bool&gt; res2, QFuture&lt;bool&gt; res3) {
    if (res1 &amp; res2 &amp; res3) {
        qDebug("All pictures loaded!\n");
    }
}


int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QString filename1 = "1.jpg";
    QString filename2 = "2.jpg";
    QString filename3 = "3.jpg";

    QImage image1, image2, image3;

    QFuture&lt;bool&gt; result1 = QtConcurrent::run(LoadImage, filename1, &amp;image1);
    QFuture&lt;bool&gt; result2 = QtConcurrent::run(LoadImage, filename2, &amp;image2);
    QFuture&lt;bool&gt; result3 = QtConcurrent::run(LoadImage, filename3, &amp;image3);

    CheckResult(result1, result2, result3);

    return 0;

}
</pre>
To use the thread pool in Qt, the task to be threaded is written in a function. This can be a global function or a class member. In this example, that function is LoadImage(). Unlike the QThread's run() function, QtConcurrent::run() can take in arguments, and as shown, the filename and image parameters are passed along as arguments to LoadImage(). Since we have not changed the default number of threads used in the QThreadPool, the Qt framework will create two threads when we are using a single-core, hyper-threaded system, assign each thread the first two LoadImages() tasks, and then reuse one of them to complete the last LoadImage() task. <br /><br />Another nice concept that the QtConcurrent framework introduces is the QFuture object. QFuture represents the eventual output of the thread, even though it might not exist yet. In this way, users can pass the QFuture object to another function or thread that might be waiting for the data, as illustrated with CheckResult() above. When the computation result stored in a QFuture object is accessed, either by an implicit cast to the result type, or by an explicit call to the result() method, the Qt framework will wait for the result to be generated. In this case, in CheckResult(), the threads that are loading the image are waited on when the QFutures res1, res2 and res3 are checked. It is important to make sure all thread values are read, which is why the bitwise &amp; was used to test the result values instead of the short-circuit boolean &amp;&amp; operator. Again, the nice thing here is that the program will not wait for the result of the computation until it is actually needed. Thread pools are an easy way for users to achieve multithreading without the responsibility of managing threads or scaling an implementation across varying numbers of hardware threads. Of course, if more direct management of threads is beneficial (such as knowledge that each thread does a lot of I/O and would block), users can either change the default number of threads created for the thread pool by calling setMaxThreadCount() on the global instance of QThreadPool, or by manually spawning and maintaining their own QThreads. <br /><br /><b>Locking with QMutex</b><br /><br />The previous examples of loading three images can be threaded without locks because the work each thread is doing is independent. They are each loading three separate files, resulting in three separate images. However, often multithreading requires locking to guarantee a particular sequence of events or to ensure atomic access to a shared resource. If multiple threads update a shared variable without locking, a race condition may be introduced. Depending on when each thread executes and completes, the value previously read for update by some threads may be stale as other threads have already written a different value to that variable. Mutexes are one of the basic mechanisms for ensuring consistency and Qt offers a mutex implementation though the QMutex class. Here is an example using QMutex: <br /><br />
<pre name="code" class="cpp">#include &lt;QCoreApplication&gt;
#include &lt;QThread&gt;
#include &lt;QtGui/QImage&gt;
#include &lt;QString&gt;
#include &lt;QDebug&gt;
#include &lt;QMutex&gt;

int totalByteCount;
QMutex countLock;

class LoadThread : public QThread
{
public:
    LoadThread() { filename = ""; image = NULL; }
    LoadThread(QString str, QImage *img) { filename = str; image = img; }

protected:
    void run() {
        image-&gt;load(filename);

        if (!image-&gt;isNull()) {
           countLock.lock();
           totalByteCount += image-&gt;byteCount();
           countLock.unlock();
       }
    }

private:
    QString filename;
    QImage *image;

};

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QString filename1 = "1.jpg";
    QString filename2 = "2.jpg";
    QString filename3 = "3.jpg";

    QImage image1, image2, image3;

    totalByteCount = 0;

    LoadThread *thread1 = new LoadThread(filename1, &amp;image1);
    thread1-&gt;start();

    LoadThread *thread2 = new LoadThread(filename2, &amp;image2);
    thread2-&gt;start();

    LoadThread *thread3 = new LoadThread(filename3, &amp;image3);
    thread3-&gt;start();

    thread1-&gt;wait();
    thread2-&gt;wait();
    thread3-&gt;wait();

    if (!image1.isNull() &amp;&amp; !image2.isNull() &amp;&amp; !image3.isNull()) {
        qDebug("All pictures loaded with a total byte count of %d\n", totalByteCount);
    }

    return 0;
}
</pre>
Since the three threads are now updating the same totalByteCount variable, they need to ensure that they complete the read and write of that variable before being swapped out for another thread. Otherwise, the result of totalByteCount may be inconsistent. By creating a global QMutex called countLock to protect this variable, each thread first calls lock() on that mutex to gain access to it. If another thread has already grabbed that lock, then the thread will block and wait for it to be freed (which happens when the previous lock-holding thread calls unlock() on the mutex) before continuing. Locking in threads does carry an overhead (see the Atom performance notes in the last section), so care should be taken to employ it only when needed. <br /><br /><b>QtConcurrent and Qt Collections</b><br /><br />The QtConcurrent namespace also offers support for parallel algorithms by allowing users to transform all the elements in a Qt collection class with a user-defined function in parallel. For example, given a QVector of QStrings and a user function that converts a string to upper case, all the strings can be converted to uppercase in parallel. QtConcurrent takes care of spawning the threads and provides the user with a single QFuture object that can be tested to see if all the operations have completed. Here is an example of image loading using a QtConcurrent map:<br /><br />
<pre name="code" class="cpp">#include &lt;QCoreApplication&gt;
#include &lt;QtGui/QImage&gt;
#include &lt;QString&gt;
#include &lt;QtCore&gt;
#include &lt;QVector&gt;

class MyImage {
public:
    MyImage() { filename = ""; image = NULL; }
    MyImage(QString _filename) { filename = _filename; image = NULL; }
    QString filename;
    QImage *image;
    void load() {
        if (filename != "") {
            image = new QImage(filename);
        }
    }
};

void ImageLoad(MyImage &amp;myImg) {
    myImg.load();
}

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QVector &lt;MyImage&gt; images;

    images.push_back(MyImage("1.jpg"));
    images.push_back(MyImage("2.jpg"));
    images.push_back(MyImage("3.jpg"));
    QFuture&lt;void&gt; done = QtConcurrent::map(images, ImageLoad);

    done.waitForFinished();

    bool flag = true;

    for (int i = 0; i &lt; images.size(); i++) {
         if (images[i].image-&gt;isNull()) {
             flag = false;
             break;
         }
     }

    if (flag) {
        qDebug("All pictures loaded!\n");
    }

    return 0;
}
</pre>
Using QtConcurrent::map requires the user map function to take in one parameter by reference, which matches the type stored in the collection. In the above example, the ImageLoad() function will be applied to each element of the images QVector and it will modify the MyImage object stored there in-place. The return value of the map function is not used. To wait for the function to be applied on every element in the QVector, we need to call waitForFinished() on the QFuture output of the QtConcurrent::map() call before we can safely use the collection to get our results. This single QFuture object signals the completion of the entire operation, and it is simpler to use than if we were to create individual threads ourselves, as we do not have to keep track of the state of each thread.<br /><br /><b>Thread Primitives on Atom</b><br /><br />Using Qt to achieve parallelism as illustrated in the above four examples is not difficult. However, multithreading does incur some overhead and the cost of that must be considered when calculating the performance benefit of threading. On a N470 1.83 GHz Intel Atom system that is running a beta tablet build of MeeGo, we measured the overhead times of some thread primitives. Creating a thread costs about 366,000 clock cycles, context switching about 2,100 clock cycles and locking/unlocking a QMutex about 120 clock cycles. The results are not unexpected given the relatively slower (at this time) clock frequency and IPC of the Atom CPU compared to current desktop CPUs and are within 3X of them. The Atom CPU performs thread management in a manner comparable to desktop CPUs. Therefore, the same general rule for threading on any CPU applies. If the amount of work needed to be accomplished takes more clock cycles than the overhead incurred by the threading primitives needed to implement multithreading, then threading would be a good way to increase performance. On MeeGo, using QThreads when direct management of threads is needed, or the QtConcurrent namespace APIs when it is not, is an easy way to introduce multithreading into programs.<br /><br />For further reading on the Qt classes for multithreading, Intel Atom development and hyper-threading, check out the following links:<br /><br /><a target="_blank" href="http://doc.qt.nokia.com/latest/qthread.html">http://doc.qt.nokia.com/latest/qthread.html</a><br /><a target="_blank" href="http://doc.qt.nokia.com/latest/qtconcurrent.html">http://doc.qt.nokia.com/latest/qtconcurrent.html</a><br /><a href="http://software.intel.com/en-us/articles/developers-guide-to-atom-part-1-of-4/">http://software.intel.com/en-us/articles/developers-guide-to-atom-part-1-of-4/</a> <br /><a target="_blank" href="http://www.intel.com/intelpress/sum_hyperthreading.htm">http://www.intel.com/intelpress/sum_hyperthreading.htm</a><br /><br />
<h2 class="sectionHeading">About the Author</h2>
<img src="http://software.intel.com/file/34409" align="left"  />Christine M. Lin is a Senior Software Engineer working in the Intel Atom Platforms Engineering group in SSG. She has a B.S. in Electrical Engineering and Computer Science from the University of California at Berkeley and has worked at Intel for 13 years. She lives in Sunnyvale, California with her husband and two young sons.<br /><br /><br /> ]]></description>
      <link>http://software.intel.com/en-us/articles/an-introduction-to-threading-on-intel-atom-and-meego/</link>
      <pubDate>Tue, 22 Feb 2011 00:00:00 -0800</pubDate>
      <comments>http://software.intel.com/en-us/articles/an-introduction-to-threading-on-intel-atom-and-meego/#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/an-introduction-to-threading-on-intel-atom-and-meego/</guid>
      <category>Intel® AppUp(SM) Developer Community</category>
    </item>
    <item>
      <title>Developer Experience: Porting the Antix* Game Player to MeeGo*</title>
      <description><![CDATA[ <b>By Nancy Nicolaisen</b><br /><br />
<h2 class="sectionHeading">Download Article</h2>
Download <a href="http://software.intel.com/file/30555">Developer Experience: Porting the Antix* Game Player to MeeGo*</a> [PDF 590KB]<br /><br />
<p ><img height="250" width="478" src="http://software.intel.com/file/30545" /></p>
The developers at Antix Labs* had an innovative idea: What if people could enjoy high-performance games across all of their devices, just like they're used to doing with music, photos, videos, and documents? The Antix Game Player* (AGP) is a middleware layer that allows users to do exactly this. AGP abstracts the operating system, chipset, screen size, and orientation and input device, providing an on-device, software-based game client. From the developer or publisher's point of view, AGP bootstraps rapid cross-platform deployments of game content and services and provides built-in protection for the revenue and intellectual property rights of publishers and operators.<br /><br />From the consumer's point of view, AGP provides a means by which a user can install, manage, and play games distributed in the Antix ATX format. ATX offers a single, portable executable format for use on all of the devices on which a user might want to play a game. Consumers can enjoy and share high-quality games online or offline as well as on phones, personal computers, TVs, and other connected devices. AGP allows users to play high-performance content across a broad variety of devices and to copy their games from one machine to another, share those games with their friends, and connect using the Internet or short-distance networking technologies.<br /><br /><br />
<h2 class="sectionHeading">Streamlining the Mobile Development Process</h2>
Historically, multiplatform, mobile-targeted game development has been a costly and time-consuming affair—not least because of multiple tiers of fragmentation. Devices, operating systems, and market barriers imposed by carriers have had a track record of bedeviling game developers trying to break into the platform-neutral mobile gaming space. Recently, however, the combination of netbooks and open source technology has done a lot to change this landscape, allowing developers to take advantage of familiar tools, targets, and legacy code bases for both Windows* and Linux*. The Antix developers' experience in moving their product from Moblin™ v1.0 (the first Intel release of Moblin back in 2008) to MeeGo* provides some worthwhile reflections on how to make the hop. Here's why: As of today, AGP runs on mobile devices, including Android*, Linux (Nokia Maemo*, Moblin, and MeeGo), Symbian* OS S60, Windows, and Windows Mobile* as well as diverse processor architectures designed by ARM*, Intel, and MIPS.<br /><br />
<h2 class="sectionHeading">Maemo* + Moblin™ = MeeGo*'s Heritage</h2>
Nokia Maemo and Moblin are the progenitors of MeeGo, and each brings strengths and advantages to mobile developers. Maemo offered a Linux-based software stack for use on mobile devices. Obviously, taking its source into account, it had a considerable smart phone bias. However, it was also used in devices like tablet computers. In contrast, Moblin was the Intel entry in the mobile Linux space, but it was a good deal more device-agnostic, being widely deployed to mobile Internet-based devices, netbooks, and in-vehicle systems. One of greatest strengths of Moblin was that it could wake up a device very rapidly and be available for connected use in seconds.<br /><br />As a hybrid of these two systems, MeeGo incorporates many of the best features of its ancestors: MeeGo runs on many types of computing devices, including handsets, netbooks, tablets, connected TVs, and in-vehicle systems. It gives developers a larger market by aggregating device types, and it benefits from the combined efforts and resources of the two teams that worked on its predecessors.<br /><br /><i><b>Moving to MeeGo* vs. Previous Ports</b></i><br />For Antix lead developer Kevin Digweed, one of the best surprises about working with MeeGo was that he got to use tools he already knew and preferred. "For me, porting from Moblin v1.0 to MeeGo was a relatively painless experience. I was able to do some development work on-device, using a netbook. On my Ubuntu desktop, I set up an environment where I could run my MeeGo binary builds natively. This had two main benefits: First, all of my favorite Linux command-line and GUI [graphical user interface] tools—as well as some in-house tools—ran just as I am used to seeing them do. This meant the tools with which I am experienced and comfortable were available to write, analyze, and debug the code. My MeeGo development environment was immediately familiar, with very close to zero learning curve." Digweed felt that he received a significant productivity boost, because the binaries for his port ran natively on the desktop. "It was a painless process to iterate over the development cycle," said Digweed. He was able to do preliminary testing on the desktop; then, using a simple Copy operation between his computer working directory and the netbook, he could run and test on the target device. "I didn't have to waste my time setting up and configuring VMs [virtual machines], emulators, or cross-compilers," said Digweed.<br /><br /><i><b>The Antix Toolchain for the MeeGo* Move</b></i><br />In this port of AGP, Digweed and his team members worked on code that was written in about 90% C, with most of the rest in C++. "I used Ubuntu 9.10 exclusively for the desktop environment. One big productivity boost came from the fact that I was able to set up a <span class="font-family: courier;">chroot</span> environment on my development workstation," said Digweed. The <span class="font-family: courier;">chroot</span> technique is powerful for sandboxing an application that is in the early stages of development and may not be entirely stable. It works like this: On a Linux- or UNIX*-like operating system, <span class="font-family: courier;">chroot</span> changes the effective root directory for a specific process and any child processes it spawns. Doing this essentially defines a limited execution environment for the process. This technique allowed Digweed and his collaborators to create a runtime environment on the desktop that was more or less identical to the one the AGP would see on an actual target MeeGo device.<br /><br />When it came time to begin debugging, Digweed and his colleagues began working natively—on the target device—as early as possible. "I did my initial assessments using the chroot environment, but if there is one recommendation I can make to other developers, it's this: Always do your final debugging and QA [quality assurance] passes on the device, because in terms of behavior and performance, that way you'll see the same things that your users do," says Digweed.<br /><br />Most developers who have had small device experience expect to encounter at least some difficulties setting up remote debugging. Many issues can be involved in connecting two devices over a cable or network connection and getting them both to agree on the details of communication and process control. Here again, the Antix team was happily surprised by the efficiency and lack of complexity involved. They used the GNU Debugger (GDB) on both the desktop environment and the target device. GDB runs on most UNIX-like systems and works for a variety of development languages. Of the Antix project's experience, Digweed said: "It is a good choice in a mixed-language development effort, and many developers are familiar with it. Because the target device was a relatively powerful netbook, I was able to simply install and run the debugger locally on both systems. If I had to debug on a more restricted device such as a smart phone, I would have investigated running gdbserver on the device, communicating with my desktop over TCP/IP."<br /><br />If you aren't familiar with gdbserver setup, here's how this works:<br /><br />1. On the netbook side of the connection, make a copy of the executable you are debugging and the gdbserver application.<br />2. Launch gdbserver on the netbook, providing as arguments the fully qualified path of the debugging target and a port number, which can be either TCP/IP or Universal Datagram Protocol (UDP).<br />3. When gdbserver starts the application on the target device, a status message shows the process ID (PID). Note of ID: You need it to connect the GDB on the host to the gdbserver session on the target device.<br />4. On the host side, you need both the executable and the source files for the debugging target.<br />5. Launch GDB on the host, specifying the application to be debugged as an argument.<br /><br /><b>Note:</b> <i>Typically, environment settings resolve the paths to source and .exe files, and you won't have to supply full pathnames. (If this doesn't reflect your situation, type <b>gdb –help</b> for more options.)</i><br /><br />6. At the GDB command line, point GDB to the remote target as follows:<br /><br />• <b>target remote mylittlenetbook:1234</b> (where <i>1234</i> is the PID you got from the gdbserver launch and mylittlenetbook is the system alias )<br /><br />–or–<br />• <b>target remote 145.114.13.85:1234</b> (where <i>1234</i> is the PID you got from the gdbserver launch and 145.114.13.85 is the netbook IP address)<br /><br />Ultimately, the Antix team made rapid progress moving AGP to MeeGo, because they were able to do a lot of on-device development using a netbook. On the order of 20–25 percent was handled this way, split across several development phases.<br /><br />"The way I worked was to get each main development task functional on the desktop, and then to moved to the netbook for any fine-tuning that needed to be done, based on the results of on-device testing before returning to the desktop for the next main task. By moving between the two environments in this way, I knew I wasn't potentially storing up a set of fine-tuning tasks by waiting until the port was largely finished, and then moving to the target device. This meant that I could be much more accurate in my planning and timescale estimations," said Digweed.<br /><br />Given that this was the team's first experience with MeeGo and that they were working on a code base with which they were extremely conversant, the development group felt that they profited by being able to use familiar, favorite tools that were largely command-line based. However, Digweed observed that if starting a new project from scratch, they would certainly investigate using an integrated development environment (IDE) such as Eclipse for the main development environment on the desktop.<br /><br /><br />
<h2 class="sectionHeading">MeeGo* and the Open Source Community</h2>
By merging the Maemo and Moblin open source communities and technology bases, MeeGo has significantly expanded market size for developers of mobile apps. MeeGo runs on a wide range of devices and chip architectures, which makes moving to it a low-risk proposition. Keeping the platform open source maintains freedom for developer innovation and helps to secure the way forward by embracing the tradition of developer community involvement. "The point here is that this is a stable, mature, open source standards process but also one that has a vibrant and growing community participating in its advancement. The stated objective of the MeeGo group is to lay the foundations of an ecosystem that allows for applications to be both portable and accelerated on a variety of silicon platforms," says Digweed.<br /><br />Antix enables game developers and publishers to target devices as game platforms without doing a triage based on likely sales or device population trends. This means that Antix supports proprietary platforms as well as open source options. The key to their cross-platform strategy is leveraging open source tools and technologies for graphic rendering and acceleration. In pursuit of this goal, Antix is actively engaged with the larger open source community, including playing a central role as a contributing member of the Khronos Group.  Founded in 2000, the Khronos Group is a member-funded, nonprofit industry consortium of media-focused technology companies whose mission is to create open-standard, royalty-free, platform-agnostic application programming interfaces (APIs) for content development and accelerated playback. Today, there are better than a dozen significant sets of Khronos APIs that are used to target a broad array of devices. More than 100 Khronos Group company members, including Intel, contribute to the projects.<br /><br />Antix Labs takes particular interest in Khronos working groups that define specifications for dynamic media APIs, serving as specification editor for the OpenKODE APIs. OpenKODE is an abstraction layer for operating system resources like file systems and networks, with a particular emphasis on media, graphics, and parallel computing acceleration. It provides a standard for a comprehensive media stack specification based on a set of native APIs. Says Digweed of the OpenKODE toolset's advantages to his project: "It makes high-end media capabilities available in a consistent way, across all platforms that implement it, by accelerating media and graphics processing. One of OpenKODE's big benefits to the Antix Game Player is that the Khronos Media APIs offer state-of-the-art acceleration for rendering 2D and 3D graphics whether we are running on Linux, Brew, Symbian, Windows Mobile, WIPI, or RTOS-based platforms." By contributing back to the OpenKODE community, the company is able to influence the evolutionary direction of APIs and components in ways that allow its AGP product to rapidly and gracefully migrate across new platforms and stay in front of device evolution.<br /><br /><br />
<h2 class="sectionHeading">The Take-home Lessons of the Antix Move to MeeGo*</h2>
When asked to sum up the porting experience, Digweed framed his thoughts in terms of the overall business environment for mobile gaming. "Increasingly, consumers want to move their content across a lot of devices and do it quickly and conveniently. They want to access services like game scoreboards and multiplayer environments from laptops and desktops but also from smart phones, netbooks, and TVs. Open source technologies like MeeGo and OpenKODE support rapid, cost-effective delivery of products that meet consumer demands for features like 3D graphics acceleration, high-quality vector-based fonts, 3D interprocess navigation, and advanced user interfaces. Having key players like Intel and Nokia behind MeeGo is an open source community win for everybody."<br /><br /><br />
<h2 class="sectionHeading">About the Author</h2>
Nancy Nicolaisen is the author of numerous books on software engineering techniques. She specializes in the design and development of solutions for small mobile and embedded systems. Her involvement with the game industry dates back to 1981, when she worked at gaming pioneer Imagic, developer of <i>Demon Attack</i> and other classics.<br /> ]]></description>
      <link>http://software.intel.com/en-us/articles/developer-experience-porting-the-antix-game-platform-to-meego/</link>
      <pubDate>Mon, 20 Sep 2010 00:00:00 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/developer-experience-porting-the-antix-game-platform-to-meego/#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/developer-experience-porting-the-antix-game-platform-to-meego/</guid>
      <category>Intel® AppUp(SM) Developer Community</category>
      <category>Visual Computing</category>
      <category>Game Development</category>
    </item>
    <item>
      <title>Six Tips for Developing Easily Ported Games</title>
      <description><![CDATA[ <b>By John Till</b><br /><br /><span class="sectionHeading">Download Article<br /></span><br />Download <a href="http://software.intel.com/file/30212">Six Tips for Developing Easily Ported Games</a> [PDF 968KB]<br /><br />For a game developer, one of the greatest feelings in the world comes from watching someone happily playing your game. You can see how much this player is enjoying it, so why isn't everyone else playing it? The simple answer is that not everyone can, because not everyone has the same hardware or runs the same operating system. Millions of game consoles are sold each year [1]. New PCs, laptops, netbooks, and smart phones are released with amazing frequency [2]. Tablets are quickly establishing their place in the market. Standing between you and a world full of potential players are hardware and software variations of epic proportions. How can your awesome game possibly reach the masses? These six tips should help.<br /><br />
<h2 class="sectionHeading">Tip 1: Be Flexible with Your Presentation Layer</h2>
When I first started developing Pocket PC* games, I had no intention of porting them to other platforms. That was a bit short-sighted on my part, because I was writing and compiling them in Microsoft Visual C++* on Microsoft Windows* for testing purposes anyway. The code had to be re-compiled with Microsoft eMbedded Visual Tools* (available at no cost) before the games would even run on the actual devices. Unfortunately, I had also made the mistake of locking myself into a portrait-oriented, Quarter VGA (QVGA: 240 x 320) resolution, as that's what all of the devices were using at the time. Oops.<br /><br />The moral of this story is that building your game for a fixed resolution and orientation is generally not a good idea. There are just too many devices with varying displays. Your presentation layer needs to be flexible and separate from the data layer. Before the rise of smart phones and tablets, nearly every display was landscape oriented. Because handheld devices can be turned on their sides, they too can become landscape devices. This makes porting a lot easier.<br /><br />There are plenty of strategies for handling different resolutions. In the 2D game world, if you design your game for a fixed resolution (like 800 × 600 pixels), the user can typically run it full screen, in which case the monitor handles any scaling. The game could also be run in a window, but if you want the window to be resizable or you want to run it on a device that doesn't allow 800 × 600, then who's responsible for scaling? One popular technique used in OpenGL* is to draw your graphics on a single texture of your desired resolution, and then show that one texture scaled to the full size of the screen (or window). Even though it's only a 2D game, you can take advantage of a 3D engine to ensure that the entire image will be there regardless of device resolution.<br /><br />You need to take some other factors into consideration, as well. What if your fonts become illegible as a result of scaling, or your objects don't look right at a different resolution? In such cases, where you need “pixel precision,” you may have to alter what you show on the screen. For example, assume your 800 × 600 game (A in Figure 1) is running on a typical netbook with a 1024 × 600 resolution. If you have a game board sitting on top of a background, you could stretch just the background to the full resolution (B in Figure 1), leaving the game board unchanged. You could also use an alternate background designed for widescreen displays (C in Figure 1), or you could have two 112 × 600 images that could be placed on either side (D in Figure 1).<br /><br />
<p ><img src="http://software.intel.com/file/30206" width="465" height="350" /></p>
<div ><b>Figure 1. </b><i>Altering the dimensions can make your game look better.</i><br /></div>
<br />Regardless of whether you alter the display to compensate for a less-than-ideal resolution or orientation, be sure to use variable positioning for your visual elements. Doing so not only provides the greatest level of flexibility, it allows you to implement cool features like moving the screen elements on the fly in response to feedback from a device's accelerometer or smoothly transitioning between landscape and portrait orientations. Some devices may look much better with a particular layout, so being able to easily reposition your elements is incredibly useful.<br /><br /><br />
<h2 class="sectionHeading">Tip 2: Use Middleware That's Already Multiplatform</h2>
Unless you're writing everything for your game from scratch, it's rather likely that you're going to integrate someone else's technology or middleware solution. This could be anything from an entire game engine [3] to path-finding logic to script interpreters to multimedia libraries for video and audio. There are a lot of options out there [4]: Let's take a look at a few.<br /><br /><i><b>Computer Graphics</b></i><br />In the realm of computer graphics, two 3D technologies tower over the rest: Microsoft Direct3D* [5] and OpenGL* [6]. Both offer great visuals and are supported by graphics card manufacturers, but only one of them is an open standard. This doesn't make a huge difference if you're only developing for Windows, but that's a lot of code to rewrite if you decide that you want to port your game to a platform that doesn't support Microsoft DirectX*.<br /><br /><i><b>Audio Libraries</b></i><br />Audio libraries are in the same boat as their visual counterparts. Each platform typically has its own proprietary application programming interface (API) that you can take advantage of, but then you're stuck having to rewrite your function calls for the next platform. Thankfully, several multiplatform alternatives are available that will likely suit your needs, such as OpenAL* [7] and FMOD* [8].<br /><br />Does this mean you should completely avoid proprietary libraries? No. Some of those libraries may provide additional quality, performance, features, and power or cost savings that you just won't get from a multiplatform library. You'll have to weigh the advantages against the disadvantages. In the end, your game should offer the richest possible experience for the user's platform.<br /><br />Also keep in mind that not all platforms are equal, and in some cases you can save development time or reduce licensing costs by taking advantage of a less feature-rich solution. For example, you don't need to implement 7.1 surround sound on a platform that only offers stereo output.<br /><br /><br />
<h2 class="sectionHeading">Tip 3: Consider Mobile Users</h2>
Every day, thousands of new smart phones, laptops, and tablet computers are turned on for the first time. Unfortunately, they can only function as long as their batteries allow them to. Gamers in today's society aren't tied to power outlets. If you keep that in mind, the mobile ports of your game can benefit greatly. Of course, this means compiling your game as a native application, which is less portable than an interpreted program (see Figure 2).<br /><br /><b>
<p ><img src="http://software.intel.com/file/30207" width="465" height="350" /></p>
</b>
<div ><b>Figure 2.</b> <i>Native applications require less processing than interpreted programs.</i><br /></div>
<br />Interpreted programs have to be converted into machine language commands by another program, called an <i>interpreter</i>. The interpreter also acts as a middleman between your game and the host operating system for handling the user's input and the game's multimedia output. This results in additional CPU cycles, which can slow down performance and deplete the battery faster than an equivalent compiled program would.<br /><br />Because a native application is not dependent on an interpreter, it can offer the player higher frame rates, increased responsiveness, and less battery drain. Also, because it eliminates a layer of complexity, native applications can even result in fewer technical support incidents.<br /><br />However, an interpreted program has a couple of serious advantages: quick development time and the potential for the program to work on any platform for which a compatible interpreter has been written. If the interpreter has already been ported, you may not have to do anything to your game to get it to run on that platform. That's incredibly convenient for you, but your mobile users will have to pay for that convenience.<br /><br />When you play an Adobe Flash*-based game [9], you'll notice that it runs in a plug-in in a browser window (see Figure 3). Every key press or mouse action has to be translated multiple times before it reaches the game logic. On a desktop machine, it's a small price to pay. Flash is compatible with a lot of platforms, and Flash programs typically only need to be written once. However, Flash is still not supported on all platforms and may require the user to install the Flash plug-in first, and the content itself needs to be sent from a server, which could take some time to download, depending on the user's Internet connection. For mobile devices, wireless signals can quickly deplete batteries.<br /><br />
<p ><img src="http://software.intel.com/file/30208" /></p>
<div ><b>Figure 3.</b> <i>Adobe Flash-based games can be played in most Web browsers</i>.<br /></div>
<br />Whatever you decide to use, keep in mind that mobile users have a limited playtime before they need to recharge their devices. Any strides you take to conserve power while maintaining a smooth and exciting game experience will earn you their appreciation. Compiling your game so that it runs natively is definitely a step in that direction, but you should expect it to take longer to achieve your porting goals.<br /><br /><br />
<h2 class="sectionHeading">Tip 4: Allow for Multiple Input Methods</h2>
Keyboards, mouse devices, touch pads, touch screens, accelerometers, joysticks... These are the typical input methods you'll be faced with when porting your game. It may look like an intimidating list at first, but it can be simplified into a few categories. For example, if you're using a touch pad on a laptop or netbook or a touch screen on a tablet or smart phone, your actions are generally converted into mouse inputs: X + Y + Event. Gestures are a relatively new exception that not all devices support. Keyboards, accelerometers, and joysticks may or may not be present depending on the device, whether it's docked or undocked, and so on.<br /><br />Simply put, there are so many hardware variations that you typically can't get by with programming for just one type of input unless you're porting to a very particular set of devices. But how do you decide which inputs your game should handle? Table 1 provides a decent guideline.<br /><i><br /></i><br /> 
<table class="tableformat1" border="0" cellspacing="0" cellpadding="0" width="500">
<tbody >
<tr >
<td  width="100"></td>
<td  width="100"><b>Keyboard/hardware buttons</b></td>
<td  width="100"><b>Mouse/touch pad/touch screen</b></td>
<td  width="100"><b>Accelerometer</b></td>
<td  width="100"><b>Joystick</b></td>
</tr>
<tr >
<td >Desktop</td>
<td >X</td>
<td >X</td>
<td ></td>
<td ></td>
</tr>
<tr >
<td >Laptop/netbook</td>
<td >X</td>
<td >X</td>
<td ></td>
<td ></td>
</tr>
<tr >
<td >Tablet</td>
<td ></td>
<td >X</td>
<td >X</td>
<td ></td>
</tr>
<tr >
<td >Smart phone</td>
<td ></td>
<td >X</td>
<td >X</td>
<td ></td>
</tr>
<tr >
<td >Console</td>
<td >X</td>
<td ></td>
<td ></td>
<td >X</td>
</tr>
</tbody>
</table>
<b>Table 1. </b><i>Common device inputs based on hardware category</i> <br /><br /><br />Granted, there are plenty of desktops with joysticks attached, smart phones with built-in keyboards, and so on. The requirements of the game should ultimately determine which inputs you decide to implement.<br /><br /><br />
<h2 class="sectionHeading">Tip 5: Plan for Localization</h2>
If you want your game to go global, then you need to face the reality that not everyone speaks English. Even if you don't speak any foreign languages yourself, you can still plan for it rather easily. Localization can usually be handled by focusing on three specific locations: text strings, art assets, and vocals.<br /><br />For most strings that show up as labels, mouse-over text, long descriptions, etc., you can use a simple text file that contains an index and a translation. When your game loads, it can read that file into an array, and then you can recall the proper translation when you need to display it.<br /><br />Storing text in the art assets doesn't require a lot of work on the coding side, where a programmer can simply load a different image, but having the artists recreate the same assets multiple times (once for each locale) is something you want to avoid, if possible. If the artists are already maintaining multiple variations of the assets—for different devices, quality levels, etc.—the amount of work they need to do can grow prohibitively large.<br /><br />Vocals can really help immerse your players in your game, and the easy way around having to record them in multiple languages is to do what movies usually do: Show subtitles. These are good to have anyway, because they give players a chance to see exactly what the characters are saying, even if they have their sound turned off or need to pull their attention away from the game for a moment.<br /><br />Text usually doesn't take up a lot of space, but image and sound files do. Because most users will only want to play the game in their native tongue anyway, they likely won't want all of the localized art assets and vocals needlessly taking up extra space. That space can be especially precious on a mobile device or solid-state disk (SSD). If you can't avoid having the translated assets, you should at least be able to package the localized versions separately. This will save space, decrease the download time for your game, and make for a better user experience. It will also allow your game to hit the market sooner, because you won't need to wait for all of the translations to be completed.<br /><br /><br />
<h2 class="sectionHeading">Tip 6: Choose a Development Environment That Makes Porting Easy</h2>
Most integrated development environments (IDEs) originally weren't created with the intention of being used for multiplatform development. Today, however, there are quite a few tools that will compile your game for desktop, mobile, and even console platforms with minimal or no modifications to the source code. Two popular offerings are Microsoft XNA Game Studio* [10] and the Torque* [11] development tools.<br /><br /><i><b>XNA Game Studio*</b></i><br />Taking advantage of Microsoft Visual Studio*, C#, and the Microsoft .NET* Framework, XNA Game Studio may seem limited by its proprietary nature at first glance, but when you consider that the games you can make with it are capable of running on the Windows operating system (for desktops, laptops/netbooks, and tablets), Microsoft Xbox 360*, Microsoft Zune* media players, and the upcoming Windows* Phone 7 series of devices with almost zero changes to the source code, that's a huge market of players just waiting for your awesome game to come their way. Figure 4 shows the XNA Game Studio interface.<br /><br />
<p ><img src="http://software.intel.com/file/30209" width="465" height="267" /></p>
<div ><b>Figure 4.</b><i> Create. Compile. Run. Microsoft XNA Game Studio templates make it easy.<br /></i></div>
<br />How much does it cost? This is one of XNA Game Studio's greatest strengths: It's free to download and develop your games. You can also release your Windows games without sending a dime to Microsoft. Publishing for Xbox 360, Zune, or Windows Phone 7, however, requires that you register as a developer on the appropriate distribution portal (which is about US$100 per year).<br /><br />How easy is it? An experienced developer will pick it up fairly quickly. New developers will want to familiarize themselves with C# programming first, but there are plenty of online tutorials and books written for it. Overall, the platform has matured very nicely since its release in early 2006.<br /><br /><i><b>Torque* (2D, 3D, X, etc.)</b></i><br />Originally built as a 3D engine for the game <i>Tribes 2</i>, the Torque development tools have evolved significantly over the past nine years. They're currently split into a variety of separately licensed products, each focusing on a specific market or platform. The code, however, is largely portable across the Torque IDEs. For example, a game written in Torque 2D for Windows can be compiled with iTorque 2D*, which targets an entirely different set of devices. Torque's greatest strengths are found in the number of platforms it supports, its large community, and its developer-friendly interface (see Figure 5).<br /><br />
<p ><img src="http://software.intel.com/file/30210" /></p>
<div ><b>Figure 5.</b> <i>Torque provides templates and drag-and-drop development.</i><br /></div>
<br />How much does it cost? You'll need to visit the Torque Web site for current pricing, but you should expect to pay at least US$100. You can also download a free 30-day trial version of Torque 2D*.<br /><br />Although XNA Game Studio and Torque are only a small sample of the multiplatform development tools available, they should give you a good idea of what to look for in a multiplatform IDE: easy application development, support for plenty of popular platforms, and minimal or no re-coding necessary.<br /><br /><br />
<h2 class="sectionHeading">Summary</h2>
Not everyone owns the same hardware. Not all devices run the same operating system. That doesn't mean that your game can't be played by everyone. With careful planning and the right tools, your game can be enjoyed by millions of players all over the world.<br /><br /><br />
<h2 class="sectionHeading">References</h2>
[1] Video game charts: <a href="http://www.vgchartz.com" target="_blank">http://www.vgchartz.com</a><br />[2] Tech news sites: Engadget (<a href="http://www.engadget.com" target="_blank">http://www.engadget.com</a>) and Gizmodo (<a href="http://www.gizmodo.com" target="_blank">http://www.gizmodo.com</a>)<br />[3] Survey by Mark DeLaura at Gamasutra: <a href="http://www.gamasutra.com/blogs/MarkDeLoura/20090302/581/The_Engine_Survey_General_results.php" target="_blank">http://www.gamasutra.com/blogs/MarkDeLoura/20090302/581/The_Engine_Survey_General_results.php</a><br />[4] Middleware solutions: <a href="http://www.gamemiddleware.org" target="_blank">http://www.gamemiddleware.org</a><br />[5] DirectX* Developer Center: <a href="http://msdn.microsoft.com/en-us/directx/default.aspx" target="_blank">msdn.microsoft.com/en-us/directx/default.aspx</a><br />[6] OpenGL*: <a href="http://www.opengl.org" target="_blank">http://www.opengl.org</a><br />[7] OpenAL*: <a href="http://connect.creativelabs.com/openal/default.aspx" target="_blank">http://connect.creativelabs.com/openal/default.aspx</a><br />[8] FMOD*: <a href="http://www.fmod.org" target="_blank">http://www.fmod.org</a><br />[9] Flash* Games: <a href="http://www.flash-game.net" target="_blank">http://www.flash-game.net</a><br />[10] XNA Game Studio* Creators Club Online <a href="http://creators.xna.com" target="_blank">http://creators.xna.com</a><br />[11] Torque* Development Tools: <a href="http://www.torquepowered.com" target="_blank">http://www.torquepowered.com</a><br /><br /><br />
<h2 class="sectionHeading">About the Author</h2>
John Till is the independent developer responsible for all of the games at Pocket Adventures.com. His games have been acclaimed in Pocket PC Magazine's Annual Software Awards and have ranked in the top ten lists at major distribution portals like Handango and PocketGear. John holds a Bachelor's degree in Computer Science from Purdue University and has more than 12 years of experience working in IT.
<div  id="vc-meta">
<div id="vc-meta-author">
<div>John Till</div>
</div>
<div id="vc-meta-pubdate">09-07-2010</div>
<div id="vc-meta-modificationdate">09-07-2010</div>
<div id="vc-meta-taxonomy">Tech Articles</div>
<div id="vc-meta-category-product"></div>
<div id="vc-meta-category"></div>
<div id="vc-meta-thumb"></div>
<div id="vc-meta-thumb-tout"></div>
<div id="vc-meta-thumb-hero"></div>
<div id="vc-meta-tocenable">no</div>
<div id="vc-meta-abstract">Developing great games is easy, but getting them to the masses may prove difficult. With consumers having different systems and different levels of hardware, this article delves into the development tools and practices one should have in mind while creating a cross platform games.</div>
</div> ]]></description>
      <link>http://software.intel.com/en-us/articles/six-tips-for-developing-easily-ported-games/</link>
      <pubDate>Tue, 07 Sep 2010 00:00:00 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/six-tips-for-developing-easily-ported-games/#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/six-tips-for-developing-easily-ported-games/</guid>
      <category>Intel® AppUp(SM) Developer Community</category>
      <category>Visual Computing</category>
      <category>Game Development</category>
    </item>
    <item>
      <title>Does Intel® VTune™ Amplifier XE 2011 support Intel® Atom™ Processor?</title>
      <description><![CDATA[ <p class="MsoNormal"><span lang="EN-US" >Yes, VTune™ Amplifier XE 2011 supports the Intel® Atom™ processor as long as the platform is running a supported operating system.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" >Since Intel Atom processors are based on the IA-32 architecture and support Intel® Streaming SIMD Extensions-3 (Intel® SSE3), VTune™ Amplifier XE can be used to analyze software running on the machine. This should work for any of the supported platforms and operating systems listed in the Release Notes.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" >VTune™ Amplifier XE supports the Atom processor both for general operations such as data collection and data analysis, as well as Atom-specific event-based sampling analysis (EBS). <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" >When using VTune™ Amplifier XE on an Atom based device two different approaches are commonly used. The first approach is to run the complete VTune™ Amplifier XE on the Atom <i>target</i>. This implies installation of the full product and requires significant hardware resources to be installed on the machine. In this case all types of analysis can be made from within VTune™ Amplifier XE GUI. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" >A second approach is to use a remote collector on the target Atom machine, the results being then analyzed on a PC that has the full VTune™ Amplifier XE product installed (the <i>host</i> machine). In this mode, VTune Amplifier XE just requires that the remote data collector and command line tools are installed on target machine - see Figure 1.  Refer to the product Release Notes for installation guidelines.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" >Once the data collectors are installed on the target, use the command line tools to collect raw data.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" >With remote data collection, those data need to find their way back to the host machine for analysis, viewing and reporting, but this can be done by a variety of means, from network copies to remotely mapped file systems.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><i><span lang="EN-US" ><img alt="VTune_remote_collection2.jpg" title="VTune_remote_collection2.jpg" src="http://software.intel.com/file/30358" /><br /></span></i></p>
<p class="MsoNormal"><i><span lang="EN-US" >Figure 1 - Remote data collection using VTune</span></i><span lang="EN-US" >™<i> Amplifier XE</i></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" >For example:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal" ><span lang="EN-US" >&gt;amplxe-cl -collect concurrency -result-dir r001cc my_app<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" >This command runs Concurrency analysis for the my_app application and stores the results in directory ‘r001cc.’<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" >When the collection is finished, the ‘r001cc’ directory will contain everything needed on the host machine to complete the analysis.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" ><br /></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US" >Configuring the Hardware Event-based Sampling Analysis<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoListParagraph" > </p>
<ul>
<li><i><span lang="EN-US" >When full product is installed on the target system</span></i></li>
</ul>
<p>There are no predefined collection types for the Intel® Atom™ processor, but users can create custom profiles based on available Performance Monitoring Unit (PMU) events.</p>
<p class="MsoNormal"><span lang="EN-US" >To create a new analysis type, press the ‘New’ button and select ‘New Hardware Event-based Sampling Analysis.’<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" >Then press the ‘Add Event’ button and select the desired events from the list of available events provided for the current microarchitecture.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" >Note: You can copy the generated command line and configuration file and use them for data collection without the GUI. To do that press the ‘Get Command Line’ button and read instructions.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoListParagraph" > </p>
<ul>
<li><i><span lang="EN-US" >When only data collectors and command line tools are installed on the target system</span></i></li>
</ul>
<p>Running EBS data collection remotely requires both a configuration file (.cfg) and a command line that will be fed to the collection tool running on the target.</p>
<p class="MsoNormal"><span lang="EN-US" >If the full product is not available on the target machine, you might be able to configure something on the host machine that can be used on the target:<o:p></o:p></span></p>
<p class="MsoListParagraph" ><span lang="EN-US" ><span >-<span > </span></span></span><span lang="EN-US" >Start a new project and configure Hardware Event-based Sampling Analysis<o:p></o:p></span></p>
<p class="MsoListParagraph" ><span lang="EN-US" ><span >-<span > </span></span></span><span lang="EN-US" >Edit the generated .cfg file: event names in the "pmuEventConfig" knob must be changed according to the target machine PMU<o:p></o:p></span></p>
<p class="MsoListParagraph" ><span lang="EN-US" ><span >-<span > </span></span></span><span lang="EN-US" >Copy the .cfg file to the target machine and use a path to the file in the command line.<o:p></o:p></span></p>
<p  class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><br /></span></p>
<p class="MsoNormal"><span lang="EN-US" >To check which PMU events are available in the CPU installed on the system run the command:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal" ><span lang="EN-US" >&gt;amplxe-runsa -event-list</span><span lang="EN-US" ><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><br /></span></p>
<p class="MsoNormal"><span lang="EN-US" >There is a simple way to remotely collect the most commonly used EBS data without creating a .cfg file:</span></p>
<span > 
<ul>
<li>Use lightweight-hotspots collection type. It will create a collection of basic events which is sufficient in many cases:</li>
</ul>
</span><ol> </ol>
<p class="MsoNormal" ><span lang="EN-US" >&gt;amplxe-cl -collect lightweight-hotspots my_app</span></p>
<p class="MsoNormal" ><span lang="EN-US" ><br /></span></p>
<span > 
<ul>
<li>In order to enable more options use run-tools to control the analysis configuration and then import raw data into the VTune™ Amplifier XE project. For example:</li>
</ul>
</span>
<p class="MsoNormal" ><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal" ><span lang="EN-US" >&gt;amplxe-runsa -d 10 --event-config "CPU_CLK_UNHALTED.CORE":sa=2000000, "SIMD_INST_RETIRED.ANY" --result-dir r001lh –- my_app<o:p></o:p></span></p>
<p class="MsoNormal" ><span lang="EN-US" >&gt;amplxe-cl -finalize r001lh<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" ><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" >In these commands the run-tool runs EBS collection with the selected events for the my_app application during 10 seconds, and then stores the raw results in directory ‘r001lh.’ For resolving symbols the finalization command of data collector is used.<o:p></o:p></span></p>
<p class="MsoNormal"><span ><span ><span ><span ><br /></span></span></span></span></p> ]]></description>
      <link>http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe-supports-intel-atom-processor/</link>
      <pubDate>Mon, 30 Aug 2010 13:00:00 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe-supports-intel-atom-processor/#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe-supports-intel-atom-processor/</guid>
      <category>Tools</category>
      <category>Intel® AppUp(SM) Developer Community</category>
      <category>Intel® VTune™ Amplifier XE Knowledge Base</category>
    </item>
    <item>
      <title>Green Computing with Intel® Atom™ Processor-Based Devices</title>
      <description><![CDATA[ <b>By Nancy Nicolaisen</b><br /> <br />
<h2 class="sectionHeading">Download Article</h2>
Download <a href="http://software.intel.com/file/29499">Green Computing with Intel® Atom™ Processor-Based Devices</a> [PDF 825KB]<br /><br /> My first exposure to Intel® Atom™ microarchitecture was as a by-product of a search for a durable, low-cost, powerful platform for ultra-mobile field science applications. I can say, without reservation, that Intel® Atom™ processor-based devices are superlative in this use case. What I learned about their relative "greenness" came later, and so I want to be clear about one thing from the outset: Few people in the technology industry have the luxury of choosing solutions exclusively because they are green. When a few cents of additional cost in a bill of materials can make the difference between a profitable design and a complete loser, the bottom line is very often where the decision gets made about what to build.<br /><br /> However, if the best candidate also turns out to be the most environmentally friendly one, then we end up with a double win, and this is worth knowing. Appreciating the green manufacturing process, operating characteristics, and life cycle management opportunities you deliver into your customers' hands is a form of situational awareness in the technology development process. Even if you didn't set out to be green, increasingly, both consumers and enterprise customers evaluate purchases with this in mind. Published figures for the number of consumers that take environmental considerations into account when making purchases put the share at around 77 percent overall, with higher numbers for the 18-24 age group, which is disproportionately represented among game consumers.<br /><br /> This year, for the first time, you can leverage good environmental product design, because there is a way to make green claims stick. Underwriters Laboratories (UL), the same institution that labels a wide variety of consumer products as being certifiably compliant with safety and quality standards, is providing certification for products that meet energy and sustainability standards as well as third-party validation of environmental claims (see Figure 1).<br /><br />
<p ><img src="http://software.intel.com/file/29493" /></p>
<b>Figure 1.</b> <i>UL is introducing programs to provide third-party validation for environmental claims. Testing allows vendors to use UL's respected logo in marking their products.</i><br /> <br /> UL's green claims validation process contemplates better than a dozen aspects of sustainability and reasonable behavior regarding waste streams. On its own, the Intel® Atom™ processor could qualify for consideration in terms of energy efficiency, water efficiency, and freedom from hazardous and toxic substances content.<br /><br /><br />
<h2 class="sectionHeading">Clean Manufacturing</h2>
Perhaps the most under-reported achievement of the Intel® Atom™ processor is the one for which it most deserves attention: the Intel® Atom™ processor is a member of the first family of Intel® processors to claim a completely lead- and halogen-free manufacturing process-an accomplishment that took six years of research and development to achieve.<br /><br /><br /> <b><i>Getting the Lead Out-Literally</i></b><br /> Lead has the highest atomic weight of all stable elements and is used in a variety of applications, including solder, fireproofing, and fusible alloys. Because of its malleability, low melting temperature, and ease of rendering from ore-bearing rock, lead has been widely used for centuries. For this reason, it is virtually ubiquitous, and every living human has some measurable level of lead present in his or her blood-not good news, because it is a powerful neurotoxin, bioaccumulating in both soft tissue and bone. In young children, lead toxicity causes life-long learning disabilities and behavioral problems; in adults, it can permanently impair heart, kidney, intestine, and reproductive function (see Figure 2).<br /><br />
<p ><img src="http://software.intel.com/file/29494" /></p>
<b>Figure 2.</b> <i>Of all environmental pollutants, lead is by far the most frequent cause of health problems in children. The data depicted above are quoted from a study by Dr. Phillip Landrigan, a globally recognized advocate for children's health. Landrigan's studies were a key influencer in the U.S. Government's requirement to eliminate lead from gasoline.</i><br /> <br /> Lead accumulation in humans occurs as a result of exposure to contaminated air, water, soil, food, or consumer products. Because of its chemical stability, lead is particularly persistent in the environment, being capable of long-distance transport via wind and water.<br /> <br /> Heavy metals and a handful of other persistent organic pollutants are so serious a problem that in one of the first initiatives after its creation, the European Union (EU) established regulations limiting use of six hazardous substances commonly found in electronics:<br /> <br /> 
<ul>
<li>Lead</li>
<li>Mercury</li>
<li>Cadmium</li>
<li>Hexavalent chromium</li>
<li>Polybrominated biphenyls</li>
<li>Polybrominated diphenyl ether</li>
</ul>
It was forward-looking of the EU to tackle the problem of reducing the environmental inputs of substances known to have profound impacts on human health, and with an economy of over US$16 trillion in 2009, the EU can make such restrictions stick. In practice, however, exclusions and exceptions permit continued use of the six hazmat "bad guys" where other materials are too difficult or too costly to substitute. As a result, many integrated circuit manufacturers meet the EU Restriction on Hazardous Substances, enabling them to market products in the EU, but they don't build <i>contaminant-free</i> products.<br /> <br /> Intel, in contrast, invested six years and millions of dollars to design and produce a family of processors that <i>exceed</i> the EU restrictions on lead. No lead is used, anywhere.<br /><br /> <br /> <b><i>Going Halogen Free</i></b><br /> In addition to losing the lead, the Intel® Atom™ family of processors is halogen free. Halogen compounds (including the last two on the EU list shown above) have long been used in a variety of applications (think textiles, appliances, and electronics) as flame retardants (HFRs). They do this by escalating the temperature at which plastics and resin-based items like circuit boards ignite. It wasn't until the mid-1990s that scientists began to investigate what happens when halogen-based HFRs actually <i>do</i> ignite at high temperatures. The discoveries were sobering.<br /> <br /> Combustion products from high-temperature HFR fires can include dioxins and furans, two of the most teratogenic and carcinogenic families of compounds known to man. Here are the key things to understand about the health and environmental risks of burning HFRs:<br /> 
<ul>
<li>Dioxin and dioxin-like compounds are <i>persistent organic pollutants</i> (POPs), which means that they don't readily degrade through chemical, biologic, or photolytic processes.</li>
<li>Because they are such durable compounds, they are readily transported over long distances by movement in air and water.</li>
<li>They bioaccumulate in human and animal tissue.</li>
<li>They biomagnify in food chains.</li>
<li>Dioxin and dioxin-like compounds are not intentionally manufactured for any purpose. The dominant environmental input is open burning of trash and in particular, e-trash.</li>
</ul>
<i>Bioaccumulation</i> is a process by which plants, animals, and people living in environments where there are higher-than-normal concentrations contaminants become saturated with them. Because contaminants do not degrade naturally and cannot be metabolized, contamination is exaggerated as is goes up the food chain (see Figure 3), resulting in <i>biomagnfication</i>.<br /> <br />
<p ><img src="http://software.intel.com/file/29495" /></p>
<div><b>Figure 3.</b> <i>The Boundary Waters Treaty of 1909 established the International Joint Commission/Commission Mixte International, under which the governments of the United States and Canada collaborate to monitor, assess, and remediate water and air quality issues of the Great Lakes and St. Lawrence Seaway. This area is the largest freshwater complex on earth and, owing to its cultural history and huge surface area, has had significant problems with accumulation of toxic pollutants in its plant, animal, and human communities. The image above is a depiction of a Great Lakes food web, showing the paths by which POPs bioaccumulate and biomagnify in plants, animals, and people. (Taken from the IJC-CMI 11th Biennial Report on Great Lakes Water Quality, available at <a href="http://www.ijc.org/php/publications/html/11br/english/report/index.html">http://www.ijc.org/php/publications/html/11br/english/report/index.html</a>.)</i><br /><br /></div>
<br />
<h2 class="sectionHeading">Facing the E-trash Issue</h2>
Today, the principal source of atmospheric dioxin and furan family compounds is open burning. Sometimes, this is simply a matter of people burning personal household trash. EPA and the New York State Department of Health conducted a joint study to analyze the impacts of open-barrel burning of household trash. For some combustion products, the toxic effluent produced by burning 10 pounds of household trash per day was equivalent to the output of a well-controlled commercial incinerator burning 400,000 pounds of trash per day (see Figure 4).<br /> <br />
<p ><img src="http://software.intel.com/file/29496" /></p>
<b>Figure 4.</b> <i>Results of joint state/federal studies conducted in partnership with EPA during the decade between 2000 and the present showed the relative contribution of open-barrel burning to highly toxic, persistent, airborne pollutants.</i><br /> <br /> As a result of these and other studies, most states and the U.S. Government restrict what materials can be dispose of by burning.<br /> <br /> Increasingly, however, waste electronics are being shipped abroad by fraudulent "recycling" operations. This so called "e-trash" is the fastest growing waste stream globally, with over 50 million tons being dumped annually-mostly in Africa but also in China and India. Devices including computers, monitors, cell phones, printers, televisions, and medical equipment are sold to small-scale salvage businesses. The e-trash serves as raw material from which workers render copper and lead by burning in open bonfires. The fires burn for as long as necessary to incinerate plastics, making metal constituents easily recoverable. Workers are frequently children.<br /> <br /> Open burning of e-trash poisons workers, irreparably contaminates soil and ground water, and creates perverse incentives in the e-waste recycling industry. In addition, released airborne pollutants are readily distributed globally by atmospheric circulation. EPA studies conducted to determine the rate of travel of airborne heavy metal contaminants showed that starting from various locations in North America, in 5 to 10 days, airborne pollutants can traverse the entire continent (see Figure 5).<br /> <br />
<p ><img src="http://software.intel.com/file/29497" /></p>
<b>Figure 5.</b> <i>This map shows airshed bands, centered on the shores of the Great Lakes-the largest complex of freshwater lakes on earth, containing about 18 percent of the world's fresh water. The numbers in the bands reflect the time it took airborne pollutants to reach and be deposited in the lakes. This research was conducted and published by the EPA Great Waters Program.</i><br /> <br /> Like lead, the combustion products from halogenated fire-suppression materials are extremely stable. Once released into the environment as noxious effluent, they will be there for a long, long time. Last year, over 500,000 waste personal computers were reportedly delivered to Lagos, Nigeria, as "used goods." There weren't 500,000 consumers lined up to take them home and plug them in.<br /><br /> <br />
<h2 class="sectionHeading">You Can't Talk Green Without Talking Energy</h2>
What happens when a processor is manufactured happens once. Likewise, what happens when it is recycled (or not) happens once. It is true that the impacts of these activities can have long-lasting and even devastating effects. However, for several years in between those two events, there will be a "daily life," and how a device goes about its business during that time matters exceedingly for purposes of energy impact and carbon footprint.<br /> <br /> There are two common ways computers waste energy:<br /> <br /> 
<ul>
<li>The waste can be present as excess capacity for an IT operation that has overprovisioned to ensure that it will have the necessary resources when computing demand peaks.</li>
<li>The computer can be left on when it isn't actually in use, so that it will be rapidly available for ad hoc use.</li>
</ul>
Intel® Atom™ processor-based devices help individuals, software developers, and the enterprise unwind energy demand by dramatically reducing unnecessary and unproductive energy consumption.<br /><br /> <br /> <b><i>The Green Cloud</i></b><br /> We are upon the threshold of the era of the cloud, and cloud computing may turn out to be the greenest thing to hit the planet since crop rotation. Here's why: In the same way cell phones have changed our expectations about connectedness with people, cloud computing will change our beliefs about connectedness to services, information, and management of computing infrastructure. Consider the first item in the energy wasting list above.<br /> <br /> In an architecture where powerful, ubiquitous, lightweight "viewer" devices access resources and assets stored and managed in the cloud, there is no incentive to overprovision. You can pay as you go for a desired level of service and cheaply enjoy the benefits of specialized infrastructure made affordable by economies of scale. This delivers savings in the individual or enterprise case through lower capital, staffing, and energy costs; it provides improved environmental stewardship in the aggregate case through optimized resource utilization.<br /><br /> <br /> <b><i>Conserve Power by Needing Less</i></b><br /> Leaving an Intel® Atom™ processor-based device in a power-on standby status has a considerably reduced carbon footprint compared to doing the same thing using hardware running on bigger, faster, hotter processors. Quoting from a paper entitled "A Sub-1W to 2W Low-Power IA Processor for Mobile Internet Devices and Ultra-Mobile PCs" by Gianfranco Gerosa et al., presented at the International Solid State Circuits Conference of 2008:<br /> <br /> <i>"This paper describes a low-power Intel® Architecture (IA) processor specifically designed for Mobile Internet Devices (MID) and Ultra-Mobile PCs (UMPC) <b>where average power consumed is on the order of a few hundred mW</b> (as measured by MobileMark'05 OP @ 60 nits brightness) with performance similar to mainstream Ultra-Mobile PCs." [Emphasis mine.]</i> <br /><br />Average power use measured in milliwatts needs little further elaboration, and this result was published almost two years ago. Power and thermal efficiency advances continue for Intel® Atom™ processors. The year 2010 saw the introduction of next-generation technology, the Intel® Atom™ Z6xx series processors. Devices built on these platforms will benefit from stunning reductions in power consumption, benchmarking as follows:<br /> 
<ul>
<li>More than 50 times less at processor idle</li>
<li>More than 20 times less for audio</li>
<li>More than two times less for video playback and connected browsing</li>
</ul>
An Intel® Atom™ processor-powered netbook can operate on as little as 11.5 watts. In contrast, a typical laptop uses 60-90 watts; a desktop computer can use between 60 and 250 watts, depending on configuration.<br /><br /> <br />
<h2 class="sectionHeading">Ultramobility Is the New Normal</h2>
When considering the history of personal computing, one more-or-less rigid constraint imposed limits from T0 until the netbook. To access serious resources, you had to be where they were, or at least near the right infrastructure to bridge you to them fairly frequently (think wall power, high-bandwidth Internet access, climate-controlled environments, chairs, etc.). Imagine the vast amounts of energy that could be saved if, no matter where we all were, no one had to get in a car or on an airplane (unless they wanted to) to connect with colleagues, customers, and companions (see Figure 6).<br /> <br />
<p ><img src="http://software.intel.com/file/29498" /></p>
<div><b>Figure 6.</b> <i>Increasingly, we expect to work, play, and connect from wherever we happen to find ourselves. (Composite image created by Reto Stöckli, Nazmi El Saleous, and Marit Jentoft-Nilsen, NASA GSFC, available at <a href="http://www.nersc.gov/news/science/quantumsecrets.php" target="_blank">http://www.nersc.gov/news/science/quantumsecrets.php</a>.)</i><br /></div>
<br /> Obviating the effect of physical distance automatically rewrites the rules about the way we use all types of resources to work, play, learn, and form communities. Ultramobility is a cultural and environmental game changer for this reason, and Intel® Atom™ microarchitecture has done more to get us there than any other single influence.<br /><br /><br />
<h2 class="sectionHeading">About the Author</h2>
Nancy Nicolaisen is an author,  researcher and veteran software developer specializing in mobile and embedded  device technologies. Her feature articles, columns and analyses have been  internationally circulated in publications including <b>BYTE, PC Magazine,  Windows Sources, Computer Shopper, Dr. Dobbs Journal of Software Engineering,  Microsoft Systems Journal</b>; She is author of three books: Making Windows  Portable: Porting Win32 to Win CE (2002, <b>John Wiley &amp;  Sons</b>); The Practical Guide to Debugging 32 Bit Windows Applications  (1996, <b>McGraw Hill</b>); and The Visual Guide to Visual C++ (1994,  <b>Ventana Press</b>) available in five foreign language editions. In  2007 she served as technical advisor for the development of the Microsoft  Professional Education course titled "Designing, Building and Managing Wireless  Networks". Ms. Nicolaisen is currently active in exploring open source  technologies and trends for mobile, embedded and wireless devices.  <br /> <br /> ]]></description>
      <link>http://software.intel.com/en-us/articles/green-computing-with-intel-atom-processor-based-devices/</link>
      <pubDate>Mon, 02 Aug 2010 21:00:00 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/green-computing-with-intel-atom-processor-based-devices/#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/green-computing-with-intel-atom-processor-based-devices/</guid>
      <category>Intel® AppUp(SM) Developer Community</category>
    </item>
    <item>
      <title>Rapid Porting Tips (part 1): Five Tips for Getting Your Game Up and Running on Netbooks</title>
      <description><![CDATA[ <b>By Nancy Nicolaisen</b><br /><br />Netbooks are a great opportunity for game developers and consumers alike. Light, easily portable, inexpensive, and relatively powerful, these platforms offer attractive bonuses. Most particularly, in a time when each day brings more dour news about consumer economics, netbooks are a bright spot. Published statistics for 2009 have netbook shipments increasing at between 79% and 103%, depending on whose accounting methods you like best. In 2009, 80% of these devices were powered by the Intel® Atom™ processor. For game developers who have desktop content running on Intel®-based platforms, these statistics amount to some really good news: Deploy current desktop game offerings to the netbook with a few savvy tweaks, and capture the attention of a huge new audience with a low-cost, low-risk porting effort. <br /><br />A typical Intel Atom processor powered netbook offers users a reasonably large screen, a touchpad and a something better than an 87% sized keyboard. Most have two or more USB ports, but are optimized to access content by download rather than through the use of storage media. At the same time, they are light weight, inexpensive, and hold a charge for a significantly longer time than either a laptop or a phone when used unconnected. In short, netbooks are perfectly suited to personal entertainment applications. Think cloud content consumers, single player arcade or action games, and mobile networked multi person entertainment and games.<br /><br />
<p ><img src="http://software.intel.com/file/27169" /></p>
<div ><b>Figure 1:</b> <i>This Asus* Eee PC netbook has a 9" screen and an 'all day' battery life.</i><br /></div>
<br />This is a rapidly evolving market space that offers game developers unique new opportunities: Imagine the play experiences you can design by leveraging mobility; dynamically constructed teams; and location aware, ongoing game play over long duration. These little devices also create and refresh the market for older arcade style games, because these tend to be easily interruptible and rely on simple graphics-- both characteristics that fit well with the properties of netbook hardware and usage patterns. In many cases, developers will be able to get their games and content into this space fairly rapidly.<br /><br />Here are five tips for making the hop to a vibrant, growing entertainment marketplace:<br /><br />
<h1 class="sectionHeading">Tip 1: Don't Overlook an Opportunity to Reintroduce Legacy Inventory</h1>
Bringing your game to market as early as possible is key in this niche market, and this article focuses on tips to help get your current titles up and running on netbooks as rapidly as possible. However, that's not the only opportunity netbooks offer game and entertainment content developers. These highly mobile little devices are very nearly as powerful today as state-of-the-art desktop computers were a relatively short time ago. This means that with very little updating, earlier game versions may enjoy a profitable second life on netbook class devices. <i>Simple, older, arcade-style games port beautifully to netbooks</i>. Here's why:<br /><br /> 
<ul>
<li>They require little modification in terms of graphics.</li>
<li>Netbook users tend toward intermittent usage patterns, so short-duration, arcade-style play nicely fits the needs, preferences, and usage patterns of the audience.</li>
<li>Netbook versions of earlier games have an extremely low barrier to entry and low cost of sales because expenditures associated with development, documentation, and marketing have already been retired. Most of each revenue dollar is profit, making it easy to compete on price in this space.</li>
<li>Perhaps best of all, arcade-type games are easy to internationalize, which dramatically broadens the potential audience. European and Asian consumers have enthusiastically embraced netbooks.</li>
</ul>
<br />
<h1 class="sectionHeading">Tip 2: Join the Intel® Atom™ Developer Program</h1>
Intel is providing game developers with a wealth of knowledge, development tools, and content-promotion opportunities. Taking advantage of these resources will help you get your game onto the platform and into the market more quickly. By joining the Intel® Atom™ Developer Program, you get access to a turnkey marketing channel: the Intel AppUp<sup>SM</sup> center. The Intel AppUp<sup>SM</sup> center provides these tools and supports:<br /><br /> 
<ul>
<li>A digital distribution center for applications that target netbooks</li>
<li>A validation process to ensure that applications play well on netbooks</li>
<li>A software development kit (SDK) to connect your game with the Intel AppUp<sup>SM</sup> center</li>
<li>The opportunity to sell games or game components on the Intel AppUp<sup>SM</sup> center, where developers receive up to 70% of the revenue</li>
</ul>
And here's a really good thing: Membership in the Intel® Atom™ Developer Program is available at no cost for the first year.<br /><br /><br />
<h1 class="sectionHeading">Tip 3: For Newer Generations of Games, Start by Evaluating Visuals</h1>
Successfully moving from a big screen to a small one requires that you address three issues.<br /><br /><b>Think in Terms of Visual Impacts Related to Screen Size and Device Mobility.</b> To deliver a satisfying play experience, users have to be able to see the entire field of play on the screen without scrolling. For most games, this means that you'll have some work to do on the visuals. It's probably safest and most conservative to assume that you'll be targeting a 10-inch screen. Remember that it may be necessary to reserve some of this screen real estate for controls and user interaction features.<br /><br />Smaller screen sizes mean that you have to streamline your storytelling and that you'll want to reduce the complexity, size, and subtlety of graphics. Not only do you have to get the action in a smaller physical space, but you'll be working within a couple of other important visual constraints. Netbooks are designed for casual use--on the go and unconnected. In practice, this means outdoors, in waiting areas, in parked cars, and so forth. What all of these locations have in common is the probability that users will be in less-than-optimum ambient lighting conditions. When reworking visuals for a netbook port, these things will make for a better user experience in conditions of glare and poor lighting.<br /><br /><b>Crop Big-screen Images Mercilessly</b>. If a visual element doesn't advance the story line of the game or cue users that they should respond in a particular way, give it the old heave-ho. Backgrounds that are meant to establish mood or provide aesthetic appeal won't work well in a netbook game for a variety of reasons, so reduce or eliminate layers that have no interactive or storytelling function. When positioning controls or game elements, don't hard-code their screen coordinates; instead, position them relative to the center or edges of the visible playing field, as shown in Figure 2.<br /><br />
<p ><img src="http://software.intel.com/file/27170" /></p>
<b>Figure 2.</b> <i>Use relative positioning for controls and play elements to ensure that they will be visible and accessible regardless of the actual screen dimensions.</i><br /><br />Scaling down image sizes is relatively easy to do and yields benefits other than just making the game more enjoyable in poor lighting conditions. Doing so can also help achieve better power performance by reducing the game's overall footprint. One technique that you can invariably eliminate for small screen compositions is the use of wide-angle shots. The overall size and resolution of most netbook screens doesn't support these images well enough to make them an advantage to the play experience. There is a point beyond which the content would suffer, so if you dynamically scale graphics, set a minimum screen size (see Figure 2).<br /><br /><br />
<p ><img src="http://software.intel.com/file/27171" /></p>
<b>Figure 3.</b> <i>Scale graphics, but enforce a minimum screen size to preserve the quality of the play experience.<br /></i><br /><br /><b>Focus Tightly on the Action or Interaction.</b> Keep the essence of the play experience in the center of the screen, limit visual composition to a small number of objects, and keep depictions of characters as simple as possible. If images are cropped very closely to frame the subject, you'll fill the frame and make animation and action lively, even in very small formats. Keeping all of the play action centered as much as possible reduces the player's tendency to compare the netbook gaming experience unfavorably with the desktop version.<br /><br />Avoid techniques and visual cues that will remind users that they're playing the game in an abbreviated space. For example, to move the story along or bring in different characters, cut between shots instead of panning. Steer clear of suggesting to users that they are "missing out" on something that is happening outside their visible field of play. Keep play action away from the sides of the display as much as possible, and cut away from a scene or character rather than having things disappear off screen margins. Display only the control elements that users need to play the game; use hover controls or floating pop-ups for support or informational content, as shown in Figure 3.<br /><br />
<p ><img src="http://software.intel.com/file/27172" /></p>
<b>Figure 4.</b> <i>Limit the display of controls and game elements to the minimum set a player actually needs.</i><br /><br /><br />
<h1 class="sectionHeading">Tip 4: Netbook Users Rely on the Keyboard and Touch Pad to Interact</h1>
Even though most netbooks have one or more USB ports, dedicated game controller devices are unlikely to be the rule for the netbook gaming audience. Remember, a large share of your potential audience will be people who play opportunistically: people in airports and coffee shops, soccer moms waiting for practice to end, kids in the back seat on a family road trip. Assume that most netbook gamers will use either the keyboard or the touch pad to control play.<br /><br />Many touch pads will react like the Apple* iPhone*, iPad*, or iPod Touch* in that they are double-tap or two finger friendly. Players with an Apple* iPhone*, iPad*, or iPod Touch* background will be comfortable with scaling and moving items and photos by spreading or pinching their fingers.<br /><br />Not every netbook has a great touch pad, though, and a lot of people will find using the keyboard for complicated actions a little too retro, so consider the use of screen-based icons and hover controls. Easily learned, self-documenting visual controls are probably the best approach both for the user experience and to make the game play well across a variety of vendor devices (see Figure 5).<br /><br />
<p ><img src="http://software.intel.com/file/27173" /></p>
<b>Figure 5.</b> <i>Icons can replace a lot of textual cues and make play intuitive on a small screen.</i><br /><br /><br />
<h1 class="sectionHeading">Tip 5: Make "Gaming on the Go" a Strength and a Selling Point</h1>
Most netbook gamers play on the run in locations where they can't control ambient lighting or sound levels and have limited time, intermittent connectivity, and little access to wall power. These can sound like limitations, but what if they are simply the rules of a new style of play? This isn't just looking of the bright side. In two years, it's entirely likely that fewer people will want to play games where they are stuck indoors in one spot, tethered to the wall socket and home wireless network. Make mobility and flexibility advantages of the game experience, and at the same time you'll make your game leaner, faster, and more fun.<br /><br />For example, use social media sites to keep scores and rankings, reducing the need for gamers to be connected full time but also building your game's community and fan base. Structure games to be played, paused, and resumed with no loss of standing or points. Set up scoring regimes where players can accumulate points over a specified time period. Make multi-player connected games tolerant of loss of connection and interrupted play.<br /><br /><br />
<h1 class="sectionHeading">Summary</h1>
With a relatively uncomplicated porting effort, a lot of desktop games and entertainment content can be smoothly and rapidly ported to Intel® Atom™ processor-powered netbooks-particularly legacy and arcade-style games. Intel has some great tools to help you get games up and running rapidly and, better still, offers a ready marketing channel: the Intel AppUp<sup>SM</sup> Center. The Intel AppUp<sup>SM</sup> Center provides a seamless marketing, download, and payment facility so that developers don't have to do the hard work of maintaining their own sales presence and payment-collection infrastructure. Developers can reap up to 70% of the revenue.<br /><br /><br />
<h1 class="sectionHeading">About the Author</h1>
Nancy Nicolaisen is the author of numerous books on software engineering techniques. She specializes in the design and development of solutions for small mobile and embedded systems. Her involvement with the game industry dates back to 1981, when she worked at gaming pioneer Imagic, developer of <b>Demon Attack</b> and other classics.
<div  id="vc-meta">
<div id="vc-meta-author">
<div>Nancy Nicolaisen</div>
</div>
<div id="vc-meta-pubdate">05-17-2010</div>
<div id="vc-meta-modificationdate">05-17-2010</div>
<div id="vc-meta-taxonomy">Tech Articles</div>
<div id="vc-meta-category-product"></div>
<div id="vc-meta-category"></div>
<div id="vc-meta-thumb"></div>
<div id="vc-meta-thumb-tout"></div>
<div id="vc-meta-thumb-hero"></div>
<div id="vc-meta-tocenable">no</div>
<div id="vc-meta-abstract">Outlines five tips for developers porting over to the netbook platform.  By reviewing legacy software, joining the Atom Developer Program, evaluating visuals, understanding input hardware,  and capitalizing on netbook portability, developers can easily port software to Intel Atom powered netbooks.</div>
</div> ]]></description>
      <link>http://software.intel.com/en-us/articles/rapid-porting-tips-part-1-five-tips-for-getting-your-game-up-and-running-on-netbooks/</link>
      <pubDate>Mon, 17 May 2010 00:00:00 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/rapid-porting-tips-part-1-five-tips-for-getting-your-game-up-and-running-on-netbooks/#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/rapid-porting-tips-part-1-five-tips-for-getting-your-game-up-and-running-on-netbooks/</guid>
      <category>Intel® AppUp(SM) Developer Community</category>
      <category>Visual Computing</category>
      <category>Game Development</category>
    </item>
    <item>
      <title>How to build ffmpeg to run under Moblin 2</title>
      <description><![CDATA[ <div class="Section1">
<p class="MsoNormal"><span class="sectionBodyText"><br />The application ‘ffmpeg’ consist of three executables and 5 libraries. All the sources can be downloaded using the following svn command:</span></p>
<p class="MsoNormal"><span class="sectionBodyText"></span></p>
<p class="MsoNormal"><span class="sectionBodyText"></span></p>
<p class="MsoNormal" ><span >Ø<span >      </span></span><span class="sectionBodyText">svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg </span></p>
<p class="MsoNormal"><span > </span><strong class="sectionHeading">Required patch</strong></p>
<p class="MsoNormal"><span class="sectionBodyText">One version which I tried ( download: svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg –r 17944)</span></p>
<p class="sectionBodyText">has a known problem with the sources. If you try to build the code, then you will get a compile time error:</p>
<p class="MsoNormal"><span class="sectionBodyText"> </span><span class="sectionBodyText">libswscale/swscale.c:488: error: ‘PIX_FMT_YUV420PLE’ undeclared</span></p>
<p class="MsoNormal"><span class="sectionBodyText"></span></p>
<p class="MsoNormal"><span class="sectionBodyText">The solution is solved by copying the contents of the libswscale directory from .</span><span ><span class="sectionBodyText">  </span> <a href="http://www.ffmpeg.org/releases/ffmpeg-0.5.tar.bz2" title="http://www.ffmpeg.org/releases/ffmpeg-0.5.tar.bz2" >http://www.ffmpeg.org/releases/ffmpeg-0.5.tar.bz2</a>    (see </span><span lang="EN" ><a href="http://www.ffmpeg.org/download.html" >http://www.ffmpeg.org/download.html</a>)</span></p>
<p class="MsoNormal"><span class="sectionBodyText"></span></p>
<p class="MsoNormal"><span class="sectionBodyText">Please Note, <b><i>only</i></b> the libswscale directory should be copied <b><i>over the top</i></b> of the existing files.</span></p>
<h3> </h3>
<h3><span class="sectionHeading" lang="FR">Build Instructions</span></h3>
<p class="MsoNormal"><span class="sectionBodyText"></span></p>
<p class="MsoNormal"><span class="sectionBodyText">Following instructions will help you build ffmpeg under a Linux system assuming that the tar ball from the download is copied to &lt;install_directory&gt;:<br /></span><br /> Ø      cd  &lt;install_directory&gt;<br /><br /> Ø      cd tar xvfz  ffmpeg.tar.gz   #Extract the tar ball to your local directory. You will find a directory tree under the name ffmpeg installed. All the required sources are installed within this tree provided that you are not enabling any additional third party libraries.<br /><br /> Ø      cd ffmpeg</p>
<p class="sectionBodyText"> Ø      ./configure –help &lt;cr&gt; # to show all the options available to rebuild ffmpeg. For a reference build with <b>gcc</b> there is no need to provide any parameters to configure. However if you would like to enable any third party libraries like ‘libfaad’, ‘libx264’ etc. then you need to add --enable-libfaad --enable-libx264 etc. as parameters to configure. If this is required make sure that you have these sources available on your development environment and that the third party libraries are rebuilt with the selected compiler / compiler options.</p>
<p class="sectionBodyText"> Ø      ./configure &lt;parameters as below&gt;</p>
<p class="MsoNormal"><span class="sectionBodyText"> </span>Ø      make &lt;cr&gt; #recommended sequence is ‘make clean’ followed by ‘make’. The rebuild will take several minutes (depending on your development environment). Two versions of each executable are produced: ex. ‘ffmpeg’ and ‘ffmpeg_g’. The ‘*_g’ contains the executable with debug information while the ‘*’ is the stripped version. In addition ‘ffplay, ffplay_g, ffserver and ffserver_g’ are produced as executables and libavutil, libavcodec, libavformat, libavdevice and libswscale are rebuilt.</p>
<p class="sectionHeadingText"> <b><span >Icc build</span></b>:</p>
<p class="MsoNormal"><span class="sectionBodyText">Depending on what version of icc you are using different configure parameters may be necessary.</span></p>
<p class="MsoNormal"><span class="sectionBodyText"> </span><span class="sectionBodyText">Using icc v10.1.xxx:</span></p>
<p class="MsoNormal"><span class="sectionBodyText"> </span>Ø      ./configure cc=icc --extra-cflags=”-xL –O3” --extra-libs=-lsvml &lt;cr&gt; # Without linking in the extra library (libsvml.so) you get several references unresolved.</p>
<p class="MsoNormal"><span class="sectionBodyText"> </span><span class="sectionBodyText">Using icc v11.0.xxx:</span></p>
<p class="MsoNormal"><span class="sectionBodyText"> </span>Ø      ./configure cc=icc –extra-cflags=”-xSSE3_ATOM –O3” –extra-libs=-lsvml &lt;cr&gt; #  The option –xSSE3_ATOM do require that you run the code on a processor which does support the ‘movbe’ instruction. If you would like to test the code on a processor not supporting the ‘movbe’ instruction you can add the option ‘-minstruction=nomovbe’ in the extra-cflag part of the command line above.<br />Ø      Make sure that the LD (linker) options do not contain ‘–march=generic’ in the config.mak file. This option causes an error from the compiler.<br /><span class="sectionBodyText"><br />Using icc v11.1.xxx:<br /></span><br />Ø      To avoid a run time erratum following source change is needed:   Open file ./libavcodec/x86/dsputil_mmx.c and on line #2944 insert // before || __ICC &gt; 1100. The line is highlighted below.</p>
<p class="MsoNormal" ><span ><v:shapetype coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f" id="_x0000_t75"><v:stroke join></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype><v:shape type="#_x0000_t75" id="_x0000_s1025" ><v:imagedata src="new_page_21_files/image001.png"><img height="151" width="576" src="http://software.intel.com/file/22666" /></v:imagedata></v:shape></span><br /><br />Ø      After the change it will look like: #if ARCH_X86_64 || ! ( __ICC) // || __ICC &gt; 1100</p>
<p class="MsoNormal" ><span class="sectionBodyText"></span></p>
<p class="sectionBodyText" >Ø      ./configure cc=icc –extra-cflags=”-xSSE3_ATOM –O3” &lt;cr&gt; # This simple configure does work but you get better performance if you also add the ‘--extra-lib=-lsvml’. Additional compiler switches can be used to improve the performance – for example ‘-no-prec-div’, ‘-vec-‘. As the no-prec-div has an effect on the fp calculations please refer to the compiler documentation before it is used. In addition the ‘-xSSE3_ATOM’ switch are no longer requiring a processor with ‘movbe’ support.</p>
<p class="sectionHeadingText"> Cross compilation.</p>
<p class="MsoNormal"><span class="sectionBodyText">It is standard practice to build the library and executables on a development machine and then copy the resultant files to the MOBLIN target.  You can use the option --enable–cross-compile in this case.</span></p>
<p class="MsoNormal"><span class="sectionBodyText"></span></p>
<p class="MsoNormal" ><span class="sectionBodyText"></span></p>
<p class="MsoNormal"><span class="sectionBodyText">Once you have completed the configure stage you can just run the ‘make clean’ followed by ‘make’. You could expect additional warnings produced.</span></p>
<p class="MsoNormal"><span class="sectionHeading"></span></p>
<p class="MsoNormal"><b><span ><span class="sectionHeading">Building ffmpeg with third party libraries:</span></span></b></p>
<p class="MsoNormal"><b><span ><span class="sectionHeading"></span></span></b></p>
<p class="MsoNormal"><span class="sectionBodyText">The application can support 21 different external 3<sup>rd</sup> party libraries. Each of those are selected in the configure process by adding the option ‘--enable-&lt;library-name&gt;’. </span></p>
<p class="MsoNormal"><span class="sectionBodyText">Below is an example of using some of the different external libraries available:</span></p>
<p class="MsoNormal"><span class="sectionBodyText"> </span>Ø      ./configure &lt;other options as above&gt; --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid<span class="sectionBodyText"> </span></p>
<p class="MsoNormal"><span class="sectionBodyText">The invocation above assumes that you will be using 6 external 3<sup>rd</sup> party libraries:</span></p>
<p class="MsoNormal"><span class="sectionBodyText"> </span><span class="sectionBodyText">- libfaac       # for example you can download ‘faac-1.28.tar.gz’ or later version from the web.</span></p>
<p class="MsoNormal"><span class="sectionBodyText"> </span><span class="sectionBodyText">- libfaad       # for example you can download ‘faad2-2.7.tar.gz’ or later version from the web.</span></p>
<p class="MsoNormal"><span class="sectionBodyText"> </span><span class="sectionBodyText">- libmp3lame # for example you can download ‘lame-398-2.tar.gz’ or later version from the web.</span></p>
<p class="MsoNormal"><span class="sectionBodyText"> </span><span class="sectionBodyText">- libtheora    # for example you can download ‘libtheora-1.0.tar.tar’ or later version from the web. Please note that you can not use ICC v 10.1 to rebuild this library due to a compiler issue. This has been fixed with 11.1 version of the compiler.</span></p>
<p class="MsoNormal"><span class="sectionBodyText"> </span><span class="sectionBodyText">- libx264      # for example you can download ‘x264-snapshot-20090117-2245.tar.bz2’ or later version from the web.</span></p>
<p class="MsoNormal"><span class="sectionBodyText"> </span><span class="sectionBodyText">- libxvid      # for example you can download ‘xvidcore-1.2.1.tar.gz’ or later version from the web.<br /></span><span class="sectionBodyText"><br /><strong>Performance Notes:</strong> <br /><br />Best option combination for ICC: “-xSSE3_ATOM –O3 –vec- -static –no-prec-div –ansi_alias”. Also make sure you add –extra-libs=-lsvml in your configure invocation.<br /><br />Two ways of improving the performance of ffmpeg:<br /><br />1) Use the external 3rd party libraries which are supported – 20+ are available. They are optimized for their specific field. You need to select the suitable library – download the code and build them using the ICC. <br /><br />2) Use PGO. Here it is important to produce a set of .dyn files for the most common conversion you will be using. The code size improves a bit and the performance also gets a boost provided that you use any of the conversions for which you generated a .dyn file. If you select a totally different conversion you actually could get a slower performance compared to both gcc and icc (general optimized version). For those who are not familiar with the PGO optimization this is a three step procedure:<br /><br />a. Add the option –prof-gen to the extra-cflags section for the configure generation. Build ffmpeg. <br /><br />b. Run the resulting binary on your target. Make sure you use representative input files and output formats. You may want to repeat this process several times. For each run you will have a .dyn file generated on the target. Copy these files over to your development system.<br /><br />c. Now use the options –prof-use and –prof-dir &lt;directory path where you have the .dyn files which you copied in step b&gt; [make sure to remove –prof-gen option]. Generate a new make file with configure and build your ffmpeg. You may see a number of warnings ‘missing .dpi information for &lt;file name.’ This is information only and can be ignored. The finally generated ffmpeg should be both smaller and faster. <br /><br /><br />
<table cellpadding="5" cellspacing="0" rules="none" border="1">
<tbody>
<tr>
<th align="left" valign="middle" >Optimization Notice</th>
</tr>
<tr bgcolor="#ccecff">
<td>
<p>Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.</p>
<p align="right">Notice revision #20110804</p>
</td>
</tr>
</tbody>
</table>
<br /><br /><br /><br /><br /></span></p>
</div> ]]></description>
      <link>http://software.intel.com/en-us/articles/how-to-build-ffmpeg-to-run-under-moblin-2/</link>
      <pubDate>Wed, 23 Sep 2009 00:00:00 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/how-to-build-ffmpeg-to-run-under-moblin-2/#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/how-to-build-ffmpeg-to-run-under-moblin-2/</guid>
      <category>Mobility</category>
      <category>Open Source</category>
      <category>Tools</category>
      <category>Intel® AppUp(SM) Developer Community</category>
      <category>MID</category>
      <category>Intel® Software Development Tool Suites for Intel® Atom™ Processor Knowledge Base</category>
    </item>
  </channel></rss>
