示例#1
0
int MPI_Sendrecv(const 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);
}
/**
 * Measurement wrapper for MPI_Comm_get_name
 * @note Auto-generated by wrapgen from template: std.w
 * @note C interface
 * @note Introduced with MPI 2.0
 * @ingroup cg_ext
 */
int MPI_Comm_get_name(MPI_Comm comm,
                      char*    comm_name,
                      int*     resultlen)
{
  int return_val;

  if (IS_EVENT_GEN_ON_FOR(CG_EXT))
  {
    EVENT_GEN_OFF();
    esd_enter(epk_mpi_regid[EPK__MPI_COMM_GET_NAME]);

    return_val = PMPI_Comm_get_name(comm, comm_name, resultlen);

    esd_exit(epk_mpi_regid[EPK__MPI_COMM_GET_NAME]);
    EVENT_GEN_ON();
  }
  else
  {
    return_val = PMPI_Comm_get_name(comm, comm_name, resultlen);
  }

  return return_val;
}
示例#3
0
int MPI_Send(const 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);
}
示例#4
0
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);
}
示例#5
0
int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                   void *recvbuf, const int recvcounts[], const 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);
}
示例#6
0
int MPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
{
  return PMPI_Comm_get_name(comm, name, len);
}