Commit 7552b992 authored by Darius Buntinas's avatar Darius Buntinas
Browse files

[svn-r6886] Improved error message when we get a POLLERR in the TCP netmod. Reviewed by goodell@

parent c11e39f4
......@@ -859,7 +859,9 @@ is too big (> MPIU_SHMW_GHND_SZ)
**sem_destroy %s:sem_destroy() failed %s
**comm_fail:Communication error
**comm_fail %s:Communication error: %s
**comm_fail %d:Communication error with rank %d
**comm_fail %d %s:Communication error with rank %d: %s
**exceeded_connect_tries:Unable to establish connection to process
**exceeded_connect_tries %d:Unable to establish connection to rank %d
**vc_in_error_state:Connection is in error state
......
......@@ -1717,6 +1717,16 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
* on many platforms, including modern Linux. */
if (it_plfd->revents & POLLERR || it_plfd->revents & POLLNVAL) {
int cleanup_errno = MPI_SUCCESS;
int rc;
char dummy;
const char *err_str = "UNKNOWN";
/* See if we can get a specific error for this fd
(Stevens Network Programming Vol 1, pg 184) */
rc = read(it_plfd->fd, &dummy, 1);
if (rc < 0)
err_str = MPIU_Strerror(rc);
MPIU_DBG_MSG(NEM_SOCK_DET, VERBOSE, "error polling fd, closing sc");
if (it_sc->vc) {
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, it_sc->vc);
......@@ -1725,7 +1735,7 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
MPIU_ERR_SET(cleanup_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
MPIU_ERR_ADD(mpi_errno, cleanup_errno);
}
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d", it_sc->vc->pg_rank);
MPIU_ERR_SET2(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d %s", it_sc->vc->pg_rank, err_str);
} else {
MPIDU_Ftb_publish(MPIDU_FTB_EV_COMMUNICATION, "");
cleanup_errno = cleanup_and_free_sc_plfd(it_sc);
......@@ -1733,7 +1743,7 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
MPIU_ERR_SET(cleanup_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
MPIU_ERR_ADD(mpi_errno, cleanup_errno);
}
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**comm_fail");
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %s", err_str);
}
goto fn_fail;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment