Skip to content

Commit 5a3646f

Browse files
authored
Merge pull request #6884 from guserav/reintroduce-common-ofi
Reintroduce common ofi
2 parents 8933171 + 56c3d9a commit 5a3646f

File tree

7 files changed

+196
-0
lines changed

7 files changed

+196
-0
lines changed

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ libmca_orte_common_alps_so_version=0:0:0
110110

111111
# OPAL layer
112112
libmca_opal_common_cuda_so_version=0:0:0
113+
libmca_opal_common_ofi_so_version=0:0:0
113114
libmca_opal_common_sm_so_version=0:0:0
114115
libmca_opal_common_ucx_so_version=0:0:0
115116
libmca_opal_common_ugni_so_version=0:0:0

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ AC_SUBST(libopen_pal_so_version)
155155
# transparently by adding some intelligence in autogen.pl
156156
# and/or opal_mca.m4, but I don't have the cycles to do this
157157
# right now.
158+
AC_SUBST(libmca_opal_common_ofi_so_version)
158159
AC_SUBST(libmca_opal_common_cuda_so_version)
159160
AC_SUBST(libmca_opal_common_sm_so_version)
160161
AC_SUBST(libmca_opal_common_ugni_so_version)

opal/mca/common/ofi/Makefile.am

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#
2+
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
# University Research and Technology
4+
# Corporation. All rights reserved.
5+
# Copyright (c) 2004-2013 The University of Tennessee and The University
6+
# of Tennessee Research Foundation. All rights
7+
# reserved.
8+
# Copyright (c) 2004-2009 High Performance Computing Center Stuttgart,
9+
# University of Stuttgart. All rights reserved.
10+
# Copyright (c) 2004-2005 The Regents of the University of California.
11+
# All rights reserved.
12+
# Copyright (c) 2011-2013 NVIDIA Corporation. All rights reserved.
13+
# Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
14+
# Copyright (c) 2015 Intel, Inc. All rights reserved.
15+
# Copyright (c) 2017 Los Alamos National Security, LLC. All rights
16+
# reserved.
17+
# Copyright (c) 2019 Hewlett Packard Enterprise. All rights reserved.
18+
# $COPYRIGHT$
19+
#
20+
# Additional copyrights may follow
21+
#
22+
# $HEADER$
23+
#
24+
# A word of explanation...
25+
#
26+
# This library is linked against various MCA components because the
27+
# support for ofis is needed in various places.
28+
#
29+
# Note that building this common component statically and linking
30+
# against other dynamic components is *not* supported!
31+
32+
AM_CPPFLAGS = $(opal_ofi_CPPFLAGS)
33+
34+
# Header files
35+
36+
headers = \
37+
common_ofi.h
38+
39+
# Source files
40+
41+
sources = \
42+
common_ofi.c
43+
44+
# As per above, we'll either have an installable or noinst result.
45+
# The installable one should follow the same MCA prefix naming rules
46+
# (i.e., libmca_<type>_<name>.la). The noinst one can be named
47+
# whatever it wants, although libmca_<type>_<name>_noinst.la is
48+
# recommended.
49+
50+
# To simplify components that link to this library, we will *always*
51+
# have an output libtool library named libmca_<type>_<name>.la -- even
52+
# for case 2) described above (i.e., so there's no conditional logic
53+
# necessary in component Makefile.am's that link to this library).
54+
# Hence, if we're creating a noinst version of this library (i.e.,
55+
# case 2), we sym link it to the libmca_<type>_<name>.la name
56+
# (libtool will do the Right Things under the covers). See the
57+
# all-local and clean-local rules, below, for how this is effected.
58+
59+
lib_LTLIBRARIES =
60+
noinst_LTLIBRARIES =
61+
comp_inst = lib@OPAL_LIB_PREFIX@mca_common_ofi.la
62+
comp_noinst = lib@OPAL_LIB_PREFIX@mca_common_ofi_noinst.la
63+
64+
65+
if MCA_BUILD_opal_common_ofi_DSO
66+
lib_LTLIBRARIES += $(comp_inst)
67+
else
68+
noinst_LTLIBRARIES += $(comp_noinst)
69+
endif
70+
71+
lib@OPAL_LIB_PREFIX@mca_common_ofi_la_SOURCES = $(headers) $(sources)
72+
lib@OPAL_LIB_PREFIX@mca_common_ofi_la_LDFLAGS = \
73+
$(opal_ofi_LDFLAGS) \
74+
-version-info $(libmca_opal_common_ofi_so_version)
75+
lib@OPAL_LIB_PREFIX@mca_common_ofi_la_LIBADD = $(opal_ofi_LIBS)
76+
77+
lib@OPAL_LIB_PREFIX@mca_common_ofi_noinst_la_SOURCES = $(headers) $(sources)
78+
lib@OPAL_LIB_PREFIX@mca_common_ofi_noinst_la_LDFLAGS = $(opal_ofi_LDFLAGS)
79+
lib@OPAL_LIB_PREFIX@mca_common_ofi_noinst_la_LIBADD = $(opal_ofi_LIBS)
80+
81+
# Conditionally install the header files
82+
83+
if WANT_INSTALL_HEADERS
84+
opaldir = $(opalincludedir)/$(subdir)
85+
opal_HEADERS = $(headers)
86+
endif
87+
88+
# These two rules will sym link the "noinst" libtool library filename
89+
# to the installable libtool library filename in the case where we are
90+
# compiling this component statically (case 2), described above).
91+
92+
V=0
93+
OMPI_V_LN_SCOMP = $(ompi__v_LN_SCOMP_$V)
94+
ompi__v_LN_SCOMP_ = $(ompi__v_LN_SCOMP_$AM_DEFAULT_VERBOSITY)
95+
ompi__v_LN_SCOMP_0 = @echo " LN_S " `basename $(comp_inst)`;
96+
97+
all-local:
98+
$(OMPI_V_LN_SCOMP) if test -z "$(lib_LTLIBRARIES)"; then \
99+
rm -f "$(comp_inst)"; \
100+
$(LN_S) "$(comp_noinst)" "$(comp_inst)"; \
101+
fi
102+
103+
clean-local:
104+
if test -z "$(lib_LTLIBRARIES)"; then \
105+
rm -f "$(comp_inst)"; \
106+
fi

