Jeff,

I'm intrigued by this commit. Here is how I read the patch:

1. In most of the cases you added one opal_output on top of the already existing orte_show_help

2. In some other cases you replaced meaningful messages such as
"mca_common_sm_mmap_init: orte_rml.recv failed from %d with errno=%d\n"
  with
     "Receive was less than posted size"

I don't think this makes things more clear or cleaner ...

  george.

On Oct 7, 2009, at 14:58 , jsquy...@osl.iu.edu wrote:

Author: jsquyres
Date: 2009-10-07 14:58:58 EDT (Wed, 07 Oct 2009)
New Revision: 22066
URL: https://svn.open-mpi.org/trac/ompi/changeset/22066

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

Text files modified:
trunk/ompi/mca/common/sm/common_sm_mmap.c | 22 +++++++++++ +----------
  1 files changed, 12 insertions(+), 10 deletions(-)

Modified: trunk/ompi/mca/common/sm/common_sm_mmap.c
= = = = = = = = ======================================================================
--- trunk/ompi/mca/common/sm/common_sm_mmap.c   (original)
+++ trunk/ompi/mca/common/sm/common_sm_mmap.c 2009-10-07 14:58:58 EDT (Wed, 07 Oct 2009)
@@ -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 @@
        /* 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 @@
            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 @@
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 @@
                /* 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,
_______________________________________________
svn-full mailing list
svn-f...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/svn-full

Reply via email to