root/ompi/contrib/libompitrace/sendrecv.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. MPI_Sendrecv

   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) 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 #include <string.h>
  27 
  28 #include "opal_stdint.h"
  29 
  30 #include "ompi/mpi/c/bindings.h"
  31 
  32 int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
  33                  int dest, int sendtag, void *recvbuf, int recvcount,
  34                  MPI_Datatype recvtype, int source, int recvtag,
  35                  MPI_Comm comm,  MPI_Status *status)
  36 {
  37     char sendtypename[MPI_MAX_OBJECT_NAME], recvtypename[MPI_MAX_OBJECT_NAME];
  38     char commname[MPI_MAX_OBJECT_NAME];
  39     int len;
  40     int rank;
  41     int size;
  42 
  43     PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
  44     PMPI_Type_get_name(sendtype, sendtypename, &len);
  45     PMPI_Type_get_name(sendtype, recvtypename, &len);
  46     PMPI_Comm_get_name(comm, commname, &len);
  47     PMPI_Type_size(recvtype, &size);
  48 
  49     fprintf(stderr, "MPI_SENDRECV[%d]: sendbuf %0" PRIxPTR " sendcount %d sendtype %s dest %d sendtag %d\n\t"
  50            "recvbuf %0" PRIxPTR " recvcount %d recvtype %s source %d recvtag %d comm %s\n",
  51             rank, (uintptr_t) sendbuf, sendcount, sendtypename, dest, sendtag,
  52             (uintptr_t) recvbuf, recvcount, recvtypename, source, recvtag, commname);
  53     fflush(stderr);
  54 
  55     memset(recvbuf, 0, recvcount*size);
  56 
  57     return PMPI_Sendrecv(sendbuf, sendcount, sendtype, dest, sendtag,
  58                          recvbuf, recvcount, recvtype, source, recvtag,
  59                          comm, status);
  60 }

/* [<][>][^][v][top][bottom][index][help] */