-
Notifications
You must be signed in to change notification settings - Fork 196
/
Copy pathscorep-9.0-build-Add-MPIF08-configure-check-for-Intel-MPI.patch
129 lines (117 loc) · 4.96 KB
/
scorep-9.0-build-Add-MPIF08-configure-check-for-Intel-MPI.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
From 1a7be011a2d9084d9e2dc9c7d79de729e0ed52b7 Mon Sep 17 00:00:00 2001
From: Jan Andre Reuter <[email protected]>
Date: Mon, 7 Apr 2025 10:47:03 +0200
Subject: [PATCH] build: Add MPIF08 configure check for Intel MPI
Adds an additional configure check to check if Intel MPI
fails to build a simple MPIF08 test case. This is due to a
bug in Intel MPI which has to be fixed after installation of Intel
MPI, requiring to rebuild the MPIF08 bindings.
If not checked, builds with Intel MPI will fail due to the bug
described in:
https://community.intel.com/t5/Intel-MPI-Library/MPI-f08-with-polymorphic-argument-CLASS/m-p/1590421
When this bug is triggered, disable the entire MPIF08 support.
Steps on how to solve this are already described in OPEN_ISSUES.
Signed-off-by: Jan Andre Reuter <[email protected]>
---
OPEN_ISSUES | 6 ++---
build-config/m4/scorep_mpi.m4 | 18 +++++++++++++
build-mpi/configure | 26 +++++++++++++++++++
src/adapters/mpi/f08/SCOREP_Mpi_F08_Abort.f90 | 6 +++++
4 files changed, 53 insertions(+), 3 deletions(-)
diff --git a/OPEN_ISSUES b/OPEN_ISSUES
index 69fe817..44a9fc7 100644
--- a/OPEN_ISSUES
+++ b/OPEN_ISSUES
@@ -266,9 +266,9 @@ various Score-P components.
- `MPI_ALLTOALLW` allocates temporary arrays for type conversions from F08
to C. On large communicators, this might consume a large amount of memory.
- - Compilation of Score-P fails with oneAPI's mpiifx (several versions
- affected) due to an error in their F08 bindings. A workaround is
- described here:
+ - Configure will disable MPIF08 support with oneAPI's mpiifx (several
+ versions affected) if it detects an error in their F08 bindings. A
+ workaround, enabling support, is described here:
https://community.intel.com/t5/Intel-MPI-Library/MPI-f08-with-polymorphic-argument-CLASS/m-p/1590421/highlight/true#M11660
diff --git a/build-config/m4/scorep_mpi.m4 b/build-config/m4/scorep_mpi.m4
index fb89a42..6398441 100644
--- a/build-config/m4/scorep_mpi.m4
+++ b/build-config/m4/scorep_mpi.m4
@@ -461,6 +461,24 @@ AC_LINK_IFELSE(AC_LANG_SOURCE([[program pmpi_funcs
end program]]), [], [scorep_mpi_usempif08_supported="no, MPI library does not provide all required PMPI procedures"])
fi
+# Test for Intel MPI bug with Fortran 2008 bindings. See
+# https://community.intel.com/t5/Intel-MPI-Library/MPI-f08-with-polymorphic-argument-CLASS/m-p/1590421
+if test x"$scorep_mpi_usempif08_supported" = xyes; then
+AC_COMPILE_IFELSE(AC_LANG_SOURCE([[subroutine test(baz, dtype)
+ use MPI_f08
+ implicit none (type, external)
+
+ ! Subroutine arguments
+ class(*) :: baz
+ type(MPI_Datatype) :: dtype
+
+ ! Local variables
+ type(MPI_Request) :: recvreq
+
+ call MPI_Irecv(baz, 1, dtype, 0, 0, MPI_COMM_SELF, recvreq)
+end subroutine test]]), [], [scorep_mpi_usempif08_supported="no, due to a bug in the MPI library"])
+fi
+
AC_MSG_RESULT([$scorep_mpi_usempif08_supported])
ac_ext="${ac_ext_save}"
AC_LANG_POP([Fortran])
diff --git a/build-mpi/configure b/build-mpi/configure
index 39901d4..4119823 100755
--- a/build-mpi/configure
+++ b/build-mpi/configure
@@ -44669,6 +44669,32 @@ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
+# Test for Intel MPI bug with Fortran 2008 bindings. See
+# https://community.intel.com/t5/Intel-MPI-Library/MPI-f08-with-polymorphic-argument-CLASS/m-p/1590421
+if test x"$scorep_mpi_usempif08_supported" = xyes; then
+cat > conftest.$ac_ext <<_ACEOF
+subroutine test(baz, dtype)
+ use MPI_f08
+ implicit none (type, external)
+
+ ! Subroutine arguments
+ class(*) :: baz
+ type(MPI_Datatype) :: dtype
+
+ ! Local variables
+ type(MPI_Request) :: recvreq
+
+ call MPI_Irecv(baz, 1, dtype, 0, 0, MPI_COMM_SELF, recvreq)
+end subroutine test
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+
+else
+ scorep_mpi_usempif08_supported="no, due to a bug in the MPI library"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $scorep_mpi_usempif08_supported" >&5
case "$scorep_mpi_usempif08_supported" in #(
yes|ok|yes[\ ,]*) :
diff --git a/src/adapters/mpi/f08/SCOREP_Mpi_F08_Abort.f90 b/src/adapters/mpi/f08/SCOREP_Mpi_F08_Abort.f90
index 55d17ea..43cdaf9 100644
--- a/src/adapters/mpi/f08/SCOREP_Mpi_F08_Abort.f90
+++ b/src/adapters/mpi/f08/SCOREP_Mpi_F08_Abort.f90
@@ -31,6 +31,12 @@ subroutine MPI_Init_thread_f08(required, provided, ierror)
integer, intent(in) :: required
integer, intent(out) :: provided
integer, optional, intent(out) :: ierror
+
+ ! Workarond for IntelMPI bug, to prevent error:
+ ! A dummy argument with an explicit INTENT(OUT) declaration is not
+ ! given an explicit value.
+ provided = 0
+
write (*, *) "[Score-P] Support for 'USE mpi_f08' is disabled in", &
" this Score-P installation."
write (*, *) " Please view 'scorep.summary' for details. "
--
2.43.0