Add "-tv" option to orterun:
orterun -tv -np 4 foo which will turn around and re-exec: totalview orterun -a -np 4 foo This commit was SVN r7636.
Этот коммит содержится в:
родитель
65698bc6be
Коммит
65f1adfedc
@ -89,3 +89,9 @@ that there are no runaway processes still executing.
|
||||
A prefix was supplied to %s that only contained slashes.
|
||||
|
||||
This is a fatal error; %s will now abort. No processes were launched.
|
||||
[totalview-exec-failed]
|
||||
%s was unable to launch the totalview debugger. Things to check:
|
||||
|
||||
- Ensure that TotalView is installed properly
|
||||
- Ensure that the "totalview" executable is in your path
|
||||
- Ensure that valid licenses are available to run the TotalView debugger
|
||||
|
@ -687,6 +687,7 @@ static int parse_globals(int argc, char* argv[])
|
||||
init_globals();
|
||||
opal_cmd_line_create(&cmd_line, cmd_line_init);
|
||||
mca_base_cmd_line_setup(&cmd_line);
|
||||
orte_totalview_cmd_line_setup(&cmd_line);
|
||||
if (OMPI_SUCCESS != (ret = opal_cmd_line_parse(&cmd_line, true,
|
||||
argc, argv)) ) {
|
||||
return ret;
|
||||
@ -705,6 +706,10 @@ static int parse_globals(int argc, char* argv[])
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* Do we want totalview? */
|
||||
|
||||
orte_totalview_cmd_line_process(&cmd_line, orterun_basename, argc, argv);
|
||||
|
||||
/* Allocate and map by node or by slot? Shortcut for setting an
|
||||
MCA param. */
|
||||
|
||||
|
@ -38,6 +38,9 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <strings.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The environment
|
||||
@ -46,6 +49,8 @@ extern char **environ;
|
||||
|
||||
#include "opal/util/opal_environ.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/class/opal_list.h"
|
||||
#include "mca/base/base.h"
|
||||
#include "mca/errmgr/errmgr.h"
|
||||
@ -111,6 +116,41 @@ static void dump(void)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add "-tv" to the command line parsing options
|
||||
*/
|
||||
void orte_totalview_cmd_line_setup(opal_cmd_line_t *cmd)
|
||||
{
|
||||
opal_cmd_line_make_opt3(cmd, '\0', "tv", "tv", 0,
|
||||
"Convenience option to re-exec under the TotalView debugger");
|
||||
}
|
||||
|
||||
/**
|
||||
* If -tv was given, re-exec under totalview
|
||||
*/
|
||||
void orte_totalview_cmd_line_process(opal_cmd_line_t *cmd, char *basename,
|
||||
int argc, char *argv[])
|
||||
{
|
||||
if (opal_cmd_line_is_taken(cmd, "tv")) {
|
||||
int i;
|
||||
char **new_argv = NULL;
|
||||
printf("found -tv\n");
|
||||
|
||||
opal_argv_append_nosize(&new_argv, "totalview");
|
||||
opal_argv_append_nosize(&new_argv, argv[0]);
|
||||
opal_argv_append_nosize(&new_argv, "-a");
|
||||
for (i = 1; i < argc; ++i) {
|
||||
opal_argv_append_nosize(&new_argv, argv[i]);
|
||||
}
|
||||
|
||||
execvp(new_argv[0], new_argv);
|
||||
opal_show_help("help-orterun.txt", "totalview-exec-failed",
|
||||
true, basename);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialization of data structures for running under a debugger
|
||||
* using the MPICH/TotalView parallel debugger interface. Before the
|
||||
|
@ -19,6 +19,9 @@
|
||||
|
||||
#include "orte_config.h"
|
||||
|
||||
void orte_totalview_cmd_line_setup(opal_cmd_line_t *cmd);
|
||||
void orte_totalview_cmd_line_process(opal_cmd_line_t *cmd, char *basename,
|
||||
int argc, char *argv[]);
|
||||
void orte_totalview_init_before_spawn(void);
|
||||
void orte_totalview_init_after_spawn(orte_jobid_t jobid);
|
||||
void orte_totalview_finalize(void);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user