Commits

Anonymous committed 695781b

Backing out the Open SHMEM project

Comments (0)

Files changed (351)

 #
 # Copyright (c) 2007-2011 High Performance Computing Center Stuttgart, 
 #                         University of Stuttgart.  All rights reserved.
-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
 # $COPYRIGHT$
 # 
 # Additional copyrights may follow
   ${OpenMPI_SOURCE_DIR}/opal/include
   ${OpenMPI_SOURCE_DIR}/ompi
   ${OpenMPI_SOURCE_DIR}/ompi/include
-  ${OpenMPI_SOURCE_DIR}/oshmem
-  ${OpenMPI_SOURCE_DIR}/oshmem/include
   ${OpenMPI_SOURCE_DIR}/orte
   ${OpenMPI_SOURCE_DIR}/orte/include
   ${OpenMPI_BINARY_DIR}/
   ${OpenMPI_BINARY_DIR}/opal/include
   ${OpenMPI_BINARY_DIR}/ompi
   ${OpenMPI_BINARY_DIR}/ompi/include
-  ${OpenMPI_BINARY_DIR}/oshmem
-  ${OpenMPI_BINARY_DIR}/oshmem/include
   ${OpenMPI_BINARY_DIR}/orte
   ${OpenMPI_BINARY_DIR}/orte/include
 )
 # set up the libevent and hwloc include dirs
 INCLUDE_DIRECTORIES (${LIBEVENT_INCLUDE_DIRS} ${HWLOC_PATH}/hwloc/include)
 ADD_SUBDIRECTORY(ompi)
-ADD_SUBDIRECTORY(oshmem)
 ADD_SUBDIRECTORY(orte)
 ADD_SUBDIRECTORY(contrib/platform/win32/examples)
 
 #                         All rights reserved.
 # Copyright (c) 2006-2010 Cisco Systems, Inc.  All rights reserved.
 # Copyright (c) 2012      Los Alamos National Security, Inc.  All rights reserved.
-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
 # $COPYRIGHT$
 # 
 # Additional copyrights may follow
 	csh "$(top_srcdir)/config/distscript.csh" "$(top_srcdir)" "$(distdir)" "$(OMPI_VERSION)" "$(OMPI_SVN_R)"
 
 ACLOCAL_AMFLAGS = -I config
-
-if OSHMEM_SUPPORT
-DISTCHECK_CONFIGURE_FLAGS = --with-oshmem --disable-debug
-cov:
-	PATH=/hpc/local/commercial/coverity/cov-sa/bin:$$PATH && rm -rf $(PWD)/cov-build && make clean && cov-build --dir $(PWD)/cov-build make all && cov-analyze --dir $(PWD)/cov-build && cov-format-errors --dir $(PWD)/cov-build
-
-get_tarball:
-	cp $(distdir).tar.gz $(to)
-endif

README-SHMEM-WITH-VALGRIND.txt

-Copyright (c) 2012      Mellanox Technologies, Inc.
-                        All rights reserved.
-In order to enable valgrind support:
-1) download and build (into the same dir for convenience)  two libraries: libmlx4 and libibverbs with valgrind support.
-	- http://www.openfabrics.org/downloads/libmlx4/
-	- ./configure --prefix=/PATH_TO_LIBS --with-valgrind && make && make install
-	- http://www.openfabrics.org/downloads/libibverbs/
-	- ./configure --prefix=/PATH_TO_LIBS --with-valgrind && make && make install
-
-NOTE: libmlx4 and libibvers should match your ofed version
-
-2) build shmem with valgrind, memchecker module and these two libs:
-./autogen.sh && ./configure --prefix=$PWD/install --with-openib=/usr --with-oshmem --with-openib-libdir=PATH_TO_LIBS --with-valgrind=PATH_TO_VALGRIND --enable-memchecker --disable-dlopen && make  clean && make  && make install 
-
-	- --with-openib=/usr - the place where to look for infiniband
-	- --with-openib-libdir=PATH_TO_LIBS  - two libs previously installed
-	- --with-valgrind - the --prefix  to the valgrind install. that must contain $prefix/include/valgrind/valgrind.h and $prefix/valgrind/memchecker.h. Should be /usr if valgrind installed from rpm 
-
-==8511== Conditional jump or move depends on uninitialised value(s)
-==8511==    at 0x3849A17486: index (in /lib64/ld-2.12.so)
-==8511==    by 0x3849A06254: expand_dynamic_string_token (in /lib64/ld-2.12.so)
-==8511==    by 0x3849A07CAF: _dl_map_object (in /lib64/ld-2.12.so)
-==8511==    by 0x3849A016EA: map_doit (in /lib64/ld-2.12.so)
-==8511==    by 0x3849A0E0A5: _dl_catch_error (in /lib64/ld-2.12.so)
-==8511==    by 0x3849A015EE: do_preload (in /lib64/ld-2.12.so)
-==8511==    by 0x3849A03BAA: dl_main (in /lib64/ld-2.12.so)
-==8511==    by 0x3849A15A7D: _dl_sysdep_start (in /lib64/ld-2.12.so)
-==8511==    by 0x3849A01493: _dl_start (in /lib64/ld-2.12.so)
-==8511==    by 0x3849A00AF7: ??? (in /lib64/ld-2.12.so)
-==8511==    by 0x2: ???
-==8511==    by 0x7FF0000A2: ???
-==8511==  Uninitialised value was created by a stack allocation
-==8511==    at 0x3849A0328D: dl_main (in /lib64/ld-2.12.so)
-
-In order to get rid of them use an extra command line option to valgrind: --suppression=${prefix}/share/openshmem/openmpi-valgrind.supp --suppressions=shmem_suppressions, where shmem_suppressions is the file in the root of the shmem code and ${prefix} is shmem install prefix as set by configure.
-

README-SHMEM.txt

-Copyright (c) 2012      Mellanox Technologies, Inc.
-                        All rights reserved.
-
-
-Build SHMEM
------------
-
-./autogen.sh
-./configure --prefix=$PWD/install --with-oshmem -enable-contrib-no-build=libnbc,vt --with-openib
-make 
-make install
-export SHMEM_HOME=$PWD/install
-
-Run SHMEM
----------
-
-$SHMEM_HOME/bin/shmemrun -np 10 --host amd1,amd5,amd7 -mca btl openib,self hello_shmem.exe
-
-
 # Copyright (c) 2008      Sun Microsystems, Inc.  All rights reserved.
 # Copyright (c) 2008-2011 Cisco Systems, Inc.  All rights reserved.
 # Copyright (c) 2011      NVIDIA Corporation.  All rights reserved.
-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
 
 # This is the VERSION file for Open MPI, describing the precise
 # version of Open MPI in this distribution.  The various components of
 libopen_rte_so_version=0:0:0
 libopen_pal_so_version=0:0:0
 libmpi_java_so_version=0:0:0
-libshmem_so_version=0:0:0
 
 # "Common" components install standalone libraries that are run-time
 # linked by one or more components.  So they need to be versioned as
 #
 # Copyright (c) 2009-2012 Cisco Systems, Inc.  All rights reserved.
 # Copyright (c) 2010      Oracle and/or its affiliates.  All rights reserved.
-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
+#
 # $COPYRIGHT$
 # 
 # Additional copyrights may follow
 # Command line parameters
 my $no_ompi_arg = 0;
 my $no_orte_arg = 0;
-my $no_oshmem_arg = 0;
 my $quiet_arg = 0;
 my $debug_arg = 0;
 my $help_arg = 0;
 
 my $ok = Getopt::Long::GetOptions("no-ompi" => \$no_ompi_arg,
                                   "no-orte" => \$no_orte_arg,
-                                  "no-oshmem" => \$no_oshmem_arg,
                                   "quiet|q" => \$quiet_arg,
                                   "debug|d" => \$debug_arg,
                                   "help|h" => \$help_arg,
     print "Options:
   --no-ompi | -no-ompi          Do not build the Open MPI layer
   --no-orte | -no-orte          Do not build the ORTE layer
-  --no-oshmem | -no-oshmem      Do not build the OSHMEM layer
   --quiet | -q                  Do not display normal verbose output
   --debug | -d                  Output lots of debug information
   --help | -h                   This help list
     $no_orte_arg = 1;
     debug "No orte subdirectory found - will not build ORTE\n";
 }
