Merge pull request #2457 from OMGtechy/master
Fixed -Werror=unused-result warnings in comm_cid.c by adding error checking
Этот коммит содержится в:
Коммит
756d09fd6f
@ -840,6 +840,9 @@ static int ompi_comm_allreduce_pmix_reduce_complete (ompi_comm_request_t *reques
|
||||
opal_pmix_pdata_t pdat;
|
||||
opal_buffer_t sbuf;
|
||||
int rc;
|
||||
int bytes_written;
|
||||
const int output_id = 0;
|
||||
const int verbosity_level = 1;
|
||||
|
||||
OBJ_CONSTRUCT(&sbuf, opal_buffer_t);
|
||||
|
||||
@ -858,16 +861,36 @@ static int ompi_comm_allreduce_pmix_reduce_complete (ompi_comm_request_t *reques
|
||||
opal_dss.unload(&sbuf, (void**)&info.data.bo.bytes, &info.data.bo.size);
|
||||
OBJ_DESTRUCT(&sbuf);
|
||||
|
||||
if (cid_context->send_first) {
|
||||
(void)asprintf(&info.key, "%s:%s:send:%d", cid_context->port_string, cid_context->pmix_tag,
|
||||
cid_context->iter);
|
||||
(void)asprintf(&pdat.value.key, "%s:%s:recv:%d", cid_context->port_string, cid_context->pmix_tag,
|
||||
cid_context->iter);
|
||||
bytes_written = asprintf(&info.key,
|
||||
cid_context->send_first ? "%s:%s:send:%d"
|
||||
: "%s:%s:recv:%d",
|
||||
cid_context->port_string,
|
||||
cid_context->pmix_tag,
|
||||
cid_context->iter);
|
||||
|
||||
if (bytes_written == -1) {
|
||||
opal_output_verbose (verbosity_level, output_id, "writing info.key failed\n");
|
||||
} else {
|
||||
(void)asprintf(&info.key, "%s:%s:recv:%d", cid_context->port_string, cid_context->pmix_tag,
|
||||
cid_context->iter);
|
||||
(void)asprintf(&pdat.value.key, "%s:%s:send:%d", cid_context->port_string, cid_context->pmix_tag,
|
||||
cid_context->iter);
|
||||
bytes_written = asprintf(&pdat.value.key,
|
||||
cid_context->send_first ? "%s:%s:recv:%d"
|
||||
: "%s:%s:send:%d",
|
||||
cid_context->port_string,
|
||||
cid_context->pmix_tag,
|
||||
cid_context->iter);
|
||||
|
||||
if (bytes_written == -1) {
|
||||
opal_output_verbose (verbosity_level, output_id, "writing pdat.value.key failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (bytes_written == -1) {
|
||||
// write with separate calls,
|
||||
// just in case the args are the cause of failure
|
||||
opal_output_verbose (verbosity_level, output_id, "send first: %d\n", cid_context->send_first);
|
||||
opal_output_verbose (verbosity_level, output_id, "port string: %s\n", cid_context->port_string);
|
||||
opal_output_verbose (verbosity_level, output_id, "pmix tag: %s\n", cid_context->pmix_tag);
|
||||
opal_output_verbose (verbosity_level, output_id, "iter: %d\n", cid_context->iter);
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
/* this macro is not actually non-blocking. if a non-blocking version becomes available this function
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user