Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

PTP/designs/new sdm

< PTP‎ | designs
Revision as of 13:29, 9 May 2008 by G.watson.computer.org (Talk | contribs) (Initialization)

Overview

This document describes the changes to the scalable debug manager that are proposed for the PTP 2.1 release. It should be read in conjunction with the Scalable Debug Manager design document.

The major changes to the SDM for the 2.1 release are:

  • Remove dependency on OpenMPI for debugger startup
  • Remove dependency on MPI communication primitives
  • Allow communication infrastructure to be pluggable
  • Clean separation of protocol specific and protocol independent components
  • Support for I/O forwarding

Startup

The communications network comprises a master process and a number of server processes. To debug an N process application, N+1 debugger processes are started (1 master and N server processes.) SDM startup occurs in two phases: the master process is started; then the server processes are started. When debugging an application using PTP, the resource manager is responsible for coordinating this startup.

Master Process Launch

The master process could be located anywhere, but since it needs to be able to communicate with both the debugger front-end and the server processes, it will normally be launched on the system login node (the location specified in the resource manager configuration). When it is launched, the master process is passed arguments specifying an arbitrary connection string. The master process then calls sdm_master_init() and passes this connection string as a parameter. If the call to sdm_master_init() is successful, the master will repeatedly call sdm_master_progress() to process incoming messages from the front-end.

The default implementation of sdm_master_init() requires a connection string that specifies the TCP/IP address of the front-end and port number to connect to. It will attempt to connected this address a predetermined number of times, returning and error if the connection is unsuccessful.

Server Process Launch

The server processes will be controlling the application, so need to be located on the same nodes as the application processes. It is assumed that the server processes will be launched by the same runtime system that is used to launch normal applications (typically MPI). Server processes are passed an arbitrary connection string as an argument. Each server process will call sdm_server_init() and pass this connection string as a parameter. If the call to sdm_server_init() is successful, it will return an ID in the interval [0, N-1] that is guaranteed to be unique across all server processes. The server will then repeatedly call sdm_server_progress() to process incoming messages from the parent servers.

In the default implementation of sdm_server_init() the connection string will comprise a random non-privileged TCP/IP port number. Each server will attempt to bind to this port number. If the port number is in use, then the server will increment the port number and try to bind again. This will be repeated until the server finds an available port number. Once the server processes are started, they will wait for incoming connections on the port. The unique ID will be obtained via an environment variable that is passed to the server process by the runtime system.

Initialization

As soon as it starts, the master connects to the front-end. This serves to notify the front-end that the debugger is ready for initialization. The initialization process then proceeds as follows:

  1. The front-end waits until it has received notification from the runtime that all N server processes have started.
  2. The front-end queries the model to build a routing table. The routing table consists of N entries that are indexed by the server ID (not the Unix PID). Each entry consists of the address of the host on which the server process is located.
  3. The first command sent by the front-end to the master is a global initialization command that supplies the routing table to all processes.
  4. The master process establishes connections to its immediate children by calling sdm_connect_children().
  5. The master process then sends the initialization command to the children by calling sdm_send_to_children().
  6. The master's child server processes will receive a connection followed by an initialization message.
  7. The server processes will establish connections to their immediate children by calling sdm_connect_children() and then forward the initialization message by calling sdm_send_to_children().
  8. This process will repeat until all servers have been initialized.
  9. Each server process will generate an acknowledgment event and pass it back to its parent by calling sdm_send_to_parent().
  10. The front-end will eventually receive an aggregated event indicating all servers are initialized, or that some kind of error occurred (for example, a server could not be contacted.)
  11. Assuming the front-end initialization was successful, the front-end will finish the initialization phase.

In the default implementation, sdm_connect_to_children() will compute the each process's location in a binomial tree. The ID of each child process will then be used to index the routing table in order to find the IP address of the node on which the child is located. A connection will be attempted on the port number that was previously supplied to the server processes. If unsuccessful, the port number will be incremented and another connection will be attempted after a delay period. This will continue for a predetermined number of times, or until a successful connection is established.

Operation

Once the front-end has received confirmation that the servers have been successfully started, it will enter normal operating mode. This mode starts by notifying the debug servers about the application they will be debugging, and then continuously processes commands initiated by user interaction, and events that are generated as a result of the commands.

Debugger operation consists of the following:

  1. The PDI startDebugger() is called to pass the application executable name and arguments to the server processes. Depending on the startup mode, this will also indicate that the debugger should attach to existing application processes.
  2. If the "Stop at main() on startup" option is selected, setFunctionBreakpoint() will be called to insert a breakpoint in main(), then start() will be called to start the application execution.
    • The event generated as a result of the breakpoint being reached will be sent back to the front-end to indicate that operation can continue.
  3. The debugger will now forward commands and process events normally.

Back to the top