⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mpidi_callback_rzv.c

📁 fortran并行计算包
💻 C
字号:
/*  (C)Copyright IBM Corp.  2007, 2008  *//** * \file src/pt2pt/mpidi_callback_rzv.c * \brief The callback for a new RZV RTS */#include "mpidimpl.h"/** * \brief The callback for a new RZV RTS * \note  Because this is a short message, the data is already received * \param[in]  clientdata   Unused * \param[in]  rzv_envelope The 16-byte msginfo struct * \param[in]  count        The number of msginfo quads (1) * \param[in]  senderrank   The sender's rank * \param[in]  sndlen       The length of the incoming data * \param[in]  sndbuf       Where the data is stored */void MPIDI_BG2S_RecvRzvCB(void                         * clientdata,                          const MPIDI_DCMF_RzvEnvelope * rzv_envelope,                          unsigned                       count,                          unsigned                       senderrank,                          const char                   * sndbuf,                          unsigned                       sndlen){  MPID_Request * rreq = NULL;  MPIDI_DCMF_MsgInfo * msginfo = (MPIDI_DCMF_MsgInfo *)&rzv_envelope->msginfo;  int found;  /* -------------------------- */  /*      match request         */  /* -------------------------- */  MPIDI_Message_match match;  match.rank              = msginfo->msginfo.MPIrank;  match.tag               = msginfo->msginfo.MPItag;  match.context_id        = msginfo->msginfo.MPIctxt;  rreq = MPIDI_Recvq_FDP_or_AEU(match.rank, match.tag, match.context_id, &found);  if (rreq == NULL)    {      /* ------------------------------------------------- */      /* we have failed to match the request.              */      /* allocate and initialize a request object instead. */      /* ------------------------------------------------- */      int mpi_errno = MPIR_Err_create_code(MPI_SUCCESS,                                           MPIR_ERR_FATAL,                                           "mpid_recv",                                           __LINE__,                                           MPI_ERR_OTHER,                                           "**nomem", 0);      rreq->status.MPI_ERROR = mpi_errno;      rreq->status.count     = 0;      MPID_Abort(NULL, mpi_errno, -1, "Cannot allocate message");    }  /* -------------------------------------- */  /* Signal that the recv has been started. */  /* -------------------------------------- */  MPID_Progress_signal ();  /* ------------------------ */  /* copy in information      */  /* ------------------------ */  rreq->status.MPI_SOURCE = match.rank;  rreq->status.MPI_TAG    = match.tag;  MPID_Request_setPeerRank(rreq,senderrank);  MPID_Request_setPeerRequest(rreq,msginfo->msginfo.req);  MPID_Request_setSync(rreq, msginfo->msginfo.isSync);  MPID_Request_setRzv(rreq, 1);  /* ----------------------------------------------------- */  /* Save the rendezvous information for when the target   */  /* node calls a receive function and the data is         */  /* retreived from the origin node.                       */  /* ----------------------------------------------------- */  MPIDI_DCMF_RzvInfo * rzvinfo = (MPIDI_DCMF_RzvInfo *)&rzv_envelope->rzvinfo;  rreq->status.count = rzvinfo->sndlen;  rreq->dcmf.rzvinfo.sndlen = rzvinfo->sndlen;  rreq->dcmf.rzvinfo.sndbuf = rzvinfo->sndbuf;  /* ----------------------------------------- */  /* figure out target buffer for request data */  /* ----------------------------------------- */  if (found)    {      MPIDI_DCMF_RendezvousTransfer (rreq);    }  /* ------------------------------------------------------------- */  /* Request was not posted. */  /* ------------------------------------------------------------- */  else    {      rreq->dcmf.uebuf = NULL;      rreq->dcmf.uebuflen = 0;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -