Fix a few more cases where we are using a function
as an argument to a macro which could result in it being called twice. I did not observe any issues, but it should be fixed. Also did some minor refactoring for clarity and following code convention. This commit was SVN r23886.
Этот коммит содержится в:
родитель
0b8691e950
Коммит
20c5e6e0d6
@ -40,7 +40,7 @@
|
|||||||
void mca_pml_bfo_recv_request_process_pending(void)
|
void mca_pml_bfo_recv_request_process_pending(void)
|
||||||
{
|
{
|
||||||
mca_pml_bfo_recv_request_t* recvreq;
|
mca_pml_bfo_recv_request_t* recvreq;
|
||||||
int i, s = (int)opal_list_get_size(&mca_pml_bfo.recv_pending);
|
int rc, i, s = (int)opal_list_get_size(&mca_pml_bfo.recv_pending);
|
||||||
|
|
||||||
for(i = 0; i < s; i++) {
|
for(i = 0; i < s; i++) {
|
||||||
OPAL_THREAD_LOCK(&mca_pml_bfo.lock);
|
OPAL_THREAD_LOCK(&mca_pml_bfo.lock);
|
||||||
@ -50,8 +50,8 @@ void mca_pml_bfo_recv_request_process_pending(void)
|
|||||||
if( OPAL_UNLIKELY(NULL == recvreq) )
|
if( OPAL_UNLIKELY(NULL == recvreq) )
|
||||||
break;
|
break;
|
||||||
recvreq->req_pending = false;
|
recvreq->req_pending = false;
|
||||||
if(OPAL_SOS_GET_ERROR_CODE(mca_pml_bfo_recv_request_schedule_exclusive(recvreq, NULL)) ==
|
rc = mca_pml_bfo_recv_request_schedule_exclusive(recvreq, NULL);
|
||||||
OMPI_ERR_OUT_OF_RESOURCE)
|
if(OMPI_ERR_OUT_OF_RESOURCE == OPAL_SOS_GET_ERROR_CODE(rc))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ OBJ_CLASS_INSTANCE(mca_pml_bfo_send_range_t, ompi_free_list_item_t,
|
|||||||
|
|
||||||
void mca_pml_bfo_send_request_process_pending(struct mca_btl_base_module_t *btl)
|
void mca_pml_bfo_send_request_process_pending(struct mca_btl_base_module_t *btl)
|
||||||
{
|
{
|
||||||
int i, s = opal_list_get_size(&mca_pml_bfo.send_pending);
|
int rc, i, s = opal_list_get_size(&mca_pml_bfo.send_pending);
|
||||||
|
|
||||||
/* advance pending requests */
|
/* advance pending requests */
|
||||||
for(i = 0; i < s; i++) {
|
for(i = 0; i < s; i++) {
|
||||||
@ -56,25 +56,27 @@ void mca_pml_bfo_send_request_process_pending(struct mca_btl_base_module_t *btl)
|
|||||||
|
|
||||||
switch(pending_type) {
|
switch(pending_type) {
|
||||||
case MCA_PML_BFO_SEND_PENDING_SCHEDULE:
|
case MCA_PML_BFO_SEND_PENDING_SCHEDULE:
|
||||||
if(OPAL_SOS_GET_ERROR_CODE(mca_pml_bfo_send_request_schedule_exclusive(sendreq)) ==
|
rc = mca_pml_bfo_send_request_schedule_exclusive(sendreq);
|
||||||
OMPI_ERR_OUT_OF_RESOURCE) {
|
if(OMPI_ERR_OUT_OF_RESOURCE == OPAL_SOS_GET_ERROR_CODE(rc)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MCA_PML_BFO_SEND_PENDING_START:
|
case MCA_PML_BFO_SEND_PENDING_START:
|
||||||
send_dst = mca_bml_base_btl_array_find(
|
send_dst = mca_bml_base_btl_array_find(
|
||||||
&sendreq->req_endpoint->btl_eager, btl);
|
&sendreq->req_endpoint->btl_eager, btl);
|
||||||
if( (NULL == send_dst) ||
|
if (NULL == send_dst) {
|
||||||
(OPAL_SOS_GET_ERROR_CODE(mca_pml_bfo_send_request_start_btl(sendreq, send_dst)) ==
|
/* Put request back onto pending list and try next one. */
|
||||||
OMPI_ERR_OUT_OF_RESOURCE) ) {
|
|
||||||
/* prepend to the pending list to minimize reordering in case
|
|
||||||
* send_dst != 0 */
|
|
||||||
add_request_to_send_pending(sendreq,
|
add_request_to_send_pending(sendreq,
|
||||||
MCA_PML_BFO_SEND_PENDING_START, NULL == send_dst);
|
MCA_PML_BFO_SEND_PENDING_START, true);
|
||||||
/* if no destination try next request otherwise give up,
|
} else {
|
||||||
* no more resources on this btl */
|
rc = mca_pml_bfo_send_request_start_btl(sendreq, send_dst);
|
||||||
if(send_dst != NULL)
|
if (OMPI_ERR_OUT_OF_RESOURCE == OPAL_SOS_GET_ERROR_CODE(rc)) {
|
||||||
|
/* No more resources on this btl so prepend to the pending
|
||||||
|
* list to minimize reordering and give up for now. */
|
||||||
|
add_request_to_send_pending(sendreq,
|
||||||
|
MCA_PML_BFO_SEND_PENDING_START, false);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -72,7 +72,7 @@ static void dump_csum_error_data(mca_btl_base_segment_t* segments, size_t num_se
|
|||||||
void mca_pml_csum_recv_request_process_pending(void)
|
void mca_pml_csum_recv_request_process_pending(void)
|
||||||
{
|
{
|
||||||
mca_pml_csum_recv_request_t* recvreq;
|
mca_pml_csum_recv_request_t* recvreq;
|
||||||
int i, s = (int)opal_list_get_size(&mca_pml_csum.recv_pending);
|
int rc, i, s = (int)opal_list_get_size(&mca_pml_csum.recv_pending);
|
||||||
|
|
||||||
for(i = 0; i < s; i++) {
|
for(i = 0; i < s; i++) {
|
||||||
OPAL_THREAD_LOCK(&mca_pml_csum.lock);
|
OPAL_THREAD_LOCK(&mca_pml_csum.lock);
|
||||||
@ -82,8 +82,8 @@ void mca_pml_csum_recv_request_process_pending(void)
|
|||||||
if( OPAL_UNLIKELY(NULL == recvreq) )
|
if( OPAL_UNLIKELY(NULL == recvreq) )
|
||||||
break;
|
break;
|
||||||
recvreq->req_pending = false;
|
recvreq->req_pending = false;
|
||||||
if(OPAL_SOS_GET_ERROR_CODE(mca_pml_csum_recv_request_schedule_exclusive(recvreq, NULL)) ==
|
rc = mca_pml_csum_recv_request_schedule_exclusive(recvreq, NULL);
|
||||||
OMPI_ERR_OUT_OF_RESOURCE)
|
if(OMPI_ERR_OUT_OF_RESOURCE == OPAL_SOS_GET_ERROR_CODE(rc))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ OBJ_CLASS_INSTANCE(mca_pml_csum_send_range_t, ompi_free_list_item_t,
|
|||||||
|
|
||||||
void mca_pml_csum_send_request_process_pending(mca_bml_base_btl_t *bml_btl)
|
void mca_pml_csum_send_request_process_pending(mca_bml_base_btl_t *bml_btl)
|
||||||
{
|
{
|
||||||
int i, s = opal_list_get_size(&mca_pml_csum.send_pending);
|
int rc, i, s = opal_list_get_size(&mca_pml_csum.send_pending);
|
||||||
|
|
||||||
/* advance pending requests */
|
/* advance pending requests */
|
||||||
for(i = 0; i < s; i++) {
|
for(i = 0; i < s; i++) {
|
||||||
@ -65,25 +65,27 @@ void mca_pml_csum_send_request_process_pending(mca_bml_base_btl_t *bml_btl)
|
|||||||
|
|
||||||
switch(pending_type) {
|
switch(pending_type) {
|
||||||
case MCA_PML_CSUM_SEND_PENDING_SCHEDULE:
|
case MCA_PML_CSUM_SEND_PENDING_SCHEDULE:
|
||||||
if(OPAL_SOS_GET_ERROR_CODE(mca_pml_csum_send_request_schedule_exclusive(sendreq)) ==
|
rc = mca_pml_csum_send_request_schedule_exclusive(sendreq);
|
||||||
OMPI_ERR_OUT_OF_RESOURCE) {
|
if(OMPI_ERR_OUT_OF_RESOURCE == OPAL_SOS_GET_ERROR_CODE(rc)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MCA_PML_CSUM_SEND_PENDING_START:
|
case MCA_PML_CSUM_SEND_PENDING_START:
|
||||||
send_dst = mca_bml_base_btl_array_find(
|
send_dst = mca_bml_base_btl_array_find(
|
||||||
&sendreq->req_endpoint->btl_eager, bml_btl->btl);
|
&sendreq->req_endpoint->btl_eager, bml_btl->btl);
|
||||||
if( (NULL == send_dst) ||
|
if (NULL == send_dst) {
|
||||||
(OPAL_SOS_GET_ERROR_CODE(mca_pml_csum_send_request_start_btl(sendreq, send_dst)) ==
|
/* Put request back onto pending list and try next one. */
|
||||||
OMPI_ERR_OUT_OF_RESOURCE) ) {
|
|
||||||
/* prepend to the pending list to minimize reordering in case
|
|
||||||
* send_dst != 0 */
|
|
||||||
add_request_to_send_pending(sendreq,
|
add_request_to_send_pending(sendreq,
|
||||||
MCA_PML_CSUM_SEND_PENDING_START, NULL == send_dst);
|
MCA_PML_CSUM_SEND_PENDING_START, true);
|
||||||
/* if no destination try next request otherwise give up,
|
} else {
|
||||||
* no more resources on this btl */
|
rc = mca_pml_csum_send_request_start_btl(sendreq, send_dst);
|
||||||
if(send_dst != NULL)
|
if (OMPI_ERR_OUT_OF_RESOURCE == OPAL_SOS_GET_ERROR_CODE(rc)) {
|
||||||
|
/* No more resources on this btl so prepend to the pending
|
||||||
|
* list to minimize reordering and give up for now. */
|
||||||
|
add_request_to_send_pending(sendreq,
|
||||||
|
MCA_PML_CSUM_SEND_PENDING_START, false);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
void mca_pml_ob1_recv_request_process_pending(void)
|
void mca_pml_ob1_recv_request_process_pending(void)
|
||||||
{
|
{
|
||||||
mca_pml_ob1_recv_request_t* recvreq;
|
mca_pml_ob1_recv_request_t* recvreq;
|
||||||
int i, s = (int)opal_list_get_size(&mca_pml_ob1.recv_pending);
|
int rc, i, s = (int)opal_list_get_size(&mca_pml_ob1.recv_pending);
|
||||||
|
|
||||||
for(i = 0; i < s; i++) {
|
for(i = 0; i < s; i++) {
|
||||||
OPAL_THREAD_LOCK(&mca_pml_ob1.lock);
|
OPAL_THREAD_LOCK(&mca_pml_ob1.lock);
|
||||||
@ -46,8 +46,8 @@ void mca_pml_ob1_recv_request_process_pending(void)
|
|||||||
if( OPAL_UNLIKELY(NULL == recvreq) )
|
if( OPAL_UNLIKELY(NULL == recvreq) )
|
||||||
break;
|
break;
|
||||||
recvreq->req_pending = false;
|
recvreq->req_pending = false;
|
||||||
if(OPAL_SOS_GET_ERROR_CODE(mca_pml_ob1_recv_request_schedule_exclusive(recvreq, NULL)) ==
|
rc = mca_pml_ob1_recv_request_schedule_exclusive(recvreq, NULL);
|
||||||
OMPI_ERR_OUT_OF_RESOURCE)
|
if(OMPI_ERR_OUT_OF_RESOURCE == OPAL_SOS_GET_ERROR_CODE(rc))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ OBJ_CLASS_INSTANCE(mca_pml_ob1_send_range_t, ompi_free_list_item_t,
|
|||||||
|
|
||||||
void mca_pml_ob1_send_request_process_pending(mca_bml_base_btl_t *bml_btl)
|
void mca_pml_ob1_send_request_process_pending(mca_bml_base_btl_t *bml_btl)
|
||||||
{
|
{
|
||||||
int i, s = opal_list_get_size(&mca_pml_ob1.send_pending);
|
int rc, i, s = opal_list_get_size(&mca_pml_ob1.send_pending);
|
||||||
|
|
||||||
/* advance pending requests */
|
/* advance pending requests */
|
||||||
for(i = 0; i < s; i++) {
|
for(i = 0; i < s; i++) {
|
||||||
@ -53,25 +53,27 @@ void mca_pml_ob1_send_request_process_pending(mca_bml_base_btl_t *bml_btl)
|
|||||||
|
|
||||||
switch(pending_type) {
|
switch(pending_type) {
|
||||||
case MCA_PML_OB1_SEND_PENDING_SCHEDULE:
|
case MCA_PML_OB1_SEND_PENDING_SCHEDULE:
|
||||||
if(OPAL_SOS_GET_ERROR_CODE(mca_pml_ob1_send_request_schedule_exclusive(sendreq)) ==
|
rc = mca_pml_ob1_send_request_schedule_exclusive(sendreq);
|
||||||
OMPI_ERR_OUT_OF_RESOURCE) {
|
if(OMPI_ERR_OUT_OF_RESOURCE == OPAL_SOS_GET_ERROR_CODE(rc)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MCA_PML_OB1_SEND_PENDING_START:
|
case MCA_PML_OB1_SEND_PENDING_START:
|
||||||
send_dst = mca_bml_base_btl_array_find(
|
send_dst = mca_bml_base_btl_array_find(
|
||||||
&sendreq->req_endpoint->btl_eager, bml_btl->btl);
|
&sendreq->req_endpoint->btl_eager, bml_btl->btl);
|
||||||
if( (NULL == send_dst) ||
|
if (NULL == send_dst) {
|
||||||
(OPAL_SOS_GET_ERROR_CODE(mca_pml_ob1_send_request_start_btl(sendreq, send_dst)) ==
|
/* Put request back onto pending list and try next one. */
|
||||||
OMPI_ERR_OUT_OF_RESOURCE) ) {
|
|
||||||
/* prepend to the pending list to minimize reordering in case
|
|
||||||
* send_dst != 0 */
|
|
||||||
add_request_to_send_pending(sendreq,
|
add_request_to_send_pending(sendreq,
|
||||||
MCA_PML_OB1_SEND_PENDING_START, NULL == send_dst);
|
MCA_PML_OB1_SEND_PENDING_START, true);
|
||||||
/* if no destination try next request otherwise give up,
|
} else {
|
||||||
* no more resources on this btl */
|
rc = mca_pml_ob1_send_request_start_btl(sendreq, send_dst);
|
||||||
if(send_dst != NULL)
|
if (OMPI_ERR_OUT_OF_RESOURCE == OPAL_SOS_GET_ERROR_CODE(rc)) {
|
||||||
|
/* No more resources on this btl so prepend to the pending
|
||||||
|
* list to minimize reordering and give up for now. */
|
||||||
|
add_request_to_send_pending(sendreq,
|
||||||
|
MCA_PML_OB1_SEND_PENDING_START, false);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user