1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2 /*
3 * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
4 * University Research and Technology
5 * Corporation. All rights reserved.
6 * Copyright (c) 2004-2005 The University of Tennessee and The University
7 * of Tennessee Research Foundation. All rights
8 * reserved.
9 * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
10 * University of Stuttgart. All rights reserved.
11 * Copyright (c) 2004-2005 The Regents of the University of California.
12 * All rights reserved.
13 * Copyright (c) 2006-2009 Cisco Systems, Inc. All rights reserved.
14 * Copyright (c) 2013 Los Alamos National Security, LLC. All rights
15 * reserved.
16 * $COPYRIGHT$
17 *
18 * Additional copyrights may follow
19 *
20 * $HEADER$
21 */
22
23 #include "ompi_config.h"
24
25 #include <stdio.h>
26
27 #include "opal_stdint.h"
28
29 #include "ompi/op/op.h"
30 #include "ompi/mpi/c/bindings.h"
31
32 int MPI_Reduce(const void *sendbuf, void *recvbuf, int count,
33 MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
34 {
35 char typename[MPI_MAX_OBJECT_NAME], commname[MPI_MAX_OBJECT_NAME];
36 int len;
37 int rank;
38
39 PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
40 PMPI_Type_get_name(datatype, typename, &len);
41 PMPI_Comm_get_name(comm, commname, &len);
42
43 fprintf(stderr,"MPI_REDUCE[%d]: sendbuf %0" PRIxPTR " recvbuf %0" PRIxPTR " count %d datatype %s op %s root %d comm %s\n",
44 rank, (uintptr_t) sendbuf, (uintptr_t) recvbuf, count, typename, op->o_name, root, commname);
45 fflush(stderr);
46
47 return PMPI_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
48 }