Skip to content

Commit ff5060a

Browse files
committed
Set default MPI-IO hint cb_nodes to 1 when using OpenMPI 5.0.5 and priors
1 parent dd0c2e7 commit ff5060a

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

darshan-runtime/configure.ac

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -598,14 +598,6 @@ if test "x$enable_darshan_runtime" = xyes ; then
598598
AC_MSG_ERROR(must provide --with-jobid-env=<name> argument to configure.)
599599
fi
600600

601-
__DARSHAN_LOG_HINTS_DEFAULT="romio_no_indep_rw=true;cb_nodes=4"
602-
if test "x$GOT_LOG_HINTS" != xyes ; then
603-
dnl use default hints
604-
AC_DEFINE_UNQUOTED([__DARSHAN_LOG_HINTS], "$__DARSHAN_LOG_HINTS_DEFAULT",
605-
[Comma-separated list of MPI-IO hints for log file write])
606-
__DARSHAN_LOG_HINTS=$__DARSHAN_LOG_HINTS_DEFAULT
607-
fi
608-
609601
# checks to see how we can print 64 bit values on this architecture
610602
gt_INTTYPES_PRI
611603
if test "x$PRI_MACROS_BROKEN" = x1; then
@@ -690,10 +682,40 @@ if test "x$enable_darshan_runtime" = xyes ; then
690682
#error OPENMPI FOUND
691683
#endif
692684
])],
685+
[],
693686
[is_ompi=0], [is_ompi=1])
694687

695688
if test "x$is_ompi" = x1 ; then
696689
AC_DEFINE(HAVE_OPEN_MPI, 1, [Define if OpenMPI is being used])
690+
691+
dnl Check if version is 5.0.6 or later
692+
AC_MSG_CHECKING([Check if OpenMPI version is 5.0.6 or later])
693+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mpi.h>
694+
#if (OMPI_MAJOR_VERSION*1000000 + OMPI_MINOR_VERSION*1000 + OMPI_RELEASE_VERSION < 5000006)
695+
choke me
696+
#endif
697+
]])], [ompi_ge_5_0_6=1], [ompi_ge_5_0_6=0])
698+
AC_MSG_RESULT([$ompi_ge_5_0_6])
699+
AC_DEFINE_UNQUOTED(OMPI_GE_5_0_6, [$ompi_ge_5_0_6],
700+
[Define if OpenMPI version is 5.0.6 or later])
701+
fi
702+
703+
if test "x$GOT_LOG_HINTS" != xyes ; then
704+
if test "x$is_ompi" = x1 && test "x$ompi_ge_5_0_6" = x0 ; then
705+
# OpenMPI 5.0.5 and priors contain a bug that can corrupt the
706+
# Darshan log files. The bug is related to file locking protocols
707+
# implemented when data sieving is enabled. Setting hint cb_nodes
708+
# to 1 can avoid the bug, but may make writing log files slow.
709+
# For more information, see PR 1070,
710+
# https://github.com/darshan-hpc/darshan/pull/1070
711+
__DARSHAN_LOG_HINTS_DEFAULT="romio_no_indep_rw=true;cb_nodes=1"
712+
else
713+
__DARSHAN_LOG_HINTS_DEFAULT="romio_no_indep_rw=true;cb_nodes=4"
714+
fi
715+
dnl use default hints
716+
AC_DEFINE_UNQUOTED([__DARSHAN_LOG_HINTS], "$__DARSHAN_LOG_HINTS_DEFAULT",
717+
[Comma-separated list of MPI-IO hints for log file write])
718+
__DARSHAN_LOG_HINTS=$__DARSHAN_LOG_HINTS_DEFAULT
697719
fi
698720

699721
# determine if the MPI library includes MPI-IO functions or not
@@ -923,6 +945,7 @@ AC_SUBST(PNETCDF_PATH, ["$with_pnetcdf"])
923945
AC_SUBST(DAOS_PATH, ["$with_daos"])
924946
AC_SUBST(LDMS_PATH, ["$LDMS_HOME"])
925947
AC_SUBST(HAVE_OPEN_MPI, ["$is_ompi"])
948+
AC_SUBST(OMPI_GE_5_0_6, ["$ompi_ge_5_0_6"])
926949

927950
AM_CONDITIONAL(ENABLE_MMAP_LOGS, [test "x$enable_mmap_logs" = xyes])
928951
AM_CONDITIONAL(ENABLE_LDPRELOAD, [test "x$enable_ld_preload" = xyes])

0 commit comments

Comments
 (0)