Add profiling function definitions for MPI_T and add a missing type into mpi.h
This commit was SVN r28803.
Этот коммит содержится в:
родитель
456de007a8
Коммит
e6e9f2c6fd
@ -35,6 +35,8 @@ AC_DEFUN([OMPI_CONFIG_FILES],[
|
||||
ompi/mpi/fortran/use-mpi-f08/Makefile
|
||||
ompi/mpi/fortran/use-mpi-f08-desc/Makefile
|
||||
ompi/mpi/fortran/mpiext/Makefile
|
||||
ompi/mpi/tool/Makefile
|
||||
ompi/mpi/tool/profile/Makefile
|
||||
|
||||
ompi/tools/ompi_info/Makefile
|
||||
ompi/tools/wrappers/Makefile
|
||||
|
@ -12,6 +12,8 @@
|
||||
# Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
# Copyright (c) 2010-2011 Sandia National Laboratories. All rights reserved.
|
||||
# Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -22,12 +24,12 @@
|
||||
# We always have C bindings, but do we have profiling?
|
||||
|
||||
if BUILD_MPI_BINDINGS_LAYER
|
||||
c_mpi_lib = mpi/c/libmpi_c_mpi.la
|
||||
c_mpi_lib = mpi/c/libmpi_c_mpi.la mpi/tool/libmpi_mpit.la
|
||||
else
|
||||
c_mpi_lib =
|
||||
endif
|
||||
if BUILD_PMPI_BINDINGS_LAYER
|
||||
c_pmpi_lib = mpi/c/profile/libmpi_c_pmpi.la
|
||||
c_pmpi_lib = mpi/c/profile/libmpi_c_pmpi.la mpi/tool/profile/libmpi_pmpit.la
|
||||
else
|
||||
c_pmpi_lib =
|
||||
endif
|
||||
@ -77,6 +79,7 @@ SUBDIRS = \
|
||||
debuggers \
|
||||
etc \
|
||||
mpi/c \
|
||||
mpi/tool \
|
||||
$(OMPI_MPIEXT_C_DIRS) \
|
||||
mpi/fortran/base/ \
|
||||
$(MCA_ompi_FRAMEWORKS_SUBDIRS) \
|
||||
@ -108,6 +111,7 @@ DIST_SUBDIRS = \
|
||||
debuggers \
|
||||
etc \
|
||||
mpi/c \
|
||||
mpi/tool \
|
||||
mpi/cxx \
|
||||
mpi/fortran/base \
|
||||
mpi/fortran/mpif-h \
|
||||
@ -117,6 +121,7 @@ DIST_SUBDIRS = \
|
||||
mpi/fortran/use-mpi-f08-desc \
|
||||
mpi/fortran/mpiext \
|
||||
mpi/java \
|
||||
mpi/tool \
|
||||
$(OMPI_MPIEXT_ALL_SUBDIRS) \
|
||||
$(MCA_ompi_FRAMEWORKS_SUBDIRS) \
|
||||
$(MCA_ompi_FRAMEWORK_COMPONENT_ALL_SUBDIRS) \
|
||||
@ -180,7 +185,6 @@ include tools/Makefile.am
|
||||
include mpi/Makefile.am
|
||||
include mpi/man/man3/Makefile.extra
|
||||
include mpiext/Makefile.am
|
||||
include mpit/Makefile.am
|
||||
include patterns/net/Makefile.am
|
||||
include patterns/comm/Makefile.am
|
||||
|
||||
|
@ -740,6 +740,7 @@ enum {
|
||||
*/
|
||||
#define MPI_T_PVAR_ALL_HANDLES ((MPI_T_pvar_handle) -1)
|
||||
#define MPI_T_PVAR_HANDLE_NULL ((MPI_T_pvar_handle) 0)
|
||||
#define MPI_T_CVAR_HANDLE_NULL ((MPI_T_cvar_handle) 0)
|
||||
|
||||
/* MPI-2 specifies that the name "MPI_TYPE_NULL_DELETE_FN" (and all
|
||||
related friends) must be accessible in C, C++, and Fortran. This is
|
||||
@ -2353,6 +2354,49 @@ OMPI_DECLSPEC int PMPI_Win_unlock(int rank, MPI_Win win);
|
||||
OMPI_DECLSPEC int PMPI_Win_wait(MPI_Win win);
|
||||
OMPI_DECLSPEC double PMPI_Wtick(void);
|
||||
OMPI_DECLSPEC double PMPI_Wtime(void);
|
||||
OMPI_DECLSPEC int PMPI_T_init_thread (int required, int *provided);
|
||||
OMPI_DECLSPEC int PMPI_T_finalize (void);
|
||||
OMPI_DECLSPEC int PMPI_T_cvar_get_num (int *num_cvar);
|
||||
OMPI_DECLSPEC int PMPI_T_cvar_get_info (int cvar_index, char *name, int *name_len,
|
||||
int *verbosity, MPI_Datatype *datatype,
|
||||
MPI_T_enum *enumtype, char *desc,
|
||||
int *desc_len, int *bind, int *scope);
|
||||
OMPI_DECLSPEC int PMPI_T_cvar_handle_alloc (int cvar_index, void *obj_handle,
|
||||
MPI_T_cvar_handle *handle, int *count);
|
||||
OMPI_DECLSPEC int PMPI_T_cvar_handle_free (MPI_T_cvar_handle *handle);
|
||||
OMPI_DECLSPEC int PMPI_T_cvar_read (MPI_T_cvar_handle handle, void *buf);
|
||||
OMPI_DECLSPEC int PMPI_T_cvar_write (MPI_T_cvar_handle handle, const void *buf);
|
||||
OMPI_DECLSPEC int PMPI_T_category_get_num(int *num_cat);
|
||||
OMPI_DECLSPEC int PMPI_T_category_get_info(int cat_index, char *name, int *name_len,
|
||||
char *desc, int *desc_len, int *num_cvars,
|
||||
int *num_pvars, int *num_categories);
|
||||
OMPI_DECLSPEC int PMPI_T_category_get_cvars(int cat_index, int len, int indices[]);
|
||||
OMPI_DECLSPEC int PMPI_T_category_get_pvars(int cat_index, int len, int indices[]);
|
||||
OMPI_DECLSPEC int PMPI_T_category_get_categories(int cat_index, int len, int indices[]);
|
||||
OMPI_DECLSPEC int PMPI_T_category_changed(int *stamp);
|
||||
|
||||
OMPI_DECLSPEC int PMPI_T_pvar_get_num(int *num_pvar);
|
||||
OMPI_DECLSPEC int PMPI_T_pvar_get_info(int pvar_index, char *name, int *name_len,
|
||||
int *verbosity, int *var_class, MPI_Datatype *datatype,
|
||||
MPI_T_enum *enumtype, char *desc, int *desc_len, int *bind,
|
||||
int *readonly, int *continuous, int *atomic);
|
||||
OMPI_DECLSPEC int PMPI_T_pvar_session_create(MPI_T_pvar_session *session);
|
||||
OMPI_DECLSPEC int PMPI_T_pvar_session_free(MPI_T_pvar_session *session);
|
||||
OMPI_DECLSPEC int PMPI_T_pvar_handle_alloc(MPI_T_pvar_session session, int pvar_index,
|
||||
void *obj_handle, MPI_T_pvar_handle *handle, int *count);
|
||||
OMPI_DECLSPEC int PMPI_T_pvar_handle_free(MPI_T_pvar_session session, MPI_T_pvar_handle *handle);
|
||||
OMPI_DECLSPEC int PMPI_T_pvar_start(MPI_T_pvar_session session, MPI_T_pvar_handle handle);
|
||||
OMPI_DECLSPEC int PMPI_T_pvar_stop(MPI_T_pvar_session session, MPI_T_pvar_handle handle);
|
||||
OMPI_DECLSPEC int PMPI_T_pvar_read(MPI_T_pvar_session session, MPI_T_pvar_handle handle,
|
||||
void *buf);
|
||||
OMPI_DECLSPEC int PMPI_T_pvar_write(MPI_T_pvar_session session, MPI_T_pvar_handle handle,
|
||||
const void *buf);
|
||||
OMPI_DECLSPEC int PMPI_T_pvar_reset(MPI_T_pvar_session session, MPI_T_pvar_handle handle);
|
||||
OMPI_DECLSPEC int PMPI_T_pvar_readreset(MPI_T_pvar_session session, MPI_T_pvar_handle handle,
|
||||
void *buf);
|
||||
OMPI_DECLSPEC int PMPI_T_enum_get_info(MPI_T_enum enumtype, int *num, char *name, int *name_len);
|
||||
OMPI_DECLSPEC int PMPI_T_enum_get_item(MPI_T_enum enumtype, int index, int *value, char *name,
|
||||
int *name_len);
|
||||
|
||||
/*
|
||||
* Tool MPI API
|
||||
|
@ -36,8 +36,7 @@
|
||||
#include "ompi/mca/bml/base/base.h"
|
||||
#include "pml_ob1_component.h"
|
||||
#include "ompi/mca/allocator/base/base.h"
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "opal/mca/base/mca_base_pvar.h"
|
||||
|
||||
OBJ_CLASS_INSTANCE( mca_pml_ob1_pckt_pending_t,
|
||||
ompi_free_list_item_t,
|
||||
|
41
ompi/mpi/tool/Makefile.am
Обычный файл
41
ompi/mpi/tool/Makefile.am
Обычный файл
@ -0,0 +1,41 @@
|
||||
#
|
||||
# Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
# of Tennessee Research Foundation. All rights
|
||||
# reserved.
|
||||
# Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
SUBDIRS = profile
|
||||
|
||||
AM_CPPFLAGS = -DOMPI_PROFILING_DEFINES=0
|
||||
|
||||
noinst_LTLIBRARIES = libmpi_mpit.la
|
||||
|
||||
headers = mpit-internal.h
|
||||
|
||||
libmpi_mpit_la_SOURCES = init_thread.c finalize.c cvar_get_num.c \
|
||||
cvar_get_info.c cvar_read.c cvar_write.c \
|
||||
cvar_handle_alloc.c cvar_handle_free.c \
|
||||
catagory_get_num.c catagory_get_info.c \
|
||||
catagory_get_cvars.c catagory_get_pvars.c \
|
||||
catagory_get_catagories.c catagory_changed.c \
|
||||
pvar_get_info.c pvar_get_num.c pvar_handle_alloc.c \
|
||||
pvar_handle_free.c pvar_read.c pvar_readreset.c \
|
||||
pvar_reset.c pvar_session_create.c pvar_session_free.c \
|
||||
pvar_start.c pvar_stop.c pvar_write.c \
|
||||
enum_get_info.c enum_get_item.c mpit_common.c
|
||||
|
||||
# Conditionally install the header files
|
||||
|
||||
if WANT_INSTALL_HEADERS
|
||||
ompidir = $(includedir)/openmpi/$(subdir)
|
||||
ompi_HEADERS = $(headers)
|
||||
endif
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_category_changed = PMPI_T_category_changed
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_category_changed";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_category_get_categories = PMPI_T_category_get_categories
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_category_get_categories";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_category_get_cvars = PMPI_T_category_get_cvars
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_category_get_cvars";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_category_get_info = PMPI_T_category_get_info
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_category_get_info";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_category_get_num = PMPI_T_category_get_num
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_catagory_get_num";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_category_get_pvars = PMPI_T_category_get_pvars
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_category_get_pvars";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_cvar_get_info = PMPI_T_cvar_get_info
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_cvar_get_info";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_cvar_get_num = PMPI_T_cvar_get_num
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_cvar_get_num";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_cvar_handle_alloc = PMPI_T_cvar_handle_alloc
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_cvar_handle_alloc";
|
||||
|
@ -9,7 +9,17 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_cvar_handle_free = PMPI_T_cvar_handle_free
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_cvar_handle_free";
|
||||
|
||||
int MPI_T_cvar_handle_free (MPI_T_cvar_handle *handle)
|
||||
{
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_cvar_read = PMPI_T_cvar_read
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_cvar_read";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_cvar_write = PMPI_T_cvar_write
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_cvar_write";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_enum_get_info = PMPI_T_enum_get_info
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_enum_get_info";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_enum_get_item = PMPI_T_enum_get_item
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_enum_get_item";
|
||||
|
@ -10,11 +10,19 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#include "opal/include/opal/sys/atomic.h"
|
||||
#include "opal/runtime/opal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_finalize = PMPI_T_finalize
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_finalize";
|
||||
|
||||
int MPI_T_finalize (void)
|
76
ompi/mpi/tool/init_thread.c
Обычный файл
76
ompi/mpi/tool/init_thread.c
Обычный файл
@ -0,0 +1,76 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#include "ompi/runtime/ompi_info_support.h"
|
||||
#include "opal/include/opal/sys/atomic.h"
|
||||
#include "opal/runtime/opal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_init_thread = PMPI_T_init_thread
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
extern opal_mutex_t mpit_big_lock;
|
||||
|
||||
extern volatile uint32_t mpit_init_count;
|
||||
extern volatile int32_t initted;
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_init_thread";
|
||||
|
||||
int MPI_T_init_thread (int required, int *provided)
|
||||
{
|
||||
static volatile int32_t first_init = 1;
|
||||
int rc = MPI_SUCCESS;
|
||||
|
||||
if (opal_atomic_cmpset (&first_init, 1, 0) == 1) {
|
||||
OBJ_CONSTRUCT(&mpit_big_lock, opal_mutex_t);
|
||||
initted = 1;
|
||||
}
|
||||
|
||||
while (!initted) {
|
||||
usleep (10);
|
||||
}
|
||||
|
||||
mpit_lock ();
|
||||
|
||||
do {
|
||||
if (0 != mpit_init_count++) {
|
||||
break;
|
||||
}
|
||||
|
||||
/* call opal_init_util to intialize the MCA system */
|
||||
rc = opal_init_util (NULL, NULL);
|
||||
if (OPAL_SUCCESS != rc) {
|
||||
rc = MPI_ERR_OTHER;
|
||||
break;
|
||||
}
|
||||
|
||||
/* register all parameters */
|
||||
rc = ompi_info_register_framework_params (NULL);
|
||||
if (OMPI_SUCCESS != rc) {
|
||||
rc = MPI_ERR_OTHER;
|
||||
break;
|
||||
}
|
||||
|
||||
/* determine the thread level. TODO -- this might
|
||||
be wrong */
|
||||
ompi_mpi_thread_level (required, provided);
|
||||
} while (0);
|
||||
|
||||
mpit_unlock ();
|
||||
|
||||
return rc;
|
||||
}
|
@ -9,21 +9,12 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
|
||||
#include <sched.h>
|
||||
|
||||
#include "ompi/runtime/ompi_info_support.h"
|
||||
#include "opal/include/opal/sys/atomic.h"
|
||||
#include "opal/runtime/opal.h"
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_init_thread";
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
opal_mutex_t mpit_big_lock;
|
||||
|
||||
volatile uint32_t mpit_init_count = 0;
|
||||
static volatile int32_t initted = 0;
|
||||
volatile int32_t initted = 0;
|
||||
|
||||
void mpit_lock (void)
|
||||
{
|
||||
@ -91,48 +82,3 @@ int ompit_var_type_to_datatype (mca_base_var_type_t type, MPI_Datatype *datatype
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int MPI_T_init_thread (int required, int *provided)
|
||||
{
|
||||
static volatile int32_t first_init = 1;
|
||||
int rc = MPI_SUCCESS;
|
||||
|
||||
if (opal_atomic_cmpset (&first_init, 1, 0) == 1) {
|
||||
OBJ_CONSTRUCT(&mpit_big_lock, opal_mutex_t);
|
||||
initted = 1;
|
||||
}
|
||||
|
||||
while (!initted) {
|
||||
usleep (10);
|
||||
}
|
||||
|
||||
mpit_lock ();
|
||||
|
||||
do {
|
||||
if (0 != mpit_init_count++) {
|
||||
break;
|
||||
}
|
||||
|
||||
/* call opal_init_util to intialize the MCA system */
|
||||
rc = opal_init_util (NULL, NULL);
|
||||
if (OPAL_SUCCESS != rc) {
|
||||
rc = MPI_ERR_OTHER;
|
||||
break;
|
||||
}
|
||||
|
||||
/* register all parameters */
|
||||
rc = ompi_info_register_framework_params (NULL);
|
||||
if (OMPI_SUCCESS != rc) {
|
||||
rc = MPI_ERR_OTHER;
|
||||
break;
|
||||
}
|
||||
|
||||
/* determine the thread level. TODO -- this might
|
||||
be wrong */
|
||||
ompi_mpi_thread_level (required, provided);
|
||||
} while (0);
|
||||
|
||||
mpit_unlock ();
|
||||
|
||||
return rc;
|
||||
}
|
102
ompi/mpi/tool/profile/Makefile.am
Обычный файл
102
ompi/mpi/tool/profile/Makefile.am
Обычный файл
@ -0,0 +1,102 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
# of Tennessee Research Foundation. 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 (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
|
||||
# Copyright (c) 2012 Oak Rigde National Laboratory. All rights reserved.
|
||||
# Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
#
|
||||
# OMPI_PROFILING_DEFINES flag s enabled when we want our MPI_* symbols
|
||||
# to be replaced by PMPI_*. In other words, this flag decides
|
||||
# whether "profile/defines.h" is included or not. "profile/defines.h"
|
||||
# replaces all MPI_* symbols with PMPI_* symbols. In this directory
|
||||
# we definately need it to be 1.
|
||||
#
|
||||
AM_CPPFLAGS = -DOMPI_PROFILING_DEFINES=1
|
||||
|
||||
#
|
||||
# This build needs to go through only if profiling is required.
|
||||
# Further, this build HAS to go through if profiling is required.
|
||||
#
|
||||
|
||||
noinst_LTLIBRARIES =
|
||||
if BUILD_PMPI_BINDINGS_LAYER
|
||||
noinst_LTLIBRARIES += libmpi_pmpit.la
|
||||
endif
|
||||
|
||||
headers = defines.h
|
||||
|
||||
nodist_libmpi_pmpit_la_SOURCES = \
|
||||
pcatagory_changed.c \
|
||||
pcatagory_get_catagories.c \
|
||||
pcatagory_get_cvars.c \
|
||||
pcatagory_get_info.c \
|
||||
pcatagory_get_num.c \
|
||||
pcatagory_get_pvars.c \
|
||||
pcvar_get_info.c \
|
||||
pcvar_get_num.c \
|
||||
pcvar_handle_alloc.c \
|
||||
pcvar_handle_free.c \
|
||||
pcvar_read.c \
|
||||
pcvar_write.c \
|
||||
penum_get_info.c \
|
||||
penum_get_item.c \
|
||||
pfinalize.c \
|
||||
pinit_thread.c \
|
||||
ppvar_get_info.c \
|
||||
ppvar_get_num.c \
|
||||
ppvar_handle_alloc.c \
|
||||
ppvar_handle_free.c \
|
||||
ppvar_read.c \
|
||||
ppvar_readreset.c \
|
||||
ppvar_reset.c \
|
||||
ppvar_session_create.c \
|
||||
ppvar_session_free.c \
|
||||
ppvar_start.c \
|
||||
ppvar_stop.c \
|
||||
ppvar_write.c
|
||||
|
||||
#
|
||||
# Sym link in the sources from the real MPI directory
|
||||
#
|
||||
$(nodist_libmpi_pmpit_la_SOURCES):
|
||||
if test ! -r $@ ; then \
|
||||
pname=`echo $@ | cut -b '2-'` ; \
|
||||
$(LN_S) $(top_srcdir)/ompi/mpi/tool/$$pname $@ ; \
|
||||
fi
|
||||
|
||||
# Conditionally install the header files
|
||||
|
||||
if WANT_INSTALL_HEADERS
|
||||
ompidir = $(includedir)/openmpi/$(subdir)
|
||||
ompi_HEADERS = $(headers)
|
||||
endif
|
||||
|
||||
# These files were created by targets above
|
||||
|
||||
MAINTAINERCLEANFILES = $(nodist_libmpi_pmpit_la_SOURCES)
|
||||
|
||||
# Don't want these targets in here
|
||||
|
||||
tags-recursive:
|
||||
tags:
|
||||
TAGS:
|
||||
GTAGS:
|
||||
ID:
|
60
ompi/mpi/tool/profile/defines.h
Обычный файл
60
ompi/mpi/tool/profile/defines.h
Обычный файл
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. 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 (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
|
||||
* Copyright (c) 2012 Oak Rigde National Laboratory. All rights reserved.
|
||||
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef OMPIT_PROFILE_DEFINES_H
|
||||
#define OMPIT_PROFILE_DEFINES_H
|
||||
/*
|
||||
* This file is included in the top directory only if
|
||||
* profiling is required. Once profiling is required,
|
||||
* this file will replace all MPI_* symbols with
|
||||
* PMPI_* symbols
|
||||
*/
|
||||
#define MPI_T_category_changed PMPI_T_category_changed
|
||||
#define MPI_T_category_get_categories PMPI_T_category_get_categories
|
||||
#define MPI_T_category_get_cvars PMPI_T_category_get_cvars
|
||||
#define MPI_T_category_get_info PMPI_T_category_get_info
|
||||
#define MPI_T_category_get_num PMPI_T_category_get_num
|
||||
#define MPI_T_category_get_pvars PMPI_T_category_get_pvars
|
||||
#define MPI_T_cvar_get_info PMPI_T_cvar_get_info
|
||||
#define MPI_T_cvar_get_num PMPI_T_cvar_get_num
|
||||
#define MPI_T_cvar_handle_alloc PMPI_T_cvar_handle_alloc
|
||||
#define MPI_T_cvar_handle_free PMPI_T_cvar_handle_free
|
||||
#define MPI_T_cvar_read PMPI_T_cvar_read
|
||||
#define MPI_T_cvar_write PMPI_T_cvar_write
|
||||
#define MPI_T_enum_get_info PMPI_T_enum_get_info
|
||||
#define MPI_T_enum_get_item PMPI_T_enum_get_item
|
||||
#define MPI_T_finalize PMPI_T_finalize
|
||||
#define MPI_T_init_thread PMPI_T_init_thread
|
||||
#define MPI_T_pvar_get_info PMPI_T_pvar_get_info
|
||||
#define MPI_T_pvar_get_num PMPI_T_pvar_get_num
|
||||
#define MPI_T_pvar_handle_alloc PMPI_T_pvar_handle_alloc
|
||||
#define MPI_T_pvar_handle_free PMPI_T_pvar_handle_free
|
||||
#define MPI_T_pvar_read PMPI_T_pvar_read
|
||||
#define MPI_T_pvar_readreset PMPI_T_pvar_readreset
|
||||
#define MPI_T_pvar_reset PMPI_T_pvar_reset
|
||||
#define MPI_T_pvar_session_create PMPI_T_pvar_session_create
|
||||
#define MPI_T_pvar_session_free PMPI_T_pvar_session_free
|
||||
#define MPI_T_pvar_start PMPI_T_pvar_start
|
||||
#define MPI_T_pvar_stop PMPI_T_pvar_stop
|
||||
#define MPI_T_pvar_write PMPI_T_pvar_write
|
||||
#endif /* OMPIT_C_PROFILE_DEFINES_H */
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_pvar_get_info = PMPI_T_pvar_get_info
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_pvar_get_info";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_pvar_get_num = PMPI_T_pvar_get_num
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_pvar_get_num";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_pvar_handle_alloc = PMPI_T_pvar_handle_alloc
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_pvar_handle_alloc";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_pvar_handle_free = PMPI_T_pvar_handle_free
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_pvar_handle_free";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_pvar_read = PMPI_T_pvar_read
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_pvar_read";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_pvar_readreset = PMPI_T_pvar_readreset
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_pvar_readreset";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_pvar_reset = PMPI_T_pvar_reset
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_pvar_reset";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_pvar_session_create = PMPI_T_pvar_session_create
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_pvar_session_create";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_pvar_session_free = PMPI_T_pvar_session_free
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_pvar_session_free";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_pvar_start = PMPI_T_pvar_start
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_pvar_start";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_pvar_stop = PMPI_T_pvar_stop
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_pvar_stop";
|
||||
|
@ -9,7 +9,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi/mpit/mpit-internal.h"
|
||||
#include "ompi/mpi/tool/mpit-internal.h"
|
||||
|
||||
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
||||
#pragma weak MPI_T_pvar_write = PMPI_T_pvar_write
|
||||
#endif
|
||||
|
||||
#if OMPI_PROFILING_DEFINES
|
||||
#include "ompi/mpi/tool/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static const char FUNC_NAME[] = "MPI_T_pvar_write";
|
||||
|
@ -1,31 +0,0 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
# of Tennessee Research Foundation. All rights
|
||||
# reserved.
|
||||
# Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# This Makefile.am does not stand on its own - it is included from ompi/Makefile.am
|
||||
|
||||
headers += mpit/mpit-internal.h mpit/mpit-pvar.h
|
||||
|
||||
libmpi_la_SOURCES += mpit/init_thread.c mpit/finalize.c mpit/cvar_get_num.c \
|
||||
mpit/cvar_get_info.c mpit/cvar_read.c mpit/cvar_write.c \
|
||||
mpit/cvar_handle_alloc.c mpit/cvar_handle_free.c \
|
||||
mpit/catagory_get_num.c mpit/catagory_get_info.c \
|
||||
mpit/catagory_get_cvars.c mpit/catagory_get_pvars.c \
|
||||
mpit/catagory_get_catagories.c mpit/catagory_changed.c \
|
||||
mpit/pvar_get_info.c mpit/pvar_get_num.c mpit/pvar_handle_alloc.c \
|
||||
mpit/pvar_handle_free.c mpit/pvar_read.c mpit/pvar_readreset.c \
|
||||
mpit/pvar_reset.c mpit/pvar_session_create.c mpit/pvar_session_free.c \
|
||||
mpit/pvar_start.c mpit/pvar_stop.c mpit/pvar_write.c \
|
||||
mpit/enum_get_info.c mpit/enum_get_item.c
|
Загрузка…
x
Ссылка в новой задаче
Block a user