1
1

First cut at weak symbol support for profiling and all fortran symbol

extensions.  Not quite complete yet.

This commit was SVN r116.
Этот коммит содержится в:
Jeff Squyres 2004-01-08 13:42:23 +00:00
родитель 1d8a51ab60
Коммит 9a8d02de1c
4 изменённых файлов: 93 добавлений и 1 удалений

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

@ -2,12 +2,19 @@
* $HEADER$
*/
#include "lam_config.h"
#include <string.h>
#include "mpi.h"
#include "mpi/c/profiling.h"
#include "lam/util/strncpy.h"
#include "communicator.h"
#include "totalview.h"
#if LAM_WANT_MPI_PROFILING && LAM_HAVE_WEAK_SYMBOLS
#pragma weak PMPI_Comm_set_name = MPI_Comm_set_name
#endif
int
MPI_Comm_set_name(MPI_Comm comm, char *name)
@ -24,7 +31,7 @@ MPI_Comm_set_name(MPI_Comm comm, char *name)
/* Copy in the name */
strncpy(comm->c_name, name, MPI_MAX_OBJECT_NAME);
lam_strncpy(comm->c_name, name, MPI_MAX_OBJECT_NAME);
comm->c_name[MPI_MAX_OBJECT_NAME - 1] = 0;
/* -- Tracing information for new communicator name -- */

25
src/mpi/interface/c/profiling.h Обычный файл
Просмотреть файл

@ -0,0 +1,25 @@
/*
* $HEADER$
*/
#ifndef LAM_MPI_C_PROFILING_H
#define LAM_MPI_C_PROFILING_H
#include "lam_config.h"
/* Unless explicitly asked for (i.e., when we're compiling in
src/mpi/<lang>/profile, don't automatically convert MPI_Foo ->
PMPI_Foo via #defines. */
#ifndef LAM_PROFILING_DEFINES
#define LAM_PROFILING_DEFINES 0
#endif
/* If requested, add a #define for each MPI function to convert it to
it's PMPI equivalent. */
#if LAM_PROFILING_DEFINES
#define MPI_Comm_set_name PMPI_Comm_set_name
#endif
#endif /* LAM_MPI_C_PROFILING_H */

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

@ -2,10 +2,36 @@
* $HEADER$
*/
#include "lam_config.h"
#include <string.h>
#include "mpi.h"
#if 0
/* JMS Need to continue here */
#include "mpi/f77/profiling.h"
#endif
#if LAM_HAVE_WEAK_SYMBOLS
#include "mpi/f77/weak_prototypes.h"
#pragma weak mpi_comm_set_name_ = mpi_comm_set_name_f
#pragma weak mpi_comm_set_name__ = mpi_comm_set_name_f
#pragma weak mpi_comm_set_name = mpi_comm_set_name_f
#pragma weak MPI_COMM_SET_NAME = mpi_comm_set_name_f
#if LAM_WANT_MPI_PROFILING
#pragma weak pmpi_comm_set_name_ = mpi_comm_set_name_f
#pragma weak pmpi_comm_set_name__ = mpi_comm_set_name_f
#pragma weak pmpi_comm_set_name = mpi_comm_set_name_f
#pragma weak PMPI_COMM_SET_NAME = mpi_comm_set_name_f
#endif
#else
#if 0
/* JMS Need to continue here */
//#include "mpi-fortran-"
#endif
#endif
int
mpi_comm_set_name_f(int *comm, char *name)

34
src/mpi/interface/f77/profiling.h Обычный файл
Просмотреть файл

@ -0,0 +1,34 @@
/*
* $HEADER$
*/
#ifndef LAM_MPI_F77_PROFILING_H
#define LAM_MPI_F77_PROFILING_H
#include "lam_config.h"
/* Unless explicitly asked for (i.e., when we're compiling in
src/mpi/<lang>/profile, don't automatically convert MPI_Foo ->
PMPI_Foo via #defines. */
#ifndef LAM_PROFILING_DEFINES
#define LAM_PROFILING_DEFINES 0
#endif
/* If requested, add a #define for each MPI function to convert it to
it's PMPI equivalent. */
#if LAM_PROFILING_DEFINES
#if LAM_FORTRAN_CAPS
#define mpi_comm_set_name_f MPI_COMM_SET_NAME
#elif LAM_FORTRAN_NO_UNDERSCORE
#define mpi_comm_set_name_f mpi_comm_set_name
#elif LAM_FORTRAN_SINGLE_UNDERSCORE
#define mpi_comm_set_name_f mpi_comm_set_name_
#elif LAM_FORTRAN_DOUBLE_UNDERSCORE
#define mpi_comm_set_name_f mpi_comm_set_name__
#else
#error I do not know how your fortran compiler exports symbols. :-(
#endif
#endif /* LAM_MPI_F77_PROFILING_H */