Assignment #6 (a): Study of PTP/CDT Toolkits in Eclipse for MPI Program Development.


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.


This write up provides instruction for building all the required packages from source. This is because during the time of writing this report, precompiled binaries for PTP were not available. However, by the time this work got completed, the first set of binaries were *officially* released for end users. However, I would like to keep these build instructions because the main strength of open source software is the ability to build it according to one's preference & not just depend on only the officially released precompiled binaries. Instructions for using the released binaries directly without building from  source are also provided.


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.

Installing PTP:

PTP has four prerequisites:
  1. A running MPI Compiler*.
  2. Eclipse SDK
  3. CDT Toolkit which is a plug-in for eclipse for running C/C++ programs
  4. PTP development & runtime plugins
The discussion that follows and the next section of this assignment (assignment 6(b)) assumes a Fedora Core 4 Linux installation on an x86 architecture (such as P-II, P-III or P-IV machine) as the base operating system. The technique for installing PTP in any other platform, particularly on OSX over a PowerPc architecture will be similar. During the writing of this report, PTP does not yet support solaris over Sparc or other Sun architectures.

* Important Note: For PTP-MPI development tools only, any version of MPI can be used, like OpenMPI or LAM/MPI. For PTP debugging & runtime tools OpenMPI  is currently the only supported environment (I personally do not see that this would change in near future). OpenMPI is a complete rewrite and combines work from four different MPI implementations. It also provides a new runtime layer called Open Runtime Environment (OpenRTE) which PTP relies heavily on for OpenMPI support in the current version.

Step 1:
Download & build OpenMPI

Since OpenMPI is the common platform for both MPI development & runtime tools, we will focus primarily on OpenMPI.
Download OpenMPI 1.0.2 (pending) alpha and copy it into a convenient location.
Run configure as follows:
./configure --with-devel-headers --prefix=/path/to/your/ompi/install
make all
make install
At this point it's a good idea to run a small mpi program to test you have installed OpenMPI correctly.
mpicc helloMPI.c -o hello
mpirun -np 2 hello
If you want to use LAM/MPI with the development tools only, you can download & install LAM/MPI from : http://www.lam-mpi.org/7.1/download.php.
The installation instruction for LAM/MPI is given here: http://www.lam-mpi.org/7.1/install/
Please note that Fedora Core 4 already comes with LAM package.  You may need to select this package using custom installation. If you have forgotten to select it though, you can install it any time by using the command "yum install lam" as root. In any case, the package that comes with Fedora needs upgradation & hence use "yum update lam" to update lam.

Step 2:
Eclipse installation.

Install Eclipse. Just download Eclipse SDK from  http://www.eclipse.org/downloads/ .
Copy it to any location that is accessible by all users like /usr/share. Ensure that you have Java installed. If not, install Java for Fedora.
Note that Fedora Core 4 comes with a customized version of Eclipse development environment. I prefer downloading your own copy of eclipse and using it since PTP requires an updated (version 3.1) copy of Eclipse.

Step 3:
Install CDT Toolkit. Open up eclipse.

To install CDT from the update site, in the Help menu select Software Updates and then Find and Install, Select Search for new features to install and click Next. Click New Remote Site to add an update site with the URL:

        http://download.eclipse.org/tools/cdt/releases/eclipse3.1

Select the appropriate CDT entry and click next to show the list of features for this release. The features for the CDT have been simplified and now only defines two features, the CDT runtime and the CDT SDK. The SDK feature is a superset of the CDT runtime with the addition of the CDT source. Place a check mark next to the desired entry and click through the rest of the pages to get the install started. After the install is completed, please make sure you accept the workbench restart.
There is another old fashioned way of installing CDT, that through downloading .tar.gz file but I personally never used it. The above mentioned strategy worked fine for me.

Step 4:

A. Instructions for building PTP from source:

Open up eclipse. Go to Window->Open Perspective->Other. Select CVS Repository Exploring.
Click OK. On your left, repository pane opens up. Right click on this pane & click new->repository location from the popup menu. A dialogue box opens up. Setup the various parameters in the box as shown here. Click OK.
From the repository hierarchy go to HEAD/org.eclipse.ptp.

For PTP Development Plugins only:
Select these packages:-

UNDER TOOLS:-
org.eclipse.ptp.mpi.core
org.eclipse.ptp.mpi.help


For PTP Runtime & Debugging Plugins only:
Select these packages:

UNDER CORE:-
org.eclipse.ptp.core
org.eclipse.ptp.launch
org.eclipse.ptp.ui

UNDER DEBUG:-
org.eclipse.ptp.debug.core
org.eclipse.ptp.debug.external.core
org.eclipse.ptp.debug.external.ui
org.eclipse.ptp.debug.ui

