Beispiel #1
0
int
ompi_mtl_mx_iprobe(struct mca_mtl_base_module_t* mtl, 
                   struct ompi_communicator_t *comm,
                   int src,
                   int tag,
                   int *flag,
                   struct ompi_status_public_t *status)
{
    uint32_t result;
    mx_return_t ret;
    mx_status_t mx_status;
    uint64_t match_bits;
    uint64_t mask_bits;

    MX_SET_RECV_BITS(match_bits, 
                     mask_bits,
                     comm->c_contextid,
                     src,
                     tag);

    ret = mx_iprobe(ompi_mtl_mx.mx_endpoint,
                    match_bits,
                    mask_bits,
                    &mx_status,
                    &result);
    if (MX_SUCCESS != ret) {
        opal_output(ompi_mtl_base_output, "Error in mx_iprobe (error %s)\n", mx_strerror(ret));
        return OMPI_ERROR;
    }

    if (result) {
        if(MPI_STATUS_IGNORE != status) { 
            MX_GET_SRC(mx_status.match_info, status->MPI_SOURCE);
            MX_GET_TAG(mx_status.match_info, status->MPI_TAG); 
            status->_ucount = mx_status.msg_length;
        }
        *flag = 1;
    } else {
        *flag = 0;
    }

    return OMPI_SUCCESS;
}
Beispiel #2
0
int MPID_nem_mx_iprobe(MPIDI_VC_t *vc,  int source, int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status)
{
    uint64_t match_info = NEM_MX_MATCH_DIRECT;
    uint64_t match_mask = NEM_MX_MATCH_FULL_MASK;
    int      mpi_errno = MPI_SUCCESS;
    mx_return_t ret;
    mx_status_t mx_status;
    uint32_t result;

    NEM_MX_SET_CTXT(match_info,comm->context_id + context_offset);
    if( source  == MPI_ANY_SOURCE)
    {
	NEM_MX_SET_ANYSRC(match_info);
	NEM_MX_SET_ANYSRC(match_mask);	
    }
    else
	NEM_MX_SET_SRC(match_info,source);	
    if (tag == MPI_ANY_TAG)
    {
	NEM_MX_SET_ANYTAG(match_info);
	NEM_MX_SET_ANYTAG(match_mask);
    }
    else
        NEM_MX_SET_TAG(match_info,tag);
    
    ret = mx_iprobe(MPID_nem_mx_local_endpoint,match_info,match_mask,&mx_status,&result);
    MPIU_Assert(ret == MX_SUCCESS);

    if (result != 0)
    {    
	NEM_MX_MATCH_GET_RANK(mx_status.match_info,status->MPI_SOURCE);
	NEM_MX_MATCH_GET_TAG(mx_status.match_info,status->MPI_TAG);
	status->count = mx_status.xfer_length;	
	*flag = TRUE;	
    }
    else
	*flag = FALSE;
	
 fn_exit:
    return mpi_errno;
 fn_fail: ATTRIBUTE((unused))
    goto fn_exit;
}