Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Compiling and Running the Parallel Ocean Program using Photran 5.0, PTP 3.0, and RDT"

Line 5: Line 5:
 
Before you begin, you should install the netcdf library.  It is required to compile POP and can be obtained from http://www.unidata.ucar.edu/software/netcdf/.  
 
Before you begin, you should install the netcdf library.  It is required to compile POP and can be obtained from http://www.unidata.ucar.edu/software/netcdf/.  
  
'''Configuring POP:'''  
+
'''Configuring POP:''' In this set of steps we will extract POP and get our project directory setup for when we create the project in Eclipse.
  
 
1. Download the newest version of the POP source code from http://climate.lanl.gov/Models/POP/.
 
1. Download the newest version of the POP source code from http://climate.lanl.gov/Models/POP/.
Line 15: Line 15:
 
4. Run '''./setup_run_dir test test'''.  This copies the necessary files for testing in the test directory.  Refer to the user manual at http://climate.lanl.gov/Models/POP/UsersGuide.pdf if you want to use a non-testing setup.
 
4. Run '''./setup_run_dir test test'''.  This copies the necessary files for testing in the test directory.  Refer to the user manual at http://climate.lanl.gov/Models/POP/UsersGuide.pdf if you want to use a non-testing setup.
  
'''Obtaining the RDT Server:'''
+
'''Obtaining the RDT Server:''' The rdt-server is run on the remote machine and will be used to connect with Eclipse in the next section.
  
 
1. Download the latest rdt-server package from http://wiki.eclipse.org/PTP/builds/3.0.0 and copy it to your remote machine.
 
1. Download the latest rdt-server package from http://wiki.eclipse.org/PTP/builds/3.0.0 and copy it to your remote machine.
Line 21: Line 21:
 
2. Extract the rdt-server package.
 
2. Extract the rdt-server package.
  
'''Configuring RDT:'''
+
'''Configuring RDT:''' In this section we will create a Remote System Explorer (RSE) connection.  This connection will work with the rdt-server to give us access to files, processes,and shells on the remote machine.
  
 
1. In Eclipse, on the local machine, change to the '''Remote System Explorer''' perspective.
 
1. In Eclipse, on the local machine, change to the '''Remote System Explorer''' perspective.
Line 53: Line 53:
 
At this point you should be connected to your remote machine.  Make sure you can browse the remote machine's files before moving to the next step.  (To browse the files, in the Remote System Explorer perspective, expand your connection -> Files -> My Home and make sure your home directory files are appearing.)
 
At this point you should be connected to your remote machine.  Make sure you can browse the remote machine's files before moving to the next step.  (To browse the files, in the Remote System Explorer perspective, expand your connection -> Files -> My Home and make sure your home directory files are appearing.)
  
'''Creating a Remote Project:'''
+
'''Creating a Remote Project:''' Now that we have access to the files on the remote system, we can make a project using the directory we extracted POP to.
  
 
1. Go to '''File -> New -> Project'''.
 
1. Go to '''File -> New -> Project'''.
Line 83: Line 83:
 
14. Click '''Finish'''.  You should now be able to find the project you created in the '''C/C++ Perspective'''.
 
14. Click '''Finish'''.  You should now be able to find the project you created in the '''C/C++ Perspective'''.
  
'''Configuring the Project:'''
+
'''Configuring the Project:''' In this section, we will setup the environment variables and build directory change necessary to compile POP.
  
 
1. Switch to the '''C/C++ Perspective'''.
 
1. Switch to the '''C/C++ Perspective'''.
Line 101: Line 101:
 
2. Your build path is correct.
 
2. Your build path is correct.
  
'''Creating a Resource Manager:''' In order to run your parallel program remotely, a remote resource manager must be created.
+
'''Creating a Resource Manager:''' In this section, we will create a resource manager, which is used to run our program on the remote machine with the correct instruction (depending on if we want to use MPICH, OpenMPI, etc.).
  
 
1. Switch to the '''PTP Runtime Perspective'''.
 
1. Switch to the '''PTP Runtime Perspective'''.
Line 115: Line 115:
 
