1
1

This commit fixes trac:1931. By separating out structures and defines used by

the debugger plugins into files suffixed by _dbg.h.

This commit was SVN r21404.

The following Trac tickets were found above:
  Ticket 1931 --> https://svn.open-mpi.org/trac/ompi/ticket/1931
Этот коммит содержится в:
Terry Dontje 2009-06-10 14:57:28 +00:00
родитель f966d9f972
Коммит fa9f356c8c
9 изменённых файлов: 173 добавлений и 82 удалений

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

@ -3,7 +3,7 @@
* Copyright (c) 2004-2007 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2008 Sun Microsystmes, Inc. All rights reserved.
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -36,7 +36,6 @@
#include "ompi_config.h"
#include "ompi_common_dll_defs.h"
#include "ompi/mca/topo/topo.h"
/* Basic callbacks into the debugger */
const mqs_basic_callbacks *mqs_basic_entrypoints;

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

@ -14,6 +14,7 @@
* Include all header files for the datatypes that we care about / use
* in the DLL code
*/
#include "ompi/mca/topo/topo.h"
#include "ompi/mca/pml/base/pml_base_request.h"
#include "ompi/mca/pml/base/pml_base_sendreq.h"
#include "ompi/mca/pml/base/pml_base_recvreq.h"

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

@ -3,7 +3,7 @@
* Copyright (c) 2004-2007 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -75,8 +75,52 @@
#include <stdlib.h>
#endif /* defined(HAVE_STDLIB_H) */
#include "ompi/mca/pml/base/pml_base_request.h"
#include "ompi/group/group.h"
/* Notice to developers!!!!
* The following include files with _dbg.h suffixes contains definitions
* that are shared between the debuggger plugins and the OMPI code base.
* This is done instead of including the non-_dbg suffixed files because
* of the different way compilers may handle extern definitions. The
* particular case that is causing problems is when there is an extern
* variable or function that is accessed in a static inline function.
* For example, here is the code we often see in a header file.
*
* extern int request_complete;
* static inline check_request(void) {
* request_complete = 1;
* }
*
* If this code exists in a header file and gets included in a source
* file, then some compilers expect to have request_complete defined
* somewhere even if request_complete is never referenced and
* check_request is never called. Other compilers do not need them defined
* if they are never referenced in the source file.
*
* In the case of extern functions we something like the following:
*
* extern int foo();
* static inline bar(void) {
* foo();
* }
*
* If this code exists it actually compiles fine however an undefined symbol
* is kept for foo() and in the case of some tools that load in plugins with
* RTLD_NOW this undefined symbol causes the dlopen to fail since we do not
* have (nor really need) the supporting library containing foo().
*
* Therefore, to handle cases like the above with compilers that require the
* symbols (like Sun Studio) instead of pulling in all of OMPI into the
* plugins or defining dummy symbols here we separate the definitions used by
* both sets of code into the _dbg.h files.
*
* This means if one needs to add another definition that the plugins must see
* one should either move the definition into one of the existing _dbg.h file or
* create a new _dbg.h file.
*/
#include "ompi/group/group_dbg.h"
#include "ompi/request/request_dbg.h"
#include "ompi/mca/pml/base/pml_base_request_dbg.h"
#include "mpi.h" /* needed for MPI_ANY_TAG */
#include "msgq_interface.h"
#include "ompi_msgq_dll_defs.h"
@ -124,43 +168,6 @@
#define DEBUG(LEVEL,WHAT)
#endif /* VERBOSE */
#if defined(__SUNPRO_C)
/*
* These symbols are defined here because of the different way compilers
* may handle extern definitions. The particular case that is causing
* problems is when there is an extern variable that is accessed in a
* static inline function. For example, here is the code we often see in
* a header file.
*
* extern int request_complete;
* static inline check_request(void) {
* request_complete = 1;
* }
*
* If this code exists in a header file and gets included in a source
* file, then some compilers expect to have request_complete defined
* somewhere even if request_complete is never referenced and
* check_request is never called. Other compilers do not need them defined
* if they are never referenced in the source file. Therefore, to handle
* cases like the above with compilers that require the symbol (like
* Sun Studio) we add in these definitions here.
*/
size_t ompi_request_completed;
opal_condition_t ompi_request_cond;
size_t ompi_request_waiting;
opal_mutex_t ompi_request_lock;
opal_mutex_t opal_event_lock;
#if OPAL_HAVE_THREAD_SUPPORT
volatile
#endif
uint32_t opal_progress_recursion_depth_counter;
int opal_progress_spin_count;
volatile int32_t opal_progress_thread_count;
bool opal_mutex_check_locks;
bool opal_uses_threads;
ompi_proc_t* ompi_proc_local_proc;
#endif /* defined(__SUNPRO_C) */
/**********************************************************************/
/* Set up the basic callbacks into the debugger */

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

