btl/usnic: remove all calls to abort()
Inspired by https://github.com/open-mpi/ompi/pull/5205, finally remove all calls to abort() from the usnic BTL. Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Этот коммит содержится в:
родитель
b82a08254f
Коммит
8a2441603f
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014-2018 Cisco Systems, Inc. All rights reserved
|
* Copyright (c) 2014-2019 Cisco Systems, Inc. All rights reserved
|
||||||
* Copyright (c) 2015 Intel, Inc. All rights reserved.
|
* Copyright (c) 2015 Intel, Inc. All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -205,7 +205,7 @@ opal_event_base_t *opal_progress_thread_init(const char *name)
|
|||||||
ret = opal_thread_start(&agent_thread);
|
ret = opal_thread_start(&agent_thread);
|
||||||
if (OPAL_SUCCESS != ret) {
|
if (OPAL_SUCCESS != ret) {
|
||||||
OPAL_ERROR_LOG(ret);
|
OPAL_ERROR_LOG(ret);
|
||||||
ABORT("Failed to start usNIC agent thread");
|
opal_btl_usnic_util_abort("Failed to start usNIC agent thread", __FILE__, __LINE__);
|
||||||
/* Will not return */
|
/* Will not return */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,8 +338,8 @@ pack_chunk_seg_chain_with_reserve(
|
|||||||
first_pass) {
|
first_pass) {
|
||||||
seg = opal_btl_usnic_chunk_segment_alloc(module);
|
seg = opal_btl_usnic_chunk_segment_alloc(module);
|
||||||
if (OPAL_UNLIKELY(NULL == seg)) {
|
if (OPAL_UNLIKELY(NULL == seg)) {
|
||||||
BTL_ERROR(("chunk segment allocation error"));
|
opal_btl_usnic_util_abort("chunk segment allocation error",
|
||||||
abort(); /* XXX */
|
__FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
++n_segs;
|
++n_segs;
|
||||||
|
|
||||||
@ -446,8 +446,8 @@ prepare_src_large(
|
|||||||
rc = opal_convertor_clone(convertor, &frag->sf_convertor,
|
rc = opal_convertor_clone(convertor, &frag->sf_convertor,
|
||||||
/*copy_stack=*/true);
|
/*copy_stack=*/true);
|
||||||
if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) {
|
if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) {
|
||||||
BTL_ERROR(("unexpected convertor clone error"));
|
opal_btl_usnic_util_abort("unexpected convertor clone error",
|
||||||
abort(); /* XXX */
|
__FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2006 Sandia National Laboratories. All rights
|
* Copyright (c) 2006 Sandia National Laboratories. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2009-2019 Cisco Systems, Inc. All rights reserved
|
||||||
* Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2014 Intel, Inc. All rights reserved
|
* Copyright (c) 2014 Intel, Inc. All rights reserved
|
||||||
@ -808,8 +808,8 @@ pack_chunk_seg_from_frag(
|
|||||||
/* TODO look at ways to deal with this case more gracefully, possibly as
|
/* TODO look at ways to deal with this case more gracefully, possibly as
|
||||||
* part of capping the overall BTL memory consumption. Watch out for
|
* part of capping the overall BTL memory consumption. Watch out for
|
||||||
* possible MPI-layer deadlock. */
|
* possible MPI-layer deadlock. */
|
||||||
BTL_ERROR(("chunk segment allocation error"));
|
opal_btl_usnic_util_abort("chunk segment allocation error",
|
||||||
abort(); /* XXX */
|
__FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
seg_space = module->max_chunk_payload;
|
seg_space = module->max_chunk_payload;
|
||||||
@ -1008,8 +1008,7 @@ usnic_do_resends(
|
|||||||
ret = opal_hotel_checkin(&endpoint->endpoint_hotel,
|
ret = opal_hotel_checkin(&endpoint->endpoint_hotel,
|
||||||
sseg, &sseg->ss_hotel_room);
|
sseg, &sseg->ss_hotel_room);
|
||||||
if (OPAL_UNLIKELY(OPAL_SUCCESS != ret)) {
|
if (OPAL_UNLIKELY(OPAL_SUCCESS != ret)) {
|
||||||
BTL_ERROR(("hotel checkin failed\n"));
|
opal_btl_usnic_util_abort("hotel checkin failed\n", __FILE__, __LINE__);
|
||||||
abort(); /* should not be possible */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2149,7 +2148,8 @@ static void init_connectivity_checker(opal_btl_usnic_module_t *module)
|
|||||||
int rc = opal_btl_usnic_connectivity_listen(module);
|
int rc = opal_btl_usnic_connectivity_listen(module);
|
||||||
if (OPAL_SUCCESS != rc) {
|
if (OPAL_SUCCESS != rc) {
|
||||||
OPAL_ERROR_LOG(rc);
|
OPAL_ERROR_LOG(rc);
|
||||||
ABORT("Failed to notify connectivity agent to listen");
|
opal_btl_usnic_util_abort("Failed to notify connectivity agent to listen",
|
||||||
|
__FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2539,7 +2539,8 @@ int opal_btl_usnic_module_init(opal_btl_usnic_module_t *module)
|
|||||||
int rc = opal_btl_usnic_connectivity_listen(module);
|
int rc = opal_btl_usnic_connectivity_listen(module);
|
||||||
if (OPAL_SUCCESS != rc) {
|
if (OPAL_SUCCESS != rc) {
|
||||||
OPAL_ERROR_LOG(rc);
|
OPAL_ERROR_LOG(rc);
|
||||||
ABORT("Failed to notify connectivity agent to listen");
|
opal_btl_usnic_util_abort("Failed to notify connectivity agent to listen",
|
||||||
|
__FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* If we're not doing a connectivity check, just set the port
|
/* If we're not doing a connectivity check, just set the port
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2006 Sandia National Laboratories. All rights
|
* Copyright (c) 2006 Sandia National Laboratories. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2008-2017 Cisco Systems, Inc. All rights reserved
|
* Copyright (c) 2008-2019 Cisco Systems, Inc. All rights reserved
|
||||||
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
@ -231,7 +231,7 @@ void opal_btl_usnic_recv_call(opal_btl_usnic_module_t *module,
|
|||||||
fip->rfi_data_in_pool = false;
|
fip->rfi_data_in_pool = false;
|
||||||
}
|
}
|
||||||
if (fip->rfi_data == NULL) {
|
if (fip->rfi_data == NULL) {
|
||||||
abort();
|
opal_btl_usnic_util_abort("malloc failed", __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
#if MSGDEBUG1
|
#if MSGDEBUG1
|
||||||
opal_output(0, "Start large recv to %p, size=%"PRIu32"\n",
|
opal_output(0, "Start large recv to %p, size=%"PRIu32"\n",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2017 Cisco Systems, Inc. All rights reserved
|
* Copyright (c) 2013-2019 Cisco Systems, Inc. All rights reserved
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -18,6 +18,38 @@
|
|||||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Safely (but abnornmally) exit this process without abort()'ing (and
|
||||||
|
* leaving a corefile).
|
||||||
|
*/
|
||||||
|
struct opal_btl_usnic_module_t;
|
||||||
|
void opal_btl_usnic_exit(struct opal_btl_usnic_module_t *module);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print a show_help message and then call opal_btl_usnic_exit().
|
||||||
|
*/
|
||||||
|
void opal_btl_usnic_util_abort(const char *msg, const char *file, int line);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Long enough to hold "xxx.xxx.xxx.xxx/xx"
|
||||||
|
*/
|
||||||
|
#define IPV4STRADDRLEN 20
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If netmask==0, it is not included in the output string. addr is
|
||||||
|
* expected to be in network byte order.
|
||||||
|
*/
|
||||||
|
void opal_btl_usnic_snprintf_ipv4_addr(char *out, size_t maxlen,
|
||||||
|
uint32_t addr_be, uint32_t netmask_be);
|
||||||
|
|
||||||
|
void opal_btl_usnic_snprintf_bool_array(char *s, size_t slen, bool a[], size_t alen);
|
||||||
|
|
||||||
|
void opal_btl_usnic_dump_hex(int verbose_level, int output_id,
|
||||||
|
void *vaddr, int len);
|
||||||
|
|
||||||
|
size_t opal_btl_usnic_convertor_pack_peek(const opal_convertor_t *conv,
|
||||||
|
size_t max_len);
|
||||||
|
|
||||||
/* avoid "defined but not used" warnings */
|
/* avoid "defined but not used" warnings */
|
||||||
static inline int __opal_attribute_always_inline__ usnic_fls(int x)
|
static inline int __opal_attribute_always_inline__ usnic_fls(int x)
|
||||||
__opal_attribute_unused__;
|
__opal_attribute_unused__;
|
||||||
@ -69,8 +101,7 @@ usnic_convertor_pack_simple(
|
|||||||
*bytes_packed = max_bytes_to_pack;
|
*bytes_packed = max_bytes_to_pack;
|
||||||
rc = opal_convertor_pack(convertor, &iov, &iov_count, bytes_packed);
|
rc = opal_convertor_pack(convertor, &iov, &iov_count, bytes_packed);
|
||||||
if (OPAL_UNLIKELY(rc < 0)) {
|
if (OPAL_UNLIKELY(rc < 0)) {
|
||||||
BTL_ERROR(("opal_convertor_pack error"));
|
opal_btl_usnic_util_abort("opal_convertor_pack error", __FILE__, __LINE__);
|
||||||
abort(); /* XXX */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,36 +122,4 @@ usnic_cidrlen_to_netmask(
|
|||||||
return htonl(mask);
|
return htonl(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Safely (but abnornmally) exit this process without abort()'ing (and
|
|
||||||
* leaving a corefile).
|
|
||||||
*/
|
|
||||||
struct opal_btl_usnic_module_t;
|
|
||||||
void opal_btl_usnic_exit(struct opal_btl_usnic_module_t *module);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Print a show_help message and then call opal_btl_usnic_exit().
|
|
||||||
*/
|
|
||||||
void opal_btl_usnic_util_abort(const char *msg, const char *file, int line);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Long enough to hold "xxx.xxx.xxx.xxx/xx"
|
|
||||||
*/
|
|
||||||
#define IPV4STRADDRLEN 20
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If netmask==0, it is not included in the output string. addr is
|
|
||||||
* expected to be in network byte order.
|
|
||||||
*/
|
|
||||||
void opal_btl_usnic_snprintf_ipv4_addr(char *out, size_t maxlen,
|
|
||||||
uint32_t addr_be, uint32_t netmask_be);
|
|
||||||
|
|
||||||
void opal_btl_usnic_snprintf_bool_array(char *s, size_t slen, bool a[], size_t alen);
|
|
||||||
|
|
||||||
void opal_btl_usnic_dump_hex(int verbose_level, int output_id,
|
|
||||||
void *vaddr, int len);
|
|
||||||
|
|
||||||
size_t opal_btl_usnic_convertor_pack_peek(const opal_convertor_t *conv,
|
|
||||||
size_t max_len);
|
|
||||||
|
|
||||||
#endif /* BTL_USNIC_UTIL_H */
|
#endif /* BTL_USNIC_UTIL_H */
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user