Skip to content

Commit 6f7fbd1

Browse files
authored
Merge pull request #6158 from ggouaillardet/topic/mpiext-path-updates
mpiext: updates for header file locations
2 parents 0b42f3d + c0faf34 commit 6f7fbd1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+111
-113
lines changed

config/ompi_ext.m4

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,15 @@ AC_DEFUN([EXT_CONFIGURE_M4_CONFIG_COMPONENT],[
405405
#--------------------
406406
#
407407
# C:
408-
# - c/mpiext_<component>_c.h: is included in mpi_ext.h
408+
# - c/mpiext_<component>_c.h: is installed to
409+
# <includedir>/openmpi/mpiext/mpiext_<component>_c.h and is included in
410+
# mpi_ext.h
409411
# - c/libmpiext_<component>.la: convneience library slurped into libmpi.la
410412
#
411413
# mpi.f.h:
412-
# - mpif-h/<component>_mpifh.h: is included mpi mpif_ext.h
414+
# - mpif-h/mpiext_<component>_mpifh.h: is installed to
415+
# <includedir>openmpi/mpiext/mpiext_<component>_mpifh.h and is included mpi
416+
# mpif_ext.h
413417
# - mpif-h/libmpiext_<component>_mpifh.la: convenience library slurped
414418
# into libmpi_mpifh.la
415419
#
@@ -461,7 +465,7 @@ AC_DEFUN([EXT_PROCESS_COMPONENT],[
461465
###############
462466
# C Bindings
463467
###############
464-
test_header="${srcdir}/ompi/mpiext/${component}/c/${component}_c.h"
468+
test_header="${srcdir}/ompi/mpiext/${component}/c/mpiext_${component}_c.h"
465469

466470
AC_MSG_CHECKING([if MPI Extension $component has C bindings])
467471

@@ -479,14 +483,14 @@ AC_DEFUN([EXT_PROCESS_COMPONENT],[
479483
$3="$$3 $component"
480484

481485
# JMS Where is this needed?
482-
EXT_C_HEADERS="$EXT_C_HEADERS mpiext/c/${component}_c.h"
486+
EXT_C_HEADERS="$EXT_C_HEADERS mpiext/c/mpiext_${component}_c.h"
483487

484-
component_header="${component}_c.h"
488+
component_header="mpiext_${component}_c.h"
485489

486490
cat >> $mpi_ext_h <<EOF
487491
/* Enabled Extension: $component */
488492
#define $component_define 1
489-
#include "openmpi/ompi/mpiext/$component_header"
493+
#include "openmpi/mpiext/$component_header"
490494

491495
EOF
492496

@@ -497,7 +501,7 @@ EOF
497501
# Test if this extension has mpif.h bindings
498502
# If not, skip this step.
499503
#
500-
test_header="${srcdir}/ompi/mpiext/$component/mpif-h/${component}_mpifh.h"
504+
test_header="${srcdir}/ompi/mpiext/$component/mpif-h/mpiext_${component}_mpifh.h"
501505
enabled_mpifh=0
502506

503507
AC_MSG_CHECKING([if MPI Extension $component has mpif.h bindings])
@@ -506,11 +510,37 @@ EOF
506510
AC_MSG_RESULT([yes])
507511
enabled_mpifh=1
508512

509-
# JMS Where is this needed?
510-
EXT_MPIFH_HEADERS="$EXT_MPIFH_HEADERS mpiext/${component}_mpifh.h"
513+
EXT_MPIFH_HEADERS="$EXT_MPIFH_HEADERS mpiext/mpiext_${component}_mpifh.h"
511514
$4="$$4 $component"
512515

513-
component_header="${component}_mpifh.h"
516+
# Per https://github.com/open-mpi/ompi/pull/6030, we will end
517+
# up putting a user-visible Fortran "include" statement in the
518+
# installed mpif-ext.h file, and we therefore have to ensure
519+
# that the total length of the line is <=72 characters. Doing
520+
# a little math here:
521+
#
522+
# leading indent spaces: 6 chars
523+
# "include '": 9 chars
524+
# "openmpi/mpiext/mpiext_NAME_mpifh.h": without NAME, 30 chars
525+
# trailing "'": 1 char
526+
#
527+
# 6+9+30+1 = 46 chars overhead.
528+
# 72-46 = 26 characters left for NAME.
529+
#
530+
# It would be exceedingly unusual to have an MPI extension
531+
# name > 26 characters. But just in case, put a check here
532+
# to make sure: error out if the MPI extension name is > 26
533+
# characters (because otherwise it'll just be a really weird /
534+
# hard to diagnose compile error when a user tries to compile
535+
# a Fortran MPI application that includes `mpif-ext.h`).
536+
len=`echo $component | wc -c`
537+
result=`expr $len \> 26`
538+
AS_IF([test $result -eq 1],
539+
[AC_MSG_WARN([MPI extension name too long: $component])
540+
AC_MSG_WARN([For esoteric reasons, MPI Extensions with mpif.h bindings must have a name that is <= 26 characters])
541+
AC_MSG_ERROR([Cannot continue])])
542+
543+
component_header="mpiext_${component}_mpifh.h"
514544

515545
cat >> $mpif_ext_h <<EOF
516546
!
@@ -519,7 +549,7 @@ EOF
519549
integer $component_define
520550
parameter ($component_define=1)
521551
522-
include 'openmpi/ompi/mpiext/$component_header'
552+
include 'openmpi/mpiext/$component_header'
523553
524554
EOF
525555
else
@@ -550,7 +580,6 @@ EOF
550580
if test -e "$test_header" ; then
551581
AC_MSG_RESULT([yes])
552582

553-
# JMS Where is this needed?
554583
EXT_USEMPI_HEADERS="$EXT_USEMPI_HEADERS mpiext/$component/use-mpi/mpiext_${component}_usempi.h"
555584
$5="$$5 $component"
556585
component_header="mpiext_${component}_usempi.h"
@@ -566,7 +595,7 @@ EOF
566595
# srcdir is needed to find the header.
567596
#
568597
if test "$enabled_mpifh" = 1; then
569-
mpifh_component_header="${component}_mpifh.h"
598+
mpifh_component_header="mpiext_${component}_mpifh.h"
570599
cat >> $mpiusempi_ext_h <<EOF
571600
#include "${srcdir}/ompi/mpiext/$component/mpif-h/$mpifh_component_header"
572601
EOF
@@ -602,7 +631,6 @@ EOF
602631
if test -e "$test_header" ; then
603632
AC_MSG_RESULT([yes])
604633

605-
# JMS Where is this needed?
606634
EXT_USEMPIF08_HEADERS="$EXT_USEMPIF08_HEADERS mpiext/$component/use-mpi-f08/mpiext_${component}_usempif08.h"
607635
$6="$$6 $component"
608636

@@ -619,7 +647,7 @@ EOF
619647
# the srcdir is needed to find the header.
620648
#
621649
if test "$enabled_mpifh" = 1; then
622-
mpifh_component_header="${component}_mpifh.h"
650+
mpifh_component_header="mpiext_${component}_mpifh.h"
623651
cat >> $mpiusempif08_ext_h <<EOF
624652
#include "${srcdir}/ompi/mpiext/$component/mpif-h/$mpifh_component_header"
625653
EOF

ompi/mpiext/affinity/c/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ noinst_LTLIBRARIES = libmpiext_affinity_c.la
3232

3333
# This is where the top-level header file (that is included in
3434
# <mpi-ext.h>) must be installed.
35-
ompidir = $(ompiincludedir)/ompi/mpiext
35+
ompidir = $(ompiincludedir)/mpiext/
3636

3737
# This is the header file that is installed.
38-
ompi_HEADERS = affinity_c.h
38+
ompi_HEADERS = mpiext_affinity_c.h
3939

4040
# Sources for the convenience libtool library. Other than the one
4141
# header file, all source files in the extension have no file naming

ompi/mpiext/affinity/c/mpiext_affinity_str.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
77
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
88
* reserved.
9-
* Copyright (c) 2015-2018 Research Organization for Information Science
10-
* and Technology (RIST). All rights reserved.
9+
* Copyright (c) 2015-2017 Research Organization for Information Science
10+
* and Technology (RIST). All rights reserved.
1111
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
1212
* $COPYRIGHT$
1313
*
@@ -37,7 +37,7 @@
3737
#include "ompi/errhandler/errhandler.h"
3838
#include "ompi/mca/rte/rte.h"
3939
#include "ompi/mpi/c/bindings.h"
40-
#include "ompi/mpiext/affinity/c/affinity_c.h"
40+
#include "ompi/mpiext/affinity/c/mpiext_affinity_c.h"
4141

4242
static const char FUNC_NAME[] = "OMPI_Affinity";
4343
static const char ompi_nobind_str[] = "Open MPI did not bind this process";

ompi/mpiext/cr/c/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ noinst_LTLIBRARIES = libmpiext_cr_c.la
2424

2525
# This is where the top-level header file (that is included in
2626
# <mpi-ext.h>) must be installed.
27-
ompidir = $(ompiincludedir)/ompi/mpiext
27+
ompidir = $(ompiincludedir)/mpiext
2828

2929
# This is the header file that is installed.
30-
ompi_HEADERS = cr_c.h
30+
ompi_HEADERS = mpiext_cr_c.h
3131

3232
# Sources for the convenience libtool library. Other than the one
3333
# header file, all source files in the extension have no file naming

ompi/mpiext/cr/c/checkpoint.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* University Research and Technology
44
* Corporation. All rights reserved.
55
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
6-
* Copyright (c) 2018 Research Organization for Information Science
7-
* and Technology (RIST). All rights reserved.
86
* $COPYRIGHT$
97
*
108
* Additional copyrights may follow
@@ -20,7 +18,7 @@
2018
#include "ompi/communicator/communicator.h"
2119
#include "orte/mca/snapc/snapc.h"
2220

23-
#include "ompi/mpiext/cr/c/cr_c.h"
21+
#include "ompi/mpiext/cr/c/mpiext_cr_c.h"
2422

2523
static const char FUNC_NAME[] = "OMPI_CR_Checkpoint";
2624
#define HANDLE_SIZE_MAX 256

ompi/mpiext/cr/c/inc_register_callback.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* University Research and Technology
44
* Corporation. All rights reserved.
55
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
6-
* Copyright (c) 2018 Research Organization for Information Science
7-
* and Technology (RIST). All rights reserved.
86
* $COPYRIGHT$
97
*
108
* Additional copyrights may follow
@@ -16,7 +14,7 @@
1614

1715
#include "ompi/mpi/c/bindings.h"
1816
#include "opal/runtime/opal_cr.h"
19-
#include "ompi/mpiext/cr/c/cr_c.h"
17+
#include "ompi/mpiext/cr/c/mpiext_cr_c.h"
2018

2119
#include "ompi/runtime/params.h"
2220
#include "ompi/communicator/communicator.h"

ompi/mpiext/cr/c/migrate.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* University Research and Technology
44
* Corporation. All rights reserved.
55
* Copyright (c) 2012-2018 Cisco Systems, Inc. All rights reserved
6-
* Copyright (c) 2018 Research Organization for Information Science
7-
* and Technology (RIST). All rights reserved.
86
* $COPYRIGHT$
97
*
108
* Additional copyrights may follow
@@ -22,7 +20,7 @@
2220
#include "ompi/communicator/communicator.h"
2321
#include "orte/mca/snapc/snapc.h"
2422

25-
#include "ompi/mpiext/cr/c/cr_c.h"
23+
#include "ompi/mpiext/cr/c/mpiext_cr_c.h"
2624

2725
static const char FUNC_NAME[] = "OMPI_CR_Migrate";
2826

File renamed without changes.

ompi/mpiext/cr/c/quiesce_checkpoint.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* University Research and Technology
44
* Corporation. All rights reserved.
55
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
6-
* Copyright (c) 2018 Research Organization for Information Science
7-
* and Technology (RIST). All rights reserved.
86
* $COPYRIGHT$
97
*
108
* Additional copyrights may follow
@@ -20,7 +18,7 @@
2018
#include "ompi/communicator/communicator.h"
2119
#include "orte/mca/snapc/snapc.h"
2220

23-
#include "ompi/mpiext/cr/c/cr_c.h"
21+
#include "ompi/mpiext/cr/c/mpiext_cr_c.h"
2422

2523
static const char FUNC_NAME[] = "OMPI_CR_Quiesce_checkpoint";
2624

0 commit comments

Comments
 (0)