1 /****************************************************************************\
2  *  debugger.h - definitions needed for TotalView interactions
3  *****************************************************************************
4  *  This file was supplied by James Cownie <jcownie@etnus.com> and provides
5  *  information required to interface Slurm to the TotalView debugger from
6  *  the Etnus Corporation. For more information about TotalView, see
7  *  http://www.etnus.com/
8 \*****************************************************************************/
9 
10 #include "config.h"
11 
12 /* This file contains support for bringing processes up stopped, so that
13  * a debugger can attach to them     (done for TotalView)
14  */
15 
16 /* Update log
17  *
18  * Nov 27 1996 jcownie@dolphinics.com: Added the executable_name to MPIR_PROCDESC
19  */
20 
21 #ifndef _DEBUGGER_INCLUDE
22 #define _DEBUGGER_INCLUDE
23 
24 #include "srun_job.h"
25 /*****************************************************************************
26 *                                DEBUGGING SUPPORT                           *
27 *****************************************************************************/
28 
29 
30 /* A little struct to hold the target processor name and pid for
31  * each process which forms part of the MPI program.
32  * We may need to think more about this once we have dynamic processes...
33  *
34  * DO NOT change the name of this structure or its fields. The debugger knows
35  * them, and will be confused if you change them.
36  */
37 
38 typedef struct {
39   char * host_name;           /* Something we can pass to inet_addr */
40   char * executable_name;     /* The name of the image */
41   int    pid;		      /* The pid of the process */
42 } MPIR_PROCDESC;
43 
44 /* Array of procdescs for debugging purposes */
45 extern MPIR_PROCDESC *MPIR_proctable;
46 extern int MPIR_proctable_size;
47 
48 /* Various global variables which a debugger can use for
49  * 1) finding out what the state of the program is at
50  *    the time the magic breakpoint is hit.
51  * 2) inform the process that it has been attached to and is
52  *    now free to run.
53  */
54 extern volatile int MPIR_debug_state;
55 extern int          MPIR_being_debugged; /* Cause extra info on internal state
56 					  * to be maintained
57 					  */
58 #ifdef DEBUGGER_PARTIAL_ATTACH
59 extern int          MPIR_partial_attach_ok;
60 #endif
61 
62 /* Values for the debug_state, this seems to be all we need at the moment
63  * but that may change...
64  */
65 #define MPIR_DEBUG_SPAWNED   1
66 #define MPIR_DEBUG_ABORTING  2
67 
68 /* Slurm specific declarations */
69 extern int MPIR_i_am_starter;
70 extern int MPIR_acquired_pre_main;
71 
72 extern void MPIR_Breakpoint(srun_job_t *job);
73 
74 /* Value for totalview %J expansion in bulk launch string
75  */
76 extern char *totalview_jobid;
77 extern char *totalview_stepid;
78 
79 #endif
80