-if (! -e "oshmem") {
-    $no_oshmem_arg = 1;
-    debug "No oshmem subdirectory found - will not build OSHMEM\n";
-}
 
 if ($no_ompi_arg == 1 && $no_orte_arg == 0) {
     $project_name_long = "Open MPI Run Time Environment";
     if (!$no_orte_arg);
 push(@{$projects}, { name => "ompi", dir => "ompi", need_base => 1 })
     if (!$no_ompi_arg);
-push(@{$projects}, { name => "oshmem", dir => "oshmem", need_base => 1 })
-    if (!$no_ompi_arg && !$no_orte_arg && !$no_oshmem_arg);
-
 
 # Save the list of projects in the m4 file
 my $str;

config/opal_check_attributes.m4

 #                         All rights reserved.
 # Copyright (c) 2009      Oak Ridge National Labs.  All rights reserved.
 # Copyright (c) 2010      Cisco Systems, Inc.  All rights reserved.
-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
 # $COPYRIGHT$
 #
 # Additional copyrights may follow
     opal_cv___attribute__visibility=0
     opal_cv___attribute__warn_unused_result=0
     opal_cv___attribute__weak_alias=0
-    opal_cv___attribute__destructor=0
   else
     AC_MSG_RESULT([yes])
 
         [],
         [])
 
-    _OPAL_CHECK_SPECIFIC_ATTRIBUTE([destructor],
-        [
-        void foo(void) __attribute__ ((__destructor__));
-        void foo(void) { return ; }
-        ],
-        [],
-        [])
   fi
 
   # Now that all the values are set, define them
                      [Whether your compiler has __attribute__ warn unused result or not])
   AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_WEAK_ALIAS, [$opal_cv___attribute__weak_alias],
                      [Whether your compiler has __attribute__ weak alias or not])
-  AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_DESTRUCTOR, [$opal_cv___attribute__destructor],
-                     [Whether your compiler has __attribute__ destructor or not])
 ])

config/oshmem_config_files.m4

-# -*- shell-script -*-
-#
-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
-# $COPYRIGHT$
-# 
-# Additional copyrights may follow
-# 
-# $HEADER$
-#
-
-AC_DEFUN([OSHMEM_CONFIG_FILES],[
-    AC_CONFIG_FILES([
-    oshmem/Makefile
-    oshmem/include/Makefile
-    oshmem/shmem/c/Makefile
-    oshmem/shmem/f77/Makefile
-
-    oshmem/shmem/c/profile/Makefile
-
-    oshmem/tools/wrappers/Makefile
-    oshmem/tools/wrappers/shmemcc-wrapper-data.txt
-    oshmem/tools/wrappers/shmemf77-wrapper-data.txt
-    oshmem/tools/wrappers/shmemf90-wrapper-data.txt
-    ])
-])

config/oshmem_configure_options.m4

-dnl -*- shell-script -*-
-dnl
-dnl Copyright (c) 2012      Mellanox Technologies, Inc.
-dnl                         All rights reserved.
-dnl
-dnl $COPYRIGHT$
-dnl 
-dnl Additional copyrights may follow
-dnl 
-dnl $HEADER$
-dnl
-
-
-
-AC_DEFUN([OSHMEM_CONFIGURE_OPTIONS],[
-ompi_show_subtitle "OSHMEM Configuration options"
-
-
-AC_SUBST(OSHMEM_LIBSHMEM_EXTRA_LIBS)
-AC_SUBST(OSHMEM_LIBSHMEM_EXTRA_LDFLAGS)
-
-#
-# OSHMEM support
-#
-AC_MSG_CHECKING([if want OSHMEM support])
-AC_ARG_WITH([oshmem],
-    [AC_HELP_STRING([--with-oshmem],
-                    [Build with OSHMEM support (default=no)])])
-if test "$with_oshmem" = "no"; then
-    AC_MSG_RESULT([no])
-    oshmem_with_support=0
-else
-    AC_MSG_RESULT([yes])
-    oshmem_with_support=1
-fi
-AM_CONDITIONAL(OSHMEM_SUPPORT, test "$oshmem_with_support" = 1)
-AC_DEFINE_UNQUOTED([OSHMEM_ENABLED], [$oshmem_with_support],
-                   [Whether user wants OSHMEM support or not])
-
-#
-# Enable compatibility mode
-#
-AC_MSG_CHECKING([if want SGI/Quadrix compatibility mode])
-AC_ARG_ENABLE(oshmem-compat,
-        AC_HELP_STRING([--enable-oshmem-compat],
-            [enable compatibility mode (default: enabled)]))
-if test "$enable_oshmem_compat" != "no"; then
-    AC_MSG_RESULT([yes])
-    OSHMEM_SPEC_COMPAT=1
-else
-    AC_MSG_RESULT([no])
-    OSHMEM_SPEC_COMPAT=0
-fi
-AC_DEFINE_UNQUOTED([OSHMEM_SPEC_COMPAT], [$OSHMEM_SPEC_COMPAT],
-                   [Whether user wants OSHMEM in compatibility mode or not])
-
-
-
-#
-# Do we want to disable OSHMEM parameter checking at run-time?
-#
-AC_MSG_CHECKING([if want SHMEM API parameter checking])
-AC_ARG_WITH(shmem-param-check,
-    AC_HELP_STRING([--shmem-param-check(=VALUE)],
-                   [behavior of SHMEM function parameter checking.  Valid values are: always, never.  If --with-shmem-param-check is specified with no VALUE argument, it is equivalent to a VALUE of "always"; --without-shmem-param-check is equivalent to "never" (default: always).]))
-shmem_param_check=1
-if test "$with_shmem_param_check" = "no" -o \
-    "$with_shmem_param_check" = "never"; then
-    shmem_param_check=0
-    AC_MSG_RESULT([never])
-elif test "$with_shmem_param_check" = "yes" -o \
-    "$with_shmem_param_check" = "always" -o \
-    -z "$with_shmem_param_check"; then
-    shmem_param_check=1
-    AC_MSG_RESULT([always])
-else
-    AC_MSG_RESULT([unknown])
-    AC_MSG_WARN([*** Unrecognized --with-shmem-param-check value])
-    AC_MSG_WARN([*** See "configure --help" output])
-    AC_MSG_WARN([*** Defaulting to "runtime"])
-fi
-AC_DEFINE_UNQUOTED(OSHMEM_PARAM_CHECK, $shmem_param_check,
-    [Whether we want to check SHMEM parameters always or never])
-
-
-#
-#  OSHMEM profiling support
-#
-AC_MSG_CHECKING([if want pshmem_])
-AC_ARG_ENABLE(oshmem-profile,
-    AC_HELP_STRING([--enable-oshmem-profile],
-                   [enable OSHMEM profiling (default: enabled)]))
-if test "$enable_oshmem_profile" != "no"; then
-    AC_MSG_RESULT([yes])
-    oshmem_progiling_support=1
-else
-    AC_MSG_RESULT([no])
-    oshmem_progiling_support=0
-fi
-AM_CONDITIONAL(OSHMEM_PROFILING, test "$oshmem_progiling_support" = 1)
-#AC_DEFINE_UNQUOTED([OSHMEM_PROFILING], [$oshmem_progiling_support],
-#                   [Whether user wants OSHMEM profiling])
-
-])
-
-
-AC_DEFUN([OSHMEM_SETUP_CFLAGS],[
-
-
-OMPI_C_COMPILER_VENDOR([oshmem_c_vendor])
-
-#
-# OSHMEM force warnings as errors
-#
-#
-# Since SHMEM libraries are not fully ISO99 C compliant
-# -pedantic and -Wundef raise a bunch of warnings, so
-# we just strip them off for this component
-AC_MSG_WARN([Removed -pedantic and -Wundef from CFLAGS for OSHMEM])
-
-oshmem_CFLAGS="$CFLAGS"
-
-# Strip off problematic arguments
-oshmem_CFLAGS="`echo $oshmem_CFLAGS | sed 's/-pedantic//g'`"
-oshmem_CFLAGS="`echo $oshmem_CFLAGS | sed 's/-Wundef//g'`"
-oshmem_CFLAGS="`echo $oshmem_CFLAGS | sed 's/-Wno-long-double//g'`"
-CFLAGS="$oshmem_CFLAGS"
-
-case "$oshmem_c_vendor" in
-    gnu)
-        OSHMEM_CFLAGS=" -Werror "
-        OSHMEM_TEST_CFLAGS="$CFLAGS -Wall -Wundef  -Werror "
-        ;;
-    intel)
-        # we want specifically the warning on format string conversion
-        OSHMEM_CFLAGS=" -Werror "
-        OSHMEM_TEST_CFLAGS="$CFLAGS -Wall -Werror -wd188,981,1419,810"
-        ;;
-esac
-
-AC_SUBST([OSHMEM_CFLAGS])
-AC_SUBST([OSHMEM_TEST_CFLAGS])
-
-
-
-OMPI_CHECK_OPENFABRICS([openib],
-                        [openib_happy="yes"],
-                        [openib_happy="no"])
-
-# substitute in the things needed to build MEMHEAP BASE
-AC_SUBST([openib_CFLAGS])
-AC_SUBST([openib_CPPFLAGS])
-AC_SUBST([openib_LDFLAGS])
-AC_SUBST([openib_LIBS])
-
-# If we have the openib stuff available, find out what we've got
-AS_IF(
-    [test "$openib_happy" = "yes"],
-    [
-        OSHMEM_LIBSHMEM_EXTRA_LDFLAGS="$OSHMEM_LIBSHMEM_EXTRA_LDFLAGS $openib_LDFLAGS"
-        OSHMEM_LIBSHMEM_EXTRA_LIBS="$OSHMEM_LIBSHMEM_EXTRA_LIBS $openib_LIBS"
-
-        # ibv_reg_shared_mr was added in MOFED 1.8
-        oshmem_have_mpage=0
-
-        openib_save_CPPFLAGS="$CPPFLAGS"
-        openib_save_LDFLAGS="$LDFLAGS"
-        openib_save_LIBS="$LIBS"
-
-        CPPFLAGS="$CPPFLAGS $openib_CPPFLAGS"
-        LDFLAGS="$LDFLAGS $openib_LDFLAGS"
-        LIBS="$LIBS $openib_LIBS"
-
-        AC_CHECK_DECLS([IBV_ACCESS_ALLOCATE_MR],
-               [oshmem_have_mpage=1], [],
-               [#include <infiniband/verbs.h>])
-
-        AC_CHECK_LIB([ibverbs], [ibv_reg_shared_mr], [oshmem_have_mpage=2])
-
-        CPPFLAGS="$openib_save_CPPFLAGS"
-        LDFLAGS="$openib_save_LDFLAGS"
-        LIBS="$openib_save_LIBS"
-
-        AC_DEFINE_UNQUOTED(MPAGE_ENABLE, $oshmem_have_mpage,
-            [Whether we can use M-PAGE supported since MOFED 1.8])
-    ])
-])dnl
-
 # Copyright (c) 2009      Oak Ridge National Labs.  All rights reserved.
 # Copyright (c) 2011      NVIDIA Corporation.  All rights reserved.
 # Copyright (c) 2012      Oracle and/or its affiliates.  All rights reserved.
