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