Skip to content

Commit c24a303

Browse files
authored
Merge pull request #4825 from jsquyres/pr/usnic-btl-version
btl/usnic: update BTL_VERSION handling
2 parents 6fb6aed + d36648b commit c24a303

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

opal/mca/btl/usnic/btl_usnic_compat.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved.
3+
* Copyright (c) 2013-2018 Cisco Systems, Inc. All rights reserved
44
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
55
* reserved.
66
* Copyright (c) 2018 Intel, Inc. All rights reserved.
@@ -18,6 +18,7 @@
1818
#define BTL_USNIC_COMPAT_H
1919

2020
#include "opal/mca/rcache/rcache.h"
21+
#include "opal/mca/btl/btl.h"
2122

2223
/************************************************************************/
2324

@@ -76,7 +77,16 @@
7677
# define USNIC_PUT_REMOTE des_segments
7778
# define USNIC_PUT_REMOTE_COUNT des_segments_count
7879

79-
# define BTL_VERSION 310
80+
// Starting after Open MPI v3.1.0, the BTL_VERSION macro was defined
81+
// by btl.h (it'll likely get into v4.0.0 -- don't know if this change
82+
// will migrate to the v3.x.y branches). So if BTL_VERSION is already
83+
// defined, then we don't need to define it again. As of this writing
84+
// (Feb 2018), this set of defines works fine with BTL v3.0.0 and
85+
// v3.1.0. So we'll set the BTL version to the minimium acceptable
86+
// value: 3.0.0.
87+
# if !defined(BTL_VERSION)
88+
# define BTL_VERSION 300
89+
# endif
8090

8191
# define USNIC_COMPAT_FREE_LIST_GET(list, item) \
8292
(item) = opal_free_list_get((list))
@@ -297,8 +307,6 @@ struct mca_btl_base_endpoint_t;
297307

298308
#if BTL_VERSION == 20
299309

300-
#include "ompi/mca/btl/btl.h"
301-
302310
/* This function changed signature in BTL 3.0 */
303311
mca_btl_base_descriptor_t*
304312
opal_btl_usnic_prepare_src(
@@ -335,9 +343,7 @@ opal_btl_usnic_put(
335343
/* BTL 3.0 (i.e., >=v1.9, but listed separately because these are
336344
really BTL API issues) */
337345

338-
#elif BTL_VERSION == 310
339-
340-
#include "opal/mca/btl/btl.h"
346+
#elif BTL_VERSION >= 300
341347

342348
/* This function changed signature compared to BTL 2.0 */
343349
struct mca_btl_base_descriptor_t *

0 commit comments

Comments
 (0)