Commit 82faf803 authored by fogal1's avatar fogal1
Browse files

Add a method to help with parallel debugging.

This adds a method, `PAR_WaitForDebugger' which spins until a
developer attaches a debugger to the process with MPI rank 0, and
sets the variable `i' to 0.  Code which calls it should never make
it into a release (or even a commit), but it's useful when you're
trying to debug a parallel problem.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@7174 18c085ea-50e0-402c-830e-de6fd14e8384
parent 91a9f41b
......@@ -245,6 +245,30 @@ PAR_UIProcess(void)
return (par_rank == 0);
}
// ****************************************************************************
// Function: PAR_WaitForDebugger
//
// Purpose:
// Spins indefinitely until a developer loads up a debugger on process 0
// and fixes it.
//
// Programmer: Tom Fogal
// Creation: October 17, 2008
//
// ****************************************************************************
void
PAR_WaitForDebugger(void)
{
volatile int i = 0;
if(PAR_Rank() == 0)
{
do {
// nothing
} while(i == 0);
}
Barrier();
}
// ****************************************************************************
// Function: MinMaxOp
......
......@@ -64,6 +64,7 @@ PIPELINE_API void PAR_Init(int &argc, char **&argv);
PIPELINE_API int PAR_Rank(void);
PIPELINE_API int PAR_Size(void);
PIPELINE_API bool PAR_UIProcess(void);
PIPELINE_API void PAR_WaitForDebugger(void);
PIPELINE_API void SumIntAcrossAllProcessors(int&);
PIPELINE_API void SumFloatAcrossAllProcessors(float&);
PIPELINE_API void SumFloatArrayAcrossAllProcessors(float *, float *, int);
......
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