@@ -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,8 +682,40 @@ if test "x$enable_darshan_runtime" = xyes ; then
690682 #error OPENMPI FOUND
691683 #endif
692684 ] ) ] ,
693- [ ] ,
694- [ AC_DEFINE ( HAVE_OPEN_MPI , 1 , Define if OpenMPI is being used ) ] )
685+ [ is_ompi=0] , [ is_ompi=1] )
686+
687+ if test "x$is_ompi" = x1 ; then
688+ AC_DEFINE ( HAVE_OPEN_MPI , 1 , [ Define if OpenMPI is being used] )
689+
690+ dnl Check if version is 5.0.6 or later
691+ AC_MSG_CHECKING ( [ Check if OpenMPI version is 5.0.6 or later] )
692+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [ #include <mpi.h>
693+ #if (OMPI_MAJOR_VERSION*1000000 + OMPI_MINOR_VERSION*1000 + OMPI_RELEASE_VERSION < 5000006)
694+ choke me
695+ #endif
696+ ] ] ) ] , [ ompi_ge_5_0_6=1] , [ ompi_ge_5_0_6=0] )
697+ AC_MSG_RESULT ( [ $ompi_ge_5_0_6] )
698+ AC_DEFINE_UNQUOTED ( OMPI_GE_5_0_6 , [ $ompi_ge_5_0_6] ,
699+ [ Define if OpenMPI version is 5.0.6 or later] )
700+ fi
701+
702+ if test "x$GOT_LOG_HINTS" != xyes ; then
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
705+ # Darshan log files. The bug is related to file locking protocols
706+ # implemented when data sieving is enabled. Setting hint cb_nodes
707+ # to 1 can avoid the bug, but may make writing log files slow.
708+ # For more information, see PR 1070,
709+ # https://github.com/darshan-hpc/darshan/pull/1070
710+ __DARSHAN_LOG_HINTS_DEFAULT="romio_no_indep_rw=true;cb_nodes=1"
711+ else
712+ __DARSHAN_LOG_HINTS_DEFAULT="romio_no_indep_rw=true;cb_nodes=4"
713+ fi
714+ dnl use default hints
715+ AC_DEFINE_UNQUOTED ( [ __DARSHAN_LOG_HINTS] , "$__DARSHAN_LOG_HINTS_DEFAULT" ,
716+ [ Comma-separated list of MPI-IO hints for log file write] )
717+ __DARSHAN_LOG_HINTS=$__DARSHAN_LOG_HINTS_DEFAULT
718+ fi
695719
696720 # determine if the MPI library includes MPI-IO functions or not
697721 AC_MSG_CHECKING ( for MPI-IO support in MPI )
@@ -868,6 +892,8 @@ AC_SUBST(HDF5_PATH, ["$with_hdf5"])
868892AC_SUBST ( PNETCDF_PATH , [ "$with_pnetcdf"] )
869893AC_SUBST ( DAOS_PATH , [ "$with_daos"] )
870894AC_SUBST ( LDMS_PATH , [ "$LDMS_HOME"] )
895+ AC_SUBST ( HAVE_OPEN_MPI , [ "$is_ompi"] )
896+ AC_SUBST ( OMPI_GE_5_0_6 , [ "$ompi_ge_5_0_6"] )
871897
872898AM_CONDITIONAL(ENABLE_MMAP_LOGS, [ test "x$enable_mmap_logs" = xyes] )
873899AM_CONDITIONAL(ENABLE_LDPRELOAD, [ test "x$enable_ld_preload" = xyes] )
0 commit comments