Skip to content

Commit d01f37c

Browse files
author
rhc54
committed
Merge pull request open-mpi#667 from rhc54/topic/cudaext
Add CUDA MPI extension for Rolf - because @jsquyres said it was OKAY
2 parents a172bd1 + a390a8f commit d01f37c

File tree

7 files changed

+202
-0
lines changed

7 files changed

+202
-0
lines changed

ompi/mpiext/cuda/Makefile.am

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana
3+
# University Research and Technology
4+
# Corporation. All rights reserved.
5+
# Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
6+
# Copyright (c) 2015 NVIDIA, Inc. All rights reserved
7+
# $COPYRIGHT$
8+
#
9+
# Additional copyrights may follow
10+
#
11+
# $HEADER$
12+
#
13+
14+
# This Makefile is not traversed during a normal "make all" in an OMPI
15+
# build. It *is* traversed during "make dist", however. So you can
16+
# put EXTRA_DIST targets in here.
17+
#
18+
# You can also use this as a convenience for building this MPI
19+
# extension (i.e., "make all" in this directory to invoke "make all"
20+
# in all the subdirectories).
21+
22+
SUBDIRS = c
23+
24+
EXTRA_DIST = README.txt

ompi/mpiext/cuda/README.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2015 NVIDIA, Inc. All rights reserved.
2+
3+
$COPYRIGHT$
4+
5+
Rolf Vandervart
6+
7+
8+
This extension provides a blah blah blah
9+
10+
See MPIx_CUDA_SUPPORT(3) for more details.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.\" Copyright 2007-2010 Oracle and/or its affiliates. All rights reserved.
2+
.\" Copyright (c) 1996 Thinking Machines Corporation
3+
.\" Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
4+
.\" Copyright (c) 2015 NVIDIA, Inc. All rights reserved.
5+
.TH MPIx_CUDA_SUPPORT 3 "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
6+
.SH NAME
7+
\fBMPIx_CUDA_SUPPORT\fP \- Obtain prettyprint strings of processor affinity information for this process
8+
9+
.SH SYNTAX
10+
.ft R
11+
.SH C Syntax
12+
.nf
13+
#include <mpi.h>
14+
#include <mpi-ext.h>
15+
16+
int MPIx_CUDA_SUPPORT(void)
17+
.fi
18+
.SH Fortran Syntax
19+
There is no Fortran binding for this function.
20+
.
21+
.SH C++ Syntax
22+
There is no C++ binding for this function.
23+
.
24+
.SH INPUT PARAMETERS
25+
.ft R
26+
.
27+
.SH OUTPUT PARAMETERS
28+
.ft R
29+
.TP 1i
30+
31+
.SH DESCRIPTION
32+
.ft R
33+
34+
.SH Examples
35+
.ft R
36+
37+
.SH See Also
38+
.ft R
39+
.nf
40+
JeffIsAToad(1)
41+
.fi

ompi/mpiext/cuda/c/Makefile.am

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana
3+
# University Research and Technology
4+
# Corporation. All rights reserved.
5+
# Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved.
6+
# Copyright (c) 2015 NVIDIA, Inc. All rights reserved.
7+
# $COPYRIGHT$
8+
#
9+
# Additional copyrights may follow
10+
#
11+
# $HEADER$
12+
#
13+
14+
# This file builds the C bindings for MPI extensions. It must be
15+
# present in all MPI extensions.
16+
17+
# We must set these #defines so that the inner OMPI MPI prototype
18+
# header files do the Right Thing.
19+
AM_CPPFLAGS = -DOMPI_PROFILE_LAYER=0 -DOMPI_COMPILING_FORTRAN_WRAPPERS=1
20+
21+
include $(top_srcdir)/Makefile.ompi-rules
22+
23+
# Convenience libtool library that will be slurped up into libmpi.la.
24+
noinst_LTLIBRARIES = libmpiext_cuda.la
25+
26+
# This is where the top-level header file (that is included in
27+
# <mpi-ext.h>) must be installed.
28+
ompidir = $(ompiincludedir)/ompi/mpiext/cuda/c
29+
30+
# This is the header file that is installed.
31+
ompi_HEADERS = mpiext_cuda.h
32+
33+
# Sources for the convenience libtool library. Other than the one
34+
# header file, all source files in the extension have no file naming
35+
# conventions.
36+
libmpiext_cuda_la_SOURCES = \
37+
$(ompi_HEADERS) \
38+
mpiext_cuda.c
39+
libmpiext_cuda_la_LDFLAGS = -module -avoid-version
40+
41+
# Man page installation
42+
nodist_man_MANS = MPIx_CUDA_SUPPORT.3
43+
44+
# Man page sources
45+
EXTRA_DIST = $(nodist_man_MANS:.3=.3in)

