Skip to content

Commit b9cc3aa

Browse files
authored
Merge pull request pmodels#7297 from hzhou/2502_f08_ignore_d
binding/f08: add ignore_tkr(d) for nvfortran Approved-by: Ken Raffenetti
2 parents e986d97 + ae03fc5 commit b9cc3aa

File tree

4 files changed

+49
-2
lines changed

4 files changed

+49
-2
lines changed

confdb/aclocal_fc.m4

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,44 @@ AC_DEFUN([PAC_FC_CHECK_IGNORE_TKR],[
12681268
AC_LANG_POP(Fortran)
12691269
])
12701270

1271+
dnl
1272+
dnl PAC_FC_CHECK_IGNORE_TKR_D check directives to ignore "DEVICE" attribute.
1273+
dnl set pac_fc_ignore_tkr_d to a type if supported, otherwise, no.
1274+
dnl
1275+
AC_DEFUN([PAC_FC_CHECK_IGNORE_TKR_D],[
1276+
AC_LANG_PUSH(Fortran)
1277+
AC_MSG_CHECKING([directives for Fortran compiler to ignore TKR(d) check])
1278+
pac_fc_ignore_tkr_d=no
1279+
for a in dir ; do
1280+
case $a in
1281+
dir)
1282+
# flang
1283+
decl='!DIR$ IGNORE_TKR(d) buf'
1284+
;;
1285+
esac
1286+
1287+
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1288+
program main
1289+
IMPLICIT NONE
1290+
INTERFACE
1291+
SUBROUTINE FUNC_A(buf)
1292+
TYPE(*), DIMENSION(..) :: buf
1293+
$decl
1294+
END SUBROUTINE
1295+
END INTERFACE
1296+
1297+
REAL A(10)
1298+
CALL FUNC_A(A)
1299+
end
1300+
])],[pac_fc_ignore_tkr_d=$a],[])
1301+
if test $pac_fc_ignore_tkr_d != no ; then
1302+
break
1303+
fi
1304+
done
1305+
AC_MSG_RESULT([$pac_fc_ignore_tkr_d])
1306+
AC_LANG_POP(Fortran)
1307+
])
1308+
12711309
dnl
12721310
dnl PAC_FC_ISO_C_BINDING check whether ISO_C_BINDING is supported.
12731311
dnl set pac_fc_iso_c_binding to yes if it's supported, otherwise, no.

configure.ac

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4207,6 +4207,7 @@ fi
42074207

42084208
if test "$enable_f08" = "yes" ; then
42094209
PAC_FC_CHECK_REAL128
4210+
PAC_FC_CHECK_IGNORE_TKR_D
42104211
if test -z "$PYTHON" ; then
42114212
if test -f src/binding/fortran/use_mpi_f08/mpi_f08.f90 ; then
42124213
AC_MSG_NOTICE([Using pre-generated Fortran mpi_f08 binding source. To prevent issues, install Python 3 and rerun configure.])
@@ -4218,6 +4219,9 @@ if test "$enable_f08" = "yes" ; then
42184219
if test "$pac_fc_has_real128" = "no" ; then
42194220
cmd_f08="$cmd_f08 -no-real128"
42204221
fi
4222+
if test "$pac_fc_ignore_tkr_d" != "no" ; then
4223+
cmd_f08="$cmd_f08 -ignore-tkr-d=$pac_fc_ignore_tkr_d"
4224+
fi
42214225
if test "$enable_romio" = "no" ; then
42224226
cmd_f08="$cmd_f08 -no-mpiio"
42234227
fi

maint/local_python/binding_f08.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,10 @@ def dump_interface_function(func, name, c_name, is_large):
879879
def dump_mpi_f08(func, is_large):
880880
f08_mapping = get_kind_map('F08', is_large)
881881

882+
def dump_ignore_tkr_d(name, out):
883+
if G.opts['ignore-tkr-d'] == 'dir': # e.g. nvfortran
884+
out.append("!DIR$ IGNORE_TKR(d) " + name)
885+
882886
uses = {}
883887
f_param_list = []
884888
decl_list = []
@@ -889,6 +893,8 @@ def dump_mpi_f08(func, is_large):
889893
f_param_list.append(p['name'])
890894
decl = get_F_decl(p, f08_mapping)
891895
decl_list.append(decl)
896+
if 'ignore-tkr-d' in G.opts and p['kind'] == 'BUFFER':
897+
dump_ignore_tkr_d(p['name'], decl_list)
892898
check_decl_uses(decl, uses)
893899
if 'return' not in func:
894900
f_param_list.append("ierror")

src/mpid/ch4/src/ch4_send.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_isend(const void *buf,
2424
#ifdef MPIDI_CH4_DIRECT_NETMOD
2525
mpi_errno = MPIDI_NM_mpi_isend(buf, count, datatype, rank, tag, comm, attr, av, req);
2626
#else
27-
int r;
28-
if ((r = MPIDI_av_is_local(av)))
27+
if ((MPIDI_av_is_local(av)))
2928
mpi_errno = MPIDI_SHM_mpi_isend(buf, count, datatype, rank, tag, comm, attr, av, req);
3029
else
3130
mpi_errno = MPIDI_NM_mpi_isend(buf, count, datatype, rank, tag, comm, attr, av, req);

0 commit comments

Comments
 (0)