1
1

Add a new contrib area for "libtrace" - a debugger library that outputs the name of the called MPI function plus the value of all its arguments before passing them along to the corresonding PMPI call.

Support for the rest of the MPI bindings will be developed over time.

This commit was SVN r21849.
Этот коммит содержится в:
Ralph Castain 2009-08-20 04:36:20 +00:00
родитель 270f0ffe18
Коммит e1662b4c30
26 изменённых файлов: 963 добавлений и 3 удалений

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

@ -695,7 +695,12 @@ EOF
# do. By this point, there should already be a header and all
# that. m4_includes are relative to the currently included file,
# so need the .. to get us from config/ to the topsrcdir again.
if test $6 = "mca" ; then
# Note that the ompi contrib system comes through here as well,
# but they directly m4 include their own configure.m4 files, so we
# skip them here.
if test "$m4conf_framework" = "contrib" ; then
true
elif test $6 = "mca" ; then
echo "m4_include(${m4conf_project}/mca/${m4conf_framework}/${m4conf_component}/configure.m4)" >> "$m4conf_ompi_topdir/$mca_m4_include_file"
else
echo "m4_include(${m4conf_project}/${m4conf_framework}/${m4conf_component}/configure.m4)" >> "$m4conf_ompi_topdir/$ext_m4_include_file"
@ -1367,7 +1372,7 @@ process_project() {
# process contributed software packages (ompi/contrib/*)
if test "$project" = "ompi"; then
for contrib_path in $project_path/contrib/*; do
process_dir $contrib_path $rg_cwd
process_dir $contrib_path $rg_cwd ompi contrib `basename $contrib_path`
done
fi

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

@ -70,7 +70,7 @@ AC_DEFUN([OMPI_CONTRIB],[
# autogen find the packages instead of this hard-coded list
# (https://svn.open-mpi.org/trac/ompi/ticket/1162).
# m4_define([contrib_software_list], [libnbc, vt])
m4_define([contrib_software_list], [vt])
m4_define([contrib_software_list], [libtrace, vt])
m4_foreach(software, [contrib_software_list],
[m4_include([ompi/contrib/]software[/configure.m4])
_OMPI_CONTRIB_CONFIGURE(software)])

20
ompi/contrib/README.txt Обычный файл
Просмотреть файл

@ -0,0 +1,20 @@
This is the OMPI contrib system. It is (far) less functional and
flexible than the OMPI MCA framework/component system.
Each contrib package must have either both a configure.params and a
configure.m4 file, or it must have an autogen.subdirs file.
If it has (configure.params, configure.m4), configure.params can be
just like any MCA component's: specify a list of files to create
during AC_OUTPUT. The configure.m4 file will be slurped up into the
main configure script, just like other MCA components. Note that
there is currently no "no configure" option for contrib packages --
you *must* have a configure.m4 (even if all it does it call $1).
Feel free to fix this situation if you want -- see:
https://svn.open-mpi.org/trac/ompi/ticket/1162
:-)
If it has an autogen.subdirs file, then it needs to be a subdirectory
that is autogen-able (see the vt project for an example).

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

@ -0,0 +1,43 @@
# -*- 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 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
lib_LTLIBRARIES = libtrace.la
libtrace_la_SOURCES = \
abort.c \
accumulate.c \
add_error_class.c \
add_error_code.c \
add_error_string.c \
address.c \
allgather.c \
allgatherv.c \
alloc_mem.c \
allreduce.c \
barrier.c \
bcast.c \
finalize.c \
init.c \
isend.c \
recv.c \
reduce.c \
request_free.c \
send.c \
sendrecv.c

39
ompi/contrib/libtrace/abort.c Обычный файл
Просмотреть файл

@ -0,0 +1,39 @@
/*
* Copyright (c) 2004-2007 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-2008 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) 2007-2009 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/mpi/c/bindings.h"
int MPI_Abort(MPI_Comm comm, int errorcode)
{
char commname[MPI_MAX_OBJECT_NAME];
int len;
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
PMPI_Comm_get_name(comm, commname, &len);
fprintf(stderr, "MPI_ABORT[%d]: comm %s errorcode %d\n", rank, commname, errorcode);
fflush(stderr);
return PMPI_Abort(comm, errorcode);
}

52
ompi/contrib/libtrace/accumulate.c Обычный файл
Просмотреть файл

@ -0,0 +1,52 @@
/*
* Copyright (c) 2004-2007 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-2008 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 Sun Microsystmes, Inc. All rights reserved.
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "opal_stdint.h"
#include "ompi/op/op.h"
#include "ompi/mpi/c/bindings.h"
int MPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
int target_rank, MPI_Aint target_disp, int target_count,
MPI_Datatype target_datatype, MPI_Op op, MPI_Win win)
{
char typename[MPI_MAX_OBJECT_NAME], target_dt[MPI_MAX_OBJECT_NAME];
char winname[MPI_MAX_OBJECT_NAME];
int len;
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
PMPI_Type_get_name(origin_datatype, typename, &len);
PMPI_Type_get_name(target_datatype, target_dt, &len);
PMPI_Win_get_name(win, winname, &len);
fprintf(stderr, "MPI_ACCUMULATE[%d]: origin_addr %0" PRIxPTR " origin_count %d origin_datatype %s\n"
"\ttarget_rank %d target_disp %" PRIdPTR " target_count %d target_datatype %s op %s win %s\n",
rank, (uintptr_t)origin_addr, origin_count, typename, target_rank, (intptr_t) target_disp,
target_count, target_dt, op->o_name, winname);
fflush(stderr);
return PMPI_Accumulate(origin_addr, origin_count, origin_datatype,
target_rank, target_disp, target_count,
target_datatype, op, win);
}

38
ompi/contrib/libtrace/add_error_class.c Обычный файл
Просмотреть файл

@ -0,0 +1,38 @@
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 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) 2006 University of Houston. All rights reserved.
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "opal_stdint.h"
#include "ompi/mpi/c/bindings.h"
int MPI_Add_error_class(int *errorclass)
{
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
fprintf(stderr, "MPI_ADD_ERROR_CLASS[%d]: errorclass %0" PRIxPTR "\n", rank, (uintptr_t)errorclass);
fflush(stderr);
return PMPI_Add_error_class(errorclass);
}

37
ompi/contrib/libtrace/add_error_code.c Обычный файл
Просмотреть файл

@ -0,0 +1,37 @@
/*
* Copyright (c) 2004-2007 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) 2006 University of Houston. All rights reserved.
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "opal_stdint.h"
#include "ompi/mpi/c/bindings.h"
int MPI_Add_error_code(int errorclass, int *errorcode)
{
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
fprintf(stderr, "MPI_ADD_ERROR_CODE[%d]: errorclass %d errcode %0" PRIxPTR "\n", rank, errorclass, (uintptr_t)errorcode);
fflush(stderr);
return PMPI_Add_error_code(errorclass, errorcode);
}

36
ompi/contrib/libtrace/add_error_string.c Обычный файл
Просмотреть файл

@ -0,0 +1,36 @@
/*
* Copyright (c) 2004-2007 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) 2006 University of Houston. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/mpi/c/bindings.h"
int MPI_Add_error_string(int errorcode, char *string)
{
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
fprintf(stderr, "MPI_ADD_ERROR_STRING[%d]: errorcode %d string %s\n",
rank, errorcode, string);
fflush(stderr);
return PMPI_Add_error_string(errorcode, string);
}

39
ompi/contrib/libtrace/address.c Обычный файл
Просмотреть файл

@ -0,0 +1,39 @@
/*
* Copyright (c) 2004-2007 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 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "opal_stdint.h"
#include "ompi/mpi/c/bindings.h"
int MPI_Address(void *location, MPI_Aint *address)
{
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
fprintf(stderr, "MPI_ADDRESS[%d]: location %0" PRIxPTR " address %0" PRIxPTR "\n",
rank, (uintptr_t)location, (uintptr_t)address);
fflush(stderr);
return PMPI_Address(location, address);
}

48
ompi/contrib/libtrace/allgather.c Обычный файл
Просмотреть файл

@ -0,0 +1,48 @@
/*
* Copyright (c) 2004-2007 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-2008 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) 2007-2009 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "opal_stdint.h"
#include "ompi/mpi/c/bindings.h"
int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPI_Comm comm)
{
char sendtypename[MPI_MAX_OBJECT_NAME], recvtypename[MPI_MAX_OBJECT_NAME];
char commname[MPI_MAX_OBJECT_NAME];
int len;
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
PMPI_Type_get_name(sendtype, sendtypename, &len);
PMPI_Type_get_name(recvtype, recvtypename, &len);
PMPI_Comm_get_name(comm, commname, &len);
fprintf(stderr, "MPI_ALLGATHER[%d]: sendbuf %0" PRIxPTR " sendcount %d sendtype %s\n\trecvbuf %0" PRIxPTR " recvcount %d recvtype %s comm %s\n",
rank, (uintptr_t) sendbuf, sendcount, sendtypename, (uintptr_t) recvbuf, recvcount, recvtypename, commname);
fflush(stderr);
return PMPI_Allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
}

48
ompi/contrib/libtrace/allgatherv.c Обычный файл
Просмотреть файл

@ -0,0 +1,48 @@
/*
* Copyright (c) 2004-2007 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-2008 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 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "opal_stdint.h"
#include "ompi/mpi/c/bindings.h"
int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int *recvcounts,
int *displs, MPI_Datatype recvtype, MPI_Comm comm)
{
char sendtypename[MPI_MAX_OBJECT_NAME], recvtypename[MPI_MAX_OBJECT_NAME];
char commname[MPI_MAX_OBJECT_NAME];
int len;
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
PMPI_Type_get_name(sendtype, sendtypename, &len);
PMPI_Type_get_name(recvtype, recvtypename, &len);
PMPI_Comm_get_name(comm, commname, &len);
fprintf(stderr, "MPI_ALLGATHERV[%d]: sendbuf %0" PRIxPTR " sendcount %d sendtype %s\n\trecvbuf %0" PRIxPTR " recvtype %s comm %s\n",
rank, (uintptr_t) sendbuf, sendcount, sendtypename, (uintptr_t) recvbuf, recvtypename, commname);
fflush(stderr);
return PMPI_Allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm);
}

38
ompi/contrib/libtrace/alloc_mem.c Обычный файл
Просмотреть файл

@ -0,0 +1,38 @@
/*
* Copyright (c) 2004-2007 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) 2007 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/mpi/c/bindings.h"
int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr)
{
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
fprintf(stderr, "MPI_Alloc_mem[%d]: size %0ld\n", rank, (long)size);
fflush(stderr);
return PMPI_Alloc_mem(size, info, baseptr);
}

44
ompi/contrib/libtrace/allreduce.c Обычный файл
Просмотреть файл

@ -0,0 +1,44 @@
/*
* Copyright (c) 2004-2007 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-2008 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 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "opal_stdint.h"
#include "ompi/op/op.h"
#include "ompi/mpi/c/bindings.h"
int MPI_Allreduce(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
{
char typename[MPI_MAX_OBJECT_NAME], commname[MPI_MAX_OBJECT_NAME];
int len;
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
PMPI_Type_get_name(datatype, typename, &len);
PMPI_Comm_get_name(comm, commname, &len);
fprintf(stderr, "MPI_ALLREDUCE[%d]: sendbuf %0" PRIxPTR " recvbuf %0" PRIxPTR " count %d datatype %s op %s comm %s\n",
rank, (uintptr_t)sendbuf, (uintptr_t)recvbuf, count, typename, op->o_name, commname);
fflush(stderr);
return PMPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm);
}

39
ompi/contrib/libtrace/barrier.c Обычный файл
Просмотреть файл

@ -0,0 +1,39 @@
/*
* Copyright (c) 2004-2007 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-2008 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 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/mpi/c/bindings.h"
int MPI_Barrier(MPI_Comm comm)
{
char commname[MPI_MAX_OBJECT_NAME];
int len;
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
PMPI_Comm_get_name(comm, commname, &len);
fprintf(stderr, "MPI_BARRIER[%d]: comm %s\n", rank, commname);
fflush(stderr);
return PMPI_Barrier(comm);
}

45
ompi/contrib/libtrace/bcast.c Обычный файл
Просмотреть файл

@ -0,0 +1,45 @@
/*
* Copyright (c) 2004-2007 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-2008 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 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "opal_stdint.h"
#include "ompi/mpi/c/bindings.h"
int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype,
int root, MPI_Comm comm)
{
char typename[MPI_MAX_OBJECT_NAME], commname[MPI_MAX_OBJECT_NAME];
int len;
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
PMPI_Type_get_name(datatype, typename, &len);
PMPI_Comm_get_name(comm, commname, &len);
fprintf(stderr, "MPI_BCAST[%d]: buffer %0" PRIxPTR " count %d datatype %s root %d comm %s\n",
rank, (uintptr_t) buffer, count, typename, root, commname);
fflush(stderr);
return PMPI_Bcast(buffer, count, datatype, root, comm);
}

26
ompi/contrib/libtrace/configure.m4 Обычный файл
Просмотреть файл

@ -0,0 +1,26 @@
# -*- shell-script -*-
#
# 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) 2007-2009 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# OMPI_contrib_libtrace_CONFIG([action-if-can-compile],
# [action-if-cant-compile])
# ------------------------------------------------
AC_DEFUN([OMPI_contrib_libtrace_CONFIG],[
$1
])dnl

24
ompi/contrib/libtrace/configure.params Обычный файл
Просмотреть файл

@ -0,0 +1,24 @@
# -*- shell-script -*-
#
# 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) 2007 Los Alamos National Security, LLC. All rights
# reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# Specific to this module
PARAM_CONFIG_FILES="Makefile"

36
ompi/contrib/libtrace/finalize.c Обычный файл
Просмотреть файл

@ -0,0 +1,36 @@
/*
* Copyright (c) 2004-2007 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 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/mpi/c/bindings.h"
int MPI_Finalize(void)
{
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
fprintf(stderr, "MPI_FINALIZE[%d]\n", rank);
fflush(stderr);
return PMPI_Finalize();
}

33
ompi/contrib/libtrace/init.c Обычный файл
Просмотреть файл

@ -0,0 +1,33 @@
/*
* Copyright (c) 2004-2007 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-2006 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) 2007-2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2008 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/mpi/c/bindings.h"
int MPI_Init(int *argc, char ***argv)
{
fprintf(stderr, "MPI_INIT: argc %d\n", (0 < *argc) ? *argc : 0);
fflush(stderr);
return PMPI_Init(argc, argv);
}

44
ompi/contrib/libtrace/isend.c Обычный файл
Просмотреть файл

@ -0,0 +1,44 @@
/*
* Copyright (c) 2004-2007 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-2008 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) 2006-2009 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "opal_stdint.h"
#include "ompi/mpi/c/bindings.h"
int MPI_Isend(void *buf, int count, MPI_Datatype type, int dest,
int tag, MPI_Comm comm, MPI_Request *request)
{
char typename[MPI_MAX_OBJECT_NAME], commname[MPI_MAX_OBJECT_NAME];
int len;
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
PMPI_Type_get_name(type, typename, &len);
PMPI_Comm_get_name(comm, commname, &len);
fprintf(stderr, "MPI_ISEND[%d]: buf %0" PRIxPTR " count %d datatype %s dest %d tag %d comm %s\n",
rank, (uintptr_t) buf, count, typename, dest, tag, commname);
fflush(stderr);
return PMPI_Isend(buf, count, type, dest, tag, comm, request);
}

44
ompi/contrib/libtrace/recv.c Обычный файл
Просмотреть файл

@ -0,0 +1,44 @@
/*
* Copyright (c) 2004-2007 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-2008 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 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "opal_stdint.h"
#include "ompi/mpi/c/bindings.h"
int MPI_Recv(void *buf, int count, MPI_Datatype type, int source,
int tag, MPI_Comm comm, MPI_Status *status)
{
char typename[MPI_MAX_OBJECT_NAME], commname[MPI_MAX_OBJECT_NAME];
int len;
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
PMPI_Type_get_name(type, typename, &len);
PMPI_Comm_get_name(comm, commname, &len);
fprintf(stderr, "MPI_RECV[%d]: buf %0" PRIxPTR " count %d datatype %s source %d tag %d comm %s\n",
rank, (uintptr_t) buf, count, typename, source, tag, commname);
fflush(stderr);
return PMPI_Recv(buf, count, type, source, tag, comm, status);
}

45
ompi/contrib/libtrace/reduce.c Обычный файл
Просмотреть файл

@ -0,0 +1,45 @@
/*
* Copyright (c) 2004-2007 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-2008 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) 2006-2009 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "opal_stdint.h"
#include "ompi/op/op.h"
#include "ompi/mpi/c/bindings.h"
int MPI_Reduce(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
{
char typename[MPI_MAX_OBJECT_NAME], commname[MPI_MAX_OBJECT_NAME];
int len;
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
PMPI_Type_get_name(datatype, typename, &len);
PMPI_Comm_get_name(comm, commname, &len);
fprintf(stderr,"MPI_REDUCE[%d]: sendbuf %0" PRIxPTR " recvbuf %0" PRIxPTR " count %d datatype %s op %s root %d comm %s\n",
rank, (uintptr_t) sendbuf, (uintptr_t) recvbuf, count, typename, op->o_name, root, commname);
fflush(stderr);
return PMPI_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
}

36
ompi/contrib/libtrace/request_free.c Обычный файл
Просмотреть файл

@ -0,0 +1,36 @@
/*
* Copyright (c) 2004-2007 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-2008 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) 2006-2009 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/mpi/c/bindings.h"
int MPI_Request_free(MPI_Request *request)
{
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
fprintf(stderr, "MPI_REQUEST_FREE[%d]\n", rank);
fflush(stderr);
return PMPI_Request_free(request);
}

44
ompi/contrib/libtrace/send.c Обычный файл
Просмотреть файл

@ -0,0 +1,44 @@
/*
* Copyright (c) 2004-2007 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-2008 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 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "opal_stdint.h"
#include "ompi/mpi/c/bindings.h"
int MPI_Send(void *buf, int count, MPI_Datatype type, int dest,
int tag, MPI_Comm comm)
{
char typename[MPI_MAX_OBJECT_NAME], commname[MPI_MAX_OBJECT_NAME];
int len;
int rank;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
PMPI_Type_get_name(type, typename, &len);
PMPI_Comm_get_name(comm, commname, &len);
fprintf(stderr, "MPI_SEND[%d]: : buf %0" PRIxPTR " count %d datatype %s dest %d tag %d comm %s\n",
rank, (uintptr_t) buf, count, typename, dest, tag, commname);
fflush(stderr);
return PMPI_Send(buf, count, type, dest, tag, comm);
}

57
ompi/contrib/libtrace/sendrecv.c Обычный файл
Просмотреть файл

@ -0,0 +1,57 @@
/*
* Copyright (c) 2004-2007 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-2008 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 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include <string.h>
#include "opal_stdint.h"
#include "ompi/mpi/c/bindings.h"
int MPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dest, int sendtag, void *recvbuf, int recvcount,
MPI_Datatype recvtype, int source, int recvtag,
MPI_Comm comm, MPI_Status *status)
{
char sendtypename[MPI_MAX_OBJECT_NAME], recvtypename[MPI_MAX_OBJECT_NAME];
char commname[MPI_MAX_OBJECT_NAME];
int len;
int rank;
int size;
PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
PMPI_Type_get_name(sendtype, sendtypename, &len);
PMPI_Type_get_name(sendtype, recvtypename, &len);
PMPI_Comm_get_name(comm, commname, &len);
PMPI_Type_size(recvtype, &size);
fprintf(stderr, "MPI_SENDRECV[%d]: sendbuf %0" PRIxPTR " sendcount %d sendtype %s dest %d sendtag %d\n\t"
"recvbuf %0" PRIxPTR " recvcount %d recvtype %s source %d recvtag %d comm %s\n",
rank, (uintptr_t) sendbuf, sendcount, sendtypename, dest, sendtag,
(uintptr_t) recvbuf, recvcount, recvtypename, source, recvtag, commname);
fflush(stderr);
memset(recvbuf, 0, recvcount*size);
return PMPI_Sendrecv(sendbuf, sendcount, sendtype, dest, sendtag,
recvbuf, recvcount, recvtype, source, recvtag,
comm, status);
}