Adding a simple hook for TotalView that is activated if a particular MCA
parameter is set. orterun/MPI integration still not quite working. This commit was SVN r7097.
Этот коммит содержится в:
родитель
ced11250e4
Коммит
a5d9199e7f
@ -81,6 +81,13 @@ opal_thread_t *ompi_mpi_main_thread = NULL;
|
|||||||
|
|
||||||
bool ompi_mpi_maffinity_setup = false;
|
bool ompi_mpi_maffinity_setup = false;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Variables for TotalView-like debuggers
|
||||||
|
*/
|
||||||
|
int MPIR_being_debugged = 0;
|
||||||
|
volatile int MPIR_debug_gate = 0;
|
||||||
|
volatile int MPIR_debug_state = 0;
|
||||||
|
|
||||||
|
|
||||||
int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
|
int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
|
||||||
{
|
{
|
||||||
@ -89,6 +96,7 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
|
|||||||
size_t nprocs;
|
size_t nprocs;
|
||||||
char *error = NULL;
|
char *error = NULL;
|
||||||
bool compound_cmd = false;
|
bool compound_cmd = false;
|
||||||
|
int wait_for_totalview;
|
||||||
|
|
||||||
/* Join the run-time environment - do the things that don't hit
|
/* Join the run-time environment - do the things that don't hit
|
||||||
the registry */
|
the registry */
|
||||||
@ -140,6 +148,21 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Setup process affinity */
|
/* Setup process affinity */
|
||||||
|
|
||||||
if (ompi_mpi_paffinity_alone) {
|
if (ompi_mpi_paffinity_alone) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user