1
1

Fix CID 1384. Also remove some opal_output(0,...)'s in favor of

ORTE_ERROR_LOG.

This commit was SVN r22066.
Этот коммит содержится в:
Jeff Squyres 2009-10-07 18:58:58 +00:00
родитель ec71acf7ca
Коммит de59a24593

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

@ -50,6 +50,7 @@
#include "orte/util/name_fns.h"
#include "orte/util/show_help.h"
#include "orte/runtime/orte_globals.h"
#include "orte/mca/errmgr/errmgr.h"
#include "ompi/constants.h"
#include "ompi/proc/proc.h"
@ -223,15 +224,19 @@ mca_common_sm_mmap_t* mca_common_sm_mmap_init(ompi_proc_t **procs,
/* process initializing the file */
fd = open(file_name, O_CREAT|O_RDWR, 0600);
if (fd < 0) {
int err = errno;
ORTE_ERROR_LOG(OMPI_ERR_IN_ERRNO);
orte_show_help("help-mpi-common-sm.txt", "sys call fail", 1,
orte_process_info.nodename,
"open(2)", file_name,
strerror(errno), errno);
strerror(err), err);
} else if (ftruncate(fd, size) != 0) {
int err = errno;
ORTE_ERROR_LOG(OMPI_ERR_IN_ERRNO);
orte_show_help("help-mpi-common-sm.txt", "sys call fail", 1,
orte_process_info.nodename,
"ftruncate(2)", "",
strerror(errno), errno);
strerror(err), err);
close(fd);
unlink(file_name);
fd = -1;
@ -263,6 +268,7 @@ mca_common_sm_mmap_t* mca_common_sm_mmap_init(ompi_proc_t **procs,
rc = orte_rml.send(&(procs[p]->proc_name), iov, 3,
OMPI_RML_TAG_SM_BACK_FILE_CREATED, 0);
if (rc < (ssize_t) (iov[0].iov_len + iov[1].iov_len + iov[2].iov_len)) {
ORTE_ERROR_LOG(OMPI_ERR_COMM_FAILURE);
opal_output(0, "mca_common_sm_mmap_init: "
"orte_rml.send failed to %lu with errno=%d, ret=%d, iov_len sum=%d\n",
(unsigned long)p, errno,
@ -312,11 +318,8 @@ mca_common_sm_mmap_t* mca_common_sm_mmap_init(ompi_proc_t **procs,
OMPI_RML_TAG_SM_BACK_FILE_CREATED, 0);
opal_progress_event_users_decrement();
if (rc < 0) {
opal_output(0, "mca_common_sm_mmap_init: "
"orte_rml.recv failed from %d with errno=%d\n",
0, errno);
munmap(map, size);
/* fd wasn't opened here; no need to close/reset */
ORTE_ERROR_LOG(OMPI_ERR_RECV_LESS_THAN_POSTED);
/* fd/map wasn't opened here; no need to close/reset */
goto out;
}
@ -328,9 +331,8 @@ mca_common_sm_mmap_t* mca_common_sm_mmap_init(ompi_proc_t **procs,
/* If not, put it on the pending list and try again */
rml_msg = OBJ_NEW(pending_rml_msg_t);
if (NULL == rml_msg) {
opal_output(0, "mca_common_sm_mmap_init: failed to create pending rml message");
munmap(map, size);
/* fd wasn't opened here; no need to close/reset */
ORTE_ERROR_LOG(OMPI_ERR_OUT_OF_RESOURCE);
/* fd/map wasn't opened here; no need to close/reset */
goto out;
}
memcpy(rml_msg->file_name, filename_to_send,