If all goes well, the resource manager will start without a problem.  If you get a message saying the resource manager could not be started or an internal error: null argument, remove and create the resource manager again.  Be sure to leave the settings default.
 
If all goes well, the resource manager will start without a problem.  If you get a message saying the resource manager could not be started or an internal error: null argument, remove and create the resource manager again.  Be sure to leave the settings default.
  
'''Creating a Run Configuration for POP:'''
+
'''Creating a Run Configuration for POP:''' Now we will tie together everything we've done so far with a run configuration.
  
 
1. Go to '''Run->Run Configurations...'''
 
1. Go to '''Run->Run Configurations...'''
Line 133: Line 133:
 
8. Click '''Apply''' and then '''Close'''.
 
8. Click '''Apply''' and then '''Close'''.
  
'''Configuring POP (part 2):'''
+
'''Configuring POP (part 2):''' In this section, we will setup some variables that POP uses in its execution.
  
 
1. In your pop/test directory, edit the file pop_in.  There are two lines close to the top that say nprocs_clinic and nprocs_tropic.  Change these to the number of processes you specified in the run configuration.
 
1. In your pop/test directory, edit the file pop_in.  There are two lines close to the top that say nprocs_clinic and nprocs_tropic.  Change these to the number of processes you specified in the run configuration.

Revision as of 13:21, 6 August 2009

This tutorial will walk the user through setting up a photran project with standard makefile with PTP and RDT. The program we will use for this is the Parallel Ocean Program, whose source is freely available from http://climate.lanl.gov/Models/POP/.

Assumptions: I will assume that Photran, PTP, and RDT (and RSE) are already installed. For instructions on installing these, consult the respective project pages.

Before you begin, you should install the netcdf library. It is required to compile POP and can be obtained from http://www.unidata.ucar.edu/software/netcdf/.

Configuring POP: In this set of steps we will extract POP and get our project directory setup for when we create the project in Eclipse.

1. Download the newest version of the POP source code from http://climate.lanl.gov/Models/POP/.

2. Extract this file on your remote system in the desired project location.

3. cd into the directory where you extracted pop

4. Run ./setup_run_dir test test. This copies the necessary files for testing in the test directory. Refer to the user manual at http://climate.lanl.gov/Models/POP/UsersGuide.pdf if you want to use a non-testing setup.

Obtaining the RDT Server: The rdt-server is run on the remote machine and will be used to connect with Eclipse in the next section.

1. Download the latest rdt-server package from http://wiki.eclipse.org/PTP/builds/3.0.0 and copy it to your remote machine.

2. Extract the rdt-server package.

Configuring RDT: In this section we will create a Remote System Explorer (RSE) connection. This connection will work with the rdt-server to give us access to files, processes,and shells on the remote machine.

1. In Eclipse, on the local machine, change to the Remote System Explorer perspective.

2. On the left side of the screen, look for something similar to the following:

Rsepane.png

3. Click on the new remote connection icon Newrseconnectionicon.png.

4. In the wizard that pops up, select the type of connection you need. For the purpose of this tutorial, we will assume the remote machine uses Linux.

5. On the next page, enter the hostname of the remote machine and a name for the connection.

6. The rest of the default settings should be sufficient, so click Finish.

7. Find the connection you created on the list. Make sure it is expanded (like in the screenshot above) and right click on Files, and then click Properties.

8. Select Server Launcher Settings and make sure this reflects how you plan to run the RDT server on the remote machine. This tutorial will assume you are using a "running" server.

9. Select Subsystem and make sure the port is set to the server port and the user id is your username on the remote host. Click OK.

10. Find the connection you created on the list. Right click on Ssh Terminals, and then click Properties.

11. Click Subsystem and make sure the port is set to the ssh port and the user id is your username on the remote host. Click OK.

12. On the remote machine, start the server by entering the directory and typing perl server.pl [port] where port is the port number you want the server to be running on.

13. Right click on the connection you created. Click Connect. You should now be connected to the remote machine.

