root/ompi/mca/mtl/psm/mtl_psm_probe.c

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

DEFINITIONS

This source file includes following definitions.
  1. ompi_mtl_psm_iprobe
  2. ompi_mtl_psm_improbe

   1 /*
   2  * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2010 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2006 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2006      QLogic Corporation. All rights reserved.
  13  * Copyright (c) 2006-2007 Los Alamos National Security, LLC.  All rights
  14  *                         reserved.
  15  * $COPYRIGHT$
  16  *
  17  * Additional copyrights may follow
  18  *
  19  * $HEADER$
  20  */
  21 
  22 #include "ompi_config.h"
  23 #include "mtl_psm.h"
  24 #include "mtl_psm_types.h"
  25 #include "psm.h"
  26 #include "ompi/communicator/communicator.h"
  27 
  28 
  29 int ompi_mtl_psm_iprobe(struct mca_mtl_base_module_t* mtl,
  30                               struct ompi_communicator_t *comm,
  31                               int src,
  32                               int tag,
  33                               int *flag,
  34                               struct ompi_status_public_t *status)
  35 {
  36     uint64_t mqtag, tagsel;
  37     psm_mq_status_t mqstat;
  38     psm_error_t err;
  39 
  40     PSM_MAKE_TAGSEL(src, tag, comm->c_contextid, mqtag, tagsel);
  41 
  42     err = psm_mq_iprobe(ompi_mtl_psm.mq, mqtag, tagsel, &mqstat);
  43     if (err == PSM_OK) {
  44         *flag = 1;
  45         if(MPI_STATUS_IGNORE != status) {
  46             status->MPI_SOURCE = PSM_GET_MQRANK(mqstat.msg_tag);
  47             status->MPI_TAG = PSM_GET_MQUTAG(mqstat.msg_tag);
  48             status->_ucount = mqstat.nbytes;
  49 
  50             switch (mqstat.error_code) {
  51             case PSM_OK:
  52                 status->MPI_ERROR = OMPI_SUCCESS;
  53                 break;
  54             case PSM_MQ_TRUNCATION:
  55                 status->MPI_ERROR = MPI_ERR_TRUNCATE;
  56                 break;
  57             default:
  58                 status->MPI_ERROR = MPI_ERR_INTERN;
  59             }
  60         }
  61 
  62         return OMPI_SUCCESS;
  63     }
  64     else if (err == PSM_MQ_INCOMPLETE) {
  65         *flag = 0;
  66         return OMPI_SUCCESS;
  67     }
  68     else
  69         return OMPI_ERROR;
  70 }
  71 
  72 
  73 int
  74 ompi_mtl_psm_improbe(struct mca_mtl_base_module_t *mtl,
  75                      struct ompi_communicator_t *comm,
  76                      int src,
  77                      int tag,
  78                      int *matched,
  79                      struct ompi_message_t **message,
  80                      struct ompi_status_public_t *status)
  81 {
  82     return OMPI_ERR_NOT_IMPLEMENTED;
  83 }

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