-: 0:Source:/home/MPI/testing/mpich2/mpich2/src/mpid/ch3/src/mpid_irsend.c
-: 0:Graph:mpid_irsend.gcno
-: 0:Data:mpid_irsend.gcda
-: 0:Runs:541
-: 0:Programs:82
-: 1:/* -*- Mode: C; c-basic-offset:4 ; -*- */
-: 2:/*
-: 3: * (C) 2001 by Argonne National Laboratory.
-: 4: * See COPYRIGHT in top-level directory.
-: 5: */
-: 6:
-: 7:#include "mpidimpl.h"
-: 8:
-: 9:/* FIXME: HOMOGENEOUS SYSTEMS ONLY -- no data conversion is performed */
-: 10:
-: 11:/*
-: 12: * MPID_Irsend()
-: 13: */
-: 14:#undef FUNCNAME
-: 15:#define FUNCNAME MPID_Irsend
-: 16:#undef FCNAME
-: 17:#define FCNAME MPIDI_QUOTE(FUNCNAME)
-: 18:int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
-: 19: MPID_Request ** request)
3061: 20:{
-: 21: MPIDI_CH3_Pkt_t upkt;
3061: 22: MPIDI_CH3_Pkt_ready_send_t * const ready_pkt = &upkt.ready_send;
-: 23: MPIDI_msg_sz_t data_sz;
-: 24: int dt_contig;
-: 25: MPI_Aint dt_true_lb;
-: 26: MPID_Datatype * dt_ptr;
-: 27: MPID_Request * sreq;
-: 28: MPIDI_VC_t * vc;
-: 29:#if defined(MPID_USE_SEQUENCE_NUMBERS)
-: 30: MPID_Seqnum_t seqnum;
-: 31:#endif
3061: 32: int mpi_errno = MPI_SUCCESS;
-: 33: MPIDI_STATE_DECL(MPID_STATE_MPID_IRSEND);
-: 34:
-: 35: MPIDI_FUNC_ENTER(MPID_STATE_MPID_IRSEND);
-: 36:
-: 37: MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
-: 38: "rank=%d, tag=%d, context=%d",
-: 39: rank, tag, comm->context_id + context_offset));
-: 40:
3061: 41: if (rank == comm->rank && comm->comm_kind != MPID_INTERCOMM)
-: 42: {
12: 43: mpi_errno = MPIDI_Isend_self(buf, count, datatype, rank, tag, comm, context_offset, MPIDI_REQUEST_TYPE_RSEND, &sreq);
12: 44: goto fn_exit;
-: 45: }
-: 46:
3049: 47: MPIDI_Request_create_sreq(sreq, mpi_errno, goto fn_exit);
3049: 48: MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_RSEND);
3049: 49: MPIDI_Request_set_msg_type(sreq, MPIDI_REQUEST_EAGER_MSG);
-: 50:
3049: 51: if (rank == MPI_PROC_NULL)
-: 52: {
|
#####: 53: MPIU_Object_set_ref(sreq, 1);
#####: 54: sreq->cc = 0;
#####: 55: goto fn_exit;
-: 56: }
-: 57:
|
3049: 58: MPIDI_Comm_get_vc_set_active(comm, rank, &vc);
-: 59:
-: 60:#ifdef ENABLE_COMM_OVERRIDES
-: 61: if (vc->comm_ops && vc->comm_ops->irsend)
-: 62: {
-: 63: mpi_errno = vc->comm_ops->irsend( vc, buf, count, datatype, rank, tag, comm, context_offset, &sreq);
-: 64: goto fn_exit;
-: 65: }
-: 66:#endif
-: 67:
3049: 68: MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr, dt_true_lb);
-: 69:
3049: 70: MPIDI_Pkt_init(ready_pkt, MPIDI_CH3_PKT_READY_SEND);
3049: 71: ready_pkt->match.parts.rank = comm->rank;
3049: 72: ready_pkt->match.parts.tag = tag;
3049: 73: ready_pkt->match.parts.context_id = comm->context_id + context_offset;
3049: 74: ready_pkt->sender_req_id = MPI_REQUEST_NULL;
3049: 75: ready_pkt->data_sz = data_sz;
-: 76:
3049: 77: if (data_sz == 0)
-: 78: {
-: 79: MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending zero length message");
-: 80:
|
#####: 81: sreq->dev.OnDataAvail = 0;
-: 82:
-: 83: MPIDI_VC_FAI_send_seqnum(vc, seqnum);
-: 84: MPIDI_Pkt_set_seqnum(ready_pkt, seqnum);
-: 85: MPIDI_Request_set_seqnum(sreq, seqnum);
-: 86:
-: 87: MPIU_THREAD_CS_ENTER(CH3COMM,vc);
#####: 88: mpi_errno = MPIU_CALL(MPIDI_CH3,iSend(vc, sreq, ready_pkt, sizeof(*ready_pkt)));
-: 89: MPIU_THREAD_CS_EXIT(CH3COMM,vc);
|
-: 90: /* --BEGIN ERROR HANDLING-- */
#####: 91: if (mpi_errno != MPI_SUCCESS)
-: 92: {
#####: 93: MPIU_Object_set_ref(sreq, 0);
#####: 94: MPIDI_CH3_Request_destroy(sreq);
#####: 95: sreq = NULL;
#####: 96: mpi_errno = MPIR_Err_create_code(mpi_errno, MPIR_ERR_FATAL, FCNAME, __LINE__, MPI_ERR_OTHER, "**ch3|eagermsg", 0);
#####: 97: goto fn_exit;
-: 98: }
-: 99: /* --END ERROR HANDLING-- */
-: 100: goto fn_exit;
-: 101: }
-: 102:
|
3049: 103: if (dt_contig) {
1861: 104: mpi_errno = MPIDI_CH3_EagerContigIsend( &sreq,
-: 105: MPIDI_CH3_PKT_READY_SEND,
-: 106: (char*)buf + dt_true_lb,
-: 107: data_sz, rank, tag,
-: 108: comm, context_offset );
-: 109:
-: 110: }
-: 111: else {
1188: 112: mpi_errno = MPIDI_CH3_EagerNoncontigSend( &sreq,
-: 113: MPIDI_CH3_PKT_READY_SEND,
-: 114: buf, count, datatype,
-: 115: data_sz, rank, tag,
-: 116: comm, context_offset );
-: 117: /* If we're not complete, then add a reference to the datatype */
1188: 118: if (sreq && sreq->dev.OnDataAvail) {
|
#####: 119: sreq->dev.datatype_ptr = dt_ptr;
#####: 120: MPID_Datatype_add_ref(dt_ptr);
-: 121: }
-: 122: }
-: 123:
|
3061: 124: fn_exit:
3061: 125: *request = sreq;
-: 126:
-: 127: MPIU_DBG_STMT(CH3_OTHER,VERBOSE,{
-: 128: if (sreq != NULL)
-: 129: {
-: 130: MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,"request allocated, handle=0x%08x", sreq->handle);
-: 131: }
-: 132: }
-: 133: );
-: 134:
|
-: 135: MPIDI_FUNC_EXIT(MPID_STATE_MPID_IRSEND);
|
3061: 136: return mpi_errno;
-: 137:}
|