Share via


How to: Debug a Remote Cluster ApplicationĀ 

This topic applies to:

Visual Studio Edition

Visual Basic

C#

C++

J#

Visual Web Developer

Express

No

No

No

No

No

Standard

No

No

No

No

No

Pro/Team

No

No

Yes

No

No

Visual Studio now supports MPI Cluster Debugging. This feature allows you to debug parallel programs that run on a cluster of computers communicating through the Message Passing Interface (MPI).

Prerequisites for MPI Debugging

  • MPI must be installed and configured on each machine in the cluster. MPI is included with Windows Server 2003, Compute Cluster Edition. Other MPI implementations are available.

  • MPIShim.exe must be installed on each machine in the cluster. MPIShim is included with Visual Studio 2005and is installed with the remote debugging components to enable the parallel debugging. MPIShim can be installed in any directory, but must be in the same directory on each machine in the cluster. One possible path is:

    c:\windows\system32\mpishim

    Alternatively, it can be installed in a directory local to the debug target.

  • The Remote Debugging Monitor (msvsmon) must be on each machine in the cluster. See How to: Run the Remote Debugging Monitor.

  • The Visual Studio host (the machine you are debugging from) must be set up with an account that has the proper privileges to debug the cluster machines. (See Remote Debugging Permissions.)

To prepare a Visual Studio project for MPI debugging

  1. Open the solution containing your parallel application in Visual Studio.

  2. In Solution Explorer, right-click the project and choose Properties from the shortcut menu.

  3. In the Project Properties dialog box, select Debugging.

  4. In the Debugger to Launch listbox, choose MPI Cluster Debugging.

  5. In the MPIRun command box, enter the location of MPIRun or MPIExec (which start the MPI application) on the cluster machine. For example:

    c:\windows\system32\mpiexec.exe

  6. In the MPIRun arguments box, enter any arguments you want to pass to MPIRun or MPIExec. For example:

    -np 2

  7. In the MPIRun working directory box, enter the working directory for MPIRun or MPIExec. For example:

    c:\temp

  8. In the Application Command box, enter the path to the application that MPI will execute on each cluster machine execute (which is also the application whose project you have open in Visual Studio). The path can be a share or a local path on each machine in the cluster. If it is a local path, the path must be identical on each machine. For example:

    $(TargetPath)

  9. In the Application Arguments box, enter any arguments you want to pass to the application.

  10. In the MPIShim location box, enter the path to the MPIShim.exe. For example:

    c:\windows\system32\mpishim

  11. You can leave the Debugger Type listbox set to auto (the default) and the debugger will choose the correct debugger type for the code you are executing. Alternatively, you can choose the correct type (native, managed, or mixed code) for your application.

  12. Close the Project Properties dialog box.

  13. From the Tools menu, choose Options.

  14. In the Options dialog box, select the Debugging node, General category

  15. Find the checkbox When one process breaks, break all other processes. Select or clear the checkbox depending on the behavior you want during your debugging session. (Because this is a Tools option, this setting will remain in effect for all projects until you change it.) For more information, see How to: Break Execution.

  16. Click OK to close the Options dialog box.

To debug your parallel application

  1. On the Debug menu, click Start to begin debugging.

    If you have set up your project correctly, the application begins running on all machines in the cluster.

    If you have set breakpoints in your code, execution will break at the first breakpoint.

  2. On the Debug menu, click Windows, and click Processes.

    The Processes window. You can use this window to set an active process. To step only the single active process, use the step buttons at the top of this window.

    You can use DataTips to get variable values while debugging a parallel application. The variable values you see in DataTips will be based on the current active process set in the Processes window.

See Also

Tasks

How to: Use the Processes Window

Concepts

Debugger Security

Other Resources

Remote Debugging Setup