@@ -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
@@ -694,6 +686,48 @@ if test "x$enable_darshan_runtime" = xyes ; then
694686
695687 if test "x$is_ompi" = x1 ; then
696688 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+ # set default hints
704+ __DARSHAN_LOG_HINTS_DEFAULT="romio_no_indep_rw=true;cb_nodes=4"
705+
706+ if test "x$is_ompi" = x1 ; then
707+ # OpenMPI 5.0.5 and priors contain a bug that can corrupt the
708+ # Darshan log files. The bug is related to file locking protocols
709+ # implemented when data sieving is enabled. Setting hint cb_nodes
710+ # to 1 can avoid the bug, but may make writing log files slow.
711+ # For more information, see PR 1070,
712+ # https://github.com/darshan-hpc/darshan/pull/1070
713+ #
714+ # However, 5.0.6 and later can cause serialization of file writes
715+ # See https://github.com/open-mpi/ompi/issues/13376
716+ # To mimize the performance impact of writing the log file, we set
717+ # hint cb_nodes to 1.
718+ #
719+ # Note hint romio_no_indep_rw is an MPI thing, not implemented in
720+ # OpenMPI.
721+ #
722+ __DARSHAN_LOG_HINTS_DEFAULT="cb_nodes=1"
723+
724+ # if test "x$ompi_ge_5_0_6" = x0 ; then
725+ # __DARSHAN_LOG_HINTS_DEFAULT="romio_no_indep_rw=true;cb_nodes=1"
726+ # else
727+ # __DARSHAN_LOG_HINTS_DEFAULT="romio_no_indep_rw=true;cb_nodes=4"
728+ # fi
729+ fi
730+ __DARSHAN_LOG_HINTS=$__DARSHAN_LOG_HINTS_DEFAULT
697731 fi
698732
699733 # determine if the MPI library includes MPI-IO functions or not
@@ -889,6 +923,10 @@ else
889923 is_ompi=0
890924fi
891925
926+ # __DARSHAN_LOG_HINTS is used by both MPI and non-MPI configurations
927+ AC_DEFINE_UNQUOTED ( [ __DARSHAN_LOG_HINTS] , "$__DARSHAN_LOG_HINTS" ,
928+ [ Comma-separated list of MPI-IO hints for log file write] )
929+
892930AC_SUBST ( ENABLE_LD_PRELOAD , [ "$enable_ld_preload"] )
893931AC_SUBST ( ENABLE_CUSERID , [ "$enable_cuserid"] )
894932AC_SUBST ( ENABLE_GROUP_READABLE_LOGS , [ "$enable_group_readable_logs"] )
@@ -923,6 +961,7 @@ AC_SUBST(PNETCDF_PATH, ["$with_pnetcdf"])
923961AC_SUBST ( DAOS_PATH , [ "$with_daos"] )
924962AC_SUBST ( LDMS_PATH , [ "$LDMS_HOME"] )
925963AC_SUBST ( HAVE_OPEN_MPI , [ "$is_ompi"] )
964+ AC_SUBST ( OMPI_GE_5_0_6 , [ "$ompi_ge_5_0_6"] )
926965
927966AM_CONDITIONAL(ENABLE_MMAP_LOGS, [ test "x$enable_mmap_logs" = xyes] )
928967AM_CONDITIONAL(ENABLE_LDPRELOAD, [ test "x$enable_ld_preload" = xyes] )
0 commit comments