@ -113,14 +113,12 @@ struct ompi_predefined_group_t {
typedef struct ompi_predefined_group_t ompi_predefined_group_t;
/* Some definitions for the flags */
#define OMPI_GROUP_ISFREED 0x00000001
#define OMPI_GROUP_INTRINSIC 0x00000002
#define OMPI_GROUP_DENSE 0x00000004
#define OMPI_GROUP_SPORADIC 0x00000008
#define OMPI_GROUP_STRIDED 0x00000010
#define OMPI_GROUP_BITMAP 0x00000020
/*
* The following include pulls in shared typedefs with debugger plugins.
* For more information on why we do this see the Notice to developers
* comment at the top of the ompi_msgq_dll.c file.
*/
#include "group_dbg.h"
#define OMPI_GROUP_IS_INTRINSIC(_group) ((_group)->grp_flags&OMPI_GROUP_INTRINSIC)
#define OMPI_GROUP_IS_DENSE(_group) ((_group)->grp_flags & OMPI_GROUP_DENSE)

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

@ -0,0 +1,29 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef OMPI_GROUP_DBG_H
#define OMPI_GROUP_DBG_H
/*
* This file contains definitions used by both OMPI and debugger plugins.
* For more information on why we do this see the Notice to developers
* comment at the top of the ompi_msgq_dll.c file.
*/
/* Some definitions for the flags */
#define OMPI_GROUP_ISFREED 0x00000001
#define OMPI_GROUP_INTRINSIC 0x00000002
#define OMPI_GROUP_DENSE 0x00000004
#define OMPI_GROUP_SPORADIC 0x00000008
#define OMPI_GROUP_STRIDED 0x00000010
#define OMPI_GROUP_BITMAP 0x00000020
#endif /* OMPI_GROUP_DBG_H */

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

@ -10,6 +10,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -42,13 +43,12 @@ OMPI_DECLSPEC extern ompi_free_list_t mca_pml_base_recv_requests;
/**
* Type of request.
*/
typedef enum {
MCA_PML_REQUEST_NULL,
MCA_PML_REQUEST_SEND,
MCA_PML_REQUEST_RECV,
MCA_PML_REQUEST_IPROBE,
MCA_PML_REQUEST_PROBE
} mca_pml_base_request_type_t;
/*
* The following include pulls in shared typedefs with debugger plugins.
* For more information on why we do this see the Notice to developers
* comment at the top of the ompi_msgq_dll.c file.
*/
#include "pml_base_request_dbg.h"
/**

30
ompi/mca/pml/base/pml_base_request_dbg.h Обычный файл
Просмотреть файл

@ -0,0 +1,30 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef MCA_PML_BASE_REQUEST_DBG_H
#define MCA_PML_BASE_REQUEST_DBG_H
/*
* This file contains definitions used by both OMPI and debugger plugins.
* For more information on why we do this see the Notice to developers
* comment at the top of the ompi_msgq_dll.c file.
*/
/**
* Type of request.
*/
typedef enum {
MCA_PML_REQUEST_NULL,
MCA_PML_REQUEST_SEND,
MCA_PML_REQUEST_RECV,
MCA_PML_REQUEST_IPROBE,
MCA_PML_REQUEST_PROBE
} mca_pml_base_request_type_t;
#endif /* MCA_PML_BASE_REQUEST_DBG_H */

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

@ -41,33 +41,13 @@ BEGIN_C_DECLS
*/
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_request_t);
/**
* Enum inidicating the type of the request
/*
* The following include pulls in shared typedefs with debugger plugins.
* For more information on why we do this see the Notice to developers
* comment at the top of the ompi_msgq_dll.c file.
*/
typedef enum {
OMPI_REQUEST_PML, /**< MPI point-to-point request */
OMPI_REQUEST_IO, /**< MPI-2 IO request */
OMPI_REQUEST_GEN, /**< MPI-2 generalized request */
OMPI_REQUEST_WIN, /**< MPI-2 one-sided request */
OMPI_REQUEST_NULL, /**< NULL request */
OMPI_REQUEST_NOOP, /**< A request that does nothing (e.g., to PROC_NULL) */
OMPI_REQUEST_MAX /**< Maximum request type */
} ompi_request_type_t;
/**
* Enum indicating the state of the request
*/
typedef enum {
/** Indicates that the request should not be progressed */
OMPI_REQUEST_INVALID,
/** A defined, but inactive request (i.e., it's valid, but should
not be progressed) */
OMPI_REQUEST_INACTIVE,
/** A valid and progressing request */
OMPI_REQUEST_ACTIVE,
/** The request has been cancelled */
OMPI_REQUEST_CANCELLED
} ompi_request_state_t;
#include "request_dbg.h"
struct ompi_request_t;

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

@ -0,0 +1,47 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef OMPI_REQUEST_DBG_H
#define OMPI_REQUEST_DBG_H
/*
* This file contains definitions used by both OMPI and debugger plugins.
* For more information on why we do this see the Notice to developers
* comment at the top of the ompi_msgq_dll.c file.
*/
/**
* Enum inidicating the type of the request
*/
typedef enum {
OMPI_REQUEST_PML, /**< MPI point-to-point request */
OMPI_REQUEST_IO, /**< MPI-2 IO request */
OMPI_REQUEST_GEN, /**< MPI-2 generalized request */
OMPI_REQUEST_WIN, /**< MPI-2 one-sided request */
OMPI_REQUEST_NULL, /**< NULL request */
OMPI_REQUEST_NOOP, /**< A request that does nothing (e.g., to PROC_NULL) */
OMPI_REQUEST_MAX /**< Maximum request type */
} ompi_request_type_t;
/**
* Enum indicating the state of the request
*/
typedef enum {
/** Indicates that the request should not be progressed */
OMPI_REQUEST_INVALID,
/** A defined, but inactive request (i.e., it's valid, but should
not be progressed) */
OMPI_REQUEST_INACTIVE,
/** A valid and progressing request */
OMPI_REQUEST_ACTIVE,
/** The request has been cancelled */
OMPI_REQUEST_CANCELLED
} ompi_request_state_t;
#endif