Refs trac:1255
This commit repairs the debugger initialization procedure. I am not closing the ticket, however, pending Jeff's review of how it interfaces to the ompi_debugger code he implemented. There were duplicate symbols being created in that code, but not used anywhere. I replaced them with the ORTE-created symbols instead. However, since they aren't used anywhere, I have no way of checking to ensure I didn't break something. So the ticket can be checked by Jeff when he returns from vacation... :-) This commit was SVN r18625. The following Trac tickets were found above: Ticket 1255 --> https://svn.open-mpi.org/trac/ompi/ticket/1255
Этот коммит содержится в:
родитель
9efbec0383
Коммит
c13cadc3c7
@ -64,9 +64,8 @@
|
||||
#include "ompi/datatype/datatype.h"
|
||||
#include "ompi/include/mpi.h"
|
||||
|
||||
OMPI_DECLSPEC int MPIR_being_debugged = 0;
|
||||
OMPI_DECLSPEC volatile int MPIR_debug_gate = 0;
|
||||
OMPI_DECLSPEC volatile int MPIR_debug_state = 0;
|
||||
#include "orte/util/totalview.h"
|
||||
|
||||
#if defined(OMPI_MSGQ_DLL)
|
||||
/* This variable is old/deprecated -- the mpimsgq_dll_locations[]
|
||||
method is preferred because it's more flexible */
|
||||
@ -85,14 +84,6 @@ OMPI_DECLSPEC int MPIR_debug_typedefs_sizeof[] = {
|
||||
sizeof(size_t)
|
||||
};
|
||||
|
||||
struct MPIR_PROCDESC {
|
||||
char *host_name; /* something that can be passed to inet_addr */
|
||||
char *executable_name; /* name of binary */
|
||||
int pid; /* process pid */
|
||||
};
|
||||
OMPI_DECLSPEC struct MPIR_PROCDESC *MPIR_proctable = NULL;
|
||||
OMPI_DECLSPEC int MPIR_proctable_size = 0;
|
||||
|
||||
/**
|
||||
* There is an issue with the debugger running on different architectures
|
||||
* compared with the debugged program. We need to know the sizes of the types
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/runtime/opal_progress.h"
|
||||
#include "opal/class/opal_pointer_array.h"
|
||||
|
||||
#include "opal/dss/dss.h"
|
||||
#include "orte/util/show_help.h"
|
||||
@ -47,14 +48,10 @@
|
||||
#include "orte/runtime/runtime.h"
|
||||
#include "orte/runtime/orte_locks.h"
|
||||
#include "orte/runtime/orte_wait.h"
|
||||
|
||||
#include "orte/util/name_fns.h"
|
||||
|
||||
|
||||
#include "orte/util/totalview.h"
|
||||
#include "orte/util/nidmap.h"
|
||||
#include "opal/class/opal_pointer_array.h"
|
||||
|
||||
|
||||
#include "orte/tools/orterun/totalview.h"
|
||||
|
||||
#include "orte/mca/plm/base/plm_private.h"
|
||||
#include "orte/mca/plm/base/base.h"
|
||||
@ -217,10 +214,9 @@ int orte_plm_base_launch_apps(orte_jobid_t job)
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* init the debuggers */
|
||||
#if 0
|
||||
/* init any debuggers */
|
||||
orte_totalview_init_after_spawn(job);
|
||||
#endif
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_plm_globals.output,
|
||||
"%s plm:base:launch completed for job %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
|
@ -39,7 +39,6 @@ endif # OMPI_INSTALL_BINARIES
|
||||
orterun_SOURCES = \
|
||||
main.c \
|
||||
orterun.c \
|
||||
orterun.h \
|
||||
totalview.c \
|
||||
totalview.h
|
||||
orterun.h
|
||||
|
||||
orterun_LDADD = $(top_builddir)/orte/libopen-rte.la
|
||||
|
@ -71,6 +71,7 @@
|
||||
#include "orte/util/pre_condition_transports.h"
|
||||
#include "orte/util/session_dir.h"
|
||||
#include "orte/util/name_fns.h"
|
||||
#include "orte/util/totalview.h"
|
||||
|
||||
#include "orte/mca/odls/odls.h"
|
||||
#include "orte/mca/plm/plm.h"
|
||||
@ -90,7 +91,6 @@
|
||||
#include "orte/orted/orted.h"
|
||||
|
||||
#include "orterun.h"
|
||||
#include "totalview.h"
|
||||
|
||||
/*
|
||||
* Globals
|
||||
@ -599,6 +599,9 @@ static void job_completed(int trigpipe, short event, void *arg)
|
||||
}
|
||||
}
|
||||
|
||||
/* if the debuggers were run, clean up */
|
||||
orte_totalview_finalize();
|
||||
|
||||
/* the job is complete - now setup an event that will
|
||||
* trigger when the orteds are gone and tell the orteds that it is
|
||||
* okay to finalize and exit, we are done with them.
|
||||
@ -1100,7 +1103,7 @@ static int parse_globals(int argc, char* argv[], opal_cmd_line_t *cmd_line)
|
||||
/* Do we want a user-level debugger? */
|
||||
|
||||
if (orterun_globals.debugger) {
|
||||
orte_run_debugger(orterun_basename, cmd_line, argc, argv);
|
||||
orte_run_debugger(orterun_basename, cmd_line, argc, argv, orterun_globals.num_procs);
|
||||
}
|
||||
|
||||
/* Allocate and map by node or by slot? Shortcut for setting an
|
||||
|
@ -36,7 +36,8 @@ headers += \
|
||||
util/dash_host/dash_host.h \
|
||||
util/comm/comm.h \
|
||||
util/nidmap.h \
|
||||
util/show_help.h
|
||||
util/show_help.h \
|
||||
util/totalview.h
|
||||
|
||||
libopen_rte_la_SOURCES += \
|
||||
util/error_strings.c \
|
||||
@ -51,5 +52,6 @@ libopen_rte_la_SOURCES += \
|
||||
util/dash_host/dash_host.c \
|
||||
util/comm/comm.c \
|
||||
util/nidmap.c \
|
||||
util/show_help.c
|
||||
util/show_help.c \
|
||||
util/totalview.c
|
||||
|
||||
|
@ -25,8 +25,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ORTE_OUTPUT_H_
|
||||
#define _ORTE_OUTPUT_H_
|
||||
#ifndef _ORTE_SHOW_HELP_H_
|
||||
#define _ORTE_SHOW_HELP_H_
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/types.h"
|
||||
|
@ -67,20 +67,13 @@
|
||||
#include "orte/runtime/runtime.h"
|
||||
#include "orte/runtime/orte_globals.h"
|
||||
|
||||
#include "orterun.h"
|
||||
#include "totalview.h"
|
||||
#include "orte/util/totalview.h"
|
||||
|
||||
/* +++ begin MPICH/TotalView interface definitions */
|
||||
|
||||
#define MPIR_DEBUG_SPAWNED 1
|
||||
#define MPIR_DEBUG_ABORTING 2
|
||||
|
||||
struct MPIR_PROCDESC {
|
||||
char *host_name; /* something that can be passed to inet_addr */
|
||||
char *executable_name; /* name of binary */
|
||||
int pid; /* process pid */
|
||||
};
|
||||
|
||||
struct MPIR_PROCDESC *MPIR_proctable = NULL;
|
||||
int MPIR_proctable_size = 0;
|
||||
int MPIR_being_debugged = 0;
|
||||
@ -92,14 +85,6 @@ volatile int MPIR_acquired_pre_main = 0;
|
||||
|
||||
/* --- end MPICH/TotalView interface definitions */
|
||||
|
||||
/*
|
||||
* NOTE: The job description in the registry will likely evolve to use
|
||||
* the "jobgrp_t", but this works for now.
|
||||
*
|
||||
* An initial skeleton of how to implement this with jobgrp_t is
|
||||
* available in SVN as orte/tools/orterun/totalview.c, version 7075.
|
||||
*/
|
||||
|
||||
|
||||
#define DUMP_INT(X) fprintf(stderr, " %s = %d\n", # X, X);
|
||||
|
||||
@ -130,7 +115,7 @@ static void dump(void)
|
||||
* new_argv.
|
||||
*/
|
||||
static int process(char *orig_line, char *basename, opal_cmd_line_t *cmd_line,
|
||||
int argc, char **argv, char ***new_argv)
|
||||
int argc, char **argv, char ***new_argv, int num_procs)
|
||||
{
|
||||
int i;
|
||||
char *line, *full_line = strdup(orig_line);
|
||||
@ -212,7 +197,7 @@ static int process(char *orig_line, char *basename, opal_cmd_line_t *cmd_line,
|
||||
asprintf(&tmp, "%s%s%s", line, user_argv, line + i + 14);
|
||||
} else if (0 == strncmp(line + i, "@np@", 4)) {
|
||||
line[i] = '\0';
|
||||
asprintf(&tmp, "%s%d%s", line, orterun_globals.num_procs,
|
||||
asprintf(&tmp, "%s%d%s", line, num_procs,
|
||||
line + i + 4);
|
||||
used_num_procs = true;
|
||||
} else if (0 == strncmp(line + i, "@single_app@", 12)) {
|
||||
@ -276,7 +261,7 @@ static int process(char *orig_line, char *basename, opal_cmd_line_t *cmd_line,
|
||||
/* We do not support launching a debugger that requires the
|
||||
-np value if the user did not specify -np on the command
|
||||
line. */
|
||||
if (used_num_procs && 0 == orterun_globals.num_procs) {
|
||||
if (used_num_procs && 0 == num_procs) {
|
||||
orte_show_help("help-orterun.txt", "debugger requires -np",
|
||||
true, (*new_argv)[0], argv[0], user_argv,
|
||||
(*new_argv)[0]);
|
||||
@ -321,7 +306,7 @@ static int process(char *orig_line, char *basename, opal_cmd_line_t *cmd_line,
|
||||
* Run a user-level debugger
|
||||
*/
|
||||
void orte_run_debugger(char *basename, opal_cmd_line_t *cmd_line,
|
||||
int argc, char *argv[])
|
||||
int argc, char *argv[], int num_procs)
|
||||
{
|
||||
int i, id;
|
||||
char **new_argv = NULL;
|
||||
@ -350,7 +335,7 @@ void orte_run_debugger(char *basename, opal_cmd_line_t *cmd_line,
|
||||
free(value);
|
||||
for (i = 0; NULL != lines[i]; ++i) {
|
||||
if (ORTE_SUCCESS == process(lines[i], basename, cmd_line, argc, argv,
|
||||
&new_argv)) {
|
||||
&new_argv, num_procs)) {
|
||||
break;
|
||||
}
|
||||
}
|
@ -25,13 +25,25 @@
|
||||
BEGIN_C_DECLS
|
||||
|
||||
void orte_run_debugger(char *basename, opal_cmd_line_t *cmd_line,
|
||||
int argc, char *argv[]) __opal_attribute_noreturn__;
|
||||
int argc, char *argv[], int num_procs) __opal_attribute_noreturn__;
|
||||
void orte_totalview_init_before_spawn(void);
|
||||
void orte_totalview_init_after_spawn(orte_jobid_t jobid);
|
||||
void orte_totalview_finalize(void);
|
||||
|
||||
ORTE_DECLSPEC extern void *MPIR_Breakpoint(void);
|
||||
|
||||
struct MPIR_PROCDESC {
|
||||
char *host_name; /* something that can be passed to inet_addr */
|
||||
char *executable_name; /* name of binary */
|
||||
int pid; /* process pid */
|
||||
};
|
||||
|
||||
ORTE_DECLSPEC extern struct MPIR_PROCDESC *MPIR_proctable;
|
||||
ORTE_DECLSPEC extern int MPIR_proctable_size;
|
||||
ORTE_DECLSPEC extern int MPIR_being_debugged;
|
||||
ORTE_DECLSPEC extern volatile int MPIR_debug_state;
|
||||
ORTE_DECLSPEC extern volatile int MPIR_debug_gate;
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* ORTERUN_TOTALVIEW_H */
|
Загрузка…
Ссылка в новой задаче
Block a user