Commit 1f4f644f authored by Darius Buntinas's avatar Darius Buntinas
Browse files

[svn-r7415] Modified what and where FTB events are thrown to reflect draft standard MPI FTB events

parent 2d14dba2
......@@ -491,10 +491,7 @@ static int send_id_info(const sockconn_t *const sc)
}
CHECK_EINTR (offset, writev(sc->fd, iov, iov_cnt));
if (offset == -1 && errno != EAGAIN) {
MPIDU_Ftb_publish(MPIDU_FTB_EV_COMMUNICATION, "");
MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
}
MPIU_ERR_CHKANDJUMP1(offset == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
MPIU_ERR_CHKANDJUMP1(offset != buf_size, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
/* FIXME log appropriate error */
/* FIXME-Z1 socket is just connected and we are sending a few bytes. So, there should not */
......@@ -543,10 +540,7 @@ static int send_tmpvc_info(const sockconn_t *const sc)
buf_size = sizeof(hdr) + sizeof(port_info);
CHECK_EINTR (offset, writev(sc->fd, iov, iov_cnt));
if (offset == -1 && errno != EAGAIN) {
MPIDU_Ftb_publish(MPIDU_FTB_EV_COMMUNICATION, "");
MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
}
MPIU_ERR_CHKANDJUMP1(offset == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
MPIU_ERR_CHKANDJUMP1(offset != buf_size, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
/* FIXME log appropriate error */
/* FIXME-Z1 socket is just connected and we are sending a few bytes. So, there should not */
......@@ -591,7 +585,6 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
goto fn_exit;
}
if (nread == -1 && errno != EAGAIN) {
MPIDU_Ftb_publish(MPIDU_FTB_EV_COMMUNICATION, "");
MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
}
MPIU_ERR_CHKANDJUMP1(nread != hdr_len, mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno)); /* FIXME-Z1 */
......@@ -611,7 +604,6 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
}
CHECK_EINTR (nread, readv(sc->fd, iov, iov_cnt));
if (nread == -1 && errno != EAGAIN) {
MPIDU_Ftb_publish(MPIDU_FTB_EV_COMMUNICATION, "");
MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
}
MPIU_ERR_CHKANDJUMP1(nread != hdr.datalen, mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno)); /* FIXME-Z1 */
......@@ -674,7 +666,6 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
CHECK_EINTR (nread, readv(sc->fd, iov, iov_cnt));
if (nread == -1 && errno != EAGAIN) {
MPIDU_Ftb_publish(MPIDU_FTB_EV_COMMUNICATION, "");
MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
}
MPIU_ERR_CHKANDJUMP1(nread != hdr.datalen, mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno)); /* FIXME-Z1 */
......@@ -723,10 +714,7 @@ static int send_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t pkt_type)
pkt.datalen = 0;
CHECK_EINTR (offset, write(fd, &pkt, pkt_len));
if (offset == -1 && errno != EAGAIN) {
MPIDU_Ftb_publish(MPIDU_FTB_EV_COMMUNICATION, "");
MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
}
MPIU_ERR_CHKANDJUMP1(offset == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno));
MPIU_ERR_CHKANDJUMP1(offset != pkt_len, mpi_errno, MPI_ERR_OTHER, "**write", "**write %s", MPIU_Strerror(errno)); /* FIXME-Z1 */
fn_exit:
return mpi_errno;
......@@ -754,10 +742,7 @@ static int recv_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t *pkt_type)
MPIDI_FUNC_ENTER(MPID_STATE_RECV_CMD_PKT);
CHECK_EINTR (nread, read(fd, &pkt, pkt_len));
if (nread == -1 && errno != EAGAIN) {
MPIDU_Ftb_publish(MPIDU_FTB_EV_COMMUNICATION, "");
MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
}
MPIU_ERR_CHKANDJUMP1(nread == -1 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**read", "**read %s", MPIU_Strerror(errno));
MPIU_ERR_CHKANDJUMP2(nread != pkt_len, mpi_errno, MPI_ERR_OTHER, "**read", "**read %d %s", nread, MPIU_Strerror(errno)); /* FIXME-Z1 */
MPIU_Assert(pkt.datalen == 0);
MPIU_Assert(pkt.pkt_type == MPIDI_NEM_TCP_SOCKSM_PKT_ID_ACK ||
......@@ -871,13 +856,8 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
sock_addr = &(vc_tcp->sock_id);
CHECK_EINTR(sc->fd, socket(AF_INET, SOCK_STREAM, 0));
if (sc->fd == -1) {
if (errno == ENOBUFS || errno == ENOMEM) {
MPIDU_Ftb_publish(MPIDU_FTB_EV_RESOURCES, "socket");
}
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, vc);
MPIU_ERR_SETANDJUMP2(mpi_errno, MPI_ERR_OTHER, "**sock_create", "**sock_create %s %d", MPIU_Strerror(errno), errno);
}
MPIU_ERR_CHKANDJUMP2(sc->fd == -1, mpi_errno, MPI_ERR_OTHER, "**sock_create", "**sock_create %s %d", MPIU_Strerror(errno), errno);
plfd->fd = sc->fd;
MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "sc->fd=%d, plfd->events=%d, plfd->revents=%d, vc=%p, sc=%p", sc->fd, plfd->events, plfd->revents, vc, sc));
mpi_errno = MPID_nem_tcp_set_sockopts(sc->fd);
......@@ -886,10 +866,7 @@ int MPID_nem_tcp_connect(struct MPIDI_VC *const vc)
MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "connecting to 0x%08X:%d", sock_addr->sin_addr.s_addr, sock_addr->sin_port));
rc = connect(sc->fd, (SA*)sock_addr, sizeof(*sock_addr));
/* connect should not be called with CHECK_EINTR macro */
if (rc < 0 && errno != EINPROGRESS) {
MPIDU_FTB_COMMERR(rc == ENETUNREACH ? MPIDU_FTB_EV_UNREACHABLE : MPIDU_FTB_EV_COMMUNICATION, vc);
MPIU_ERR_SETANDJUMP2(mpi_errno, MPI_ERR_OTHER, "**sock_connect", "**sock_connect %d %s", errno, MPIU_Strerror(errno));
}
MPIU_ERR_CHKANDJUMP2(rc < 0 && errno != EINPROGRESS, mpi_errno, MPI_ERR_OTHER, "**sock_connect", "**sock_connect %d %s", errno, MPIU_Strerror(errno));
if (rc == 0) {
CHANGE_STATE(sc, CONN_STATE_TC_C_CNTD);
......@@ -1022,13 +999,8 @@ int close_cleanup_and_free_sc_plfd(sockconn_t *const sc)
goto fn_exit;
CHECK_EINTR(rc, close(sc->fd));
if (rc == -1 && errno != EAGAIN && errno != EBADF) {
if (sc_vc)
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, sc_vc);
else
MPIDU_Ftb_publish(MPIDU_FTB_EV_COMMUNICATION, "");
if (rc == -1 && errno != EAGAIN && errno != EBADF)
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**close", "**close %s", MPIU_Strerror(errno));
}
mpi_errno = cleanup_and_free_sc_plfd(sc);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
......@@ -1611,7 +1583,6 @@ static int MPID_nem_tcp_recv_handler (struct pollfd *pfd, sockconn_t *const sc)
if (bytes_recvd == -1 && errno == EAGAIN) /* handle this fast */
goto fn_exit;
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, sc_vc);
if (bytes_recvd == 0) {
MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**sock_closed");
} else {
......@@ -1673,7 +1644,7 @@ fn_exit:
fn_fail: /* comm related failures jump here */
{
int cleanup_errno = MPI_SUCCESS;
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, sc_vc);
cleanup_errno = MPID_nem_tcp_cleanup_on_error(sc_vc); /* QUIESCENT */
if (cleanup_errno) {
MPIU_ERR_SET(cleanup_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
......@@ -1822,7 +1793,6 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
CHECK_EINTR(n, poll(MPID_nem_tcp_plfd_tbl, num_polled, 0));
if (n == -1) {
MPIDU_Ftb_publish(MPIDU_FTB_EV_COMMUNICATION, "");
MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**poll", "**poll %s", MPIU_Strerror(errno));
}
/* MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "some sc fd poll event")); */
......@@ -1852,7 +1822,6 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
#ifdef HAVE_ERROR_CHECKING
int pg_rank = it_sc->vc->pg_rank; /* vc goes away on cleanup */
#endif
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, it_sc->vc);
cleanup_errno = MPID_nem_tcp_cleanup_on_error(it_sc->vc);
if (cleanup_errno) {
MPIU_ERR_SET(cleanup_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
......@@ -1860,7 +1829,6 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
}
MPIU_ERR_SET2(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d %s", pg_rank, err_str);
} else {
MPIDU_Ftb_publish(MPIDU_FTB_EV_COMMUNICATION, "");
cleanup_errno = close_cleanup_and_free_sc_plfd(it_sc);
if (cleanup_errno) {
MPIU_ERR_SET(cleanup_errno, MPI_ERR_OTHER, "**tcp_cleanup_fail");
......@@ -1937,8 +1905,7 @@ int MPID_nem_tcp_state_listening_handler(struct pollfd *const unused_1, sockconn
continue;
else if (errno == EWOULDBLOCK)
break; /* no connection in the listen queue. get out of here.(N1) */
if (errno == ENOBUFS || errno == ENOMEM)
MPIDU_Ftb_publish(MPIDU_FTB_EV_RESOURCES, "sock_accept");
MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**sock_accept", "**sock_accept %s", MPIU_Strerror(errno));
}
else {
......
......@@ -187,18 +187,6 @@ int MPIDI_GetIPInterface( MPIDU_Sock_ifaddr_t *ifaddr, int *found );
#define MPIDI_CH3I_HOST_DESCRIPTION_KEY "description"
#define MPIDI_CH3I_IFNAME_KEY "ifname"
/* convenience macro for publishing FTB communication error events */
#define MPIDU_FTB_COMMERR(event_name, vc) do { \
int ret_ = -1; \
char bc_[1024] = ""; /* FIXME: How do we find the max length of a bc? */ \
char ifname_[1024] = ""; \
\
if (vc && vc->pg) /* pg can be null for temp VCs (dynamic processes) */ \
ret_ = vc->pg->getConnInfo((vc)->pg_rank, bc_, sizeof(bc_), (vc)->pg); \
if (!ret_) \
ret_ = MPIU_Str_get_string_arg(bc_, MPIDI_CH3I_IFNAME_KEY, ifname_, sizeof(ifname_)); \
MPIDU_Ftb_publish((event_name), ifname_); \
} while(0)
/* tcp-local packet types */
......
......@@ -99,7 +99,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
CHECK_EINTR(offset, writev(vc_tcp->sc->fd, iov, sreq->dev.iov_count));
if (offset == 0) {
int cleanup_errno = MPI_SUCCESS;
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, vc);
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**sock_closed");
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d", vc->pg_rank);
cleanup_errno = MPID_nem_tcp_cleanup_on_error(vc);
......@@ -115,7 +115,7 @@ int MPID_nem_tcp_send_queued(MPIDI_VC_t *vc, MPIDI_nem_tcp_request_queue_t *send
break;
} else {
int cleanup_errno = MPI_SUCCESS;
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, vc);
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror (errno));
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d", vc->pg_rank);
cleanup_errno = MPID_nem_tcp_cleanup_on_error(vc);
......@@ -265,7 +265,7 @@ int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
CHECK_EINTR(offset, writev(sc->fd, iov, 2));
if (offset == 0) {
int cleanup_errno = MPI_SUCCESS;
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, vc);
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**sock_closed");
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d", vc->pg_rank);
cleanup_errno = MPID_nem_tcp_cleanup_on_error(vc);
......@@ -278,7 +278,7 @@ int MPID_nem_tcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
offset = 0;
else {
int cleanup_errno = MPI_SUCCESS;
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, vc);
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror (errno));
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d", vc->pg_rank);
cleanup_errno = MPID_nem_tcp_cleanup_on_error(vc);
......@@ -405,7 +405,7 @@ int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_
CHECK_EINTR(offset, writev(sc->fd, iov, 2));
if (offset == 0) {
int cleanup_errno = MPI_SUCCESS;
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, vc);
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**sock_closed");
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d", vc->pg_rank);
cleanup_errno = MPID_nem_tcp_cleanup_on_error(vc);
......@@ -418,7 +418,7 @@ int MPID_nem_tcp_iStartContigMsg_paused(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_
offset = 0;
else {
int cleanup_errno = MPI_SUCCESS;
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, vc);
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror (errno));
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d", vc->pg_rank);
cleanup_errno = MPID_nem_tcp_cleanup_on_error(vc); /* ignoring return code */
......@@ -540,7 +540,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
CHECK_EINTR(offset, writev(sc->fd, iov, 2));
if (offset == 0) {
int cleanup_errno = MPI_SUCCESS;
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, vc);
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**sock_closed");
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d", vc->pg_rank);
cleanup_errno = MPID_nem_tcp_cleanup_on_error(vc);
......@@ -553,7 +553,7 @@ int MPID_nem_tcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
offset = 0;
else {
int cleanup_errno = MPI_SUCCESS;
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, vc);
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror (errno));
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d", vc->pg_rank);
cleanup_errno = MPID_nem_tcp_cleanup_on_error(vc);
......@@ -698,7 +698,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
CHECK_EINTR(offset, writev(vc_tcp->sc->fd, iov, iov_n));
if (offset == 0) {
int cleanup_errno = MPI_SUCCESS;
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, vc);
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**sock_closed");
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d", vc->pg_rank);
cleanup_errno = MPID_nem_tcp_cleanup_on_error(vc);
......@@ -711,7 +711,7 @@ int MPID_nem_tcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header,
offset = 0;
else {
int cleanup_errno = MPI_SUCCESS;
MPIDU_FTB_COMMERR(MPIDU_FTB_EV_COMMUNICATION, vc);
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**writev", "**writev %s", MPIU_Strerror (errno));
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d", vc->pg_rank);
cleanup_errno = MPID_nem_tcp_cleanup_on_error(vc);
......
......@@ -8,20 +8,26 @@
#define MPICH2_FTB_H_INCLUDED
/* FTB events we can throw */
#define MPIDU_FTB_EV_OTHER "OTHER"
#define MPIDU_FTB_EV_RESOURCES "RESOURCES"
#define MPIDU_FTB_EV_UNREACHABLE "UNREACHABLE"
#define MPIDU_FTB_EV_COMMUNICATION "COMUNICATION"
#define MPIDU_FTB_EV_ABORT "ABORT"
#define MPIDU_FTB_EV_OTHER "FTB_MPICH_OTHER"
#define MPIDU_FTB_EV_RESOURCES "FTB_MPICH_RESOURCES"
#define MPIDU_FTB_EV_UNREACHABLE "FTB_MPI_PROCS_UNREACHABLE"
#define MPIDU_FTB_EV_COMMUNICATION "FTB_MPI_PROCS_COMM_ERROR"
#define MPIDU_FTB_EV_ABORT "FTB_MPI_PROCS_ABORTED"
#ifdef ENABLE_FTB
struct MPIDI_VC;
/* prototypes */
int MPIDU_Ftb_init(void);
void MPIDU_Ftb_publish(const char *event_name, const char *event_payload);
void MPIDU_Ftb_publish_vc(const char *event_name, struct MPIDI_VC *vc);
void MPIDU_Ftb_publish_me(const char *event_name);
void MPIDU_Ftb_finalize(void);
#else /* ENABLE_FTB */
#define MPIDU_Ftb_init() (MPI_SUCCESS)
#define MPIDU_Ftb_publish(event_name, event_payload) do {} while(0)
#define MPIDU_Ftb_publish_vc(event_name, vc) do {} while(0)
#define MPIDU_Ftb_publish_me(event_name) do {} while(0)
#define MPIDU_Ftb_finalize() do {} while(0)
#endif /* ENABLE_FTB */
......
......@@ -74,6 +74,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
MPIU_DBG_MSG(CH3_DISCONNECT,TYPICAL, "Connection closed prematurely.");
MPIDU_Ftb_publish_vc(MPIDU_FTB_EV_UNREACHABLE, vc);
MPIDI_CHANGE_VC_STATE(vc, MORIBUND);
break;
......@@ -97,6 +98,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
MPIU_DBG_MSG_D(CH3_DISCONNECT,TYPICAL, "Connection closed prematurely during close protocol. "
"Outstanding close operations = %d", MPIDI_Outstanding_close_ops);
MPIDU_Ftb_publish_vc(MPIDU_FTB_EV_UNREACHABLE, vc);
MPIDI_CHANGE_VC_STATE(vc, MORIBUND);
/* MT: this is not thread safe */
......
......@@ -80,9 +80,9 @@ int MPID_Abort(MPID_Comm * comm, int mpi_errno, int exit_code,
}
}
MPIDU_Ftb_publish(MPIDU_FTB_EV_ABORT, error_msg);
MPIDU_Ftb_publish_me(MPIDU_FTB_EV_ABORT);
MPIDU_Ftb_finalize();
#ifdef HAVE_DEBUGGER_SUPPORT
MPIR_DebuggerSetAborting( error_msg );
#endif
......
......@@ -93,6 +93,36 @@ void MPIDU_Ftb_publish(const char *event_name, const char *event_payload)
return;
}
/* convenience function for publishing events associated with a particular vc */
#undef FUNCNAME
#define FUNCNAME MPIDU_Ftb_publish_vc
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
void MPIDU_Ftb_publish_vc(const char *event_name, struct MPIDI_VC *vc)
{
char payload[FTB_MAX_PAYLOAD_DATA] = "";
if (vc && vc->pg) /* pg can be null for temp VCs (dynamic processes) */
MPIU_Snprintf(payload, sizeof(payload), "[id: {%s:{%d}}]", (char*)vc->pg->id, vc->pg_rank);
MPIDU_Ftb_publish(event_name, payload);
return;
}
/* convenience function for publishing events associated with this process */
#undef FUNCNAME
#define FUNCNAME MPIDU_Ftb_publish_me
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
void MPIDU_Ftb_publish_me(const char *event_name)
{
char payload[FTB_MAX_PAYLOAD_DATA] = "";
MPIU_Snprintf(payload, sizeof(payload), "[id: {%s:{%d}}]", (char *)MPIDI_Process.my_pg->id, MPIDI_Process.my_pg_rank);
MPIDU_Ftb_publish(event_name, payload);
return;
}
/* MPIDU_Ftb_finalize has no return code for the same reasons that
MPIDU_Ftb_publish doesn't. */
......
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