[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1-264-gad09da4

Service Account noreply at mpich.org
Thu May 22 14:55:47 CDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  ad09da4a3394eb59e38c805b167fe047c55dce4c (commit)
      from  25e3a95390be3a7c79e65b21a67b8a1154d57fa2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/ad09da4a3394eb59e38c805b167fe047c55dce4c

commit ad09da4a3394eb59e38c805b167fe047c55dce4c
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Wed May 21 17:27:30 2014 -0500

    moved shared memory configure option to m4 macro
    
    Other parts of the code might want to use shared memory. This commit
    extracts our checks for available functions into a macro for easy
    re-use outside of nemesis.
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>

diff --git a/confdb/aclocal_shm.m4 b/confdb/aclocal_shm.m4
new file mode 100644
index 0000000..d2cbaad
--- /dev/null
+++ b/confdb/aclocal_shm.m4
@@ -0,0 +1,49 @@
+dnl
+dnl Definitions for using shared memory
+dnl
+
+dnl/*D
+dnl PAC_ARG_SHARED_MEMORY - add --with-shared-memory=kind to configure
+dnl
+dnl Synopsis:
+dnl PAC_ARG_SHARED_MEMORY
+dnl
+dnl Output effects:
+dnl Adds '--with-shared-memory' to the command line. Checks for available
+dnl shared memory functionality.
+dnl
+dnl Supported values of 'kind' include \:
+dnl+    auto - default
+dnl.    mmap - use mmap and munmap
+dnl-    sysv - use sysv shared memory functions
+dnl D*/
+AC_DEFUN([PAC_ARG_SHARED_MEMORY],[
+
+# check how to allocate shared memory
+AC_ARG_WITH(shared-memory,
+    AC_HELP_STRING([--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
+        with_shared_memory=sysv
+        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])
+    fi
+fi
+])
diff --git a/src/mpid/ch3/channels/nemesis/subconfigure.m4 b/src/mpid/ch3/channels/nemesis/subconfigure.m4
index 9c69219..e636b69 100644
--- a/src/mpid/ch3/channels/nemesis/subconfigure.m4
+++ b/src/mpid/ch3/channels/nemesis/subconfigure.m4
@@ -185,32 +185,10 @@ 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
+# Check for available shared memory functions
+PAC_ARG_SHARED_MEMORY
+if test "$with_shared_memory" != "mmap" -a "$with_shared_memory" != "sysv"; then
+    AC_MSG_ERROR([cannot support shared memory:  need either sysv shared memory functions or mmap in order to support shared memory])
 fi
 
 if test "$found_sysv_shm_funcs" = yes ; then

-----------------------------------------------------------------------

Summary of changes:
 confdb/aclocal_shm.m4                         |   49 +++++++++++++++++++++++++
 src/mpid/ch3/channels/nemesis/subconfigure.m4 |   30 ++-------------
 2 files changed, 53 insertions(+), 26 deletions(-)
 create mode 100644 confdb/aclocal_shm.m4


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list