how to leap over the parallel chasm? -...

29
© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries. *Other names and brands may be claimed as the property of others. Software and Services Group HOW TO LEAP OVER THE PARALLEL CHASM? USING THE INTEL® PARALLEL STUDIO TO DEVELOP, TEST AND TUNE PARALLEL CODE Anton Pegushin Performance, Analysis and Threading Lab Software & Services Group Intel® Corporation

Upload: dangnga

Post on 25-Jul-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

HOW TO LEAP OVER THE

PARALLEL CHASM?

USING THE INTEL® PARALLEL STUDIO TO

DEVELOP, TEST AND TUNE PARALLEL CODE

Anton Pegushin

Performance, Analysis and Threading Lab

Software & Services Group

Intel® Corporation

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

• Introduction to Intel® Parallel Studio

• Intel® Parallel Composer• Intel C++ Compiler, IPP, Threading Building Blocks

• Intel® Parallel Inspector• Memory and Threading analysis methods

• Intel® Parallel Amplifier• Hotspot, Concurrency and Locks&Wait analysis

• Intel® Parallel Studio Demo

Agenda

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Two Product Lines

Available Now

Available Now

Maximize parallel productivityIntel Parallel Studio with Visual Studio on

Windows

Maximize parallel performance Windows*, Linux* and Mac OS* X

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Intel® Parallel Studio includes all three:

• Intel® Parallel Composer

• Intel® Parallel Inspector

• Intel® Parallel Amplifier

Microsoft Visual Studio* plug-in

End-to-end product suite for parallelism

Forward scaling to manycore

Intel® Parallel StudioIntuitive development tools for multicore parallelism

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Intel® Parallel Studio

DESIGN

Gain insight on where parallelism will

most benefit existing source code

CODE & DEBUG

Develop effective applications with a

C/C++ compiler and comprehensive

threaded libraries

VERIFY

Ensure application reliability with

proactive parallel memory and threading

error checking

TUNE

Enhance applications with easy-to-use

performance analyzer and tuner

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

• Brief Introduction and motivation behind Intel® Parallel Studio

• Introduction to Intel® Parallel Studio

• Intel® Parallel Composer• Intel C++ Compiler

• Intel Threading Building Blocks

• Intel® Parallel Inspector• Memory and Threading analysis methods

• Command Line Interface

• Intel® Parallel Amplifier• Hotspot, Concurrency and Locks&Wait analysis

• Command Line Interface

• Demo

• Summary

Agenda

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Intel® Parallel Composer components

Intel® Parallel Composer include:

–Intel C++ Compiler

–Intel Integrated Performance Primitives 6.1

–Intel Threading Building Blocks 2.2

Most comprehensive multicore and standards support

OpenMP* 3.0, auto-vectorization, auto-parallelization,

parallel valarray, “parallel lint”

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Intel® Parallel Composer Main Features

• OpenMP 3.0 standard support

• High-level optimizations• Loop unrolling, reversing, permutation

• Data prefetching

• Malloc and memset combining

• Auto parallelization

• Auto vectorization• Support for newest SSE instructions

• Reporting dependencies preventing vectorization

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Highlights• A C++ runtime library that does thread management, letting

developers focus on proven parallel patterns

• Appropriately scales to the number of HW threads available

• Supports nested parallelism

• The thread library API is portable across Linux, Windows, and Mac OS* platforms. Open Source community extended support to FreeBSD*, IA Solaris* and XBox* 360

• Run-time library provides optimal size thread pool, task granularity and performance oriented scheduling

• Automatic load balancing through task stealing

• Cache efficiency and memory reuse

• Committed to:

• compiler independence

• processor independence

• OS independence

Both GPL and commercial licenses are available.

http://threadingbuildingblocks.org

Intel® Threading Building BlocksExtend C++ for parallelism

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Concurrent Containers

concurrent_hash_map

concurrent_queue

concurrent_bounded_queue

concurrent_vector

Miscellaneoustick_count

Generic Parallel Algorithms

parallel_for(range)

parallel_reduce

parallel_for_each(begin, end)

parallel_do

parallel_invoke

pipeline

parallel_sort

parallel_scan

Task scheduler

task_group

task_structured_group

task_scheduler_init

task_scheduler_observer

Synchronization Primitives

atomic;

mutex; recursive_mutex;

spin_mutex; spin_rw_mutex;

queuing_mutex; queuing_rw_mutex;

null_mutex; null_rw_mutex

Memory Allocation

tbb_allocator; cache_aligned_allocator; scalable_allocator; zero_allocator

Intel® Threading Building Blocks

Threads

tbb_thread

Thread Local Storage

enumerable_thread_specific

combinable

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

• Brief Introduction and motivation behind Intel® Parallel Studio

• Introduction to Intel® Parallel Studio

• Intel® Parallel Composer

• Intel® Parallel Inspector• Memory and Threading analysis methods

• Demos

• Intel® Parallel Amplifier• Hotspot, Concurrency and Locks&Wait analysis

• Demos

• Summary

Agenda

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Addressing the development lifecycle to

harness parallelism

DESIGN

Gain insight on where parallelism will

most benefit existing source code

CODE & DEBUG

Develop effective applications with a

