File: btl_sm_fifo.h

package info (click to toggle)
openmpi 1.1-2.3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 39,124 kB
  • ctags: 22,534
  • sloc: ansic: 216,698; sh: 22,541; makefile: 6,921; cpp: 5,562; asm: 3,160; lex: 375; objc: 365; perl: 347; csh: 89; tcl: 12; f90: 5
file content (44 lines) | stat: -rw-r--r-- 1,328 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef MCA_BTL_SM_FIFO_H
#define MCA_BTL_SM_FIFO_H

#include "btl_sm.h"
#include "btl_sm_endpoint.h"

#define MCA_BTL_SM_FIFO_WRITE(endpoint_peer, my_smp_rank,peer_smp_rank,frag,rc) \
do { \
    ompi_fifo_t* fifo; \
    fifo=&(mca_btl_sm_component.fifo[my_smp_rank][peer_smp_rank]); \
 \
    /* thread lock */ \
    if(opal_using_threads()) \
        opal_atomic_lock(&fifo->head_lock); \
    if(OMPI_CB_FREE == fifo->head) { \
        /* no queues have been allocated - allocate now */ \
        rc=ompi_fifo_init_same_base_addr( \
            mca_btl_sm_component.size_of_cb_queue, \
            mca_btl_sm_component.cb_lazy_free_freq, \
            /* at this stage we are not doing anything with memory \
            * locality */ \
            0,0,0, \
            fifo, mca_btl_sm_component.sm_mpool); \
        if( rc != OMPI_SUCCESS ) { \
            if(opal_using_threads()) \
                opal_atomic_unlock(&(fifo->head_lock)); \
            break; \
        } \
    } \
    \
    /* post fragment */ \
    rc=ompi_fifo_write_to_head_same_base_addr(frag, fifo, \
        mca_btl_sm_component.sm_mpool); \
    if(  0 <= rc ) { \
        MCA_BTL_SM_SIGNAL_PEER(endpoint_peer); \
        rc=OMPI_SUCCESS; \
    } \
    if(opal_using_threads()) \
        opal_atomic_unlock(&fifo->head_lock); \
} while(0) 


#endif