2005-06-30 09:50:55 +04:00
|
|
|
#ifndef MCA_BTL_SM_FIFO_H
|
|
|
|
#define MCA_BTL_SM_FIFO_H
|
2005-05-24 02:06:50 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
#include "btl_sm.h"
|
2005-09-12 00:55:22 +04:00
|
|
|
#include "btl_sm_endpoint.h"
|
2005-05-24 02:06:50 +04:00
|
|
|
|
2008-08-17 23:00:50 +04:00
|
|
|
#define MCA_BTL_SM_FIFO_WRITE(endpoint_peer, my_smp_rank, \
|
|
|
|
peer_smp_rank, hdr, resend, rc) \
|
|
|
|
do { \
|
|
|
|
ompi_fifo_t* fifo; \
|
|
|
|
fifo=&(mca_btl_sm_component.fifo[peer_smp_rank][my_smp_rank]); \
|
|
|
|
\
|
|
|
|
/* thread lock */ \
|
|
|
|
if(opal_using_threads()) \
|
|
|
|
opal_atomic_lock(fifo->head_lock); \
|
|
|
|
/* post fragment */ \
|
|
|
|
if(ompi_fifo_write_to_head(hdr, fifo) != OMPI_SUCCESS) { \
|
|
|
|
btl_sm_add_pending(endpoint_peer, hdr, resend); \
|
|
|
|
rc = OMPI_ERR_RESOURCE_BUSY; \
|
|
|
|
} else { \
|
|
|
|
MCA_BTL_SM_SIGNAL_PEER(endpoint_peer); \
|
|
|
|
rc = OMPI_SUCCESS; \
|
|
|
|
} \
|
|
|
|
if(opal_using_threads()) \
|
|
|
|
opal_atomic_unlock(fifo->head_lock); \
|
2008-03-09 16:17:13 +03:00
|
|
|
} while(0)
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
#endif
|