This eclipse is a modified version of:
eclipse-parallel-indigo-SR2-incubation-linux-gtk-x86_64.tar.gz or
eclipse-parallel-indigo-SR2-incubation-macosx-cocoa-x86_64.tar.gz or
Modifications include the updated PTP projects in the dropins folder.

THESE INSTRUCTIONS MIGHT BE OUT OF DATE! FOR THE LATEST VERSION,
GO TO http://www.paratools.com/eclipse

------------------------------------------------------
  Using Eclipse PTP with ALCF BG/P and BG/Q support:
  Configuring a Resource Manager
------------------------------------------------------

To launch eclipse, change to the eclipse directory and run the eclipse
executable. For the first launch, run eclipse with the "-clean" parameter.

$ cd eclipse
$ ./eclipse -clean

When prompted to select a workspace location, enter a location for your
local eclipse workspace. When the main welcome window appears, click on 
the "Workbench: Go To Workbench" icon.

To configure a connection to an ALCF resource, such as Surveyor, do the
following:

1) change to the "System Monitoring" Perspective. In the Main Menu, select
the Window -> Open Perspective -> Other... option, then select "System
Monitoring".

2) in the "Resource Managers" tab, right-click with the mouse and select
the "Create "Add Resource Manager" item.

3) in the "Choose Resource Manager Type" window, choose the
"gov.anl.alcf.bgp.batch" item, and select "Next".

4) In the "Control Connection configuration" window, select the following:
   Remote service provider: Remote Tools
   Connection Name: select the "New..." button.

5) In the "Generic Remote Host" sub-window, enter a meaningful name, such
as "Surveyor" in the "Target Name" field. In the "Host Information" area,
enter:

Remote Host (selected)
Host: surveyor.alcf.anl.gov
User: your username

Do not enter the password here, you will be prompted for it.  For Surveyor, 
you can also configure a public key authentication method.  For Intrepid or 
Challenger, select the "password" method, as public key method will not 
work. Press "finish" to accept the configuration.

6) Back in the "Control Connection Configuration", confirm that your new
host is selected in the "Connection Name" selection box, and press the
"Next" button.

7) In the "Monitor Connection configuration" window, press "Next".

8) In the "Common Resource Manager Configuration" window, you can accept
the default name or (better) un-check the "Use default name and description"
box and enter a more meaningful name in the "Name" text box. Press
"Finish" to accept your new connection.

9) To start and test the new connection, double-click with the mouse on the
new Resource Manager, or right-click with the mouse and select the "Start
Resource Manager" item.

---!!! WARNING !!!---
Due to a bug(?) in Eclipse PTP, if you enter the password incorrectly,
you might end up in a cryptocard challenge-response reset loop. If that
happens, force-quit eclipse (by killing the application). There is no 
other exit for now...
---!!! WARNING !!!---

After some initialization, you should see the active partitions for the
resource in the "system: hostname" tab. The active running jobs will be 
listed in the "Active Jobs" tab. If you select an active running job, its
job details will appear in the "Further" tab.

--------------------------------------------
  Using Eclipse PTP with ALCF BGP support:
  Creating a synchronized project
--------------------------------------------

Note: Even though we are creating an MPI Fortran application, we will
create it through the C/C++ perspective, to avoid a known bug.

1) Switch to the Remote C/C++ perspective. Under the main menu, select the
"Window -> Open Perspective -> Other..." item. In the "Open Perspective"
window, choose the "Remote C/C++" perspective and press the "OK" button.

2) Create a new project. Right-click with the mouse in the "Project Explorer"
tab, and select the "New... -> Synchronized Fortran Project" item.

3) In the "New Synchronized Project" window, enter a project name in the 
"Project Name" box. Select the "Makefile project -> Demo Calculate Pi - 
Fortran using MPI" option under "Project Type", and select "Other Toolchain"
under the "Toolchains". Press "Next" to continue.

4) In the "Basic Settings" window, enter changes if desired. Press "Next".

5) In the "Select Configurations" window, accept the defaults and press "Next".

6) In the "Configure Remote Synchronization" window, select your configured
resource manager in the "Connection" selection box. In the "Location" field, 
press the "Browse..." button and select a remote location for your project. 
If you enter a new directory, it will be created for you. As the project
primarialy lives on your local system and is synchronized to the server for
building and running, it is advised that you locate it in a scratch area.
For the BG/Q, it is REQUIRED that you locate the project in the scratch
area (/gpfs/veas-fs0/$USER/) if your program writes to disk or if you want
to generate TAU profiles later.

7) For reliable compilation on BGQ, change the Makefile to use mpixlf90 or
mpixlf90_r. To modify the Makefile, expand the project in the "Project
Explorer" sub-window. Double-click the Makefile, make the changes in the
editor, and save the file.

--------------------------------------------
  Using Eclipse PTP with ALCF BGP support:
  Running a synchronized project
--------------------------------------------

1) Select your project in the "Project Explorer" tab. 

2) Build your project by right-clicking with the mouse on your
project name, and select the "Build Project" icon, or by selecting "Project ->
Build Project" in the main menu. Be patient as the build runs locally and on
the remote system.  The build will also run automatically when the run is
submitted.

3) In the main menu, select the "Run -> Run Configurations..." item.

