@@ -170,6 +170,7 @@ if test "x$enable_darshan_runtime" = xyes ; then
170170 __DARSHAN_LOG_HINTS="$with_log_hints"
171171 GOT_LOG_HINTS=yes
172172 fi
173+ __DARSHAN_LOG_HINTS_DEFAULT="romio_no_indep_rw=true;cb_nodes=4"
173174
174175 AC_ARG_WITH ( [ log-path] ,
175176 [ AS_HELP_STRING ( [ --with-log-path=DIR] ,
@@ -598,14 +599,6 @@ if test "x$enable_darshan_runtime" = xyes ; then
598599 AC_MSG_ERROR ( must provide -- with-jobid-env=<name> argument to configure. )
599600 fi
600601
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-
609602 # checks to see how we can print 64 bit values on this architecture
610603 gt_INTTYPES_PRI
611604 if test "x$PRI_MACROS_BROKEN" = x1; then
@@ -690,8 +683,31 @@ if test "x$enable_darshan_runtime" = xyes ; then
690683 #error OPENMPI FOUND
691684 #endif
692685 ] ) ] ,
693- [ ] ,
694- [ AC_DEFINE ( HAVE_OPEN_MPI , 1 , Define if OpenMPI is being used ) ] )
686+ [ is_ompi=0] , [ is_ompi=1] )
687+
688+ if test "x$is_ompi" = x1 ; then
689+ 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$is_ompi" = x1 && test "x$ompi_ge_5_0_6" = x0 ; then
704+ # OpenMPI 5.0.5 and priors contain a bug that can corrupt the Darshan
705+ # log files. The bug is related to file locking protocols implemented
706+ # when data sieving is enabled. Setting hint cb_nodes to 1 can avoid
707+ # the bug, but may make writing log files slow. For more information,
708+ # see PR 1070, https://github.com/darshan-hpc/darshan/pull/1070
709+ __DARSHAN_LOG_HINTS_DEFAULT="romio_no_indep_rw=true;cb_nodes=1"
710+ fi
695711
696712 # determine if the MPI library includes MPI-IO functions or not
697713 AC_MSG_CHECKING ( for MPI-IO support in MPI )
@@ -776,6 +792,13 @@ if test "x$enable_darshan_runtime" = xyes ; then
776792 # End of MPI-only checks
777793 #
778794
795+ if test "x$GOT_LOG_HINTS" != xyes ; then
796+ dnl use default hints
797+ AC_DEFINE_UNQUOTED ( [ __DARSHAN_LOG_HINTS] , "$__DARSHAN_LOG_HINTS_DEFAULT" ,
798+ [ Comma-separated list of MPI-IO hints for log file write] )
799+ __DARSHAN_LOG_HINTS=$__DARSHAN_LOG_HINTS_DEFAULT
800+ fi
801+
779802 # Newer glibc implementations will redirect fscanf calls to
780803 # __isoc99_fscanf calls. To properly handle this, we detect the
781804 # presence of the __isoc99_fscanf symbol and compile it's wrapper
@@ -868,6 +891,8 @@ AC_SUBST(HDF5_PATH, ["$with_hdf5"])
868891AC_SUBST ( PNETCDF_PATH , [ "$with_pnetcdf"] )
869892AC_SUBST ( DAOS_PATH , [ "$with_daos"] )
870893AC_SUBST ( LDMS_PATH , [ "$LDMS_HOME"] )
894+ AC_SUBST ( HAVE_OPEN_MPI , [ "$is_ompi"] )
895+ AC_SUBST ( OMPI_GE_5_0_6 , [ "$ompi_ge_5_0_6"] )
871896
872897AM_CONDITIONAL(ENABLE_MMAP_LOGS, [ test "x$enable_mmap_logs" = xyes] )
873898AM_CONDITIONAL(ENABLE_LDPRELOAD, [ test "x$enable_ld_preload" = xyes] )
0 commit comments