Skip to content

Commit 81a4d67

Browse files
committed
Check autoperf submodule git SHA to determine whether to use patched darshan-apmpi.c
Patched darshan-apmpi.c will only be used when submodule autoperf's HEAD SHA is equal or earlier than 8623a0652735785fe87d89514112e43e4f52a78d
1 parent 1074414 commit 81a4d67

File tree

4 files changed

+27
-14
lines changed

4 files changed

+27
-14
lines changed

Makefile.am

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55

66
ACLOCAL_AMFLAGS = -I maint/config
77

8-
if BUILD_APMPI_MODULE
9-
SUBDIRS = modules .
10-
else
11-
SUBDIRS = .
12-
endif
8+
SUBDIRS = modules
139

1410
if BUILD_DARSHAN_RUNTIME
1511
SUBDIRS += darshan-runtime

configure.ac

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ AC_ARG_ENABLE([darshan-runtime],
3030
)
3131
AM_CONDITIONAL(BUILD_DARSHAN_RUNTIME, [test "x$enable_darshan_runtime" != xno])
3232

33-
# AUTOPERF MPI module
34-
AC_ARG_ENABLE([apmpi-mod],
35-
[AS_HELP_STRING([--enable-apmpi-mod],
36-
[Enables compilation and use of AUTOPERF MPI module (requ ires MPI)])],
37-
[], [enable_apmpi_mod=no]
38-
)
39-
AM_CONDITIONAL(BUILD_APMPI_MODULE, [test "x$enable_apmpi_mod" = xyes])
40-
4133
AC_ARG_ENABLE([darshan-util],
4234
[AS_HELP_STRING([--disable-darshan-util],
4335
[Build without Darshan utility tools])],

darshan-runtime/configure.ac

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,23 @@ if test "x$enable_darshan_runtime" = xyes ; then
312312
#endif]])], [],
313313
[AC_MSG_ERROR([APMPI module requires MPI version 3+.])]
314314
)
315+
316+
AC_MSG_CHECKING([whether patching darshan-apmpi.c is necessary])
317+
submod_status="m4_esyscmd_s([git submodule status])"
318+
apmpi_mod_sha=`echo ${submod_status} | cut -d' ' -f1`
319+
320+
if test "x$apmpi_mod_sha" = x8623a0652735785fe87d89514112e43e4f52a78d ; then
321+
apply_apmpi_patch=yes
322+
else
323+
# check if git HAED of autoperf is a descendent of 8623a06
324+
ac_flag=m4_esyscmd_s([cd ../modules/autoperf && git merge-base --is-ancestor 8623a0652735785fe87d89514112e43e4f52a78d HEAD && echo "$?"])
325+
if test "x$ac_flag" = x0 ; then
326+
apply_apmpi_patch=no
327+
else
328+
apply_apmpi_patch=yes
329+
fi
330+
fi
331+
AC_MSG_RESULT([$apply_apmpi_patch])
315332
fi
316333

317334
AC_ARG_ENABLE([apmpi-coll-sync],
@@ -1032,6 +1049,7 @@ AM_CONDITIONAL(BUILD_BGQ_MODULE, [test "x$enable_bgq_mod" = xyes])
10321049
AM_CONDITIONAL(BUILD_LUSTRE_MODULE, [test "x$enable_lustre_mod" = xyes])
10331050
AM_CONDITIONAL(BUILD_MDHIM_MODULE, [test "x$enable_mdhim_mod" = xyes])
10341051
AM_CONDITIONAL(BUILD_APMPI_MODULE, [test "x$enable_apmpi_mod" = xyes])
1052+
AM_CONDITIONAL(PATCH_APMPI_MODULE, [test "x$apply_apmpi_patch" = xyes])
10351053
AM_CONDITIONAL(BUILD_APXC_MODULE, [test "x$enable_apxc_mod" = xyes])
10361054
AM_CONDITIONAL(BUILD_HEATMAP_MODULE,[test "x$enable_heatmap_mod" = xyes])
10371055
AM_CONDITIONAL(BUILD_DAOS_MODULE, [test "x$enable_daos_mod" = xyes])

darshan-runtime/lib/Makefile.am

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,15 @@ if BUILD_APMPI_MODULE
104104
AM_CPPFLAGS += -DDARSHAN_USE_APMPI \
105105
-I$(apmpi_root) -I$(apmpi_root)/lib
106106
endif
107+
108+
if PATCH_APMPI_MODULE
109+
darshan_apmpi_c=$(top_srcdir)/../modules/patched_darshan-apmpi.c
110+
else
111+
darshan_apmpi_c=$(apmpi_root)/lib/darshan-apmpi.c
112+
endif
113+
107114
darshan-apmpi.c:
108-
$(LN_S) $(top_srcdir)/../modules/patched_darshan-apmpi.c $@
115+
$(LN_S) $(darshan_apmpi_c) $@
109116

110117
libdarshan_la_SOURCES = $(C_SRCS)
111118
libdarshan_la_LIBADD = -lpthread -lrt -lz -ldl $(DARSHAN_LUSTRE_LD_FLAGS)

0 commit comments

Comments
 (0)