Commit 4a713a69 authored by James Dinan's avatar James Dinan
Browse files

[svn-r10057] Fix ch3:sock build issue -- moved shared memory includes up to ch3 from

Nemesis.  In MPI-3, ch3 will require shared memory in order to support
MPI_Win_allocate_shared().
parent 0e733261
......@@ -186,38 +186,6 @@ AC_CHECK_FUNCS(mkstemp)
AC_CHECK_FUNCS(rand)
AC_CHECK_FUNCS(srand)
# check how to allocate shared memory
AC_ARG_WITH(shared-memory, [--with-shared-memory[=auto|sysv|mmap] - create shared memory using sysv or mmap (default is auto)],,
with_shared_memory=auto)
if test "$with_shared_memory" = auto -o "$with_shared_memory" = mmap; then
found_mmap_funcs=yes
AC_CHECK_FUNCS(mmap munmap, , found_mmap_funcs=no)
if test "$found_mmap_funcs" = yes ; then
with_shared_memory=mmap
AC_DEFINE(USE_MMAP_SHM,1,[Define if we have sysv shared memory])
AC_MSG_NOTICE([Using a memory-mapped file for shared memory])
elif test "$with_shared_memory" = mmap ; then
AC_MSG_ERROR([cannot support shared memory: mmap() or munmap() not found])
fi
fi
if test "$with_shared_memory" = auto -o "$with_shared_memory" = sysv; then
found_sysv_shm_funcs=yes
AC_CHECK_FUNCS(shmget shmat shmctl shmdt, , found_sysv_shm_funcs=no)
if test "$found_sysv_shm_funcs" = yes ; then
AC_DEFINE(USE_SYSV_SHM,1,[Define if we have sysv shared memory])
AC_MSG_NOTICE([Using SYSV shared memory])
elif test "$with_shared_memory" = sysv ; then
AC_MSG_ERROR([cannot support shared memory: sysv shared memory functions functions not found])
else
AC_MSG_ERROR([cannot support shared memory: need either sysv shared memory functions or mmap in order to support shared memory])
fi
fi
if test "$found_sysv_shm_funcs" = yes ; then
AC_CHECK_FUNCS(strtoll, , AC_MSG_ERROR([cannot find strtoll function needed by sysv shared memory implementation]))
fi
AC_ARG_ENABLE(nemesis-shm-collectives, [--enable-nemesis-shm-collectives - enables use of shared memory for collective comunication within a node],
AC_DEFINE(ENABLED_SHM_COLLECTIVES, 1, [Define to enable shared-memory collectives]))
......
......@@ -32,6 +32,8 @@
#include "mpid_sched.h"
#include "mpiu_shm_wrappers.h"
/* We need to match the size of MPIR_Pint to the relevant Format control
*/
#define MPIDI_MSG_SZ_FMT MPIR_PINT_FMT_DEC_SPEC
......
......@@ -26,6 +26,9 @@ typedef MPIR_Pint MPIDI_msg_sz_t;
/* FIXME: Include here? */
#include "opa_primitives.h"
/* For shared memory window support in MPID_Win */
#include "mpiu_os_wrappers_pre.h"
/* Include definitions from the channel which must exist before items in this
file (mpidpre.h) or the file it includes (mpiimpl.h) can be defined. */
#include "mpidi_ch3_pre.h"
......
......@@ -121,6 +121,38 @@ fi
AC_CHECK_FUNCS(CFUUIDCreate uuid_generate time)
# check how to allocate shared memory
AC_ARG_WITH(shared-memory, [--with-shared-memory[=auto|sysv|mmap] - create shared memory using sysv or mmap (default is auto)],,
with_shared_memory=auto)
if test "$with_shared_memory" = auto -o "$with_shared_memory" = mmap; then
found_mmap_funcs=yes
AC_CHECK_FUNCS(mmap munmap, , found_mmap_funcs=no)
if test "$found_mmap_funcs" = yes ; then
with_shared_memory=mmap
AC_DEFINE(USE_MMAP_SHM,1,[Define if we have sysv shared memory])
AC_MSG_NOTICE([Using a memory-mapped file for shared memory])
elif test "$with_shared_memory" = mmap ; then
AC_MSG_ERROR([cannot support shared memory: mmap() or munmap() not found])
fi
fi
if test "$with_shared_memory" = auto -o "$with_shared_memory" = sysv; then
found_sysv_shm_funcs=yes
AC_CHECK_FUNCS(shmget shmat shmctl shmdt, , found_sysv_shm_funcs=no)
if test "$found_sysv_shm_funcs" = yes ; then
AC_DEFINE(USE_SYSV_SHM,1,[Define if we have sysv shared memory])
AC_MSG_NOTICE([Using SYSV shared memory])
elif test "$with_shared_memory" = sysv ; then
AC_MSG_ERROR([cannot support shared memory: sysv shared memory functions functions not found])
else
AC_MSG_ERROR([cannot support shared memory: need either sysv shared memory functions or mmap in order to support shared memory])
fi
fi
if test "$found_sysv_shm_funcs" = yes ; then
AC_CHECK_FUNCS(strtoll, , AC_MSG_ERROR([cannot find strtoll function needed by sysv shared memory implementation]))
fi
# ensure that atomic primitives are available
AC_MSG_CHECKING([for OpenPA atomic primitive availability])
......
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