Saturday, October 30, 2010

Run MPI Programs in Eclipse with 1-Click

  1. Click on the project name in Project Explorer.
  2. Right click and choose "Properties"
  3. Choose "Run/Debug Settings"
  4. Edit one of the launch configurations or create a new one.
  5. Under the tab "Main", change C/C++ Application to be "/usr/local/bin/mpirun"
  6. Go to the tab "Arguments", change the program arguments to be "-np 4 ${workspace_loc:project_name}/Debug/project_name"
Then you can press "Ctrl+F11" to run your MPI program in Eclipse.

Open MPI Installation

In Ubuntu, key in the following command:

 In order to test if your setup is correct, download this sample open MPI file
Then execute the following commands:
where the parameter -np specifies the number of cores you would like to run the test file.