Breakpoints Overview

A "breakpoint" makes your program stop whenever a certain point in the program is reached. Setting a breakpoint you specify the place where your program should stop. For each breakpoint, you can add conditions to control in finer detail whether your program stops.

When you debug usual one-process program with a conventional debugger there is only one ‘current’ execution position and if in this position your program should stop because it has reached a breakpoint then it stops provided all the breakpoint conditions are satisfied. With a parallel program the situation is different. Any parallel program consists of more than one process. And each of processes has its own ‘current’ execution position. So in general not all processes reach a place specified by a breakpoint. And what is more a breakpoint can be set as for all the processes of a parallel program as for a group of processes or even for one process only. The processes, for which a breakpoint is set, can be specified by a conditional expression. Conditional expression of a breakpoint can be any syntactically correct mpC Boolean expression but it mustn’t contain function calls, communications and network type conversions, as well as it mustn’t cause side effects. For example if an mpC program contains the following text:

net SimpleNet (N) w;
int my_i_coord;
my_i_coord = I coordof w;

and conditional expression of a breakpoint is

my_I_coord > 0 && my_I_coord < 3

then the breakpoint stops execution of only these processes, which correspond to virtual processors that have 1 and 2 I coordinates within the w network.

Let us consider the situation when some process of a parallel program has stopped at a breakpoint. The other processes can be in one of the following states: continue execution, be stopped at the same breakpoint, be stopped at some other breakpoint, be waiting at a synchronization point and finish execution. Synchronization point is a point at which either a process communicates with other processes or execution is held until all the processes of some group have reached this point. A parallel program stops only if all of its processes stop. At the moment when a parallel program stops the process cursor associated with some process can be either green or red. If the process can be restarted with one of moving commands, for example Go (see Moving Commands), then the process cursor associated with this process is green. Otherwise the process cursor is red. Process cursor can be red if the process is stopped at a synchronization point or if it has finished execution. The processes are combined into compound cursors according to the colors of their cursors and to the lines of source code corresponding to the point at which processes are stopped. That is if some two processes having green cursors stop at the points corresponding to the same line of source code then these two processes belong to one compound cursor.

This chapter explains how to manage breakpoints. The following topics are covered:

See also:

Cursors overview