Commit f8c10ad9 authored by pugmire's avatar pugmire
Browse files

Added -debug_engine_rank option to specify debug logs for a particular rank.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@6018 18c085ea-50e0-402c-830e-de6fd14e8384
parent 8a37a3ad
......@@ -407,6 +407,9 @@ exec perl -x $0 ${1+"$@"};
# Jeremy Meredith, Wed Dec 3 15:52:00 EST 2008
# Added a little warning to -sshtunneling.
#
# Dave Pugmire, Thu Jan 15 16:43:07 EST 2009
# Add -debug_engine_rank option.
#
###############################################################################
use POSIX qw(ceil);
......@@ -750,10 +753,13 @@ $fullusage = "$usage
-debug <level> Run with <level> levels of output logging.
<level> must be between 1 and 5. This will generate
debug logs for ALL components.
-debug_<compname> <level> Run specified component with <level> of output
-debug_<compname> <level>
Run specified component with <level> of output
logging. For example, '-debug_mdserver 4' will run
the mdserver with level 4 debugging. Multiple
'-debug_<compname> <level>' args are allowed.
-debug_engine_rank <r>
Restrict debug output to the specified rank.
-clobber_vlogs By default, each invokation or restart of a VisIt
component will write its debug logs to new files.
This flag causes VisIt to overwrite existing debug
......
......@@ -62,14 +62,21 @@
static void RemovePrependedDirs(const char *, char *);
static char executableName[256];
static char componentName[256];
static const char *AVTPREP = "avtprep";
static const char *CLI = "cli";
static const char *ENGINE = "engine";
static const char *GUI = "gui";
static const char *LAUNCHER = "launcher";
static const char *MDSERVER = "mdserver";
static const char *VIEWER = "viewer";
static const char *const allComponentNames[] = {
"avtprep",
"cli",
"engine",
"gui",
"launcher",
"mdserver",
"viewer"
AVTPREP,
CLI,
ENGINE,
GUI,
LAUNCHER,
MDSERVER,
VIEWER
};
static ErrorFunction errorFunction = NULL;
static void *errorFunctionArgs = NULL;
......@@ -205,6 +212,10 @@ NewHandler(void)
// times as when you include multiple VisIt components in a single
// executable.
//
// Dave Pugmire, Thu Jan 15 16:35:08 EST 2009
// Add support for -debug_engine_rank, limiting debug output to the specified
// rank.
//
// ****************************************************************************
void
......@@ -215,7 +226,7 @@ VisItInit::Initialize(int &argc, char *argv[], int r, int n, bool strip, bool si
return;
initializeCalled = true;
int i, debuglevel = 0;
int i, debuglevel = 0, engineDebugRank=-1;
#if defined(_WIN32)
bool usePid = true;
#else
......@@ -226,6 +237,32 @@ VisItInit::Initialize(int &argc, char *argv[], int r, int n, bool strip, bool si
bool enableTimings = false;
for (i=1; i<argc; i++)
{
if (strcmp("-debug_engine_rank", argv[i]) == 0)
{
engineDebugRank = -1;
if (i+1 < argc && isdigit(*(argv[i+1])))
engineDebugRank = atoi(argv[i+1]);
else
cerr<<"Warning: debug engine rank not specified. Igorning.\n";
if (engineDebugRank >= n)
{
cerr<<"Warning: clamping debug engine rank to "<<n-1<<endl;
engineDebugRank = n-1;
}
else if (engineDebugRank < 0)
{
cerr<<"Warning: clamping debug engine rank to 0\n";
engineDebugRank = 0;
}
if(strip)
{
striparg(i,2, argc,argv);
--i;
}
else
++i;
}
if (strncmp("-debug",argv[i],6) == 0)
{
if ((strlen(argv[i]) > 7 && IsComponent(&argv[i][7])) ||
......@@ -311,6 +348,7 @@ VisItInit::Initialize(int &argc, char *argv[], int r, int n, bool strip, bool si
{
strcpy(progname, progname_wo_dir);
}
if (usePid)
{
#if defined(_WIN32)
......@@ -328,6 +366,13 @@ VisItInit::Initialize(int &argc, char *argv[], int r, int n, bool strip, bool si
if(vtk_debug && strstr(progname,"engine") != NULL && debuglevel < 1)
debuglevel = 1;
// If debug rank specified, and we are not rank 'r', then turn off debuging.
if ((strncmp(progname, ENGINE, strlen(ENGINE)) == 0) &&
engineDebugRank != -1 && engineDebugRank != r)
{
debuglevel = 0;
}
// Initialize the debug streams and also add the command line arguments
// to the debug logs.
DebugStream::Initialize(progname, debuglevel, sigs, clobberVlogs);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment