1
1
openmpi/ompi/debuggers/ompi_totalview.c
David Daniel 227947fc51 Moving MPI-side TotalView support into a separate directory
ompi/debuggers/

so that compilation options can be more easily controlled.

This commit was SVN r7113.
2005-08-31 20:35:15 +00:00

63 строки
1.8 KiB
C

/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* MPI portion of debugger support: TotalView
*/
#include "ompi_config.h"
#include <unistd.h>
#include "opal/mca/base/base.h"
#include "debuggers.h"
int MPIR_being_debugged = 0;
volatile int MPIR_debug_gate = 0;
volatile int MPIR_debug_state = 0;
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;
/**
* Wait for a TotalView-like debugger if asked.
*/
void ompi_wait_for_totalview(void)
{
int wait_for_totalview;
/* Do we need to wait for a TotalView-like debugger? */
mca_base_param_reg_int_name("orte",
"mpi_wait_for_totalview",
"Whether the MPI application "
"should wait for a debugger or not",
false, false, (int) false,
&wait_for_totalview);
if (wait_for_totalview) {
while (MPIR_debug_gate == 0) {
#if defined(WIN32)
sleep(100); /* milliseconds */
#else
usleep(100000); /* microseconds */
#endif
}
}
}