UNDER DOC:-
org.eclipse.ptp.help

For each of these packages, right click on them and select check out. The plug-in/packages starts being copied under your eclipse workspace folder.

Next, we need to build PTP from source. If your eclipse is set to "build automatically" under project menu then these packages will be built automatically as & when you check them out from CVS. The corresponding class files should exist in bin folder under each of the downloaded packages.
If however, "build automatically" is not set then click project and then click "build all".
Eclipse will start building class files for all the source packages you have downloaded from CVS. There will be a few warnings, but ignore them.

Next step is to build SDM (Scalable Debug Manager):
Note: This step is required only if you plan to use the debugging & runtime plug-in.

Make sure you have the following packages from eclipse repository by following the procedure above and each time checking out the below mentioned packages:

UNDER DEBUG:-

org.eclipse.ptp.debug.sdm
org.eclipse.ptp.debug.sdm.orte.OS.ARCH e.g org.eclipse.ptp.debug.sdm.orte.linux.x86

UNDER CORE:-

org.eclipse.ptp.proxy
org.eclipse.ptp.utils
Change to org.eclipse.ptp.debug.sdm directory and run ./configure. This will configure all three directories.
Run "make all" in the same directory. This will build the proxy and utils libraries and the sdm executable.

Run './INSTALL. This will copy the executable to the appropriate location in org.eclipse.ptp.debug.sdm.orte.OS.ARCH. Note: you will probably have to
make it executable e.g. chmod +x INSTALL

Last step is to build orte_server (Open Run Time Environment server):
Note: This step is required only if you plan to use the debugging & runtime plug-in.

Make sure you have the following packages:
UNDER CORE:-
org.eclipse.ptp.orte
org.eclipse.ptp.orte.OS.ARCH e.g. org.eclipse.ptp.orte.linux.x86
org.eclipse.ptp.proxy (You should already have them if you had followed the steps above)
org.eclipse.ptp.utils (You should already have them if you had followed the steps above)
Change to org.eclipse.ptp.orte directory & follow the same procedures as you did for sdm package.

Run './INSTALL. This will copy the executable to the appropriate location in org.eclipse.ptp.debug.sdm.orte.OS.ARCH. Note: you will probably have to
make it executable e.g. chmod +x INSTALL

Now select Run->Run ... from eclipse menu & select Eclipse Application and click new & the bottom left corner. A New eclipse application configuration opens up. The main & plug-in tabs should look like the ones given here. Click Run. A new instance of Eclipse running PTP will open up.

B. Instructions for using the PTP binaries directly by downloading
If you want to avoid all these complications I just listed, just download the following packages from http://www.eclipse.org/ptp/downloads.html.
PTP Core:
org.eclipse.ptp-1.0.0.tar.gz
PTP Runtime: org.eclipse.ptp.orte-linux-x86-1.0.0.tar.gz
PTP debug: org.eclipse.ptp.debug-orte-linux-x86-1.0.0.tar.gz
MPI Devel: org.eclipse.ptp-mpi-1.0.tar.gz

Note: At the time of last update, the above mentioned binaries were available for download from PTP website for PTP Release 1.0.

After downloading, simply extract them into your eclipse folder (eg. /usr/share/eclipse). Next, from command line fire up eclipse with "-clean" switch.

The following discussion & the next assignment assumes that you are working on a new instance of eclipse that runs PTP.

Using the PTP Development Environment for coding MPI Programs:
(Any MPI version can be used for this part)

The description given below can also be found here: http://www.eclipse.org/ptp/documentation/org.eclipse.ptp.mpi.help/html/setup.html
In Eclipse, follow these steps to create a new project:

  1. Create a CDT project (e.g. Managed Make C Project)
  2. Create a source file e.g. test.c with MPI artifacts (For an example MPI program, see testMPI.c).
  3. Setup mpicc compiler in  GCC C compiler under Project Properties -> C/C++ Build -> Tool Settings tab. Click here for a snapshot.
  4. Similarly setup mpicc under GCC Linker. Here is a snapshot.
  5. Setup path for MPI header directories.
  6. Setup lib directories.
  7. Make sure the Indexer is turned on. Project Properties->C/C++ Indexer. Select "Full C/C++ Indexer (declarations and cross references)" .Also the same in Window->Prefs->C/C++ -> Indexer.
  8. Add path to MPI header files under Window->Preferences->MPI
Now code your MPI Program or open an existing code by importing it into the project. When coding is complete,



First Posted: Feb 24 2006. Last Major Update: Mar 3 2006 Last Minor Update: Apr 1 2006 Credits: 10

Page last revised:Monday March 31, 2008

Valid HTML 4.01 Transitional