ompi/mpiext/cuda/c/mpiext_cuda.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
6+
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
7+
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
8+
* reserved.
9+
* Copyright (c) 2015 NVIDIA, Inc. All rights reserved.
10+
* $COPYRIGHT$
11+
*
12+
* Additional copyrights may follow
13+
*
14+
* $HEADER$
15+
*
16+
*/
17+
18+
#include "ompi_config.h"
19+
20+
#include <stdio.h>
21+
#include <string.h>
22+
23+
int MPIx_CUDA_SUPPORT(void)
24+
{
25+
return OPAL_ERR_NOT_SUPPORTED;
26+
}

ompi/mpiext/cuda/c/mpiext_cuda.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright (c) 2004-2009 The Trustees of Indiana University.
3+
* All rights reserved.
4+
* Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
5+
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
6+
* Copyright (c) 2015 NVIDIA, Inc. All rights reserved.
7+
* $COPYRIGHT$
8+
*
9+
* Additional copyrights may follow
10+
*
11+
* $HEADER$
12+
*
13+
*/
14+
15+
OMPI_DECLSPEC int MPIx_CUDA_SUPPORT(void);

ompi/mpiext/cuda/configure.m4

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# -*- shell-script -*-
2+
#
3+
# Copyright (c) 2004-2010 The Trustees of Indiana University.
4+
# All rights reserved.
5+
# Copyright (c) 2012-2015 Cisco Systems, Inc. All rights reserved.
6+
# Copyright (c) 2015 Intel, Inc. All rights reserved.
7+
# $COPYRIGHT$
8+
#
9+
# Additional copyrights may follow
10+
#
11+
# $HEADER$
12+
#
13+
14+
# OMPI_MPIEXT_cuda_CONFIG([action-if-found], [action-if-not-found])
15+
# -----------------------------------------------------------
16+
AC_DEFUN([OMPI_MPIEXT_cuda_CONFIG],[
17+
AC_CONFIG_FILES([ompi/mpiext/cuda/Makefile])
18+
AC_CONFIG_FILES([ompi/mpiext/cuda/c/Makefile])
19+
20+
OPAL_VAR_SCOPE_PUSH([ompi_mpi_ext_cuda_happy])
21+
22+
# If we don't want FT, don't compile this extention
23+
AS_IF([test "$ENABLE_cuda" = "1" || \
24+
test "$ENABLE_EXT_ALL" = "1"],
25+
[ompi_mpi_ext_cuda_happy=1],
26+
[ompi_mpi_ext_cuda_happy=0])
27+
28+
AS_IF([test "$ompi_mpi_ext_cuda_happy" = "1" && \
29+
test "$CUDA_SUPPORT" = "1"],
30+
[$1],
31+
[ # Error if the user specifically asked for this extension,
32+
# but we can't build it.
33+
AS_IF([test "$ENABLE_cuda" = "1"],
34+
[AC_MSG_WARN([Requested "cuda" MPI extension, but cannot build it])
35+
AC_MSG_WARN([because cuda support is not enabled.])
36+
AC_MSG_WARN([Try again with --with-cuda])
37+
AC_MSG_ERROR([Cannot continue])])
38+
$2])
39+
40+
OPAL_VAR_SCOPE_POP
41+
])

0 commit comments

Comments
 (0)