@@ -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
@@ -691,7 +683,40 @@ if test "x$enable_darshan_runtime" = xyes ; then
691683 #endif
692684 ] ) ] ,
693685 [ ] ,
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$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
719+ fi
695720
696721 # determine if the MPI library includes MPI-IO functions or not
697722 AC_MSG_CHECKING ( for MPI-IO support in MPI )
@@ -868,6 +893,8 @@ AC_SUBST(HDF5_PATH, ["$with_hdf5"])
868893AC_SUBST ( PNETCDF_PATH , [ "$with_pnetcdf"] )
869894AC_SUBST ( DAOS_PATH , [ "$with_daos"] )
870895AC_SUBST ( LDMS_PATH , [ "$LDMS_HOME"] )
896+ AC_SUBST ( HAVE_OPEN_MPI , [ "$is_ompi"] )
897+ AC_SUBST ( OMPI_GE_5_0_6 , [ "$ompi_ge_5_0_6"] )
871898
872899AM_CONDITIONAL(ENABLE_MMAP_LOGS, [ test "x$enable_mmap_logs" = xyes] )
873900AM_CONDITIONAL(ENABLE_LDPRELOAD, [ test "x$enable_ld_preload" = xyes] )
0 commit comments