4) In the "Run Configurations" window, double-click with the mouse on the 
"Parallel Application" item.

5) In the "Resources" tab, select your resource manager.

6) In the "Basic PBS Settings" tab, enter the job information. These values
will be passed to the qsub program. For example:

(note about queues - 512 nodes or more are required to run on Intrepid.
For tests, use Surveyor or Challenger.)

Account: some meaningful account
Queue: default
Number of Nodes: 32
BG/P Mode: vn (or BG/Q Mode: c16)

7) In the "Application" tab, select the "Application program" by pressing on
the "Browse" button, and navigating to the project directory on the remote
host, then expand the bin directory to find your executable.

8) In the "Arguments" tab, de-select the "Use default working directory"
checkbox, and browse to your remote project main directory.

9) Run the program by pressing the "run" button.

10) The remote build will (again) happen automatically, and the job will be
submitted.  You can monitor the build process by switching to the "Console" tab
in the bottom sub-window.  There is a current bug in which the job *might* mark
itself COMPLETED in the Eclipse interface as soon as it is submitted. That is
only because it does not show up immediately in the "qstat" results.

11) Switch to the "System Monitoring" perspective, and wait for your job to appear
in the "Active Jobs" tab, and in the system map tab.

12) when the job completes, you can view the output logs by synchronizing the
projects in eclipse. To force synchronization, switch back to the "Remote
C/C++" perspective.  Right-click with the mouse on your project, and select the
"Synchronization -> Sync all now" item. The job cobaltlog, error and output
files should appear in the "Project Explorer" tab.  

--------------------------------------------
  Using Eclipse PTP with ALCF BGP support:
  Profiling with TAU
--------------------------------------------

NOTE:
In order to profile with TAU, make sure TAU is in your path on the remote
system, BY DEFAULT. That is, it should be set in your .bashrc or .cshrc file.
The path to TAU should be set to /soft/apps/tau/tau_latest/bgp/bin on BG/P
systems, and /soft/perftools/tau/tau_latest/bgq/bin on BG/Q.

1) Select your project in the "Project Explorer" tab. 

2) The Makefile for the project has to be modified to use TAU. To modify the
Makefile, double-click the makefile in the project and it will appear in the
editor. Below the ".PHONY" line, add the following lines:

F90=mpif90
CC=mpicc
CXX=mpicxx
include eclipse.inc

For BG/Q, use the compilers mpixlf90_r, mpixlc_r, and mpixlC_r.

Also, change the "all:" build command, replacing "mpif90" with "$(F90)".
Save the Makefile.

3) Create the "eclipse.inc" file. Right-click on the project in the "Project
Explorer" and select "New -> New File" menu item. In the "New File" dialog,
enter "eclipse.inc" in the "File name:" text box. Press "Finish" to create the
file.

4) Optionally, build your project by right-clicking with the mouse on your
project name, and select the "Build Project" icon, or by selecting "Project ->
Build Project" in the main menu. Be patient as the build runs locally and on
the remote system.  The build will also run automatically when the run is
submitted.

5) In the main menu, select the "Profile -> Profile Configurations..." item.

6) In the "Profile Configurations" window, the profiling instructions are
based on the "Run" settings from the previous step.

7) In the "Performance Analysis" tab, in the "Select Tool:" selection box,
select TAU.

8) In the "TAU" tab, select the "Makefile.tau-bgptimers-mpi-pdt" makefile.

9) In the "TAU -> TAU Runtime" internal tab, replace "%%PROJECT_DIR%%" with the
remote path to the main project directory. Otherwise, Eclipse won't find the
profiles (known bug). If you are executing on BG/Q and your project lives in
the /home/$USER, you will need to specify the scratch area for your profiles
(/gpfs/veas-fs0/$USER/).

10) In the "TAU -> Data Collection" tab, select a local database configuration,
and optionally select the "Print Profile Summary" checkbox.

11) Save the settings by pressing the "Apply" button, and submit the request 
by pressing the "Run" button.

12) The remote build will (first to build, then to clean, then to build
with TAU) happen automatically, and the job will be
submitted.  You can monitor the build process by switching to the "Console" tab
in the bottom sub-window.  There is a current bug in which the job *might* mark
itself COMPLETED in the Eclipse interface as soon as it is submitted. That is
only because it does not show up immediately in the "qstat" results.

13) Switch to the "System Monitoring" perspective, and wait for your job to appear
in the "Active Jobs" tab, and in the system map tab.

14) when the job completes, you can view the output logs by synchronizing the
projects in eclipse. To force synchronization, switch back to the "Remote
C/C++" perspective.  Right-click with the mouse on your project, and select the
"Synchronization -> Sync all now" item. The job cobaltlog, error and output
files should appear in the "Project Explorer" tab.  

15) The profiles will be automatically summarized in the console tab, and the
profiles will be uploaded to the local database. To browse the profiled data,

--------------------------------------------
  Using Eclipse PTP with ALCF BGP support:
  Exiting Eclipse
--------------------------------------------

To avoid the cryptocard challenge-response reset loop, stop the Resource
Manager before exiting eclipse. To stop the resource manager, change to
the "System Monitoring" perspective, and right-click with the mouse on the
running resource manager. Select "Stop Resource Manager".

If you do end up in the reset loop, just force terminate eclipse.