C/C++ compiler and comprehensive

threaded libraries

VERIFY

Ensure application reliability

with proactive parallel memory

and threading error checking

TUNE

Enhance applications with easy-to-use

performance analyzer and tuner

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Intel® Parallel Inspector Basic Workflow, Problem types…

More detailed workflow can be found in

Parallel Inspector help content

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Intel® Parallel InspectorMicrosoft* Visual Studio Integration

Intel® Parallel Studio

Tools

Intel® Parallel

Inspector

Intel® Parallel Inspector

Toolbar

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Intel® Parallel Inspector Configuring Analysis is Easy

Control the depth of analysis vs. collection time.

Hints how to get best results

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Powerful Error Checking Analysis TypesMemory and Threading Errors

Locate large variety of memory and

resource problems including memory leaks, buffer overrun errors and pointer problems

Detect and predict thread-related deadlocks, data races and other synchronization problems

Control the depth of

analysis vs. collection

time

Reduce information by suppressing irrelevant results

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Intel® Parallel Inspector tracks all memory allocations and threading APIs

using a binary instrumentation tool called Pin

• Pin is a dynamic instrumentation system provided by Intel (http://www.pintool.org),

which allows C/C++ code to be injected into the areas of interest in a running

executable

• The injected code is then used to observe the behaviour of the program

• Intel® Parallel Inspector injects appropriate code into the application to check

memory and threading errors

Intel® Parallel Inspector

Operating System

Application

Thread Checker + Memory Checking

Pin

Intel® Parallel Inspector

Results

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Memory problems identified with location and status

Quick reference to the

source lines

Summary and Subsets

Easily focus on the problem/module

of interest

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Summary and SubsetsEasily focus on the

problem/module of interest

Quickly identifies source of data race

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

• Generally you know more about your multithreaded application than the

Intel(R) Parallel Inspector can ever know.

• For example:• Your team lead may know of error-prone third-party code.

• Your team data architect may know specific code passages are correct as coded.

• You may know you're currently fixing a specific bug.

• Suppressing such known issues can dramatically improve your

productivity.

• Inspector offers two levels of suppression to help you focus on only

those bugs that currently require your attention:• Private suppression rules

• Public suppression rules

Intel® Parallel InspectorSuppressions

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Use Cases

1. Test code changes for Memory and Threading

Regressions: Did the latest source code change introduce new memory

errors or threading errors?

2. Automate execution of Memory and Threading Checking:Run analysis during off-hours for later viewing of results, since execution

time for an application under analysis can increase 2x to 160x

Command Line Interface (CLI)

for Parallel Inspector

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

• Brief Introduction and motivation behind Intel® Parallel Studio

• Introduction to Intel® Parallel Studio

• Intel® Parallel Composer

• Intel® Parallel Inspector• Memory and Threading analysis methods

• Command Line Interface (CLI)

• Intel® Parallel Amplifier

• Hotspot, Concurrency and Locks&Wait analysis

• Demo

Agenda

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

DESIGN

Gain insight on where parallelism will

most benefit existing source code

CODE & DEBUG

Develop effective applications with a

C/C++ compiler and comprehensive

threaded libraries

VERIFY

Ensure application reliability with

proactive parallel memory and

threading error checking

TUNE

Enhance applications with easy-to-

use performance analyzer and tuner.

Quickly find bottlenecks, Tune

Windows* apps faster

Intel® Parallel AmplifierEnhance applications with easy-to-use performance analyzer and tuner

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Intel® Parallel AmplifierMicrosoft* Visual Studio Integration

Intel® Parallel Studio Tools

Intel Parallel Amplifier

Intel® Parallel

AmplifierToolbar

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Powerful Performance Analysis TypesHotspot, Concurrency, Locks&Wait

Hotspot AnalysisHelps the developer understand the application

flow and identify the sections of code that took

a long time to execute

Concurrency AnalysisMeasures how an application utilizes available processors. The concurrency analysis helps developers identify hotspot functions where processor utilization is poor

Locks&Wait AnalysisHelps developers identify the cause of the ineffective processor utilization. The most common problem for poor utilization is caused by threads waiting too long

on synchronization objects

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Intel® Parallel AmplifierIntuitive Parallel Performance Analysis

Hot Spot Analysis Where is my app spending time?

Concurrency Analysis Where and When are cores idle?

Locks & Waits Analysis Where are the bad waits?

Source View See the results on your source.

Compare Results Quickly see what changed.

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

Intel® Parallel AmplifierComparing Results

• Ability to compare results is crucial when

analyzing performance issues.

• Amplifier provides very easy-to-use comparison

functionality

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

The intention of this CLI is for the user to focus on performance regression testing by comparing several results with one command

The user can also output the data and performs the regression test manually

Intel® Parallel AmplifierCommand Line Interface (CLI)

© 2009, Intel Corporation. All rights reserved. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Software and Services Group

We are committed to providing the software community with tools to

• ease the transition to parallelism

• preserve their investment it has in software development

• take advantage of the rapidly growing installed base of multicore systems

Intel Parallel Studio is designed to help developers to leap over the

parallel chasm

Summary

Visit us at: http://www.intel.com/go/parallel

Intel Software Network: http://software.intel.com/en-us/