4875f48eaa
This commit decouples OMPI deployment from the version(s) of the lower layers of the stack by probing for UDP support. Verbs applications assume a 40-byte header (there is no current mechanism for querying payload offset). So to support a 42-byte UDP header without causing existing applications like ibv_ud_pingpong or older versions of OMPI to crash, we must inform libusnic_verbs that we are aware of the nonstandard payload offset. We do this by overriding the `transport_type` field of the device to be 42 before calling `ibv_open_device`. If the library resets it to something else, then we know the lower layers are UDP capable. Otherwise we use the older custom-L2 format. This necessitated some minor ugliness in common_verbs, but it's as tidy as Jeff and I know how to make it right now. This commit only adds support for UDP headers and connectivity over the same L2 network, it does not touch routing or interface pairing. Reviewed-by: Jeff Squyres <jsquyres@cisco.com> cmr=v1.7.5:ticket=trac:4253 This commit was SVN r30838. The following Trac tickets were found above: Ticket 4253 --> https://svn.open-mpi.org/trac/ompi/ticket/4253
78 строки
2.9 KiB
C
78 строки
2.9 KiB
C
/*
|
|
* Copyright (c) 2013-2014 Cisco Systems, Inc. All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
/* This header contains macros to help minimize usnic BTL differences between
|
|
* v1.6, v1.7, and trunk. Note that we are stomping on other namespaces,
|
|
* especially to make stock trunk code play nicely with v1.6 OMPI. */
|
|
|
|
#ifndef BTL_USNIC_COMPAT_H
|
|
#define BTL_USNIC_COMPAT_H
|
|
|
|
#if OMPI_MAJOR_VERSION == 1 && OMPI_MINOR_VERSION == 6
|
|
/* The usnic BTL will never be in the upstream v1.6 branch. The only v1.6
|
|
* variant will be a Cisco-supplied version. */
|
|
|
|
/* for per-file #ifdefs, esp. #includes */
|
|
# define OMPI_BTL_USNIC_CISCO_V1_6 1
|
|
|
|
#define opal_event_set(event_base_,A,B,C,D,E) \
|
|
opal_event_set(A,B,C,D,E)
|
|
# define opal_show_help orte_show_help
|
|
# define mca_base_var_check_exclusive(S,A,B,C,D,E,F) \
|
|
mca_base_param_check_exclusive_string(A,B,C,D,E,F)
|
|
# define ompi_process_info orte_process_info
|
|
# define ompi_rte_hash_name orte_util_hash_name
|
|
# define OMPI_PROC_MY_NAME ORTE_PROC_MY_NAME
|
|
# define OMPI_ERROR_LOG ORTE_ERROR_LOG
|
|
# define OMPI_NAME_PRINT ORTE_NAME_PRINT
|
|
|
|
# define USNIC_OUT mca_btl_base_output
|
|
# define proc_bound() ompi_btl_usnic_proc_bound_v1_6_helper()
|
|
|
|
/* the opal_if code lives inside the BTL dir in v1.6-cisco */
|
|
# define opal_ifbegin btl_usnic_opal_ifbegin
|
|
# define opal_ifnext btl_usnic_opal_ifnext
|
|
# define opal_ifindextoaddr btl_usnic_opal_ifindextoaddr
|
|
# define opal_ifindextomac btl_usnic_opal_ifindextomac
|
|
# define opal_ifindextomask btl_usnic_opal_ifindextomask
|
|
# define opal_ifindextomtu btl_usnic_opal_ifindextomtu
|
|
# define opal_ifindextoname btl_usnic_opal_ifindextoname
|
|
|
|
/* this _FOREACH macro is not present in v1.6 */
|
|
#define OPAL_LIST_FOREACH(item, list, type) \
|
|
for (item = (type *) (list)->opal_list_sentinel.opal_list_next ; \
|
|
item != (type *) &(list)->opal_list_sentinel ; \
|
|
item = (type *) ((opal_list_item_t *) (item))->opal_list_next)
|
|
|
|
#elif (OMPI_MAJOR_VERSION == 1 && OMPI_MINOR_VERSION >= 7) || \
|
|
(OMPI_MAJOR_VERSION >= 2)
|
|
/* v1.7, v1.8 (to be released), trunk (v1.9), or later */
|
|
/* TODO validate that all of these things actually work with v1.7 */
|
|
# define USNIC_OUT ompi_btl_base_framework.framework_output
|
|
# define proc_bound() (ompi_rte_proc_is_bound)
|
|
|
|
#else
|
|
# error OMPI version too old (< 1.6)
|
|
#endif
|
|
|
|
/* The FREE_LIST_*_MT stuff was introduced on the SVN trunk in r28722
|
|
(2013-07-04), but so far, has not been merged into the v1.7 branch
|
|
yet (2013-09-06). */
|
|
#ifndef OMPI_FREE_LIST_GET_MT
|
|
# define OMPI_FREE_LIST_GET_MT(list_, item_) \
|
|
do { \
|
|
int rc_ __opal_attribute_unused__; \
|
|
OMPI_FREE_LIST_GET(list_, item_, rc_); \
|
|
} while (0)
|
|
# define OMPI_FREE_LIST_RETURN_MT(list_, item_) \
|
|
OMPI_FREE_LIST_RETURN(list_, item_)
|
|
#endif
|
|
|
|
#endif /* BTL_USNIC_COMPAT_H */
|