The Eclipse Parallel Tools Platformdownload.eclipse.org/tools/ptp/docs/ptp-tutorial-hpcsw08.pdf ·...
Transcript of The Eclipse Parallel Tools Platformdownload.eclipse.org/tools/ptp/docs/ptp-tutorial-hpcsw08.pdf ·...
1
The Eclipse Parallel Tools Platform and Scientific Application
Development
Beth Tibbitts, IBM [email protected]
Greg Watson, IBM [email protected]
"This material is based upon work supported by the Defense
Advanced Research Projects Agency (DARPA) under its
Agreement No. HR0011-07-9-0002“
HPCSW 4/03/08
Tutorial Outline
GregCVS, Makefiles, autoconf,Search, Refactoring, UPC,Remote debugging, MPICH2,IBM PE & LoadLeveler
5. Advanced Eclipse andPTP features
4:30 - 5:00
BethPerf. Tools? Website, mailinglists, more info, participation
6. Other, Summary,Wrapup
5:00 - 5:30
BethPTP project creation
New project wizards
PTP Runtime Perspective
2. Creating and RunningMPI Programs
2:30-3:00
GregDebug Perspective,breakpoints, variables,stepping, etc.
4. Parallel Debugger4:00 - 4:30
Break3:00 - 3:30
PresenterOutcomesModuleTime
MPI, OpenMP analysisfeatures
Introduction to PTP
Eclipse basics
Configuring ResourceManagers & setup
Beth3. Parallel LanguageDevelopment Tools (PLDT)
3:30 - 4:00
Greg1. Overview of Eclipseand PTP
1:30 - 2:30
ii
PTP Tutorial 1-0Module 1
Module 1: Overview of Eclipseand PTP
Objective
To introduce the Eclipse platform and PTP
To learn the basics of Eclipse
Contents
What is Eclipse? Who is using Eclipse?
What is PTP?
Eclipse basics
Configuring a Resource Manager
PTP Tutorial 1-1Module 1
History
Originally developed by Object TechnologyInternational (OTI) and purchased by IBM foruse by internal developers
Released to open-source community in 2001,managed by consortium
Eclipse Public License (EPL)
Based on IBM Common Public License (CPL)
Consortium reorganized into independent not-for-profit corporation, the Eclipse Foundation,in early 2004
Participants from over 100 companies
PTP Tutorial 1-2Module 1
Eclipse Foundation & Members
Board of Directors and full-time Eclipsemanagement organization
Councils guide the development done by EclipseOpen Source projects
180 members (March ‘08)21 strategic members
942 committers, representing 50+ organizations
PTP Tutorial 1-3Module 1
3
PTP Tutorial 1-4Module 1
Eclipse Member companies
PTP Tutorial 1-5Module 1
What is Eclipse?
A vendor-neutral open source developmentplatform
A universal platform for tool integration
Plug-in based framework to create, integrateand utilize software tools
PTP Tutorial 1-6Module 1
Eclipse Platform
Core frameworks and services with which allplug-in extensions are created
Represents the common facilities required bymost tool builders:
Workbench user interface
Project model for resource management
Portable user interface libraries (SWT and JFace)
Automatic resource delta management forincremental compilers and builders
Language-independent debug infrastructure
Distributed multi-user versioned resourcemanagement (CVS supported in base install)
Dynamic update/install service
PTP Tutorial 1-7Module 1
Plug-ins
Java Development Tools (JDT)
Plug-in Development Environment (PDE)
C/C++ Development Tools (CDT)
Parallel Tools Platform (PTP)
Fortran Development Tools (Photran)
Test and Performance Tools Platform (TPTP)
Business Intelligence and Reporting Tools (BIRT)
Web Tools Platform (WTP)
Data Tools Platform (DTP)
Device Software Development Platform (DSDP)
Many more…
PTP Tutorial 1-8Module 1
Parallel Tools Platform (PTP)
The Parallel Tools Platform aims to provide a highlyintegrated environment specifically designed for parallelapplication development
Features include:An integrated development environment (IDE) thatsupports a wide range of parallel architectures and runtimesystems
A scalable parallel debugger
Parallel programming tools(MPI/OpenMP)
Support for the integrationof parallel tools
An environment that simplifies theend-user interaction with parallel systems
http://www.eclipse.org/ptp
PTP Tutorial 1-9Module 1
PTPSoftware Prerequisites
Java (1.5 or later)
Cygwin or MinGW (for Windows)
make, gcc, and gdb (or other vendorcompilers)
OpenMPI or MPICH2 (only required for PTPRuntime)
Note:
Linux & Mac have full PTP support
Windows can be used for Eclipse, targeting aremote parallel machine
PTP Tutorial 1-10Module 1
Java Prerequisite
Eclipse requires Sun or IBM versions of Java
Only need Java runtime environment (JRE)
Java 1.5 is the same as JRE 5.0
The GNU Java Compiler (GCJ), which comes standardon Linux, will not work!
PTP Tutorial 1-11Module 1
Eclipse and PTP Installation
Eclipse is installed in two stepsFirst, the ‘base’ Eclipse is downloaded and installed
This provides a number of pre-configured ‘features’
Additional functionality is obtained by adding more‘features’
This can be done via an `update site’ thatautomatically downloads and installs the features
Features can also be downloaded and manuallyinstalled
PTP requires the following featuresC/C++ Development Tools (CDT)
Parallel Tools Platform (PTP)
PTP Tutorial 1-12Module 1
Eclipse Installation
Two alternatives for installation:The Eclipse Classic is the full software development kit(SDK), including Java and Plug-in development tools
The Eclipse IDE for C/C++ developers is the base Eclipseplatform plus the CDT (C/C++ Development tools).This is ideal for PTP use (included on the tutorial CD)
Eclipse is downloaded as a single zip or gzipped tar filefrom http://eclipse.org/downloads
You must have the correct file for your operating systemand windowing system
Unzipping or untarring this file creates a directorycontaining the main executable
PTP Tutorial 2-13Module 2
Platform Differences
Single button mouse (e.g. MacBook)Use Control-click for right mouse / context menu
Context-sensitive help key differencesWindows: use F1 key
Linux: use Shift-F1 keys
MacOS XFull keyboard, use Help key
MacBooks or aluminum keyboard, create a key bindingfor Dynamic Help to any key you want
Accessing preferencesWindows & Linux: Window Preferences…
MacOS X: Eclipse Preferences…
PTP Tutorial 1-14Module 1
Starting Eclipse
Linux
From a terminal window, enter
MacOS X
From finder, open the Applications eclipse folder
Double-click on the Eclipse application
Windows
Open the eclipse folder
Double-click on the eclipse executable
Accept default workspace when asked
Select workbench icon from welcome page
<eclipse_installation>/eclipse/eclipse &
PTP Tutorial 1-15Module 1
Specifying A Workspace
The prompt can beturned off
Eclipse prompts for a workspace location atstartup time
The workspace contains all user-defined data
Projects and resources such as folders and files
PTP Tutorial 1-16Module 1
Eclipse Welcome Page
Displayed when Eclipse is run for the first time
Select “Go to the workbench”
PTP Tutorial 1-17Module 1
Adding Features
New functionality is added to Eclipse using features
Features are obtained and installed from an update site(like a web site)
Features can also be installed manually by copying filesto the features and plugins directories in the maineclipse directory
PTP Tutorial 1-18Module 1
Installing Eclipse Featuresfrom an Update Site
Three types of update sites
Remote - download and install from remote server
Local - install from local directory
Archived - a local site packaged as a zip or jar file
Eclipse 3.3.2 comes preconfigured with a link to theEuropa Discovery Site
This is a remote site that contains a large number of officialfeatures
Europa projects are guaranteed to work with Eclipse 3.3.2
Many other sites offer Eclipse features
Use at own risk
PTP Tutorial 1-19Module 1
Installing from a Local Update Site
We have combined everything neededfor the tutorial onto a local update siteon the CDROM
From the Help menu, chooseSoftware Updates Find andInstall…
Select Search for new features toinstall
Click Next >
Click New Local Site…
Navigate to your CDROM, select theupdatesite folder and click Choose(OK on Linux or Windows)
Enter Tutorial for the Name (or use default: TutorialCD/updatesite)
Click OK
PTP Tutorial 1-20Module 1
Installing Tutorial Features
Make sure only Tutorialis selected, other optionsas defaults
Click Finish
From Search Results,select Tutorial (openthe twisty to see thecontents)
PTP Tutorial 1-21Module 1
Choose features
Choose PTP features toinstall
Easy way to choose:
Select all
Unselect anythingwith red “X”
This omits featuresfor which you lackthe pre-requisites
PTP Tutorial 1-22Module 1
Finishing Installation
Click Next >
Accept the license terms
Click Next >
Click Finish
For Feature Verification, clickInstall All
Restart the Eclipse Platform whenasked
PTP Tutorial 1-23Module 1
Restarting Eclipse
Yellow
indicates newfeatures justinstalled
Welcome pageinforms you ofnew featuresinstalled
Selectworkbench iconto go toworkbench
Go toworkbench
Go toworkbench
PTP Tutorial 1-24Module 1
(Installing the PTP Proxy)
Normally installed on a parallel machine
e.g. a cluster
Can install on a non-parallel system
Not available for Windows
Requires OpenMPI to be built and installed
This process depends on the type of machine
Beyond the scope of this tutorial
To install the proxy, do the following steps from a terminal
Change to your Eclipse installation directory
Change to plugins/org.eclipse.ptp.os.arch_2.0*, whereos is your operating system (macosx or linux), arch is yourarchitecture (ppc, x86, or x86_64)
Run the command: sh BUILD
* Directory may include a suffix of build date timestamp.
PTP Tutorial 2-25Module 2
Workbench
The Workbenchrepresents the desktopdevelopment environment
It contains a set of toolsfor resource management
It provides a commonway of navigatingthrough the resources
Multiple workbenches canbe opened at the sametime
PTP Tutorial 2-26Module 2
Workbench Components
A Workbench contains perspectives
A Perspective contains views and editors
views
editor
perspective
PTP Tutorial 2-27Module 2
Perspectives
Perspectives define the layout of views in theWorkbench
They are task oriented, i.e. they containspecific views for doing certain tasks:
There is a Resource Perspective for manipulatingresources
C/C++ Perspective for manipulating compiled code
Debug Perspective for debugging applications
You can easily switch between perspectives
PTP Tutorial 2-28Module 2
Switching Perspectives
You can switchPerspectives by:
Choosing theWindow OpenPerspective menuoption
Clicking on theOpen Perspectivebutton
Clicking on aperspective shortcutbutton
PTP Tutorial 2-29Module 2
Available Perspectives
By default, certainperspectives are availablein the Workbench
We’ll use:
C/C++
PTP Runtime
PTP Debug
WindowOpen Perspective
PTP Tutorial 2-30Module 2
Views
The workbench window isdivided up into Views
The main purpose of a view is:
To provide alternative ways of presenting information
For navigation
For editing and modifying information
Views can have their own menus and toolbars
Items available in menus and toolbars areavailable only in that view
Menu actions onlyapply to the view
Views can be resized
view
view view
PTP Tutorial 2-31Module 2
Stacked Views
Stacked views appear as tabs
Selecting a tab brings that view to theforeground
PTP Tutorial 2-32Module 2
Help
Access helpHelp Help Contents
Help Search
Help Dynamic Help
Help Contents providesdetailed help on differentEclipse features
Search allows you tosearch for help locally, orusing Google or the Eclipseweb site
Dynamic Help shows helprelated to the currentcontext (perspective, view,etc.)
PTP Tutorial 1-33Module 1
Open PTP Runtime Perspective
Window > Open Perspective > Other…
PTP Tutorial 1-34Module 1
Terminology
The PTP Runtime perspective is provided formonitoring and controlling applications
Some terminologyResource manager - Corresponds to an instance ofa resource management system (e.g. a jobscheduler). You can have multiple resource mangersconnected to different machines.
Queue - A queue of pending jobs
Job - A parallel application
Machine - A parallel computer system
Node - Some form of computational resource
Process - An execution unit (may be multiplethreads of execution)
PTP Tutorial 1-35Module 1
PTP Runtime Perspective
Resourcemanagers view
Machines view
Node detailsview
Jobs view
PTP Tutorial 1-36Module 1
Resource Managers
PTP uses the term resource manager to refer to any
subsystem that controls the resources required for
launching a parallel job.
Examples:
Job scheduler (e.g. LoadLeveler)
Open MPI Runtime Environment (ORTE)
Each resource manager controls one target system
Resource Managers can be local or remote
PTP Tutorial 1-37Module 1
Adding a Resource Manager
Right-click in ResourceManagers view and selectAdd Resource Manager
Choose the ORTEResource ManagerType
Select Next>
PTP Tutorial 1-38Module 1
Configure the Resource Manager
Can choose Remoteservice provider
Can choose Proxyserver location
For details on remoteresource managers, seeModule 5
PTP Tutorial 1-39Module 1
Starting the Resource Manager
Right click on newresource manager andselect Start resourcemanager
If everything is ok, youshould see the resourcemanager change to green
If something goes wrong,it will change to red
PTP Tutorial 2-40Module 2
System Monitoring
Machine status shown inMachines view
Node status also shownMachines view
Hover over node to seenode name
Double-click on node toshow attributes
PTP Tutorial 2-0Module 2
Module 2: Creating andRunning MPI Programs
Objective
Learn how to use Eclipse to develop parallel programs
Learn how to run and monitor a parallel program
Contents
Brief introduction to the C/C++ Development Tools
Create a simple application
Learn to launch a parallel job and view it via the PTPRuntime Perspective
PTP Tutorial 2-1Module 2
Switch to C/C++ Perspective
Only needed ifyou’re notalready in theperspective
PTP Tutorial 2-2Module 2
Project Explorer View
Represents user’s data
It is a set of user definedresources
Files
Folders
Projects
Collections of files andfolders
Plus meta-data
Resources are visible inthe Project Explorer View
PTP Tutorial 2-3Module 2
Editors
An editor for a resource (e.g. a file)opens when you double-click ona resource
The type of editor depends on the type of the resource.c files are opened with the C/C++ editor
Some editors do not just edit text
When an editor opens on a resource, it stays open acrossdifferent perspectives
An active editor contains menus and toolbars specific to thateditor
When you change a resource, an asterisk on the editor’stitle bar indicates unsaved changes
editor
PTP Tutorial 2-4Module 2
Source Code Editors
A source code editor is aspecial type of editor formanipulating sourcecode
Language features arehighlighted
Marker bars for showing
Breakpoints
Errors/warnings
Tasks
Location bar fornavigating to interestingfeatures
PTP Tutorial 2-5Module 2
Set up for MPI developmentPreferences
To use the PTP Parallel Language Development Tools feature forMPI development, you need to
Specify the MPI include path
Specify the MPI build command
Open WindowPreferences…
Open the PTP item
Open the Parallel LanguageDevelopment Tools item
Select MPI
Select New… to add MPIinclude path
If running OpenMP, add itsinclude file location here too(we will cover that later)
PTP Tutorial 2-6Module 2
Creating a Parallel Application
Steps:
Create a new C project
Edit source code
Save and build
PTP Tutorial 2-7Module 2
Creating a simpleMPI Project (1)
Create a new MPI project
File New C Project
Name the project‘MyHelloProject’
Under Project types, underExecutable, select MPIHello World C Projectand hit Next
On Basic Settings page,fill in information for yournew project (Authorname etc.) and hit Next
PTP Tutorial 2-8Module 2
Creating a simpleMPI Project (2)
On the MPI Project Settingswizard page, make sure AddMPI project settings to thisproject is checked.
Change default paths, etc. ifnecessary (they are probablyOK)
Hit Finish*.
*If you instead hit Next, thenon the Select Configurationspage, you can alter Projectsettings. Hit Finish.
Open the project propertiesby right-mouse clicking onproject and selectProperties
Open C/C++ Build
Select Settings
Select GCC C Compiler tochange compiler settings
Select GCC C Linker tochange linker settings
It’s also possible to changecompiler/linker arguments
PTP Tutorial 2-9Module 2
Changing the C/C++ BuildSettings Manually
Module 5 PTP Tutorial5-10
Editor and Outline View
Double-click onsource file in theProject Explorerto open C editor
Outline view isshown for file ineditor
PTP Tutorial 2-11Module 2
Hover over the MPI Artifactidentified in the source file tosee additional informationabout that function call, forexample
Content Assist
Type an incomplete MPI function name e.g. "MPI_Ini" into theeditor, and hit ctrl-space
Select desired completion value with cursor or mouse
PTP Tutorial 2-12Module 2
Context Sensitive HelpClick mouse, then press helpkey when the cursor is within afunction name
Windows: F1 key
Linux: ctrl-F1 key
MacOS X: Help key or HelpDynamic Help
A help view appears (RelatedTopics) which showsadditional information
Click on the function name tosee more information
Move the help view within yourEclipse workbench, if you like,by dragging its title tab
PTP Tutorial 2-13Module 2
Running a Parallel Application
Steps:
Create a launch configuration
Run the application
Monitor its progress in the PTP RuntimePerspective
Open the runconfigurationdialog RunOpen Run Dialog…
Select ParallelApplication
Select the Newbutton
PTP Tutorial 2-14Module 2
Create a Launch Configuration
PTP Tutorial 2-15Module 2
Complete the Main Tab
In Main tab, select theresource manager you wantto use to launch this job
If Parallel Project isn’tfilled in then click theBrowse button to select
Find the Applicationprogram (executable) byclicking the Browse button
Local program: executableis under Debug folder in theproject
PTP Tutorial 2-16Module 2
Complete the Resources Tab
Select Resources tab
Enter the number ofprocesses for this job
Other resource managersmay provide additionalresources to select (e.g.network interface, runduration, etc.)
PTP Tutorial 2-17Module 2
Complete the Debugger Tab
Select Debugger tab
Choose SDM from theDebugger dropdown
Confirm the debuggerexecutable
Click on the Runbutton to launch thejob
PTP Tutorial 2-18Module 2
Viewing The Run
Double-click anode in machinesview to see whichprocesses ran onthe node
Hover over aprocess for tooltippopup
Job and processesshown in jobsview
PTP Tutorial 2-19Module 2
Viewing Program Output
Double-click aprocess to seeprocess detail andstandard outputfrom the process
PTP Tutorial 2-20Module 2
About PTP Icons
Open using legend icon intoolbar
Module 3 3-0PTP Tutorial
Module 3: PTP and ParallelLanguage Development Tools
Objective
Learn to develop a parallel program
Learn to analyse with PLDT
Contents
Learn to use PTP’s Parallel Language DevelopmentTools
Learn to find MPI & OpenMP artifacts
Learn how to do MPI and OpenMP Specific analysis
Module 3 3-1PTP Tutorial
Parallel Language DevelopmentTools (1)
Features
Analysis of C and C++ code to determine the locationof MPI and OpenMP Artifacts (Fortran planned)
"Artifact View" indicates locations of Artifacts found insource code
Navigation to source code location of artifacts
Content assist via ctrl+space (“completion”)
Hover help
Reference information about the MPI and OpenMP callsvia Dynamic Help
Module 3 3-2PTP Tutorial
Parallel Language DevelopmentTools (2)
More PLDT features:
New project wizard automatically configuresmanaged build projects for MPI & OpenMP
OpenMP problems view of common errors
OpenMP “show #pragma region” action
OpenMP “show concurrency” action
MPI Barrier analysis - detects potential deadlocks
Module 3 3-3PTP Tutorial
Show MPI ArtifactsSelect source file; Runanalysis by clicking ondrop-down menu nextto the analysis buttonand selecting ShowMPI Artifacts
Markers indicate thelocation of artifacts ineditor
In MPI Artifact Viewsort by any column(click on col. heading)
Navigate to source codeline by double-clickingon the artifact
Run the analysis onanother file and itsmarkers will be added tothe view
Remove markers via
Module 3 3-4PTP Tutorial
MPI Barrier Analysis
Verify barrier
synchronization in
C/MPI programs
Interprocedural static
analysis outputs:
For verified programs,
lists barrier statements
that synchronize
together (match)
For synchronization
errors, reports counter
example that illustrates
and explains the error.
Module 3 3-5PTP Tutorial
MPI Barrier Analysis - views
MPI Barriers view
Simply lists thebarriers
Like MPI Artifacts view,double-click tonavigate to sourcecode line (all 3 views)
Barrier Matches viewGroups barriers thatmatch together in abarrier set – allprocesses must gothrough a barrier inthe set to prevent adeadlock
Barrier Errors view
If there are errors, acounter-exampleshows paths withmismatched numberof barriers
Module 3 3-6PTP Tutorial
OpenMP Managed Build Project
If you haven’t set upOpenMP preferences e.g.include file location, do itnow
Create a new OpenMPproject
File New C Project
Name the project e.g.‘MyOpenMPproject’
Select OpenMP Hello World CProject
Select Next, then fill in otherinfo like MPI project
Module 3 3-7PTP Tutorial
Setting OpenMP SpecialBuild Options
OpenMP typically requiresspecial compiler options.
Open the projectproperties
Select C/C++ Build
Select Settings
Select C Compiler
In Miscellaneous,add option(s).
Module 3 3-8PTP Tutorial
Show OpenMP Artifacts
Select source file,folder, or project
Run analysis
See artifacts inOpenMP Artifactview
Module 3 3-9PTP Tutorial
Show Pragma Region
Run OpenMPanalysis
Right click onpragma inartifact view
Select Showpragma region
See highlighted region in C editor
Module 3 3-10PTP Tutorial
Show OpenMP Problems
Select OpenMPproblems view
Will identify standardOpenMP restrictions
Module 3 3-11PTP Tutorial
Show ConcurrencyHighlight a statement
Select the context menuon the highlightedstatement, and clickShow concurrency
Other statements will behighlighted in yellow
The yellow highlightedstatements might executeconcurrently to theselected statement
Module 4 PTP Tutorial 4-0
Module 4: Parallel Debugging
Objective
Learn the basics of debugging parallel programs withPTP
Contents
Launching a parallel debug session
The PTP Debug Perspective
Controlling sets of processes
Controlling individual processes
Parallel Breakpoints
Terminating processes
Module 4 PTP Tutorial 4-1
Launching A Debug Session
Use the drop-down next tothe debug button (bugicon) instead of run button
Select the project to launch
The debug launch will usethe same number ofprocesses that the normallaunch used (edit theDebug LaunchConfiguration to change)
Module 4 PTP Tutorial 4-2
Parallel Debugview shows joband processesbeing debugged
Debug view showsthreads and callstack for individualprocesses
Source viewshows a currentline marker for allprocesses
The PTP Debug Perspective (1)
Module 4 PTP Tutorial 4-3
The PTP Debug Perspective (2)
Breakpoints viewshows breakpointsthat have been set(more on this later)
Variables viewshows the currentvalues of variablesfor the currentlyselected process inthe Debug view
Outline view (fromCDT) of sourcecode
Module 4 PTP Tutorial 4-4
Stepping All Processes
The buttons in theParallel Debug Viewcontrol groups ofprocesses
Click on the Step Overbutton
Observe that all processicons change to green,then back to yellow
Notice that the currentline marker has moved tothe next source line
Module 4 PTP Tutorial 4-5
Stepping An Individual Process
The buttons in theDebug view are usedto control anindividual process, inthis case process 0
Click the Step Overbutton
You will now see twocurrent line markers,the first shows theposition of process 0,the second shows thepositions of processes1-3
Module 4 PTP Tutorial 4-6
Process Sets (1)
Traditional debuggers apply operations to a singleprocess
Parallel debugging operations apply to a single processor to arbitrary collections of processes
A process set is a means of simultaneously referring toone or more processes
Module 4 PTP Tutorial 4-7
Process Sets (2)
When a parallel debug session is first started, allprocesses are placed in a set, called the Root set
Sets are always associated with a single job
A job can have any number of process sets
A set can contain from 1 to the number of processes ina job
Module 4 PTP Tutorial 4-8
Operations On Process Sets
Debug operations on theParallel Debug viewtoolbar always apply to thecurrent set:
Resume, suspend, stop,step into, step over, stepreturn
The current process set islisted next to job namealong with number ofprocesses in the set
The processes in processset are visible in right handpart of the view
Root set = allprocesses
Module 4 PTP Tutorial 4-9
Create set Remove from set
Deleteset
Changecurrent set
Managing Process Sets
The remaining icons in the toolbar of the ParallelDebug view allow you to create, modify, and deleteprocess sets, and to change the current process set
Module 4 PTP Tutorial 4-10
Creating A New Process Set
Select the processesyou want in the set byclicking and dragging,in this case, the lastthree
Click on the CreateSet button
Enter a name for theset, in this caseworkers, and click OK
You will see the viewchange to display onlythe selected processes
Module 4 PTP Tutorial 4-11
Stepping Using New Process Set
With the workers setactive, click the StepOver button
You will see only thefirst current linemarker move
If all processes are nowat the same line, youwill only see one linemarker again
Module 4 PTP Tutorial 4-12
Process Registration
Process set commands apply to groups ofprocesses
For finer control and more detailedinformation, a process can be registered andisolated in the Debug view
Registered processes, including their stacktraces and threads, appear in the Debugview
Any number of processes can be registered,and processes can be registered orun-registered at any time
Module 4 PTP Tutorial 4-13
Registering A ProcessTo register a process,double-click its processicon in the ParallelDebug view or select anumber of processes andclick on the registerbutton
The process icon will besurrounded by a box andthe process appears inthe Debug view
To un-register a process,double-click on theprocess icon or select anumber of processes andclick on the unregisterbutton
Individual(registered)processes
Groups (sets)of processes
Module 4 PTP Tutorial 4-14
Current Line Marker
The current line marker is used to show thecurrent location of suspended processes
In traditional programs, there is a singlecurrent line marker (the exception to this ismulti-threaded programs)
In parallel programs, there is a current linemarker for every process
The PTP debugger shows one current linemarker for every group of processes at thesame location
Module 4 PTP Tutorial 4-15
Multiple processes marker
Registered process marker Un-registered process marker
Colors And Markers
The highlight color depends onthe processes suspended atthat line:
Blue: All registered process(es)
Orange: All unregisteredprocess(es)
Green: Registered or unregisteredprocess with no source line (e.g.suspended in a library routine)
The marker depends on thetype of process stopped at thatlocation
Hover over marker for moredetails about the processessuspend at that location
Module 4 PTP Tutorial 4-16
Apply only to processes in the particular set that isactive in the Parallel Debug view when the breakpointis created
Breakpoints are colored depending on the activeprocess set and the set the breakpoint applies to:
Green indicates the breakpoint set is the sameas the active set.
Blue indicates some processes in the breakpoint set arealso in the active set (i.e. the process sets overlap)
Yellow indicates the breakpoint set is different from theactive set (i.e. the process sets are disjoint)
When the job completes, the breakpoints areautomatically removed
Breakpoints
Module 4 PTP Tutorial 4-17
Creating A Breakpoint
Select the process set thatthe breakpoint should applyto, in this case, the workersset
Double-click on the left edgeof an editor window, at theline on which you want to setthe breakpoint, or right clickand use the ParallelBreakpoint ToggleBreakpoint context menu
The breakpoint on the call toMPI_Send()
Module 4 PTP Tutorial 4-18
Hitting the Breakpoint
Click on the Resume buttonin the Parallel Debug view
In this example, the threeworker processes have hit thebreakpoint, as indicated bythe yellow process icons andthe current line marker
Process 0 is still running as itsicon is green
Module 4 PTP Tutorial 4-19
More On Stepping
The Step buttons are onlyenabled when all processesin the active set aresuspended (yellow icon)
In this case, process 0 is stillrunning
Switch to the set ofsuspended processes (theworkers set)
You will now see the Stepbuttons become enabled
Module 4 PTP Tutorial 4-20
Breakpoint Information
Hover over breakpoint icon
Will show the sets this breakpoint applies to
Select Breakpoints view
Will show all breakpoints in all projects
Module 4 PTP Tutorial 4-21
Breakpoints View
Use the menu in the breakpoints view to groupbreakpoints by type
Breakpoints sorted by breakpoint set (processset)
Module 4 PTP Tutorial 4-22
Apply to all processes and all jobs
Used for gaining control at debugger startup
To create a global breakpointFirst make sure that no jobs are selected (click in whitepart of jobs view if necessary)
Double-click on the left edge of an editor window
Note that if a job is selected, the breakpoint will apply tothe current set
Global Breakpoints
Module 4 PTP Tutorial 4-23
Terminating A Debug Session
Click on the Terminateicon in the ParallelDebug view toterminate all processesin the active set
Make sure the Root setis active if you want toterminate all processes
You can also use theterminate icon in theDebug view toterminate the currentlyselected process
Module 5 PTP Tutorial 5-0Module 5 PTP Tutorial 5-0
Module 5: Advanced Development
Objective
Explore advanced features of Eclipse and PTP
Contents
Advanced Eclipse Features
Advanced PTP Features
PTP TutorialModule 5 5-1
Advanced Eclipse Concepts
Perspectives, views and preferences
Version control
Makefiles and autoconf
Task Tags
Searching
Refactoring
Module 5 PTP Tutorial 5-2
Customizing Perspectives
Items such as shortcuts, menu items and views may becustomized
Window Customize Perspective…
Save changes
Window Save Perspective As…
Close Perspective
Right-click on perspective title and select Close
Reset Perspective
Window Reset Perspective resets the currentperspective to its default layout
Module 5 PTP Tutorial 5-3
Opening New Views
To open a view:
Choose Window Show View Other…
The Show View dialog comes up
Select the view to be shown
Select OK
Module 5 PTP Tutorial 5-4
Workbench Preferences
Preferences provide a way for you tocustomize your Workbench
By selecting Window Preferences… or EclipsePreferences… (Mac)
Examples of preference settingsUse Emacs bindings for editor keys
Modify editor folding defaults
E.g., fold all macro definitionsAssociate file types with file extensions
E.g., *.f03 with the Fortran editorToggle automatic builds
Change key sequence shortcuts
E.g., Ctrl+/ for Comment
Module 5 PTP Tutorial 5-5Module 5 PTP Tutorial 5-5
Version Control (CVS)
Version control provided through the ProjectExplorer View, in the Team context menu
Provides familiar actions:Commit…
Update…
Also less used tasks:Create/Apply Patch…
Tag as Version
Branch…
Merge…
Add to .cvsignore…
Module 5 PTP Tutorial 5-6Module 5 PTP Tutorial 5-6
Specify Repository Locations
Select Window OpenPerspective Other…
Select CVS Repository Exploringthen OK
Right-click in CVS RepositoriesView, then select NewRepository Location…
Set Host to the hostname ofremote machine
Set Repository path
Fill in Username and Password
Set Connection type
Check Save password
Select Finish
Module 5 PTP Tutorial 5-7Module 5 PTP Tutorial 5-7
Checkout a non-Eclipse project as anEclipse C Project
Open Repository, open HEAD
Locate project, right-click on ProjectCheck out As…
Make sure Check out as a projectconfigured using the New ProjectWizard is selected
Select Finish
Select C C project
Select Next>
Enter Project name
Under Project Types, select Makefileproject
Ensures that CDT will use existing
makefiles
Select Finish
Switch to the C/C++ Perspective
Module 5 PTP Tutorial 5-8Module 5 PTP Tutorial 5-8
About Makefiles and autoconf
Can create project Makefiles with the MakefileEditor
Syntax highlighting and Outline view
autoconf often used to create Makefiles for
open source projects
Run configure manually, or from External
Tools Launch ConfigurationMust refresh after running configure script
Refresh whenever file system is modifiedoutside of Eclipse
Module 5 PTP Tutorial 5-9Module 5 PTP Tutorial 5-9
Building with Makefiles
Create a Make Targetnamed ‘all’
Right-click on theproject in MakeTargets View
Select Add MakeTarget
Select Create
Double click on newmake target to initiatethe build
Module 5 PTP Tutorial 5-10Module 5 PTP Tutorial 5-10
Task Tags
Task tags are identifiers inC/C++ comments
TODO is a built-in task tag
The build locates task tagsduring compilation
View task tags in Tasks View
If it’s not shown, Window Show View Other…
Open General and selectTasks
Configure your own task tagin Window Preferences
Under C/C++, select TaskTags
Module 5 PTP Tutorial 5-11Module 5 PTP Tutorial 5-11
Searching
Language-basedsearching
Search for LanguageElements
e.g., C++ Class,Function, Method,Variable, Field,Namespace
Can Limit search toDeclarations, Definitions,References
Type navigation
Module 5 PTP Tutorial 5-12Module 5 PTP Tutorial 5-12
UPC Support
To see UPC support in Ceditor, install the optionalfeature from CDT
Filetypes of “upc” willget UPC syntax high-lighting, content assist,etc.
Module 5 PTP Tutorial 5-13Module 5 PTP Tutorial 5-13
Refactoring
Source-to-source transformation thatpreserves behavior
Rename
Select C/C++ Perspective
Open a source file
Click in editor view on declaration of a variable
Select menu item Refactor Rename
Or use context menu
Change variable name
Notice that change is semantic not textual
Module 5 PTP Tutorial 5-14Module 5 PTP Tutorial 5-14
CDT 5.0 Refactoring: Extract Constant
CDT 5.0 will be availablein the Eclipse “Ganymede”release, June 2008
Other refactorings thatare planned:
Extract Function
Hide Member Function
Move Field or Member Function
Extract Subclass
Extract Baseclass
Separate Class
Implement Function
Declare Function
Move Function Definition
Generate Getters and Setters
Module 5 PTP Tutorial 5-15
Advanced PTP Concepts
Remote resource managers
Debugging remotely
MPICH2, IBM PE and LoadLeveler
Module 5 PTP Tutorial 5-16
Remote Resource Manager
Select Remote Tools as theRemote service provider
Click New… to create a newlocation
Enter a Target Name, IPaddress or host name of theremote machine, andcredentials
Select Finish
Select the Target Name youjust created for Proxyserver location if it is not
visible in the dropdown
Module 5 PTP Tutorial 5-17
Select Proxy Agent
Click Browse to selectthe proxy serverexecutable
Open Root twisty
Now navigate to andselect the proxyexecutable
Click OK
Module 5 PTP Tutorial 5-18
Using Port Forwarding
Port forwarding can beenabled to tunnel allcommunication over asingle connection
If you don’t want to useport forwarding, yourlocal machine must beaccessible from theremote machine
Select your local machine’sIP address from thedropdown
Enter it manually if it’s notvisible
Click Finish
Module 5 PTP Tutorial 5-19
Debugging Remotely
Choose remote resourcemanager in Main tab
Click Browse and selectsdm executable onremote machine (if pathis not correct)
Set Debugger sessionaddress to the addressof the machine runningthe proxy agent
The address must beaccessible from a clusternode
Click Finish
Module 5 PTP Tutorial 5-20
Alternate Resource Managers
An MPICH2 resource manager is provided
Use ptp_mpich2_proxy when selecting proxy executable
PE and LoadLeveler
See help documentation that comes with PTP forinformation on configuring and using
Debugging support for alternate resource managers willbe available in next version of PTP
Module 6 PTP Tutorial 6-0
Module 6: Where To Go Next
Objective
How to find more information on PTP
Learn about other tools related to PTP
See PTP upcoming features
Contents
Links to other tools, including performance tools
Planned features for new versions of PTP
Additional documentation
How to get involved
Module 6 PTP Tutorial 6-1
Information About PTP
Main web site for downloads, documentation, etc.
http://eclipse.org/ptp
Developers’ wiki for designs, planning, meetings, etc.
http://wiki.eclipse.org/PTP
Mailing lists
Major announcements (new releases, etc.) - low volume
http://dev.eclipse.org/mailman/listinfo/ptp-announce
User discussion and queries - medium volume
http://dev.eclipse.org/mailman/listinfo/ptp-user
Developer discussions - high volume
http://dev.eclipse.org/mailman/listinfo/ptp-dev
Module 6 PTP Tutorial 6-2
PTP-Related Tools
Performance Tools Framework
Tuning and Analysis Utilities (TAU)
TuningFork - Performance Visualization
Photran – Fortran Development Tools
Module 6 PTP Tutorial 6-3
PTP / Performance ToolsFramework
Goal:
Reduce the “eclipse plumbing”necessary to integrate tools
Provide integration forinstrumentation, measurement, andanalysis for a variety of performancetools
Dynamic Tool Definitions:Workflows & UI
Tools and tool workflows arespecified in an XML file
Tools are selected and configured inthe launch configuration window
Output is generated, managed andanalyzed as specified in theworkflow
Module 6 PTP Tutorial 6-4
PTP TAU plug-inshttp://www.cs.uoregon.edu/research/tau/home.php
TAU (Tuning and Analysis Utilities)
First implementation of Performance Tools Framework
Eclipse plug-ins wrap TAU functions, make themavailable from Eclipse
Compatible with Photran and CDT projects and withPTP parallel application launching
Other plug-ins launch Paraprof from Eclipse too
Module 6 PTP Tutorial 6-5
TuningFork
http://www.alphaworks.ibm.com/tech/tuningfork
Performance visualization Eclipse plug-insfrom IBM Research
Rich Client Platform or IDE versions available
Designed for real-time visualization of largedata sets
Will be available open source on Source Forge
Enhancements for parallel computingunderway
Module 6 PTP Tutorial 6-6
Photran
Supports Fortran inthe Eclipse workbench
Supports Fortran 77, 90,and 95It includes:
Syntax-highlighting editor
CVS support
GUI interface to gdb
Makefile-basedcompilation
Compiler error extraction
Outline view
Open declaration
Rename and Introduce
Implicit None refactorings
http://eclipse.org/photran
Module 6 PTP Tutorial 6-7
Useful Eclipse Tools
Python
http://pydev.sourceforge.net
Subversion (CVS replacement)
http://subclipse.tigris.org
Now an Eclipse Technology project
… and many more!
Module 6 PTP Tutorial 6-8
Future PTP Features
Resource manager support for SLURM, PBS,LSF, BG/P
Simplified runtime system interface (plussupport for other MPI runtimes)
Debugging support for a broad range ofarchitectures
Full remote project support (combined withCDT)
Remote build and indexing
Remote launch/debug
Performance analysis tools integration
Module 6 PTP Tutorial 6-9
PTP Publications
“Developing Scientific Applications Using Eclipse,” Computingin Science & Engineering, vol. 8, no. 4, July/August 2006, pp.50-61
Link on http://eclipse.org/ptp web page
“A Model-Based Framework for the Integration of ParallelTools”, Proceedings of the IEEE International Conference onCluster Computing, Barcelona, September 2006
Link on http://eclipse.org/ptp web page
IBM developerWorks article:http://www-128.ibm.com/developerworks/edu/os-dw-os-ecl-ptp.html
“An Integrated Tools Platform for Multi-Core Enablement,”Beth Tibbitts & Evelyn Duesterwald, STMCS: SecondWorkshop on Software Tools for Multi-Core Systems, March2007
http://www.isi.edu/~mhall/stmcs07/program.html
Module 6 PTP Tutorial 6-10
Getting Involved
See http://eclipse.org/ptpRead the developer documentation on the wikiJoin the mailing lists
[email protected]; [email protected]
Attend the monthly developer teleconferenceAttend the annual workshop
PTP will only succeed with your participation!
Module 6 PTP Tutorial 6-11
Thanks for attendingWe hope you found it useful
PTP Tutorial Feedback
Please complete feedback form
Your feedback is valuable!