Example 3

Table of Contents

Simple example scenario 3 to show command usage

listPids -h host1, host2 -f a.out

HOST   PID   CMD
------------------------
host1 8671120 a.out
host2 6718917 a.out

expCreate -h host1 -p 8671120, -h host2 -p 6718917

1

SetBreak -h host2 -p 6718917 -t 1 startxyz

Breakpoint #1 defined

expGo

Breakpoint #1 encountered

listTypes

pcsamp, usertime, mpi, fpe, hwc, io, user1, user2

expAttach pcsamp

expAttach -t 0:298, 300:398 user1

expAttach -h host2 -t 299 pcsamp

expDetach -h host2 -p 6718917 -t 12:96 pcsamp

SetBreak -h host1 -t 128 flyingRT

Breakpoint #2 defined

expGo

Breakpoint #1 encountered

clearBreak 1

expGo

Breakpoint #2 encountered

clearBreak 2

SetBreak -h host2 -t 78 flyingST

Breakpoint #3 defined

expDetach pcsamp

expAttach -h host1 -t 299 io

expAttach -h host2 -t 399 io

playBack -h host3 -f /silk/sows/ears/fe-fi&fo.script

expGo

Breakpoint #3 encountered

listMetrics

vTopN, vIO, vFpe, user1View

expView -gui user1View

expDetach io

expAttach pcsamp

expGo

expPause

expView vIO

expSave copy -h host1 -f my.data

expDetach -h host1

expDetach -h host2 pcsamp

expAttach -h host2 -p 6718917 -t 12:96 user2

expView -gui user2View

expGo

Breakpoint #3 encountered

expDetach

exit



More detailed example scenario 3 to show command usage

# Find the pids associated with the running execution of a.out on the machines named host1 and host2.

listPids -h host1, host2 -f a.out

HOST   PID   CMD
------------------------
host1 8671120 a.out
host2 6718917 a.out

# Define an experiment with these pids. This application is known to have 300 threads on host1 and 400 on host2.

expCreate -h host1 -p 8671120, -h host2 -p 6718917

1

# Set a breakpoint that is known to be associated with the start of a processing step that is of interest for performance analysis. Then run the application until the next time that the breakpoint is reached.
# Since the application was already executing, the expGo command will restart the application.

SetBreak -h host2 -p 6718917 -t 1 startxyz

Breakpoint #1 defined

expGo

# After some period of time, the breakpoint is reached and the entire running application is stopped.

Breakpoint #1 encountered

# Decide how to instrument the application, based on the types of collectors available for use. There may be a lot more output, describing paramters, metrics, reports and views. The details of these commands have not yet been determined.

listTypes

pcsamp, usertime, mpi, fpe, hwc, io, user1, user2

# Add the pcasmp collector to all the threads on both hosts.

expAttach pcsamp

# Add the user1 collector to all the threads except #299 and #399. Note that threads 300:399 don't exist on host1, but do on host2.

expAttach -t 0:298, 300:398 user1

# Oops! It's only the last thread on each host where we don't want pcsamp to be collecting performance data, The previous command skipped a thread on host2 that we need to include.

<expAttach -h host2 -t 299 pcsamp

# There are also some special threads on host2 that we don't want to collect pcasmp data for. Exclude them.

expDetach -h host2 -p 6718917 -t 12:96 pcsamp

# Set a breakpoint that is known to be associated with the start of a processing step where we will want to add additional instrumentation.

SetBreak -h host1 -t 128 flyingRT

Breakpoint #2 defined

# We're off to the races!!

expGo

Breakpoint #1 encountered

# Dang! We don't care about breakpoint #1 anymore. Get rid of it and get going!

clearBreak 1

expGo

# After a while, we (finally) get to breakpoint #2.

Breakpoint #2 encountered

# Get rid of breakpoint #2 and set another one of interest.

clearBreak 2

setBreak -h host2 -t 78 flyingST

Breakpoint #3 defined

# Stop collection of pcsamp data for all threads on both hosts. Note that previously collected data samples will be preserved and that the user1 collector remains active.

expDetach pcsamp

# Collect io data about the only 2 threads that are known to handle intermediate files for the application.

expAttach -h host1 -t 299 io

expAttach -h host2 -t 399 io

# Now run a script that does some special anaylsis and generates a repoort that is of interest. Access to this script may be implementation dependant, since it is on another host. We may only be able to read cross-mounted files systems.

playBack -h host3 -f /silk/sows/ears/fe-fi&fo.script

# Get back to the business of running the application.

expGo

Breakpoint #3 encountered

# At this point we need to examine what is going on.

listMetrics

vTopN, vIO, vFpe, user1View

# At this point we need to examine the collected data and decide what to do. Open a GUI window to examine the data collected by user1.

expView -gui user1View

# It is clear from the data that all the intermediate IO is complete. Remove the io collector from all threads, since it is no longer of interest. Note that the data accumulated by the io collector is not discarded and can be examined later.

expDetach io

# We will restart the pcsamp collector on all threads. New data will be added to the previosuly collected samples although there will be a gap in time where there are no samples about the program.

expAttach pcsamp

expGo

# Let the program run for an hour or two and then stop it to examine it's behavior.

expPause

# First, we take a look at the old io samples that were generated. This is not current information, but the realtime display for user1View suggests that there may be an anomoly that should be checked out.

expView vIO

# Hummm.... Something strange is going on. We don't want to get diverted from what we set out to do today, but we better save all the data that's been collected and we will look at it later. We will save it in a file on host1.

expSave copy -h host1 -f my.data

# What is happening on host1 is no longer of interest. Get rid of the pcsamp and user1 collectors that are still active on the host.

expDetach -h host1

# Further more, we don't want to collect any more pcsamp data for host2, but keep the user1 collector.

expDetach -h host2 pcsamp

# Information on the user1View display, indicate that this is the time to turn on our special user2 collector. It will be restricted to a subset of threads on host2.

expAttach -h host2 -p 6718917 -t 12:96 user2

# The user2 collector can generate a realtime display, so let's open it up and watch how the application is performing while it is executing.

expView -gui user2View

expGo

# The user2 collector can generate a realtime display, so let's open it up and watch how the application is performing while it is executing.

Breakpoint #3 encountered

# At some point, we reach the breakpoint that marks the end of an iteration in the application. We have collected data for a complete cycle and no longer need to instrument the program. The following expDetach command stops all data collection and disconnects the application from the performance analysis tool. It does not throw away the data that has been collected, although there is no way to View it unless a collector is re-attached to the experiment. Since the application is no longer controlled by the performance tool, it can continue to run.

expDetach

# The exit command closes the performance analysis tool. All performance data is discarded and all related displays are closed. Since the application has already been disconnected, it continues to run to completion.

exit