Skip to content

Commit 5575c86

Browse files
authored
Merge pull request #10683 from jjhursey/mpi_version_config
Move MPI Standard version to VERSION file
2 parents 849985e + bee50be commit 5575c86

File tree

7 files changed

+86
-10
lines changed

7 files changed

+86
-10
lines changed

VERSION

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ major=5
1919
minor=1
2020
release=0
2121

22+
# MPI Standard Compliance Level
23+
mpi_standard_version=3
24+
mpi_standard_subversion=1
25+
2226
# OMPI required dependency versions.
2327
# List in x.y.z format.
2428
pmix_min_version=4.1.2

config/opal_get_version.m4

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dnl Copyright (c) 2008-2020 Cisco Systems, Inc. All rights reserved.
1414
dnl Copyright (c) 2014 Intel, Inc. All rights reserved.
1515
dnl Copyright (c) 2014-2020 Research Organization for Information Science
1616
dnl and Technology (RIST). All rights reserved.
17+
dnl Copyright (c) 2022 IBM Corporation. All rights reserved.
1718
dnl $COPYRIGHT$
1819
dnl
1920
dnl Additional copyrights may follow
@@ -99,3 +100,27 @@ m4_define([OPAL_GET_VERSION],[
99100
[AC_MSG_RESULT([$$2_REPO_REV])])
100101
fi
101102
])
103+
104+
# OPAL_GET_MPI_STANDARD_VERSION(version_file)
105+
# -----------------------------------------------
106+
# parse version_file for MPI Standard version information, setting
107+
# the following shell variables:
108+
#
109+
# MPI_VERSION
110+
# MPI_SUBVERSION
111+
m4_define([OPAL_GET_MPI_STANDARD_VERSION],[
112+
dnl quote eval to suppress macro expansion with non-GNU m4
113+
if test -f "$1"; then
114+
srcdir=`dirname $1`
115+
mpi_standard_vers=`sed -n "
116+
t clear
117+
: clear
118+
s/^mpi_standard_version/MPI_VERSION/
119+
s/^mpi_standard_subversion/MPI_SUBVERSION/
120+
t print
121+
b
122+
: print
123+
p" < "$1"`
124+
[eval] "$mpi_standard_vers"
125+
fi
126+
])

config/opal_save_version.m4

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ dnl University of Stuttgart. All rights reserved.
1111
dnl Copyright (c) 2004-2005 The Regents of the University of California.
1212
dnl All rights reserved.
1313
dnl Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved.
14+
dnl Copyright (c) 2022 IBM Corporation. All rights reserved.
1415
dnl $COPYRIGHT$
1516
dnl
1617
dnl Additional copyrights may follow
@@ -62,3 +63,22 @@ AC_DEFUN([OPAL_SAVE_VERSION], [
6263

6364
AC_CONFIG_FILES([$4])
6465
])dnl
66+
67+
# OPAL_SAVE_MPI_STANDARD_VERSION(version_file)
68+
# ----------------------------------------------
69+
# creates version information for project from version_file, using
70+
# OPAL_GET_MPI_STANDARD_VERSION().
71+
AC_DEFUN([OPAL_SAVE_MPI_STANDARD_VERSION], [
72+
OPAL_GET_MPI_STANDARD_VERSION([$1])
73+
74+
AC_SUBST([MPI_VERSION])
75+
AC_SUBST([MPI_SUBVERSION])
76+
77+
AC_DEFINE_UNQUOTED([MPI_VERSION], [$MPI_VERSION],
78+
[MPI Standard Major version number])
79+
AC_DEFINE_UNQUOTED([MPI_SUBVERSION], [$MPI_SUBVERSION],
80+
[MPI Standard Minor version number])
81+
82+
AC_MSG_CHECKING([MPI Standard version])
83+
AC_MSG_RESULT([$MPI_VERSION.$MPI_SUBVERSION])
84+
])dnl

