How to: Debug a Remote Cluster Application
This topic applies to:
Edition |
Visual Basic |
C# |
C++ |
Web Developer |
---|---|---|---|---|
Express |
||||
Standard |
||||
Pro and Team |
Table legend:
Applies |
|
Does not apply |
|
Command or commands hidden by default. |
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
Open the solution containing your parallel application in Visual Studio.
In Solution Explorer, right-click the project and choose Properties from the shortcut menu.
In the ProjectProperties dialog box, select Debugging.
In the Debugger to Launch listbox, choose MPI Cluster Debugging.
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
In the MPIRun arguments box, enter any arguments you want to pass to MPIRun or MPIExec. For example:
-np 2
In the MPIRun working directory box, enter the working directory for MPIRun or MPIExec. For example:
c:\temp
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)
In the Application Arguments box, enter any arguments you want to pass to the application.
In the MPIShim location box, enter the path to the MPIShim.exe. For example:
c:\windows\system32\mpishim
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.
Close the ProjectProperties dialog box.
From the Tools menu, choose Options.
In the Options dialog box, select the Debugging node, General category
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.
Click OK to close the Options dialog box.
To debug your parallel application
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.
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