At this point you should be connected to your remote machine. Make sure you can browse the remote machine's files before moving to the next step. (To browse the files, in the Remote System Explorer perspective, expand your connection -> Files -> My Home and make sure your home directory files are appearing.)

Creating a Remote Project: Now that we have access to the files on the remote system, we can make a project using the directory we extracted POP to.

1. Go to File -> New -> Project.

2. Expand the Remote category and select New Remote C/C++ Project. Click Next.

3. Type in a name for the project.

4. Uncheck Use default location.

5. Change the file system from default to RSE and click Browse.

6. Set the Connection to the connection you created previously.

7. Expand My Home and find the directory you extracted POP to. Select it and click OK.

8. Click Next until you get to the Configure Services dialog.

9. Change the Build provider to RDT Remote Build Service. Click Configure.

10. Change the Provider to RSE

11. Change Connection to the connection you created previously. Click OK.

12. Change the C/C++ Indexing Provider to RDT Remote C/C++ Indexing Service. Click Configure.

13. Change the Host to the connection you created previously. Click OK.

14. Click Finish. You should now be able to find the project you created in the C/C++ Perspective.

Configuring the Project: In this section, we will setup the environment variables and build directory change necessary to compile POP.

1. Switch to the C/C++ Perspective.

2. Right click on the project and then click Properties.

3. Click C/C++ Build and change the Build directory field to the path to pop/test on your remote machine. (Ex: /home/rdt-test/pop/test)

4. Expand the C/C++ Build tree and select Environment. Click Add to add an environment variable with the name ARCHDIR and the value linux. Click OK.

5. Click OK in the project properties window to save your changes.

At this point, you should be able to successfully build and clean the project. If you cannot do this, check the following things:

1. The server is running and you have connected to it in the Remote System Explorer perspective.

2. Your build path is correct.

Creating a Resource Manager: In this section, we will create a resource manager, which is used to run our program on the remote machine with the correct instruction (depending on if we want to use MPICH, OpenMPI, etc.).

1. Switch to the PTP Runtime Perspective.

2. Right click in the Resource Managers box and click Add Resource Manager....

3. Choose the resource manager type according to how you plan to run the application on the remote machine. For the purpose of this tutorial, we will use OpenMPI.

4. On the next page, change the remote service provider to RSE and change the connection to the one you created previously. Then click Finish.

5. The resource manager should now show up on the list. Right click on it and then click Start Resource Manager.

If all goes well, the resource manager will start without a problem. If you get a message saying the resource manager could not be started or an internal error: null argument, remove and create the resource manager again. Be sure to leave the settings default.

Creating a Run Configuration for POP: Now we will tie together everything we've done so far with a run configuration.

1. Go to Run->Run Configurations...

2. Double click on Parallel Application to create a new run configuration of that type.

3. Under the Resources tab, select the resource manager you created previously. Change any settings you need to (such as the number of processes).

4. Under the Application tab, change the parallel project to the desired project.

5. Change the Application Program field to point to the pop binary (for example: /home/rdt-test/pop/test/pop).

6. Under the Debugger tab, choose SDM and supply the path to the sdm binary. (note: need to look into this more. does sdm need to be compiled for the remote system? is there an easy way to compile sdm for the remote system?)

7. Under the Arguments tab, type pop_in in the "Parallel program arguments" textbox.

8. Click Apply and then Close.

Configuring POP (part 2): In this section, we will setup some variables that POP uses in its execution.

1. In your pop/test directory, edit the file pop_in. There are two lines close to the top that say nprocs_clinic and nprocs_tropic. Change these to the number of processes you specified in the run configuration.

2. Run POP. You should get a message along the lines of "POP aborting... clinic blocks exceed max: increase max to 92".

3. Edit the file domain_size.F90 in the test directory. Scroll down and set max_blocks_clinic to the number POP suggested previously.

4. Recompile and run again. You should get a message along the lines of "POP aborting... tropic blocks exceed max: increase max to 92".

5. Edit domain_size.F90 again. This time set max_blocks_tropic to the number POP suggested.

6. Recompile.

At this point, everything should be fully configured and ready to run.

Back to the top