void vt_check_request(uint64_t* time, struct VTRequest* req, MPI_Status *status)
{
  if (!req ||
      ((req->flags & ERF_IS_PERSISTENT) && !(req->flags & ERF_IS_ACTIVE)))
    return;

  /* if receive request, write receive trace record */
  if ((req->flags & ERF_RECV) &&
      (status->MPI_SOURCE != MPI_PROC_NULL) && 
      (status->MPI_SOURCE != MPI_ANY_SOURCE))
  {
    int count, sz;
    PMPI_Type_size(req->datatype, &sz);
    PMPI_Get_count(status, req->datatype, &count);
    vt_mpi_recv(time, VT_RANK_TO_PE(status->MPI_SOURCE, req->comm),
		VT_COMM_ID(req->comm), status->MPI_TAG, count * sz);
  }
      
  if (req->flags & ERF_IS_PERSISTENT)
    {
      /* if persistent request, set to inactive,
         and, if requested delete request */
      req->flags &= ~ERF_IS_ACTIVE;
      if (req->flags & ERF_DEALLOCATE) vt_request_free(req);
    }
  else
    {
      /* if non-persistent request, delete always request */
      vt_request_free(req);
    }
}
Exemple #2
0
void vt_check_request(uint64_t* time, struct VTRequest* req, MPI_Status *status,
		uint8_t record_event)
{
  if (!req ||
      ((req->flags & ERF_IS_PERSISTENT) && !(req->flags & ERF_IS_ACTIVE)))
    return;

  /* if receive request, write receive trace record */
  if (record_event &&
      (req->flags & ERF_RECV) &&
      (status->MPI_SOURCE != MPI_PROC_NULL) && 
      (status->MPI_SOURCE != MPI_ANY_SOURCE))
  {
    VT_MPI_INT count, sz;
    PMPI_Type_size(req->datatype, &sz);
    PMPI_Get_count(status, req->datatype, &count);
    vt_mpi_recv(VT_CURRENT_THREAD, time,
                VT_RANK_TO_PE(status->MPI_SOURCE, req->comm),
                VT_COMM_ID(req->comm), status->MPI_TAG, count * sz);
  }

  if (record_event && (req->flags & ERF_IO))
  {
    VT_MPI_INT count, sz;
    PMPI_Type_size(req->datatype, &sz);
    PMPI_Get_count(status, req->datatype, &count);
    if (count == MPI_UNDEFINED)
      count = 0;
    vt_ioend(VT_CURRENT_THREAD, time, req->fileid, req->matchingid, req->handleid, req->fileop,
             (uint64_t)count*(uint64_t)sz);
  }

  if (req->flags & ERF_IS_PERSISTENT)
    {
      /* if persistent request, set to inactive,
         and, if requested delete request */
      req->flags &= ~ERF_IS_ACTIVE;
      if (req->flags & ERF_DEALLOCATE) vt_request_free(req);
    }
  else
    {
      /* if non-persistent request, delete always request */
      vt_request_free(req);
    }
}
#if defined(HAVE_MPI2_THREAD) && HAVE_MPI2_THREAD
if (!is_mpi_multithreaded)
#endif /* HAVE_MPI2_THREAD */
        {
          if (dest != MPI_PROC_NULL && (was_recorded || env_mpi_ignore_filter))
            {
              VT_MPI_INT sz;
              PMPI_Type_size(sendtype, &sz);
              vt_mpi_send(tid, &time, VT_RANK_TO_PE(dest, comm),
                          VT_COMM_ID(comm), sendtag, sendcount * sz);
            }

          if (status == MPI_STATUS_IGNORE) status = &mystatus;
        }
#if defined(HAVE_MPI2_THREAD) && HAVE_MPI2_THREAD
if (!is_mpi_multithreaded)
#endif /* HAVE_MPI2_THREAD */
{
    if (target_rank != MPI_PROC_NULL &&
            (was_recorded || env_mpi_ignore_filter))
    {
        MPI_Comm comm;
        VT_MPI_INT sz;
        uint32_t gid, wid;

        PMPI_Type_size(target_datatype, &sz);
        vt_win_id(win, &comm, &gid, &wid);
        vt_mpi_rma_get(tid, &time, VT_RANK_TO_PE(target_rank, comm), gid,
                       wid, target_count * sz);
    }
}