-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
 # $COPYRIGHT$
 # 
 # Additional copyrights may follow
 # Set up project specific AM_CONDITIONALs
 AM_CONDITIONAL([PROJECT_OMPI], m4_ifdef([project_ompi], [true], [false]))
 AM_CONDITIONAL([PROJECT_ORTE], m4_ifdef([project_orte], [true], [false]))
-AM_CONDITIONAL([PROJECT_OSHMEM], m4_ifdef([project_oshmem], [true], [false]))
-
 
 ompi_show_subtitle "Checking versions"
 
                             [$srcdir/VERSION],
                             [orte/include/orte/version.h])])
 
-m4_ifdef([project_oshmem],
-         [OPAL_SAVE_VERSION([OSHMEM], [Open SHMEM],
-                            [$srcdir/VERSION],
-                            [oshmem/include/oshmem/version.h])])
-
 OPAL_SAVE_VERSION([OPAL], [Open Portable Access Layer], [$srcdir/VERSION],
                   [opal/include/opal/version.h])
 
           AC_SUBST(libmca_common_portals_so_version)])
 m4_ifdef([project_orte],
          [AC_SUBST(libopen_rte_so_version)])
-m4_ifdef([project_oshmem],
-         [AC_SUBST(libshmem_so_version)])
 AC_SUBST(libmca_opal_common_hwloc_so_version)
 AC_SUBST(libopen_pal_so_version)
 
          [AC_CONFIG_HEADERS([orte/include/orte_config.h])])
 m4_ifdef([project_ompi],
          [AC_CONFIG_HEADERS([ompi/include/ompi_config.h ompi/include/mpi.h])])
-m4_ifdef([project_oshmem],
-         [AC_CONFIG_HEADER([oshmem/include/oshmem_config.h oshmem/include/shmem.h oshmem/include/shmem_portable_platform.h])])
 
 # override/fixup the version numbers set by AC_INIT, since on
 # developer builds, there's no good way to know what the version is
 OPAL_CONFIGURE_OPTIONS
 m4_ifdef([project_orte], [ORTE_CONFIGURE_OPTIONS])
 m4_ifdef([project_ompi], [OMPI_CONFIGURE_OPTIONS])
-m4_ifdef([project_oshmem], [OSHMEM_CONFIGURE_OPTIONS])
 
 if test "$enable_binaries" = "no" -a "$enable_dist" = "yes"; then
     AC_MSG_WARN([--disable-binaries is incompatible with --enable dist])
 
 # Size of pid_t
 AC_CHECK_SIZEOF(pid_t)
-AC_CHECK_SIZEOF(long)
 
 AC_CHECK_TYPES([socklen_t, struct sockaddr_in, struct sockaddr_in6,
                 struct sockaddr_storage],
 AC_DEFINE_UNQUOTED(OMPI_MPI_OFFSET_SIZE, $MPI_OFFSET_SIZE, [Size of the MPI_Offset])
 AC_DEFINE_UNQUOTED(OMPI_OFFSET_DATATYPE, $MPI_OFFSET_DATATYPE, [MPI datatype corresponding to MPI_Offset])
 
-AC_DEFINE_UNQUOTED(OSHMEM_SHMEM_OFFSET_TYPE, $MPI_OFFSET_TYPE, [Type of SHMEM_Offset -- has to be defined here and typedef'ed later because shmem.h does not get AC SUBST's])
-AC_DEFINE_UNQUOTED(OSHMEM_SHMEM_OFFSET_SIZE, $MPI_OFFSET_SIZE, [Size of the SHMEM_Offset])
-AC_DEFINE_UNQUOTED(OSHMEM_OFFSET_DATATYPE, $MPI_OFFSET_DATATYPE, [SHMEM datatype corresponding to SHMEM_Offset])
-
-AC_DEFINE_UNQUOTED(OPAL_SIZEOF_LONG, $ac_cv_sizeof_long, "Size of 'long' type")
-
 #
 # Check for MPI_Aint type.  Yes, there are platforms where
 # sizeof(void*) != sizeof(long) (64 bit Windows, apparently).
     # rather than have successive assignments to these shell
     # variables, lest the $(foo) names try to get evaluated here.
     # Yuck!
-    CPPFLAGS='-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/opal/include m4_ifdef([project_orte], [-I$(top_srcdir)/orte/include]) m4_ifdef([project_ompi], [-I$(top_srcdir)/ompi/include]) m4_ifdef([project_oshmem], [-I$(top_srcdir)/oshmem/include])'" $CPPFLAGS"
+    CPPFLAGS='-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/opal/include m4_ifdef([project_orte], [-I$(top_srcdir)/orte/include]) m4_ifdef([project_ompi], [-I$(top_srcdir)/ompi/include])'" $CPPFLAGS"
     # C++ is only relevant if we're building OMPI
     m4_ifdef([project_ompi], [CXXCPPFLAGS='-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/opal/include -I$(top_srcdir)/orte/include -I$(top_srcdir)/ompi/include'" $CXXCPPFLAGS"])
 else
 
 m4_ifdef([project_orte], [ORTE_SETUP_DEBUGGER_FLAGS],
          [m4_ifdef([project_ompi], [ORTE_SETUP_DEBUGGER_FLAGS])])
-m4_ifdef([project_oshmem], [OSHMEM_SETUP_CFLAGS])
 
 #
 # Delayed the substitution of CFLAGS and CXXFLAGS until now because
 OPAL_CONFIG_FILES
 m4_ifdef([project_orte], [ORTE_CONFIG_FILES])
 m4_ifdef([project_ompi], [OMPI_CONFIG_FILES])
-m4_ifdef([project_oshmem], [OSHMEM_CONFIG_FILES])
 
 AC_OUTPUT

contrib/Makefile.am

 # Copyright (c) 2009      Cisco Systems, Inc.  All rights reserved.
 # Copyright (c) 2010      IBM Corporation.  All rights reserved.
 # Copyright (c) 2010-2011 Oak Ridge National Labs.  All rights reserved.
-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
-#
 # $COPYRIGHT$
 # 
 # Additional copyrights may follow
 	platform/greenplum/mrplus/linux-optimized.conf
 
 dist_pkgdata_DATA = openmpi-valgrind.supp
-
-if OSHMEM_SUPPORT
-dist_pkgdata_DATA += \
-						tau/shmem_wiki_tau.sh \
-						tau/tau_openshmem.patch \
-						tau/readme
-endif 

contrib/platform/win32/CMakeModules/opal_get_version.cmake

 #
 # Copyright (c) 2007-2012 High Performance Computing Center Stuttgart, 
 #                         University of Stuttgart.  All rights reserved.
-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
 # $COPYRIGHT$
 # 
 # Additional copyrights may follow
 OMPI_DEF(OMPI_RELEASE_VERSION ${RELEASE_VERSION} "Release number of Open MPI." 0 1)
 OMPI_DEF(OMPI_VERSION ${VERSION_STRING} "Complete release number of Open MPI." 1 1)
 
-# Set OSHMEM versions
-OMPI_DEF(OSHMEM_WANT_REPO_REV ${WANT_REPO_REV} "SVN verstion of OSHMEM" 1 1)
-OMPI_DEF(OSHMEM_REPO_REV "${SVN_VERSION}" "SVN verstion of OSHMEM" 1 1)
-OMPI_DEF(OSHMEM_GREEK_VERSION "${GREEK_VERSION}" "Greek - alpha, beta, etc - release number of Open Portable Access Layer." 1 1)
-OMPI_DEF(OSHMEM_MAJOR_VERSION ${MAJOR_VERSION} "Major release number of OSHMEM." 0 1)
-OMPI_DEF(OSHMEM_MINOR_VERSION ${MINOR_VERSION} "Minor release number of OSHMEM." 0 1)
-OMPI_DEF(OSHMEM_RELEASE_VERSION ${RELEASE_VERSION} "Release number of OSHMEM." 0 1)
-OMPI_DEF(OSHMEM_VERSION ${VERSION_STRING} "Complete release number of OSHMEM." 1 1)
-
 # Set ORTE versions
 OMPI_DEF(ORTE_WANT_REPO_REV ${WANT_REPO_REV} "SVN verstion of ORTE" 1 1)
 OMPI_DEF(ORTE_REPO_REV "${SVN_VERSION}" "SVN verstion of ORTE" 1 1)

contrib/tau/readme

-Copyright (c) 2012      Mellanox Technologies, Inc.
-                        All rights reserved.
-22 May 2012
-
-Description
-===========
-
-Using TAU with OpenSHMEM
-========================
-
-
-Building PDT
-=============
-
-Download, configure and build PDT:
-
------
-wget -nc http://tau.uoregon.edu/pdt_releases/pdtoolkit-3.17.tar.gz
-tar -xzf pdtoolkit-3.17.tar.gz
-cd pdtoolkit-*
-PDT_INST=$PWD
-./configure
-make install
-cd ..
------
-
-
-Building TAU
-============
-
-Download:
-
------
-wget -nc http://www.cs.uoregon.edu/research/paracomp/tau/tauprofile/dist/tau_latest.tar.gztar -xzf pdtoolkit-3.17.tar.gz
-tar -xzf tau_latest.tar.gz
-cd tau-*
------
-
-Accept patch:
-
------
-patch -p1 -i tau_openshmem.patch
------
-
-Note: 
-Patch is needed to define profiling API that is not part of official openshmem.org standard.
-
-Configure and build:
-
------
-TAU_INST=$PWD/inst-tau-shmem
-./configure -prefix=$TAU_INST -shmem -tag=oshmem -cc=gcc -pdt=$PDT_INST -PROFILEPARAM -useropt="-I$OSHMEM_INST/include/mpp" -shmemlib=$OSHMEM_INST/lib -shmemlibrary=-lshmem#-lpmi
-make install
-cd ..
------
-
-Note: 
--useropt : specifies additional user options such as -g or -I. For multiple options, the options list should be enclosed in a single quote.
--lpmi : SLURM support
--shmeminc : is not set due to bug in TAU (http://nic.uoregon.edu/pipermail/tau-users/2011-December/000599.html)
-TAU documentation link http://www.cs.uoregon.edu/Research/tau/docs/old/bk04ch01.html
-
-
-Building Application
-====================
-
-Add OpenSHMEM installation location to the PATH environment:
-
------
-export PATH=$OSHMEM_INST/bin:$PATH
------
-
-Set TAU environmemnt variables:
-
------
-export PATH=$TAU_INST/x86_64/bin:$PATH
-export TAU_MAKEFILE=$TAU_INST/x86_64/lib/Makefile.tau-oshmem-param-shmem-pdt
-export TAU_OPTIONS=
------
-
-Note:
-TAU provides shell scripts tau_cxx.sh, tau_f90.sh and tau_cc.sh for C++,F90 and C compilers. These are typically installed in <taudir>/<arch>/bin >directory. You may replace the compiler in your Makefiles with these scripts. These scripts may also be used on the command line. Each configuration of TAU has a stub makefile associated with it. For instance,
-inst-tau-shmem/x86_64/lib/Makefile.tau-oshmem-param-shmem-pdt
-This makefile specifies the measurement components that have been configured with it. In this case it shows that TAU's MPI/SHMEM wrapper interposition library and PDT have been configured. You need to set the environment variable:
-TAU_MAKEFILE
-to point to this stub makefile. You can also pass arguments to the four stages of compilation using the environment variable
-TAU_OPTIONS
-
-Build and run example:
-
------
-tau_cc.sh $TAU_INST/../examples/shmem/c/simple.c -o simple-tau.out
-env LD_LIBRARY_PATH=$OSHMEM_INST/lib:$LD_LIBRARY_PATH srun -n 2 simple-tau.out
------
-
-After job completes, view simple report:
-
------
-pprof
-paraprof --pack example_shmem_tau.ppk
------
-
-Output example
-==============
-
------
-$pprof
-Reading Profile files in profile.*
-
-NODE 0;CONTEXT 0;THREAD 0:
----------------------------------------------------------------------------------------
-%Time    Exclusive    Inclusive       #Call      #Subrs  Inclusive Name
-              msec   total msec                          usec/call
----------------------------------------------------------------------------------------
-100.0        0.102       10,479           1           5   10479786 int main(int, char **) C
-100.0       10,479       10,479           1           0   10479221 void start_pes(int) C
-  0.0        0.423        0.423           1           0        423 void shmem_barrier_all(void) C
-  0.0         0.04         0.04           1           0         40 void shmem_long_put(long *, const long *, size_t, int) C
-  0.0         0.04         0.04           1           0         40 void shmem_long_put(long *, const long *, size_t, int) C [ <message size> = <80> ]
-  0.0            0            0           2           0          0 int shmem_my_pe(void) C
----------------------------------------------------------------------------------------
-
-USER EVENTS Profile :NODE 0, CONTEXT 0, THREAD 0
----------------------------------------------------------------------------------------
-NumSamples   MaxValue   MinValue  MeanValue  Std. Dev.  Event Name
----------------------------------------------------------------------------------------
-         1         80         80         80          0  Message size sent to all nodes
----------------------------------------------------------------------------------------
-
-NODE 1;CONTEXT 0;THREAD 0:
----------------------------------------------------------------------------------------
-%Time    Exclusive    Inclusive       #Call      #Subrs  Inclusive Name
-              msec   total msec                          usec/call
----------------------------------------------------------------------------------------
-100.0        0.042        9,270           1           4    9270413 int main(int, char **) C
-100.0        9,270        9,270           1           0    9270317 void start_pes(int) C
-  0.0        0.053        0.053           1           0         53 void shmem_barrier_all(void) C
-  0.0        0.001        0.001           2           0          0 int shmem_my_pe(void) C
-
-FUNCTION SUMMARY (total):
----------------------------------------------------------------------------------------
-%Time    Exclusive    Inclusive       #Call      #Subrs  Inclusive Name
-              msec   total msec                          usec/call
----------------------------------------------------------------------------------------
-100.0        0.144       19,750           2           9    9875100 int main(int, char **) C
-100.0       19,749       19,749           2           0    9874769 void start_pes(int) C
-  0.0        0.476        0.476           2           0        238 void shmem_barrier_all(void) C
-  0.0         0.04         0.04           1           0         40 void shmem_long_put(long *, const long *, size_t, int) C
-  0.0         0.04         0.04           1           0         40 void shmem_long_put(long *, const long *, size_t, int) C [ <message size> = <80> ]
-  0.0        0.001        0.001           4           0          0 int shmem_my_pe(void) C
-
-FUNCTION SUMMARY (mean):
----------------------------------------------------------------------------------------
-%Time    Exclusive    Inclusive       #Call      #Subrs  Inclusive Name
-              msec   total msec                          usec/call
----------------------------------------------------------------------------------------
-100.0        0.072        9,875           1         4.5    9875100 int main(int, char **) C
-100.0        9,874        9,874           1           0    9874769 void start_pes(int) C
-  0.0        0.238        0.238           1           0        238 void shmem_barrier_all(void) C
-  0.0         0.02         0.02         0.5           0         40 void shmem_long_put(long *, const long *, size_t, int) C
-  0.0         0.02         0.02         0.5           0         40 void shmem_long_put(long *, const long *, size_t, int) C [ <message size> = <80> ]
-  0.0       0.0005       0.0005           2           0          0 int shmem_my_pe(void) C
------
-
-
-A sample session
-=========== =====
-
-Following shell script can be launched to play with OpenSHMEM and TAU as shmem_wiki_tau.sh
-This script download, configure and install all needed tools, compile simple open shmem application, run one using SLURM and show the result using pprof and prepares result to view using paraprof also.
-
-ParaProf - User's Manual: http://www.cs.uoregon.edu/Research/tau/docs/paraprof/index.html
-
------
-./shmem_wiki_tau.sh <path to openshmem installation>
------
-
-Enjoy.

contrib/tau/shmem_wiki_tau.sh

-#!/bin/bash
-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
-
-if [[ -n "$1" ]]; then
-    OSHMEM_INST=$1
-else
-    echo "Path to OpenShmem install should be passed as an argument and built with --with-pmi"
-fi
-
-export PATH=$OSHMEM_INST/bin:$PATH
-
-OSHMEM_TAU_PATCH=`pwd`/tau_openshmem.patch
-
-# TAU expects having shmcc compiler name for Open SMEM
-#ln -s $OSHMEM_INST/bin/shmemcc $OSHMEM_INST/bin/oshcc
-#ln -s $OSHMEM_INST/share/openshmem/shmemcc-wrapper-data.txt $OSHMEM_INST/share/openshmem/oshcc-wrapper-data.txt
-
-
-# download PDT sources
-wget -nc http://tau.uoregon.edu/pdt_releases/pdtoolkit-3.17.tar.gz
-
-# build PDT
-tar -xzf pdtoolkit-3.17.tar.gz
-cd pdtoolkit-*
-PDT_INST=$PWD
-./configure
-make install
-cd ..
-
-
-function install_openshmem_tau_patch
-{
-cat > ${OSHMEM_TAU_PATCH} <<END_MSG
-*** tau-2.21.2/src/Profile/TauShmemOpenShmemC.c	2012-01-27 20:43:12.000000000 +0200
---- new/src/Profile/TauShmemOpenShmemC.c	2012-05-21 14:14:51.000000000 +0300
-***************
-*** 6,11 ****
---- 6,99 ----
-  #define TAU_SHMEM_TAGID tau_shmem_tagid_f=tau_shmem_tagid_f%250
-  #define TAU_SHMEM_TAGID_NEXT (++tau_shmem_tagid_f) % 250 
-  
-+ 
-+ /* This section contains old API that are not part of openshmem.org specification
-+  *
-+  */
-+ void pshmem_init (void)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return ;
-+ }  
-+ 
-+ void pshmem_finalize (void)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return ;
-+ }  
-+ 
-+ char *pshmem_nodename (void)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return NULL;
-+ }  
-+ 
-+ int pshmem_version (int *major, int *minor)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return 0;
-+ }  
-+ 
-+ void *pshmem_malloc (size_t size)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return NULL;
-+ }  
-+ 
-+ void pshmem_free (void *ptr)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return ;
-+ }  
-+ 
-+ void *pshmem_realloc (void *ptr, size_t size)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return NULL;
-+ }  
-+ 
-+ void *pshmem_memalign (size_t alignment, size_t size)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return NULL;
-+ }  
-+ 
-+ char *psherror (void)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return NULL;
-+ }  
-+ 
-+ char *pshmem_error (void)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return NULL;
-+ }  
-+ 
-+ void pshmem_sync_init (long *pSync)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return ;
-+ }  
-+ 
-+ #ifdef __cplusplus
-+ # include <complex>
-+ # define COMPLEXIFY(T) std::complex<T>
-+ #else /* _cplusplus */
-+ # include <complex.h>
-+ # define COMPLEXIFY(T) T complex
-+ #endif /* __cplusplus */
-+ void pshmem_complexd_put (COMPLEXIFY (double) * dest,
-+                                  const COMPLEXIFY (double) * src,
-+                                  size_t nelems, int pe)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return ;
-+ }  
-+ 
-+ /* Old API */
-+ 
-+ 
-  /**********************************************************
-     start_pes
-   **********************************************************/
-END_MSG
-
-patch --dry-run -p1 -i ${OSHMEM_TAU_PATCH}
-patch -p1 -i ${OSHMEM_TAU_PATCH}
-
-    return 0
-}
-
-
-# download TAU sources
-wget -nc http://www.cs.uoregon.edu/research/paracomp/tau/tauprofile/dist/tau_latest.tar.gz
-#wget http://tau.uoregon.edu/tau.tgz
-
-tar -xzf tau_latest.tar.gz
-cd tau-*
-install_openshmem_tau_patch
-TAU_INST=$PWD/inst-tau-shmem
-./configure -prefix=$TAU_INST -shmem -tag=oshmem -cc=gcc -pdt=$PDT_INST -PROFILEPARAM -useropt="-g" -shmemlib=$OSHMEM_INST/lib -shmemlibrary="-lshmem -lpmi"
-make install
-cd ..
-
-export PATH=$TAU_INST/x86_64/bin:$PATH
-export TAU_MAKEFILE=$TAU_INST/x86_64/lib/Makefile.tau-oshmem-param-shmem-pdt
-export TAU_OPTIONS=
-
-
-# Example
-# Note:
-# srun reports error message as ORTE_ERROR_LOG: A message is attempting to be sent to a process whose contact information is unknown in file
-# in case shmem library is built w/o option --with-pmi
-mkdir example
-cd example
-if [[ -n "$2" ]]; then
-    tau_cc.sh $2/test/shmem/vs/osu_latency.c -DOSHMEM -o osu_latency-tau.out
-    env LD_LIBRARY_PATH=$OSHMEM_INST/lib:$LD_LIBRARY_PATH srun -n 2 osu_latency-tau.out
-    cd ..
-else
-    tau_cc.sh $TAU_INST/../examples/shmem/c/simple.c -o simple-tau.out
-    env LD_LIBRARY_PATH=$OSHMEM_INST/lib:$LD_LIBRARY_PATH srun -n 2 simple-tau.out
-fi
-pprof
-paraprof --pack example_shmem_tau.ppk
-cd ..

contrib/tau/tau_openshmem.patch

-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
-*** tau-2.21.2/src/Profile/TauShmemOpenShmemC.c	2012-01-27 20:43:12.000000000 +0200
---- new/src/Profile/TauShmemOpenShmemC.c	2012-05-21 14:14:51.000000000 +0300
-***************
-*** 6,11 ****
---- 6,99 ----
-  #define TAU_SHMEM_TAGID tau_shmem_tagid_f=tau_shmem_tagid_f%250
-  #define TAU_SHMEM_TAGID_NEXT (++tau_shmem_tagid_f) % 250 
-  
-+ 
-+ /* This section contains old API that are not part of openshmem.org specification
-+  *
-+  */
-+ void pshmem_init (void)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return ;
-+ }  
-+ 
-+ void pshmem_finalize (void)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return ;
-+ }  
-+ 
-+ char *pshmem_nodename (void)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return NULL;
-+ }  
-+ 
-+ int pshmem_version (int *major, int *minor)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return 0;
-+ }  
-+ 
-+ void *pshmem_malloc (size_t size)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return NULL;
-+ }  
-+ 
-+ void pshmem_free (void *ptr)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return ;
-+ }  
-+ 
-+ void *pshmem_realloc (void *ptr, size_t size)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return NULL;
-+ }  
-+ 
-+ void *pshmem_memalign (size_t alignment, size_t size)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return NULL;
-+ }  
-+ 
-+ char *psherror (void)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return NULL;
-+ }  
-+ 
-+ char *pshmem_error (void)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return NULL;
-+ }  
-+ 
-+ void pshmem_sync_init (long *pSync)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return ;
-+ }  
-+ 
-+ #ifdef __cplusplus
-+ # include <complex>
-+ # define COMPLEXIFY(T) std::complex<T>
-+ #else /* _cplusplus */
-+ # include <complex.h>
-+ # define COMPLEXIFY(T) T complex
-+ #endif /* __cplusplus */
-+ void pshmem_complexd_put (COMPLEXIFY (double) * dest,
-+                                  const COMPLEXIFY (double) * src,
-+                                  size_t nelems, int pe)
-+ {
-+     fprintf(stderr, "Dummy %s\n", __FUNCTION__);
-+     return ;
-+ }  
-+ 
-+ /* Old API */
-+ 
-+ 
-  /**********************************************************
-     start_pes
-   **********************************************************/

distr/README

-Copyright (c) 2012      Mellanox Technologies, Inc.
-                        All rights reserved.
-
-Files oshmem.spec and buildrpm.sh provide a way to create binary and source rpms of the OSHMEM.
-In order to create rpms:
-./buildrpm.sh
-Created rpms are located in ./rpm-dest/.
-
-Several parameters are hardcoded in the buildshmem.sh: package name, version, release. Apart fromit, one can specify wheter to create source rpm or not.
-See comments in buildrpm.sh.
-
-Binary rpms created by the script are relocatable, implying that they can be installed in user specified directory with:
-sudo rpm -ihv --prefix=<USER DIR> <RPM>
-
-Default params:
-package_name=openshmem
-version=1.1
-release=1
-_prefix=/opt/<package_name=openshmem> - place to install
-
-
-In order to create binary tarball from binary rpm:
-./buildtarball.sh <rpm>
-The output will appear in ./tarballs/

distr/build_knem_rpm.sh

-#!/bin/sh
-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
-
-
-mydir=$(cd `dirname $0`;pwd)
-rpmdir=$mydir/rpm-dist/`hostname`
-rpmdist=$rpmdir/build
-
-knem_tgz="$mydir/knem-0.9.7.tar.gz"
-
-mkdir -p $rpmdir $rpmdist
-rpmbuild --define="_rpmdir $rpmdir" --define="_srcrpmdir $rpmdir" --define="_sourcedir $rpmdist" --define="_specdir $rpmdist" --define="_builddir $rpmdist" -tb $knem_tgz

distr/buildrpm.sh

