Eclipse PTP

General Information

The PTP project provides an integrated development environment to support the development of parallel applications written in C, C++, and Fortran. Eclipse PTP provides:

  • Support for the MPI, OpenMP and UPC programming models
  • Support for a wide range of batch systems and runtime systems, including PBS/Torque, LoadLeveler, GridEngine, Parallel Environment, Open MPI, and MPICH2
  • A scalable parallel debugger
  • Support for the integration of a wide range of parallel tools

from PTP Home

Eclipse PTP Instructions

The following instructions show how to install, update, and configure PTP so that it can be used at the CRC. It also lists the steps one should do in order to successfully build an MPI program with Eclipse PTP and create a Run Configuration so that the program can be executed. This tutorial emphasizes mainly on using MPI with Eclipse PTP and these instructions will work for Mac OSX and Linux. Currently, there is a problem when creating a Run Configuration on a Windows system, but the rest of the steps should be the same in Windows. If you want to use Eclipse PTP for other types of programs and are experiencing difficulties, please e-mail User Support at CRCSupport@nd.edu for assistance.

Installing and Updating Eclipse PTP

  1. Download Eclipse with PTP from here.

    Note: This will download a full executable of Eclipse with PTP. If you already have Eclipse installed, you can install PTP separately by following these instructions.

  2. After download is complete, extract the contents of the folder to desired location.

  3. Navigate to the folder and select the eclipse executable.

  4. While eclipse is loading, it will prompt you for a location to use as your workspace. The default is fine, but if a different location is prefered, one can change the location here.

  5. After eclipse completes loading, go to Help -> Install New Software

  6. In the Work With section, choose PTP.

  7. To update PTP, one can select the different components one wants to update, but it is usually easier to Select All the components. This will ensure all the components are up-to-date.

  8. Click Next to go to the next screen.

  9. Click Next again to go to the next screen.

  10. Accept the Terms and Conditions and then click Finish.

Using Eclipse PTP at the CRC

The instructions listed here use a sample MPI "Hello World" program I created. If you would like to follow these instructions with the sample program, you can download the sample from here.

Creating a Project

  1. Select File -> New -> Other.

  2. Under Remote select Synchronized C/C++ Project and click Next >.

  3. Enter the Project name.

  4. In the Remote directory section, under Connection select New.

  5. A screen will come up called General Remote Host.

  6. Under Target name, enter the name you want to give to the connection.

  7. Under Host Information, make sure Remote host is selected.

  8. In the Host field, enter the remote connection name.

    Note: In order for a Synchronized project to work, the remote host is required to have eGit installed. Currently opteron, crcfe01, and crcfe02* have RHEL 5 installed and that version of Red Hat does not have eGit. There are currently several faculty owned front end machiens and a test front end machine that have RHEL 6 installed. If you would like to use a faculty owned front end machine, one will require permission from the faculty. The test front end machine can be used by anyone and its connection name is crcfe01.crc.nd.edu*.

  9. In the User field, enter your ND NetID.

  10. Make sure Password based authentication is selected and enter your password in the Password field.

  11. Select Finish and the Target name you chose for the connection should now appear in the drop down list in Connection.

  12. In the Remote Directory field, select Browse to go to the directory you would like to use to save the synchronized files of the project.

  13. After the connection has been established to the Remote Host and you have selected the Project Location, press OK.

  14. Under the Project Type section select Makefile project -> Empty Project.

  15. Under the Remote Toolchain and Local Toolchain sections select ---Other Toolchain---. If ---Other Toolchain--- is not listed, uncheck the Show projects types and toolchains .... It should now appear.

  16. Click Finish.

*This machine has Infiniband and is only accessible from the campus network or VPN

Building an MPI Project

  1. If you want to build the sample MPI program, follow these steps to get the files into your project.

    1. Open the location you are using as your workspace for Eclipse PTP.

    2. Open the folder corresponding to the Project name of the project.

    3. Open the folder that contains the sample MPI "Hello World" program.

    4. Copy the necessary files for the program to compile correctly. These are helloworld.c and makefile. There are other files such as hello.script and the helloworld executable. You can use the hello.script for a later step in the tutorial, but it is pretty simple to create your own.

    5. Once the files have been copied to your Project folder, go to the Project Explorer in Eclipse.

    6. Left click the Project name and select Synchronization -> Sync All Now.

    7. Make sure the files are listed in the project.


    If you would like to create your own source code, follow these steps.

    1. Left Click the Project Name and select New -> Source File.

    2. Under the Source folder section, make sure the project for which you want to create a source file is selected. If not, select Browse to go to the project location.

    3. Under the Source file section, enter what you would like to name the source file. Make sure you end the name with .c e.g. helloworld.c.

    4. Select Finish.

    5. Now the source file should be created and you will be able to write your code.

    6. Once you are done writing the program, Synchronize the project by left clicking the Project name and select Synchronization -> Sync All Now.

      Note: Since we have chosen an Empty makefile project, you will be required to create your own makefile in order for the project to compile correctly. I have included a makefile in the sample program. There are multiple websites online that show how to create a makefile if you are not familiar with them. There are also other Project type options one can use that can create the makefile automatically, but they are not covered in this tutorial.

  2. After the project is ready to build, right click the Project name under Project Explorer and select Properties.

  3. Select C/C++ Build -> Environment Management.

  4. Make sure Default_remote [Active] is selected under the Configuration field.

  5. Check the box pertaining to Use an environment management system to customize the remote build environment. This will produce a list of the installed modules in the remote connection.

  6. Check the module that you want to be loaded for building the project. For the sample project, choose ompi/1.6.0-intel. If the list does not come up, you can close the Properties screen and open it again. This sometimes helps to get the list to show.

  7. Click Apply.

  8. Go to C/C++ General -> Paths and Symbols in the left sidebar.

  9. Make sure Default_remote[Active] is selected under the Configuration field.

  10. In the tab Includes, under the Languages section, choose GNU C.

  11. Under the Include directories section, you will need to tell Eclipse where to find the required include files in order to build the MPI program. Since we are building the project in the Remote Host, you will need to tell Eclipse where the include files are located in the remote system. To do this, do the following step:

    1. Select Add.... The Add directory path screen will appear.

    2. In the Directory field, enter the path of the include files of the OpenMPI compiler in the remote system or whichever compiler you are using. To do this, type the following: //Target_name/directory_path. Where Target_name refers to the name you gave the remote connection and directory_path is the path to the include files in the remote connection. For example, for the MPI program, I want to use ompi/1.6.0-intel. So I entered //CRCFE/opt/crc/openmpi/1.6.0/intel-12.1/include.

    3. Select OK.

    4. If there are any more include files that your project requires, follow the previous steps to add the directories.

      Note: In general, you should also include the /usr/include directory of the remote system. Also, if you do not know which include directories to include, it is a good idea to include the directories of the modules that are loaded for the project you are trying to compile. For example, when I do module load ompi/1.6.0-intel, it also loads the module intel/12.1. So it might be a good idea to also use the include files of the Intel compiler. If you do not know where the include files are located, you can type module show module_name to find out where the module is located.

    5. After all the include directories have been added under the Include directories section, go to the Library Paths tab. For the sample MPI program I have provided, the include directories that should be listed are //CRCFE/opt/crc/intel/12.1/include(Intel compiler include files), //CRCFE/usr/include(General include files), //CRCFE/opt/crc/openmpi/1.6.0/intel-12.1/include(OpenMPI include files).

  12. In the Library Path section, add the directories that contain the libraries of the modules you will use to compile the project. The library directories are added in the same way as the include directories. In the sample MPI project, we are using ompi/1.6.0-intel which also loads intel/12.1, so we need to add the directories that contain the libraries of these two modules. You can find the location of the library files with the module show module_name command when logged in to front end machine.

  13. After the include and library files have been added, select Apply and then OK.

  14. When prompted to rebuild the index, click Okay.

  15. Afterwards, Synchronize the project by right clicking the Project name and select Synchronization -> Sync All Now. Also, try to save the project if the option is available. It would give an error when trying to compile if the project was not saved.

  16. After the project has been Synchronized and Saved(if possible), the project is ready to build by either pressing the icon that looks like a hammer in the task bar or going to Project -> Build Project.

Running Project on Cluster

  1. After the project builds successfully, go to Run -> Run Configuration

  2. In the Run Configuration window, click Parallel Application and then click the New icon.

  3. A run configuration with the same name as project will be created.

  4. In the run configuration, for Target System Configuration select Grid Engine-Generic-Batch.

  5. For the Connection name: field, select the Target name of the connection you created or used for the project.

  6. Go to the Import Grid Engine Script tab.

  7. In the Script Path field, select Browse Workspace to find the submission script for the project.

  8. Select the submission script that you created in your Local computer for the project. If using the sample MPI program I provided, you can use the script that came in the zip file. Make sure to edit the header information accordingly. Also, make sure the submission script was originally in the project's folder.

  9. Click Open to open the submission script. The script should now appear under the Relevant Environment Settings section.

  10. Select Apply.

  11. Go to the Application tab.

  12. Under the Project field, make sure the project you want to run is listed, if not use the Browse button to select the correct project.

  13. Under the Application program field, select the Browse button to navigate to the location of the executable that was created when the project was built.

  14. Slect Run.

The program should be sent to the scheduler and job will be run as if one used the qsub command. Also, after the job completes, the output files will be in the directory you specified to be used for the project on the Remote Host. If you want to view the output files in the Local Host, you will need to Synchronize the project in order to get the files copied back to the Local Host.