1
1

Get rid of the static buffer. Instead use directly the user supplied one.

This commit was SVN r21541.
Этот коммит содержится в:
George Bosilca 2009-06-26 19:21:27 +00:00
родитель 24e74922ce
Коммит 760df7fcb9

Просмотреть файл

@ -416,13 +416,13 @@ static int onesided_barrier(void)
} }
static opal_buffer_t *allgather_buf;
static orte_std_cntr_t allgather_complete; static orte_std_cntr_t allgather_complete;
static void allgather_recv(int status, orte_process_name_t* sender, static void allgather_recv(int status, orte_process_name_t* sender,
opal_buffer_t *buffer, opal_buffer_t *buffer,
orte_rml_tag_t tag, void *cbdata) orte_rml_tag_t tag, void *cbdata)
{ {
opal_buffer_t *allgather_buf = (opal_buffer_t*)cbdata;
int rc; int rc;
/* xfer the data */ /* xfer the data */
@ -468,15 +468,12 @@ static int allgather(opal_buffer_t *sbuf, opal_buffer_t *rbuf)
"%s grpcomm:bad allgather buffer sent", "%s grpcomm:bad allgather buffer sent",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
/* setup the buffer that will recv the results */
allgather_buf = OBJ_NEW(opal_buffer_t);
/* now receive the final result. Be sure to do this in /* now receive the final result. Be sure to do this in
* a manner that allows us to return without being in a recv! * a manner that allows us to return without being in a recv!
*/ */
allgather_complete = false; allgather_complete = false;
rc = orte_rml.recv_buffer_nb(ORTE_NAME_WILDCARD, ORTE_RML_TAG_ALLGATHER, rc = orte_rml.recv_buffer_nb(ORTE_NAME_WILDCARD, ORTE_RML_TAG_ALLGATHER,
ORTE_RML_NON_PERSISTENT, allgather_recv, NULL); ORTE_RML_NON_PERSISTENT, allgather_recv, rbuf);
if (rc != ORTE_SUCCESS) { if (rc != ORTE_SUCCESS) {
ORTE_ERROR_LOG(rc); ORTE_ERROR_LOG(rc);
return rc; return rc;
@ -484,14 +481,6 @@ static int allgather(opal_buffer_t *sbuf, opal_buffer_t *rbuf)
ORTE_PROGRESSED_WAIT(allgather_complete, 0, 1); ORTE_PROGRESSED_WAIT(allgather_complete, 0, 1);
/* copy payload to the caller's buffer */
if (ORTE_SUCCESS != (rc = opal_dss.copy_payload(rbuf, allgather_buf))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(allgather_buf);
return rc;
}
OBJ_RELEASE(allgather_buf);
OPAL_OUTPUT_VERBOSE((1, orte_grpcomm_base_output, OPAL_OUTPUT_VERBOSE((1, orte_grpcomm_base_output,
"%s grpcomm:bad allgather completed", "%s grpcomm:bad allgather completed",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));