config/opal_summary.m4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dnl Copyright (c) 2016-2018 Cisco Systems, Inc. All rights reserved
66
dnl Copyright (c) 2016 Research Organization for Information Science
77
dnl and Technology (RIST). All rights reserved.
88
dnl Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
9+
dnl Copyright (c) 2022 IBM Corporation. All rights reserved.
910
dnl $COPYRIGHT$
1011
dnl
1112
dnl Additional copyrights may follow
@@ -92,6 +93,7 @@ AC_DEFUN([OPAL_SUMMARY_PRINT],[
9293
Open MPI configuration:
9394
-----------------------
9495
Version: $OMPI_MAJOR_VERSION.$OMPI_MINOR_VERSION.$OMPI_RELEASE_VERSION$OMPI_GREEK_VERSION
96+
MPI Standard Version: $MPI_VERSION.$MPI_SUBVERSION
9597
EOF
9698
9799
if test "$project_ompi_amc" = "true" ; then

configure.ac

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# Copyright (c) 2013-2020 Intel, Inc. All rights reserved.
2323
# Copyright (c) 2014-2022 Research Organization for Information Science
2424
# and Technology (RIST). All rights reserved.
25-
# Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
25+
# Copyright (c) 2016-2022 IBM Corporation. All rights reserved.
2626
# Copyright (c) 2018-2021 Amazon.com, Inc. or its affiliates.
2727
# All Rights reserved.
2828
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
@@ -141,7 +141,8 @@ opal_show_subtitle "Checking versions"
141141

142142
m4_ifdef([project_ompi],
143143
[OPAL_SAVE_VERSION([OMPI], [Open MPI], [$srcdir/VERSION],
144-
[ompi/include/ompi/version.h])])
144+
[ompi/include/ompi/version.h])
145+
OPAL_SAVE_MPI_STANDARD_VERSION([$srcdir/VERSION])])
145146

146147
m4_ifdef([project_oshmem],
147148
[OPAL_SAVE_VERSION([OSHMEM], [Open SHMEM],

ompi/include/mpi.h.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@
199199
#undef OMPI_MINOR_VERSION
200200
#undef OMPI_RELEASE_VERSION
201201

202+
/*
203+
* MPI version
204+
*/
205+
#undef MPI_VERSION
206+
#undef MPI_SUBVERSION
207+
202208
/* A type that allows us to have sentinel type values that are still
203209
valid */
204210
#undef ompi_fortran_bogus_type_t
@@ -249,12 +255,6 @@
249255
*/
250256
#define OPEN_MPI 1
251257

252-
/*
253-
* MPI version
254-
*/
255-
#define MPI_VERSION 3
256-
#define MPI_SUBVERSION 1
257-
258258

259259
/*
260260
* Do we want MPI interface deprecated function warnings? This is

ompi/include/mpif-values.pl

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,30 @@ sub write_file {
7171

7272
#----------------------------------------------------------------------------
7373

74+
# Read a value for a specified key from the file specified.
75+
76+
sub read_value_from_file {
77+
my ($filename, $key) = @_;
78+
my $value;
79+
80+
open(FILE_IN, $filename) || die "Couldn't open $filename";
81+
while(my $line = <FILE_IN>) {
82+
if( $line =~ /^$key=(.+)/ ) {
83+
$value = $1;
84+
last;
85+
}
86+
}
87+
close(FILE_IN);
88+
89+
if(!defined($value)) {
90+
die "Did not find the string \"$key\" in the file $filename"
91+
}
92+
93+
return $value;
94+
}
95+
96+
#----------------------------------------------------------------------------
97+
7498
print "creating Fortran header files (with common constants)...\n";
7599

76100
# Find the OMPI topdir. It is likely the pwd.
@@ -216,8 +240,8 @@ sub write_file {
216240

217241
my $constants;
218242

219-
$constants->{MPI_VERSION} = 3;
220-
$constants->{MPI_SUBVERSION} = 1;
243+
$constants->{MPI_VERSION} = read_value_from_file("$topdir/VERSION", "mpi_standard_version");
244+
$constants->{MPI_SUBVERSION} = read_value_from_file("$topdir/VERSION", "mpi_standard_subversion");
221245

222246
$constants->{MPI_ANY_SOURCE} = -1;
223247
$constants->{MPI_ANY_TAG} = -1;

0 commit comments

Comments
 (0)