Beispiel #1
0
static inline void mca_spml_irkit_req_wait(mxm_req_base_t *req)
{
    do {
        /* do at least one progress since
         * with some TLs (self, shm) request
         * can be completed immediately
         */
        opal_progress();
    } while (!mxm_req_test(req));
}
Beispiel #2
0
static inline void gasnetc_ReqRepWait(mxm_send_req_t * mxm_sreq,
                                      uint8_t is_request, uint8_t msg_num)
{
    if (is_request) {
        /*
         * Ensure progress, but only on requester side (even on async request).
         * We don't want to have recursion on responder side - otherwise
         * send might be called from context of receive and so on.
         */
#if GASNET_DEBUG_AM
        MXM_LOG("[pid %d] polling and testing(%s, msg_num = 0x%02x)...\n",
                getpid(), is_request ? "request" : "response", msg_num);
#endif

        while (!mxm_req_test(&mxm_sreq->base))
            gasnetc_AMPoll();

#if GASNET_DEBUG_AM
        MXM_LOG("[pid %d] done polling and testing(%s, msg_num = 0x%02x)...\n",
                getpid(), is_request ? "request" : "response", msg_num);
#endif
    } else {
        mxm_wait_t wait;
        wait.progress_cb = NULL;
        wait.progress_arg = NULL;
        wait.req = &mxm_sreq->base;
        wait.state = MXM_REQ_COMPLETED;
        /*
         * We're on the responder side - just wait for completion.
         */
#if GASNET_DEBUG_AM
        MXM_LOG("[pid %d] calling mxm_req_wait(%s, msg_num = 0x%02x)...\n",
                getpid(), is_request ? "request" : "response", msg_num);
#endif

        mxm_wait(&wait);

#if GASNET_DEBUG_AM
        MXM_LOG("[pid %d] mxm_req_wait(%s, msg_num = 0x%02x) returned\n",
                getpid(), is_request ? "request" : "response", msg_num);
#endif
    }
}
Beispiel #3
0
extern void gasnetc_barrier_fence(void)
{
    gasnet_mxm_send_req_t * sreqs;
    mxm_send_req_t * mxm_sreq;
    mxm_error_t mxm_res;
    int dest;

    sreqs = (gasnet_mxm_send_req_t *)
            alloca(sizeof(gasnet_mxm_send_req_t) * gasneti_nodes);

    for (dest = 0; dest < gasneti_nodes; dest++) {
        if (!gasnet_mxm_module.need_fence[dest])
            continue;
        if_pf (dest == gasneti_mynode)
        continue;
#if GASNET_PSHM
        if_pf (gasneti_pshm_in_supernode(dest))
        continue;
#endif
        mxm_sreq = &sreqs[dest].mxm_sreq;
#if MXM_API < MXM_VERSION(2,0)
        mxm_sreq->opcode = MXM_REQ_OP_FENCE;
        mxm_sreq->base.flags = MXM_REQ_FLAG_SEND_SYNC;
#else
        mxm_sreq->opcode = MXM_REQ_OP_PUT_SYNC;
        mxm_sreq->flags  = MXM_REQ_SEND_FLAG_FENCE;
        mxm_sreq->op.mem.remote_vaddr = 0;
        mxm_sreq->op.mem.remote_mkey  = &mxm_empty_mem_key;
#endif

        mxm_sreq->base.state = MXM_REQ_NEW;
        mxm_sreq->base.conn = gasnet_mxm_module.connections[dest];
        mxm_sreq->base.mq = gasnet_mxm_module.mxm_mq;

        mxm_sreq->base.data.buffer.ptr = NULL;
        mxm_sreq->base.data.buffer.length = 0;

#if MXM_API < MXM_VERSION(1,5)
        mxm_sreq->base.data.buffer.mkey = MXM_MKEY_NONE;
#else
        mxm_sreq->base.data.buffer.memh = NULL;
#endif
        mxm_sreq->base.data_type = MXM_REQ_DATA_BUFFER;

        mxm_sreq->base.completed_cb = NULL;
        mxm_sreq->base.context = NULL;

        mxm_res = mxm_req_send(mxm_sreq);
        if_pt (MXM_OK != mxm_res)
        gasneti_fatalerror("Error posting send request - %s\n",
                           mxm_error_string(mxm_res));
    }

    for (dest = 0; dest < gasneti_nodes; dest++) {
        if (!gasnet_mxm_module.need_fence[dest])
            continue;
        if_pf (dest == gasneti_mynode)
        continue;
#if GASNET_PSHM
        if_pf (gasneti_pshm_in_supernode(dest))
        continue;
#endif
        mxm_sreq = &sreqs[dest].mxm_sreq;

        /* we are waiting for real completion, not just for SENT state */
        while (!mxm_req_test(&mxm_sreq->base))
            gasnetc_AMPoll();

        gasnet_mxm_module.need_fence[dest] = 0;
    }
}
Beispiel #4
0
static inline void mca_spml_irkit_req_wait(mxm_req_base_t *req)
{
    while (!mxm_req_test(req))
        opal_progress();
}