Skip to content

Commit 6570374

Browse files
authored
Merge pull request #3843 from jjhursey/revert/gfortran-sizeof
Revert MPI_SIZEOF fix for gfortran 4.8
2 parents 550e8c4 + 20ac03c commit 6570374

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

README

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Copyright (c) 2013-2015 Intel, Inc. All rights reserved
1919
Copyright (c) 2015 NVIDIA Corporation. All rights reserved.
2020
Copyright (c) 2017 Los Alamos National Security, LLC. All rights
2121
reserved.
22-
Copyright (c) 2017 IBM Corporation. All rights reserved
2322

2423
$COPYRIGHT$
2524

@@ -371,13 +370,8 @@ Compiler Notes
371370
- All Fortran compilers support the mpif.h/shmem.fh-based bindings,
372371
with one exception: the MPI_SIZEOF interfaces will only be present
373372
when Open MPI is built with a Fortran compiler that support the
374-
INTERFACE keyword and ISO_FORTRAN_ENV.
375-
376-
*** The Open MPI team has not tested to determine exactly which
377-
version of the GNU Fortran compiler suite started supporting
378-
what is required for MPI_SIZEOF. We know that gfortran v4.8
379-
(bundled in RHEL 7.x) supports the MPI_SIZEOF interfaces.
380-
However, gfortran 4.4 (bundled in RHEL 6.x) does not.
373+
INTERFACE keyword and ISO_FORTRAN_ENV. Most notably, this
374+
excludes the GNU Fortran compiler suite before version 4.9.
381375

382376
- The level of support provided by the mpi module is based on your
383377
Fortran compiler.

config/ompi_fortran_check_storage_size.m4

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +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) 2010-2014 Cisco Systems, Inc. All rights reserved.
14-
dnl Copyright (c) 2017 IBM Corporation. All rights reserved.
14+
dnl Copyright (c) 2017 IBM Corporation. All rights reserved.
1515
dnl $COPYRIGHT$
1616
dnl
1717
dnl Additional copyrights may follow
@@ -28,6 +28,17 @@ dnl
2828
AC_DEFUN([OMPI_FORTRAN_CHECK_STORAGE_SIZE],[
2929
AS_VAR_PUSHDEF([fortran_storage_size_var], [ompi_cv_fortran_have_storage_size])
3030

31+
# Re PR: https://github.com/open-mpi/ompi/pull/3822
32+
# We explored correcting the following syntax to compile with gfortran 4.8
33+
# - size = storage_size(x) / 8
34+
# + size = storage_size(x(1)) / 8
35+
# That allowed gfortran 4.8 to pass this configure test, but fail to
36+
# correctly handle mpi_sizeof due to the weak test for INTERFACE in
37+
# ompi_fortran_check_interface.m4. Until we can strengthen that configure
38+
# check we reverted the commit from PR #3822 to keep the old logic here
39+
# so that gfortran 4.8 will disqualify itself correctly for mpi_sizeof()
40+
# support.
41+
#
3142
AC_CACHE_CHECK([if Fortran compiler supports STORAGE_SIZE for relevant types],
3243
fortran_storage_size_var,
3344
[AC_LANG_PUSH([Fortran])
@@ -62,7 +73,7 @@ SUBROUTINE storage_size_complex32_r1(x, size)
6273
COMPLEX(REAL32), DIMENSION(*)::x
6374
INTEGER, INTENT(OUT) :: size
6475

65-
size = storage_size(x(1)) / 8
76+
size = storage_size(x) / 8
6677
END SUBROUTINE storage_size_complex32_r1
6778

6879
SUBROUTINE storage_size_int32_scalar(x, size)
@@ -78,7 +89,7 @@ SUBROUTINE storage_size_int32_r1(x, size)
7889
INTEGER(INT32), DIMENSION(*)::x
7990
INTEGER, INTENT(OUT) :: size
8091

81-
size = storage_size(x(1)) / 8
92+
size = storage_size(x) / 8
8293
END SUBROUTINE storage_size_int32_r1
8394

8495
SUBROUTINE storage_size_real32_scalar(x, size)
@@ -94,7 +105,7 @@ SUBROUTINE storage_size_real32_r1(x, size)
94105
REAL(REAL32), DIMENSION(*)::x
95106
INTEGER, INTENT(OUT) :: size
96107

97-
size = storage_size(x(1)) / 8
108+
size = storage_size(x) / 8
98109
END SUBROUTINE storage_size_real32_r1
99110
]])],
100111
[AS_VAR_SET(fortran_storage_size_var, yes)],

ompi/mpi/fortran/base/gen-mpi-sizeof.pl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Copyright (c) 2014-2015 Cisco Systems, Inc. All rights reserved.
44
# Copyright (c) 2015 Research Organization for Information Science
55
# and Technology (RIST). All rights reserved.
6-
# Copyright (c) 2017 IBM Corporation. All rights reserved.
76
# $COPYRIGHT$
87
#
98
# Script to generate the overloaded MPI_SIZEOF interfaces and
@@ -98,7 +97,7 @@ sub queue_sub {
9897
${indent} INTEGER, INTENT(OUT) :: size
9998
${indent} INTEGER$optional_ierror_param, INTENT(OUT) :: ierror";
10099
$subr->{start} = $start;
101-
$subr->{middle} = "${indent} size = storage_size(xSUBSCRIPT) / 8
100+
$subr->{middle} = "${indent} size = storage_size(x) / 8
102101
${indent} ${optional_ierror_statement}ierror = 0";
103102
$subr->{end} = "${indent}END SUBROUTINE ^PREFIX^$sub_name^RANK^";
104103

@@ -127,7 +126,6 @@ sub generate {
127126
if (0 == $rank) {
128127
$str =~ s/\^RANK\^/_scalar/g;
129128
$str =~ s/\^DIMENSION\^//;
130-
$str =~ s/SUBSCRIPT//;
131129
} else {
132130
$str =~ s/\^RANK\^/_r$rank/g;
133131
my $dim;
@@ -137,7 +135,6 @@ sub generate {
137135
--$d;
138136
}
139137
$str =~ s/\^DIMENSION\^/, DIMENSION($dim*)/;
140-
$str =~ s/SUBSCRIPT/($dim 1)/;
141138
}
142139

143140
# All done

0 commit comments

Comments
 (0)