1
1

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.
Этот коммит содержится в:
David Daniel 2005-08-31 20:35:15 +00:00
родитель c7e9563377
Коммит 227947fc51
7 изменённых файлов: 183 добавлений и 61 удалений

Просмотреть файл

@ -1648,6 +1648,7 @@ AC_CONFIG_FILES([
ompi/attribute/Makefile
ompi/communicator/Makefile
ompi/datatype/Makefile
ompi/debuggers/Makefile
ompi/errhandler/Makefile
ompi/file/Makefile
ompi/group/Makefile

Просмотреть файл

@ -108,6 +108,7 @@ SUBDIRS = \
class \
communicator \
datatype \
debuggers \
errhandler \
file \
group \
@ -132,6 +133,7 @@ libmpi_la_LIBADD = \
class/libclass.la \
communicator/libcommunicator.la \
datatype/libdatatype.la \
debuggers/libdebuggers.la \
errhandler/liberrhandler.la \
file/libfile.la \
group/libgroup.la \

37
ompi/debuggers/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,37 @@
#
# 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$
#
include $(top_srcdir)/config/Makefile.options
noinst_LTLIBRARIES = libdebuggers.la
# Source code files
headers = \
debuggers.h
libdebuggers_la_SOURCES = \
$(headers) \
ompi_totalview.c
# Conditionally install the header files
if WANT_INSTALL_HEADERS
ompidir = $(includedir)/openmpi/ompi/debuggers
ompi_HEADERS = $(headers)
else
ompidir = $(includedir)
endif

40
ompi/debuggers/debuggers.h Обычный файл
Просмотреть файл

@ -0,0 +1,40 @@
/*
* 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$
*/
/**
* @file
*
* MPI portion of debugger support
*/
#ifndef OMPI_DEBUGGERS_H
#define OMPI_DEBUGGERS_H
#include "ompi_config.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
/**
* Wait for a TotalView-like debugger if asked.
*/
void ompi_wait_for_totalview(void);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* OMPI_DEBUGGERS_H */

62
ompi/debuggers/ompi_totalview.c Обычный файл
Просмотреть файл

@ -0,0 +1,62 @@
/*
* 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
}
}
}

Просмотреть файл

@ -97,6 +97,11 @@ extern "C" {
int ompi_mpi_abort(struct ompi_communicator_t* comm,
int errcode, bool kill_remote_of_intercomm);
/**
* Wait for a TotalView-like debugger if asked.
*/
void ompi_mpi_wait_for_totalview(void);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif

Просмотреть файл

@ -65,6 +65,7 @@
#include "ompi/mca/coll/base/base.h"
#include "ompi/mca/io/io.h"
#include "ompi/mca/io/base/base.h"
#include "ompi/debuggers/debuggers.h"
/*
* Global variables and symbols for the MPI layer
@ -81,19 +82,6 @@ opal_thread_t *ompi_mpi_main_thread = NULL;
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;
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;
int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
{
@ -102,7 +90,6 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
size_t nprocs;
char *error = NULL;
bool compound_cmd = false;
int wait_for_totalview;
/* Join the run-time environment - do the things that don't hit
the registry */
@ -155,19 +142,7 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
}
/* 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
}
}
ompi_wait_for_totalview();
/* Setup process affinity */