Tutorial: Find Where to Add Parallelism with Intel® Advisor

Tutorial: Find Where to Add Parallelism with Intel® Advisor

Tutorial: Find Where to Add Parallelism with Intel® Advisor Intel® Advisor 2013 for Linux* OS Fortran Sample Application Code Document number: 327861-004US World Wide Web: http://developer.intel.com Legal Information Tutorial: Find Where to Add Parallelism with Intel® Advisor Contents Legal Information................................................................................ 3 Overview.............................................................................................. 4 Chapter 1: Navigation Quick Start Chapter 2: Profile and Add Annotations Intel® Advisor GUI: Build Application and Create New Project...........................9 Discover Parallel Opportunities...................................................................12 Choose and Mark the Best Parallel Opportunities.......................................... 16 Chapter 3: Predict Parallel Behavior Intel® Advisor GUI: Build Application and Open the Project............................ 21 Check Performance Implications................................................................ 25 Examine Potential Correctness Problems..................................................... 28 Decide on the Proposed Tasks................................................................... 32 Chapter 4: Fix Sharing Problems and Add Parallelism Intel® Advisor GUI: Build the Application and Open the Project....................... 35 Fix Sharing Problems ...............................................................................36 Check Program Correctness.......................................................................40 Add Parallelism........................................................................................41 Next Steps for the Parallel Program............................................................ 43 Chapter 5: Tutorial Summary Chapter 6: Key Terms 2 Legal Information INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. A "Mission Critical Application" is any application in which failure of the Intel Product could result, directly or indirectly, in personal injury or death. SHOULD YOU PURCHASE OR USE INTEL'S PRODUCTS FOR ANY SUCH MISSION CRITICAL APPLICATION, YOU SHALL INDEMNIFY AND HOLD INTEL AND ITS SUBSIDIARIES, SUBCONTRACTORS AND AFFILIATES, AND THE DIRECTORS, OFFICERS, AND EMPLOYEES OF EACH, HARMLESS AGAINST ALL CLAIMS COSTS, DAMAGES, AND EXPENSES AND REASONABLE ATTORNEYS' FEES ARISING OUT OF, DIRECTLY OR INDIRECTLY, ANY CLAIM OF PRODUCT LIABILITY, PERSONAL INJURY, OR DEATH ARISING IN ANY WAY OUT OF SUCH MISSION CRITICAL APPLICATION, WHETHER OR NOT INTEL OR ITS SUBCONTRACTOR WAS NEGLIGENT IN THE DESIGN, MANUFACTURE, OR WARNING OF THE INTEL PRODUCT OR ANY OF ITS PARTS. Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined". Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The information here is subject to change without notice. Do not finalize a design with this information. The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request. Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order. Copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-4725, or go to: http:// www.intel.com/design/literature.htm BlueMoon, BunnyPeople, Celeron, Celeron Inside, Centrino, Centrino Inside, Cilk, Core Inside, E-GOLD, Flexpipe, i960, Intel, the Intel logo, Intel AppUp, Intel Atom, Intel Atom Inside, Intel CoFluent, Intel Core, Intel Inside, Intel Insider, the Intel Inside logo, Intel NetBurst, Intel NetMerge, Intel NetStructure, Intel SingleDriver, Intel SpeedStep, Intel Sponsors of Tomorrow., the Intel Sponsors of Tomorrow. logo, Intel StrataFlash, Intel vPro, Intel Xeon Phi, Intel XScale, InTru, the InTru logo, the InTru Inside logo, InTru soundmark, Itanium, Itanium Inside, MCS, MMX, Pentium, Pentium Inside, Puma, skoool, the skoool logo, SMARTi, Sound Mark, Stay With It, The Creators Project, The Journey Inside, Thunderbolt, Ultrabook, vPro Inside, VTune, Xeon, Xeon Inside, X-GOLD, XMM, X-PMU and XPOSYS are trademarks of Intel Corporation in the U.S. and/or other countries. *Other names and brands may be claimed as the property of others. Microsoft, Windows, and the Windows logo are trademarks, or registered trademarks of Microsoft Corporation in the United States and/or other countries. Copyright (C) 2009-2013, Intel Corporation. All rights reserved 3 Tutorial: Find Where to Add Parallelism with Intel® Advisor Overview Discover where to add parallelism by using Intel® Advisor 2013 and the nqueens Fortran sample application program. The major steps are to profile your application and add Intel Advisor annotations, predict your program's parallel behavior, and add parallel code to the selected parallel regions. About This This tutorial demonstrates the first part of a workflow you can ultimately apply to your Tutorial own applications. You will: • Build a serial application to produce a target executable. This target will be analyzed by Intel Advisor tools. • Profile the application to locate possible places where you might add parallelism. • Edit application code to add annotations that mark possible parallel (multithreaded) code regions. • Measure the predicted parallel performance of the annotated target by using the Suitability tool analysis. • Detect predicted parallel sharing problems of the annotated target by using the Correctness tool analysis. • Examine the summary data from the Suitability and Correctness tools to help you decide whether to modify or accept the proposed parallel sites and tasks. • Fix the predicted data sharing problems detected by the Correctness tool. Run both tools again to check the impact of fixing sharing problems. • View parallel code from a selected high-level parallel framework. Estimated 25-30 minutes. Duration Learning After you complete this tutorial, you should be able to: Objectives • Understand the major steps in the Intel Advisor workflow. • Become familiar with the build requirements for the three Intel Advisor tools. • Know how to run the Survey tool to profile your application and view its report to identify the time-consuming loops and functions. • Select a possible parallel code region (site) and its tasks. Insert Intel Advisor annotations to mark these possible parallel code regions. • Run the Suitability tool to measure your annotated program's predicted parallel performance for each parallel site and its task(s). • Run the Correctness tool to predict your annotated program's likely parallel data sharing problems, such as data races. • View the Summary window to examine your program's predicted parallel performance and data sharing problems. • Become familiar with the process of modifying your code to fix predicted sharing problems by adding synchronization. • Locate resources to help you replace Intel Advisor annotations with parallel framework code. More The concepts and procedures in this tutorial apply regardless of programming Resources language or parallel framework selected; however, a similar tutorial using a sample application in the C/C++ language is also installed and may be available at http:// software.intel.com/en-us/articles/intel-software-product-tutorials/. This site also offers tutorials for all the Intel® Parallel Studio XE products and a printable version (PDF) of tutorials. In addition, you can find more resources on the Intel® Developer Zone at http:// software.intel.com/en-us/articles/intel-parallel-studio-xe/. 4 Overview Next Step Profile and Add Annotations 5 1 Tutorial: Find Where to Add Parallelism with Intel® Advisor Navigation Quick Start 1 Intel Advisor provides tools that help you decide where to add parallelism to your application. Use Intel Advisor for applications: • Created with the C/C++ or Fortran programming languages. • Containing serial code that could possibly be replaced with parallel (multithreaded) code. Intel Advisor Access 1. Open a terminal session. 2. Use an ls command to locate the Intel Advisor installation directory. The default installation directory is /opt/intel/advisor_xe_2013/. 3. Type source /opt/intel/advisor_xe_2013/advixe-vars.sh to set up your bash shell environment (specify .../advixe-vars.csh if using a different shell). 4. Type advixe-gui to launch the Intel Advisor GUI. Intel Advisor GUI The menu, toolbar, Advisor XE Workflow, and Project Navigator offer different ways to perform many of the same functions. 6 Navigation Quick Start 1 After you open a project, its name appears in the title bar. Use the menus to create

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    46 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us