opal/mca/common/ofi/common_ofi.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2015 Intel, Inc. All rights reserved.
3+
* Copyright (c) 2017 Los Alamos National Security, LLC. All rights
4+
* reserved.
5+
* $COPYRIGHT$
6+
*
7+
* Additional copyrights may follow
8+
*
9+
* $HEADER$
10+
*/
11+
12+
#include "opal_config.h"
13+
#include "opal/constants.h"
14+
15+
#include <errno.h>
16+
#include <unistd.h>
17+
18+
#include "common_ofi.h"
19+
20+
int mca_common_ofi_register_mca_variables(void)
21+
{
22+
if (fi_version() >= FI_VERSION(1,0)) {
23+
return OPAL_SUCCESS;
24+
} else {
25+
return OPAL_ERROR;
26+
}
27+
}

opal/mca/common/ofi/common_ofi.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2+
/*
3+
* Copyright (c) 2015 Intel, Inc. All rights reserved.
4+
* Copyright (c) 2017 Los Alamos National Security, LLC. All rights
5+
* reserved.
6+
* $COPYRIGHT$
7+
*
8+
* Additional copyrights may follow
9+
*
10+
* $HEADER$
11+
*/
12+
13+
#ifndef OPAL_MCA_COMMON_OFI_H
14+
#define OPAL_MCA_COMMON_OFI_H
15+
#include <rdma/fabric.h>
16+
17+
OPAL_DECLSPEC int mca_common_ofi_register_mca_variables(void);
18+
19+
#endif /* OPAL_MCA_COMMON_OFI_H */

opal/mca/common/ofi/configure.m4

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# -*- shell-script -*-
2+
#
3+
# Copyright (c) 2011-2013 NVIDIA Corporation. All rights reserved.
4+
# Copyright (c) 2013 The University of Tennessee and The University
5+
# of Tennessee Research Foundation. All rights
6+
# reserved.
7+
# Copyright (c) 2015 Intel, Inc. All rights reserved.
8+
# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
9+
# Copyright (c) 2017 Los Alamos National Security, LLC. All rights
10+
# reserved.
11+
# Copyright (c) 2019 Hewlett Packard Enterprise. All rights reserved.
12+
# $COPYRIGHT$
13+
#
14+
# Additional copyrights may follow
15+
#
16+
# $HEADER$
17+
#
18+
19+
AC_DEFUN([MCA_opal_common_ofi_CONFIG],[
20+
AC_CONFIG_FILES([opal/mca/common/ofi/Makefile])
21+
22+
OPAL_CHECK_OFI
23+
24+
# Note that $opal_common_ofi_happy is
25+
# used in other configure.m4's to know if ofi configured
26+
# successfully.
27+
AS_IF([test "$opal_ofi_happy" = "yes"],
28+
[opal_common_ofi_happy=yes
29+
common_ofi_WRAPPER_EXTRA_LDFLAGS=$opal_ofi_LDFLAGS
30+
common_ofi_WRAPPER_EXTRA_LIBS=$opal_ofi_LIBS
31+
$1],
32+
[opal_common_ofi_happy=no
33+
$2])
34+
35+
])dnl

opal/mca/common/ofi/owner.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# owner/status file
3+
# owner: institution that is responsible for this package
4+
# status: e.g. active, maintenance, unmaintained
5+
#
6+
owner: Hewlett Packard Enterprise
7+
status:active

0 commit comments

Comments
 (0)