Assignment #6(b):Study of PTP Runtime & Debug Environments.


Important Note: This document has been updated to the date mentioned at the bottom of this file. PTP is still in its preliminary stages of development and is being actively worked on based on the feedback received from the PTP users (see the newsgroup). The descriptions given in this document might become obsolete within a very small span of time. The readers might find it useful to look into the PTP newsgroup (news://news.eclipse.org/eclipse.technology.ptp, free account required) and their website for recent updates, bug fixes & general questions.



Description:

PTP Toolkit as a plug-in that that helps us to design & code MPI programs within the Eclipse IDE. It provides context sensitive helps, run time information and has some interesting debugging tools that may help the programmer to build accurate MPI programs avoiding much of the pains that are associated with debugging parallel programs on a console based system. However, at present many users are not even aware of its existence. This write-up is an attempt to help users get started with PTP and its powerful capabilities.

For setting up appropriate packages for PTP Runtime & Debug plugins as well as building instructions for orte server, refer to Assignment 6(a)

Please ensure that the environment variable LD_LIBRARY_PATH contains the path to OpenMPI "lib" directory. Further, if you are running both LAM and OpenMPI, ensure that OpenMPI is your default compiler by writing something like PATH=/usr/share/ompi:$PATH in .bashrc. Also you may place orte_server & SDM in your shell PATH variable if you run into problems (I was not required to do this with Version 1.0 of PTP). If you use a shortcut to launch eclipse from desktop, ensure that you do all these things in your window manager environment variables as well. If you miss doing any of these things, the following problems may occur:

  1. If you choose 'Open Run time environment', eclipse goes into an infinitely idle mode while initializing orte_server.
  2. Same occurred if you were to choose SDM for debugging under "running mpi programs".


Running MPI Programs:

Some of the descriptions given here can also be found here:
http://www.eclipse.org/ptp/documentation/org.eclipse.ptp.help/html/02pLaunchConfig.html

In this section, I assume that OpenMPI, orte server & sdm has been properly built & configured in the system. Instructions to build & configure them has been specified in Assignment 6.

If you have not read assignment 6(a) or you are unwilling to use the actual runtime, you can run the PTP simulator that simulates a parallel execution as is described here: http://www.eclipse.org/ptp/documentation/org.eclipse.ptp.help/html/02pLaunchSim.html
For simulation, basically you set you set Window->Preferences->PTP->Control & Monitoring system to simulation. You would also like to set PTP->Simulation options. However please note that the simulation mode will not be supported by PTP very long. I have already heard from the developers that they are thinking of removing it in the next update. So these options & write-up may disapear in due course of time. Besides, the simulation mode has certain bugs that are described below in [1] under bug reports.

The following discussion assumes that you are *not* simulating, that is you have a PTP->MPI environment running to execute your programs.
Follow the following steps to run your MPI Application:

  1. Select Window->Preferences and go to PTP. From Run time systems, select  OPEN RUN TIME ENVIRONMENT (ORTE) for both Control & monitoring system. [1]
  2. Open the PTP item and click on 'Open RTE'. Make sure 'ORTEd file' points to your Open MPI installation. Make sure 'ORTE|PTP proxy server file' points to the location where orte server resides. 
  3. Ensure that orte_server and SDM binary are in your PATH environment variable. Otherwise you will get strange results.
  4. Open 'Debug' and click on 'SDM'. Make sure 'SDM executable' has the location where sdm resides.
  5. Open Run->Run ... from eclipse menu and ...
    1. Under parallel applications, click new & then give a name to your run configuration under Main Tab.
    2. Also, under application program, click browse and ...
    3. Select the path to your executable binary program file and click ok.
  6. Under Program arguments tab, type in the arguments to your MPI program.
  7. Under debugger tab, select SDM. If you are simulating the debugger, select "simulator".[2]
  8. Select the Parallel Tab. Select the number of processes & the machines & click Run. You get this dialogue.
Gotchas
If you get stuck in Eclipse with this screen, issue the following commands as root:-

%> killall orted
%> killall orte_server
%> killall sdm
%> rm -rf /tmp/openmpi*

Then restart eclipse.

Note: In version 1.0, PTP was made to do this automatically.  So you may not be required to do this manually.


PTP Runtime Descriptions:

This link has elaborate descriptions on the PTP runtime system: http://www.eclipse.org/ptp/documentation/org.eclipse.ptp.help/html/03ptpRuntimePersp.html

PTP has this cool runtime analysis tool. Initiate this tool by selecting the PTP runtime perspective. You can view the available nodes and their status.
Check this figure. Double clicking on a node (1) gives its description at the bottom (2) & the process info (3). Double clicking the process info opens up the process details window (4).
Colors and varied icons for different nodes has different meanings which can be obtained by clicking the legend button on the toolbar.
The job tab gives us the job level details. In both machine & job view, hovering the mouse on a node gives its description in the tooltip.

PTP Debug Descriptions:

PTP Debug tool is really impressive. Initiate this tool by selecting the PTP debug perspective.
Here is a snapshot of this window.
You can create groups of processes by selecting them using the mouse & then clicking the add group icon. A dialogue prompts you to specify the new group name. By default, all processes initially belong to the "root" group.
A full descriptions of process sets can be found here: http://www.eclipse.org/ptp/documentation/org.eclipse.ptp.help/html/04ptpDebugPersp.html#pSets
One could set break points by double clicking in the left margin of the source window. A tooltip describes the breakpoint.
Right clicking the break point produces a break point menu with several options.
Right clicking on one of the halted processes brings up the debug menu with usual debugging options. These options can also be found from the debug toolbar as has been described in the documentation.
It is possible to step-wise debug through different parallel executions in different nodes. For example, in this figure we have four nodes, each of them are about to execute 4 different instructions as shown by their instruction pointer. Hovering the mouse over one of those instruction pointers gives details about that ip in tooltip.
You can watch the values of the variables in the right side. Watching the value of an expression or a full array was yet not implemented till the time of writing this report.

The descriptions on the available PTP debugger features can be read from here: http://www.eclipse.org/ptp/documentation/org.eclipse.ptp.help/html/04ptpDebugPersp.html

Bug Reports as on March 7, 2006 when this report was first written:
  1. Source not found error occurred in PTP simulated debug mode when you select "stop at main" in Run ...->Parallel Application->Debugger. Why does it look for function main.c() at main.c?? I could never get it running. When I unchecked "stop at main", the node executed to completion without halting anywhere (in spite of setting breakpoints) but giving no output.
    It worked fine in non-simulated mode though.
  2. Eclipse crashed once or twice with these messages while I clicked Run->Run ...-> Parallel Application ( I could not find the log file ) & while I initialized the debugging mode.
  3. Why does the PTP runtime does not show any output?
  4. PTP Runtime locked up after clicking run.
  5. If I use multiple separate machines as nodes, where do I specify their IP/hostname?

Update on Bug reports [after working on them with the PTP Team] as on the date of updating this report (see below):

1. Simulated mode is not supported.
2. This error was completely eliminated.
3. This error was tracked down and was resolved (it was found to be due to platform incompatible orte and sdm binaries).
4. This issue was related to the previous one. It was resolved by building binaries on an updated platform.
5. This feature is not as yet supported.

 

First Posted: Mar 2 2006. Last Updated: Apr 1 2006 Credits: 5

Page Last Revised:Monday March 31, 2008

Valid HTML 4.01 Transitional