-#!/bin/bash
-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
-
-
-#this three parameters define the name of rpm package: <package_name>-<version>-<release>
-package_name=openshmem
-#version - defined from VERSION file 
-#release - define from VERSION file
-
-if [ -d /opt/knem-0.9.7mlnx1 ];then
-	KNEM_FOLDER="/opt/knem-0.9.7mlnx1"
-else
-	KNEM_FOLDER="/opt/knem-0.9.7"
-fi
-
-
-fca='no'
-debug='no'
-extra_cflags=""
-slurm_dir=""
-while getopts :k:hf:dmw:scl: OPTION
-do 
-    case $OPTION in
-    k)KNEM_FOLDER=$OPTARG 
-        ;;
-	h)echo "`basename $0` -[h] [-k <knem folder>] [-f <spec file>] [-d (debug)] [-w <number> (-DOSHMEM_WAIT_COMPLETION_DEBUG=number)] [-s (-DOSHMEM_SM_PUT_SYNC_MODE)]"
-      exit 0;
-        ;;
-    l)slurm_dir=$OPTARG
-      if [ -d "$slurm_dir/include" ]; then
-		echo using pmi/slurm
-		oshmem_configure_params="$oshmem_configure_params --with-pmi=$slurm_dir --with-slurm=$slurm_dir"
-	  else
-		  echo PMI selected but not found
-		  exit -1
-	  fi
-        ;;
-    f)rpmspec=$OPTARG
-        ;;
-        \?)echo "`basename $0` -[h] [-k <knem folder>] [-f <spec file>] [-d (debug)] [-w <number> (-DOSHMEM_WAIT_COMPLETION_DEBUG=number)] [-s (-DOSHMEM_SM_PUT_SYNC_MODE)]"
-        ;;
-    d)debug='yes'
-        ;;
-    c)fca='yes'
-        ;;
-    m)mxm='yes'
-        ;;
-    w) if [ $OPTARG -lt  0 ]; then
-        echo '-w key should be > 0';
-        exit 1;
-        fi
-      extra_cflags="$extra_cflags -DOSHMEM_WAIT_COMPLETION_DEBUG=$OPTARG"
-        ;;
-    s)extra_cflags="$extra_cflags -DOSHMEM_SM_PUT_SYNC_MODE"
-        ;;
-    esac
-done
-
-if [ $debug == "yes" ]; then
-    DEBUG_CONF="--enable-debug"
-    oshmem_name_prefix="debug-"
-    extra_cflags="$extra_cflags -g -O0"
-elif [ $debug == "no" ]; then
-    DEBUG_CONF="--disable-debug"
-    extra_cflags="$extra_cflags -g -O2"
-    oshmem_name_prefix="";
-fi
-if [ "x" == "x$rpmspec" ]; then
-    echo "please provide a spec file: -f <filename>";
-    exit 1;
-fi
-
-if [ ! -f "$rpmspec" ]; then
-   echo "$rpmspec does not exist";
-   exit 1;
-fi
-
-if [ ! -d "$KNEM_FOLDER" ]; then 
-    echo "$KNEM_FOLDER does not exist";
-    exit 1;
-fi
-#parameters that are passed to the ./configure script
-oshmem_configure_params="$oshmem_configure_params --with-oshmem --enable-mpirun-prefix-by-default $DEBUG_CONF --with-knem=$KNEM_FOLDER"
-
-
-if [ $fca == "yes" ]; then
-	echo using fca
-	oshmem_configure_params="$oshmem_configure_params --with-fca=/opt/mellanox/fca"
-fi
-
-if [ $mxm == "yes" ]; then
-	echo using mxm
-	oshmem_configure_params="$oshmem_configure_params --with-mxm=/opt/mellanox/mxm"
-fi
-
-#build the binary rpm only
-build_binary_rpm=${build_binary_rpm:='no'}
-#build both: binary and source rpms
-build_source_rpm=${build_source_rpm:='no'}
-
-which rpmbuild &> /dev/null; 
-if [ $? -ne 0 ]; then \
-    echo "*** This make target requires an rpm-based linux distribution."; \
-    (exit 1); exit 1; \
-fi
-
-mkdir -p rpm-dist sources build
-
-work_dir=$(cd `dirname $0` && pwd)
-version="`grep major= $work_dir/../VERSION | sed -e s/major=//`"."`grep minor= $work_dir/../VERSION | sed -e s/minor=//`"
-release="`grep release= $work_dir/../VERSION | sed -e s/release=//`"
-build=$(hg id -n | sed -e s/\+//g)
-release=$build
-echo oshmem version defined: $version-$release build: $build
-
-
-echo Making source tarball...
-(cd $work_dir/.. && ./autogen.sh && ./configure $oshmem_configure_params)
-make -C $work_dir/.. distcheck && make -C $work_dir/.. get_tarball to=$work_dir/sources
-
-
-rpmmacros="--define='_rpmdir $work_dir/rpm-dist' --define='_srcrpmdir $work_dir/rpm-dist' --define='_sourcedir $work_dir/sources' --define='_specdir $work_dir' --define='_builddir $work_dir/build'" 
-rpmopts="--nodeps --buildroot=$work_dir/_rpm"
-
-# Generate spec file for rpm
-echo Generating oshmem.spec file
-if [ ! -z "$oshmem_configure_params" ]
-then
-    oshmem_configure_params=${oshmem_configure_params//\//\\\/}
-fi
-if [ ! -z "$extra_cflags" ]
-then 
-    extra_cflags=${extra_cflags//\//\\\/}
-fi
-
-sed -e s/@OSHMEM_NAME@/openshmem/ -e s/@OSHMEM_CONFIGURE_PARAMS@/"$oshmem_configure_params"/ \
--e s/@OSHMEM_VERSION@/"$version"/ -e s/@OSHMEM_RELEASE@/"$release"/ -e s/@OSHMEM_CFLAGS@/"$extra_cflags"/ \
--e s/@OSHMEM_BUILD@/"$build"/ -e s/@OSHMEM_NAME_PREFIX@/"$oshmem_names_prefix"/ \
-$rpmspec > oshmem.spec
-echo ${version}-${build} > latest.txt
-
-if [ $build_source_rpm == 'yes' ]
-then
-    echo running source rpmbuild...
-    echo -ba -v $rpmmacros  $rpmopts oshmem.spec | xargs rpmbuild
-    if [ $? -ne 0 ]; then \
-        (exit 1); exit 1; \
-    fi
-	exit 0;
-fi
-
-
-if [ $build_binary_rpm == 'yes' ]
-then
-    echo running binary rpmbuild...
-#    echo "$rpmmacros $rpmopts $rpmspec"
-    echo -bb -v $rpmmacros $rpmopts oshmem.spec | xargs rpmbuild
-    if [ $? -ne 0 ]; then \
-        (exit 1); exit 1; \
-    fi
-fi
-
-
-

distr/buildtarball.sh

-#!/bin/bash
-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
-
-rpmname="$1"
-if test "$rpmname" = ""; then
-    echo "Usage: buildtarball.sh <rpm>"
-    exit 1
-fi
-if test ! -f $rpmname; then
-    echo "Can't find $rpmname"
-    exit 1
-fi
-echo "--> Found rpm: $rpmname"
-
-version="`rpm -qp $rpmname | sed s/openshmem-//`"
-mkdir -p tarballs
-rpm2cpio $rpmname | cpio -id
-cd opt/mellanox
-tar jcvf ../../tarballs/openshmem-$version.tar.bz openshmem
-cd ../..
-rm -rf opt/

distr/oshmem.spec.in

-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
-# $COPYRIGHT$
-#
-# Additional copyrights may follow
-#
-# $HEADER$
-#
-
-# don't stop with an error if we don't pack all files at once
-%define _unpackaged_files_terminate_build  0
-# avoid this error: 
-# /usr/lib/rpm/debugedit: canonicalization unexpectedly shrank by one character
-%define debug_package %{nil}
-
-
-# variables replaced by buildrpm.sh script
-%define oshmem_name @OSHMEM_NAME@
-%define oshmem_configure_params @OSHMEM_CONFIGURE_PARAMS@
-%define oshmem_version @OSHMEM_VERSION@
-%define oshmem_release @OSHMEM_RELEASE@
-%define oshmem_cflags @OSHMEM_CFLAGS@
-%define oshmem_build @OSHMEM_BUILD@
-%{!?configure_opts: %define configure_opts %{nil}}
-
-
-
-#
-# global Open SHMEM stuff
-#
-
-%{!?oshmem_name: %define oshmem_name openshmem}
-%{!?oshmem_version: %define oshmem_version 2.0}
-%{!?oshmem_release: %define oshmem_release 0}
-%{!?oshmem_build: %define oshmem_build %{nil}}
-%{!?oshmem_name_prefix: %define oshmem_name_prefix %{nil}}
-%{!?oshmem_prefix: %define oshmem_prefix /opt/mellanox/%{oshmem_name_prefix}%{oshmem_name}/%{oshmem_version}}
-
-%define oshmem_long_ver %{oshmem_name}-%{oshmem_version}.%{oshmem_build}
-%define oshmem_source %{oshmem_long_ver}.tar.gz
-%define shell_scripts_path %{_bindir}
-%define shell_scripts_basename shmemvars
-# fix configure 
-#
-%{!?extra_cflags: %define extra_cflags %{nil}}
-#
-%define _prefix %{oshmem_prefix}
-%define _sysconfdir %{_prefix}/etc
-%define _libdir %{_prefix}/lib
-%define _includedir %{_prefix}/include
-
-#
-# compiler settings
-#
-%define oshmem_compiler default
-%define oshmem_cc  " "
-%define oshmem_cxx " "
-%define oshmem_f77 " "
-%define oshmem_fc  " "
-
-
-######################################################################
-#
-# Build section
-#
-######################################################################
-Summary: Mellanox SHMEM parallel programming library.
-Name: %{oshmem_name_prefix}%{oshmem_name}
-Version: %{oshmem_version}
-Release: %{oshmem_release}
-License: Proprietary
-Group: Development/Libraries
-URL: http://www.mellanox.com
-Source0: %{oshmem_source}
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-Requires: libibverbs mxm fca
-BuildRequires: gcc-c++ libstdc++ libstdc++-devel libibverbs-devel fca mxm
-Provides: shmem
-Packager: mellanox
-Vendor: mellanox
-Prefix: %{_prefix}
-%description
-
-The Mellanox SHMEM library provides fast inter-processor communication for large 
-messages using data passing and one-sided communication techniques.
-
-The Mellanox SHMEM API based on OpenSHMEM standard from http://www.openshmem.org/
-
-%prep
-rm -rf $RPM_BUILD_ROOT
-%setup -q -n %{oshmem_long_ver}
-
-%build
-OSHMEM_CONFIGURE_FLAGS="%{oshmem_configure_params}"
-EXTRA_CFLAGS="%{extra_cflags}"
-if [ "%{oshmem_compiler}" != "default" ]; then
-OSHMEM_CONFIGURE_FLAGS="$OSHMEM_CONFIGURE_FLAGS CC=%{oshmem_cc} CXX=%{oshmem_cxx} F77=%{oshmem_f77} FC=%{oshmem_fc}"
-fi
-CFLAGS="$EXTRA_CFLAGS" && %configure $OSHMEM_CONFIGURE_FLAGS %{configure_opts} 
-make -j4
-
-%install
-rm -rf $RPM_BUILD_ROOT
-%{__make} -j4 install DESTDIR=$RPM_BUILD_ROOT 
-
-%{__mkdir_p} $RPM_BUILD_ROOT/%{shell_scripts_path}
-cat <<EOF > $RPM_BUILD_ROOT/%{shell_scripts_path}/%{shell_scripts_basename}.sh
-# NOTE: This is an automatically-generated file!  (generated by the
-# Open MPI RPM).  Any changes made here will be lost if the RPM is
-# uninstalled or upgraded.
-
-# PATH
-if test -z "\`echo \$PATH | grep %{_bindir}\`"; then
-        PATH=%{_bindir}:\${PATH}
-            export PATH
-            fi
-
-# LD_LIBRARY_PATH
-if test -z "\`echo \$LD_LIBRARY_PATH | grep %{_libdir}\`"; then
-        LD_LIBRARY_PATH=%{_libdir}\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}
-            export LD_LIBRARY_PATH
-            fi
-
-# MANPATH
-if test -z "\`echo \$MANPATH | grep %{_mandir}\`"; then
-        MANPATH=%{_mandir}:\${MANPATH}
-            export MANPATH
-            fi
-
-# MPI_ROOT
-MPI_ROOT=%{_prefix}
-export MPI_ROOT
-EOF
-
-cat>>$RPM_BUILD_ROOT/%{_sysconfdir}/openmpi-mca-params.conf<<EOF
-opal_event_include=epoll
-coll_fca_enable = 0
-scoll_fca_enable = 0
-mca_component_show_load_errors = 0
-EOF
-
-%clean
-#test "x$RPM_SOURCE_DIR" != "x" && rm -rf $RPM_SOURCE_DIR
-test "x$RPM_BUILD_DIR"  != "x" && rm -rf $RPM_BUILD_DIR/*
-test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
-
-%files 
-%defattr(-,root,root,-)
-%{oshmem_prefix}
-
-

distr/rpm2cpio

-#!/usr/bin/perl
-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
-#
-# Copyright (C) 1997,1998,1999 Roger Espel Llima
-# 
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and any associated documentation files (the "Software"), to 
-# deal in the Software without restriction, including without limitation the 
-# rights to use, copy, modify, merge, publish, distribute, sublicense, 
-# and/or sell copies of the Software, and to permit persons to whom the 
-# Software is furnished to do so, subject to the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-# SOFTWARE'S COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE
-
-# (whew, that's done!)
-
-# why does the world need another rpm2cpio?  because the existing one
-# won't build unless you have half a ton of things that aren't really
-# required for it, since it uses the same library used to extract RPM's.
-# in particular, it won't build on the HPsUX box i'm on.
-
-# sw 2002-Mar-6 Don't slurp the whole file
-# Stefan 2010-Mar-10 Add bzip2 support
-
-# add a path if desired
-$gzip = "gzip";
-$bzip2 = "bzip2";
-
-sub printhelp {
-  print <<HERE;
-rpm2cpio, perl version by Roger Espel Llima
-dumps the contents to stdout as a cpio archive
-
-use: rpm2cpio [file.rpm] > file.cpio
-
-Here's how to use cpio:
-     list of contents:   cpio -t -i < /file/name
-        extract files:   cpio -d -i < /file/name
-HERE
-
-  exit 0;
-}
-
-if ($#ARGV == -1) {
-  printhelp if -t STDIN;
-  $f = "STDIN";
-} elsif ($#ARGV == 0) {
-  open(F, "< $ARGV[0]") or die "Can't read file $ARGV[0]\n";
-  $f = 'F';
-} else {
-  printhelp;
-}
-
-printhelp if -t STDOUT;
-
-read $f, $rpm, 96;
-
-($magic, $major, $minor, $crap) = unpack("NCC C90", $rpm);
-
-die "Not an RPM\n" if $magic != 0xedabeedb;
-die "Not a version 3 or 4 RPM\n" if $major != 3 && $major != 4;
-
-while (!eof($f)) {
-  $pos = tell($f);
-  read $f,$rpm,16;
-  $smagic = unpack("n", $rpm);
-  last if $smagic == 0x1f8b; # ZIP file magic, end of headers.
-  last if $smagic == 0x425a; # BZIP2 file magic, end of headers.
-  # Turns out that every header except the start of the gzip one is
-  # padded to an 8 bytes boundary.
-  if ($pos & 0x7) {
-    $pos += 7;
-    $pos &= ~0x7;	# Round to 8 byte boundary
-    seek $f, $pos, 0;
-    read $f,$rpm,16;
-  }
-  ($magic, $crap, $sections, $bytes) = unpack("N4", $rpm);
-  die "Error: header not recognized\n" if $magic != 0x8eade801;
-  $pos += 16;		# for header
-  $pos += 16 * $sections;
-  $pos += $bytes;
-  seek $f, $pos, 0;
-}
-
-if (eof($f)) {
-  die "bogus RPM\n";
-}
-
-if ($smagic == 0x1f8b) {
-  open(ZCAT, "|$gzip -cd") || die "can't pipe to gzip\n";
-
-} elsif ($smagic == 0x425a) {
-  open(ZCAT, "|$bzip2 -cd") || die "can't pipe to bzip2\n";
-
-} else {
-  die "Unknown magic '$smagic' for compressed file contents. Expected 0x1f8b (gzip) or 0x425a (bzip2).";
-}
-
-print STDERR "CPIO archive found!\n";
-
-print ZCAT $rpm;
-
-while (read($f, ($_=''), 16384) > 0) {
-  print ZCAT;
-}
-
-close ZCAT;
-

knem_patch/README-knem-patch

-#Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
-#$COPYRIGHT$
-# 
-#Additional copyrights may follow
-#
-#$HEADER$
-#
-
-File shmem_knem.patch contains the modification to the Knem kernel module version 0.9.7 that is required for the correct work of SM BTL within SHMEM which is based on Knem.
-
-Install:
-1. Get the Knem-0.9.7 source tarball from http://runtime.bordeaux.inria.fr/knem/download/knem-0.9.7.tar.gz
-2. Untar the archive and cope shmem_knem.patch to the top directory of the Knem source tree
-3. patch -p1 -i shmem_knem.patch
-4. Build and install Knem kernel module as usual.

knem_patch/shmem_knem.patch

-# Copyright (c) 2012      Mellanox Technologies, Inc.
-#                         All rights reserved.
-diff -cr knem-0.9.7/driver/linux/knem_main.c knem-fixed/driver/linux/knem_main.c
-*** knem-0.9.7/driver/linux/knem_main.c	2011-07-28 20:06:58.000000000 +0300
---- knem-fixed/driver/linux/knem_main.c	2011-10-04 13:25:12.000000000 +0200
-***************
-*** 1145,1150 ****
---- 1145,1195 ----
-   * Copying between pinned iovecs
-   */
-  
-+ #define KNEM_FOR_SHMEM 1
-+ 
-+ #if KNEM_FOR_SHMEM
-+ static void perform_copy(void *dst, void *src, unsigned long length)
-+ {
-+     int i;
-+     int num64 = length / sizeof(uint64_t);
-+     int num32 = (length % sizeof(uint64_t))/sizeof(uint32_t);
-+     int num16 = (length % sizeof(uint32_t))/sizeof(uint16_t);
-+     int num8 = (length % sizeof(uint16_t))/sizeof(uint8_t);
-+     uint64_t *dst64 = (uint64_t*)dst;
-+     uint64_t *src64 = (uint64_t*)src;
-+     uint32_t *dst32;
-+     uint32_t *src32;
-+     uint16_t *src16;
-+     uint16_t *dst16;
-+     uint8_t  *dst8;
-+     uint8_t  *src8;
-+ 
-+     for (i=0; i<num64; i++)
-+     {
-+         *dst64++ = *src64++;
-+     }
-+     dst32 = (uint32_t *)dst64;
-+     src32 = (uint32_t *)src64;
-+     for (i=0; i<num32; i++)
-+     {
-+         *dst32++ = *src32++;
-+     }
-+     dst16 = (uint16_t *)dst32;
-+     src16 = (uint16_t *)src32;
-+     for (i=0; i<num16; i++)
-+     {
-+         *dst16++ = *src16++;
-+     }
-+     dst8 = (uint8_t *)dst16;
-+     src8 = (uint8_t *)src16;
-+     for (i=0; i<num8; i++)
-+     {
-+         *dst8++ = *src8++;
-+     }
-+ 
-+ //    printk(KERN_ERR "MEMCPY IS DONE IN KNEM, dst = %p. src = %p, len = %lu\n",(void *)dst,(void *)src,length);
-+ }
-+ #endif
-  static void
-  knem_memcpy_pinned(struct page * const * dst_page, unsigned dst_first_page_offset,
-  		   struct page * const * src_page, unsigned src_first_page_offset,
-***************
-*** 1159,1169 ****
-  			chunk = PAGE_SIZE - src_first_page_offset;
-  		if (likely(dst_first_page_offset + chunk > PAGE_SIZE))
-  			chunk = PAGE_SIZE - dst_first_page_offset;
-! 
-  		memcpy(dst_addr + dst_first_page_offset,
-  		       src_addr + src_first_page_offset,
-  		       chunk);
-! 
-  		remaining -= chunk;
-  		if (unlikely(!remaining))
-  			break;
---- 1204,1218 ----
-  			chunk = PAGE_SIZE - src_first_page_offset;
-  		if (likely(dst_first_page_offset + chunk > PAGE_SIZE))
-  			chunk = PAGE_SIZE - dst_first_page_offset;
-! #if (!KNEM_FOR_SHMEM)
-  		memcpy(dst_addr + dst_first_page_offset,
-  		       src_addr + src_first_page_offset,
-  		       chunk);
-! #else
-!         perform_copy(dst_addr + dst_first_page_offset,
-!                 src_addr + src_first_page_offset,
-!                 chunk);
-! #endif
-  		remaining -= chunk;
-  		if (unlikely(!remaining))
-  			break;

ompi/class/ompi_free_list.c

  *                         University of Stuttgart.  All rights reserved.
  * Copyright (c) 2004-2005 The Regents of the University of California.
  *                         All rights reserved.
+ * Copyright (c) 2006-2007 Mellanox Technologies. All rights reserved.
  * Copyright (c) 2010      Cisco Systems, Inc. All rights reserved.
  * Copyright (c) 2011      NVIDIA Corporation.  All rights reserved.
  * Copyright (c) 2012      Los Alamos National Security, LLC. All rights
  *                         reserved.
- * Copyright (c) 2012      Mellanox Technologies, Inc.
- *                         All rights reserved.
  * $COPYRIGHT$
  * 
  * Additional copyrights may follow