Commit 95678e94 authored by Shane Snyder's avatar Shane Snyder
Browse files

Merge branch 'snyder/dev-issue317-openmpi-check' into 'master'

Disable MPI-IO module offset tracking for OpenMPI builds

See merge request !106
parents 5b596ed1 6c5c6484
......@@ -5206,6 +5206,40 @@ fi
done
# check for OpenMPI
# NOTE: this check is needed due to a bug observed in some OpenMPI
# versions triggered by Darshan's MPI-IO module usage of the
# MPI_File_get_byte_offset() routine. For applications that create
# zero-length datatypes, then read/write to them, it can trigger a
# seg fault due to a divide by zero condition in OpenMPI. See the
# following Darshan issue for more details:
# https://xgitlab.cels.anl.gov/darshan/darshan/-/issues/317
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#include <mpi.h>
#ifdef OPEN_MPI
#error OPENMPI FOUND
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
$as_echo "#define HAVE_OPEN_MPI 1" >>confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
DARSHAN_VERSION="3.3.0-pre1"
......
......@@ -557,6 +557,24 @@ AC_CHECK_FUNCS([preadv],[],[])
AC_CHECK_FUNCS([pwritev2],[],[])
AC_CHECK_FUNCS([preadv2],[],[])
# check for OpenMPI
# NOTE: this check is needed due to a bug observed in some OpenMPI
# versions triggered by Darshan's MPI-IO module usage of the
# MPI_File_get_byte_offset() routine. For applications that create
# zero-length datatypes, then read/write to them, it can trigger a
# seg fault due to a divide by zero condition in OpenMPI. See the
# following Darshan issue for more details:
# https://xgitlab.cels.anl.gov/darshan/darshan/-/issues/317
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(,[
#include <mpi.h>
#ifdef OPEN_MPI
#error OPENMPI FOUND
#endif
])],
[],
[AC_DEFINE(HAVE_OPEN_MPI, 1, Define if OpenMPI is being used)])
DARSHAN_VERSION="AC_PACKAGE_VERSION"
AC_SUBST(darshan_lib_path)
AC_SUBST(darshan_share_path)
......
......@@ -39,6 +39,9 @@
/* Define if off64_t type is defined */
#undef HAVE_OFF64_T
/* Define if OpenMPI is being used */
#undef HAVE_OPEN_MPI
/* Define to 1 if you have the `preadv' function. */
#undef HAVE_PREADV
......
......@@ -236,10 +236,20 @@ static int my_rank = -1;
if(newpath != __path) free(newpath); \
} while(0)
/* XXX: this check is needed to work around an OpenMPI bug that is triggered by
* Darshan's MPI-IO read/write wrappers usage of 'MPI_File_get_byte_offset()'
* for some workloads. For more details, see comments in 'darshan-runtime/configure.in'.
*/
#ifndef HAVE_OPEN_MPI
static int get_byte_offset = 1;
#else
static int get_byte_offset = 0;
#endif
#define MPIIO_RECORD_READ(__ret, __fh, __count, __datatype, __offset, __counter, __tm1, __tm2) do { \
struct mpiio_file_record_ref *rec_ref; \
int size = 0; \
MPI_Offset displacement=0;\
MPI_Offset displacement=-1;\
int64_t size_ll; \
struct darshan_common_val_counter *cvc; \
double __elapsed = __tm2-__tm1; \
......@@ -248,7 +258,7 @@ static int my_rank = -1;
if(!rec_ref) break; \
PMPI_Type_size(__datatype, &size); \
size = size * __count; \
MPI_File_get_byte_offset(__fh, __offset, &displacement);\
if(get_byte_offset) MPI_File_get_byte_offset(__fh, __offset, &displacement);\
/* DXT to record detailed read tracing information */ \
dxt_mpiio_read(rec_ref->file_rec->base_rec.id, displacement, size, __tm1, __tm2); \
DARSHAN_BUCKET_INC(&(rec_ref->file_rec->counters[MPIIO_SIZE_READ_AGG_0_100]), size); \
......@@ -278,7 +288,7 @@ static int my_rank = -1;
#define MPIIO_RECORD_WRITE(__ret, __fh, __count, __datatype, __offset, __counter, __tm1, __tm2) do { \
struct mpiio_file_record_ref *rec_ref; \
int size = 0; \
MPI_Offset displacement; \
MPI_Offset displacement=-1; \
int64_t size_ll; \
struct darshan_common_val_counter *cvc; \
double __elapsed = __tm2-__tm1; \
......@@ -288,7 +298,7 @@ static int my_rank = -1;
PMPI_Type_size(__datatype, &size); \
size = size * __count; \
/* DXT to record detailed write tracing information */ \
MPI_File_get_byte_offset(__fh, __offset, &displacement); \
if(get_byte_offset) MPI_File_get_byte_offset(__fh, __offset, &displacement); \
dxt_mpiio_write(rec_ref->file_rec->base_rec.id, displacement, size, __tm1, __tm2); \
DARSHAN_BUCKET_INC(&(rec_ref->file_rec->counters[MPIIO_SIZE_WRITE_AGG_0_100]), size); \
size_ll = size; \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment