Fixes #3763: Move r29153, r29158 to v1.7 branch (move oshmem to 1.7.4)

This rolls in the OSHMEM code support, including a copy of the oshmem directory tree as of r30624 to ensure we captured all the commits in that area.

Errata: shmemrun seems to hang after executing an application. No other problems detected, particularly in the MPI arena.


---svn-pre-commit-ignore-below---

r29153 [[BR]]
Per the RFC schedule, this commit adds Mellanox OpenSHMEM to the trunk. It does not yet run on OSX or with CM PML for an MTL other than MXM. Mellanox is aware of these issues and is in the process of resolving them. This should be added to \ncmr=v1.7.4:subject=Move OSHMEM to 1.7.4:reviewer=rhc

r29156 [[BR]]
Fix typo in function name

r29158 [[BR]]
This commit 1. Fixes the void pointer casting to 64-bit integer issue in shmem_lock.c, line 170.  2. Applies the patch provided by George to add support for Intel (12.1.020110811) compiler in OSHMEM. 3. Fixes the configure warning generated by AC_TRY_RUN - disable mxm atomic locks if cross compiling.

r29161 [[BR]]
Attempt to resolve the nightly build problem

Refs #3763


r29164 [[BR]]
Adding more fixes to stomp casting/addressing issues on 32-bit systems.

r29165 [[BR]]
1. Per my previous email
(http://www.open-mpi.org/community/lists/devel/2013/09/12889.php), I
renamed all "f77" and "f90" directory/file names to "fortran"
(including removing shmemf77 / shmemf90 wrapper compilers and
replacing them with "shmemfort").

2. Fixed several Fortran coding errors.

3. Removed lots of old/stale comments that were clearly the result of
copying from the OMPI layer and then not cleaning up afterwards (i.e.,
the comments were wholly inaccurate in the oshmem layer).

4. Removed both redundant and harmful code from oshmem_config.h.in.

5. Temporarily slave building the oshmem Fortran bindings to
--enable-mpi-fortran.  This doesn't seem like a good long-term
solution, but at least you can now build all Fortran bindings (MPI +
oshmem) or not. *** SEE MY NOTE IN config/oshmem_configure_options.m4
FOR WORK THAT STILL NEEDS TO BE DONE!

r29190 [[BR]]
Fixing FORTRAN bindings in OSHMEM

r29203 [[BR]]
More OSHMEM fixes for Sun C 5.12 compiler

r29211 [[BR]]
Add missing include file on Solaris environments

Refs #3763


r29223 [[BR]]
fix for solaris which does not have bzero
cmr:v1.7.3:reviewer=jsquyres

r29239 [[BR]]
Fixing OSHMEM 64-bit compiler warnings/picky errors in MXM enabled components.

r29240 [[BR]]
Cleaning up a bit

r29249 [[BR]]
Fixing OSHMEM compiler warnings when --enable-mpi-thread-multiple is set

r29281 [[BR]]
Add svn:ignore for hello_shmem

r29311 [[BR]]
fix define name to match mxm2 API
cmr=v1.7.4:reviewer=ompi-rm1.7

r29328 [[BR]]
Adopting shmem configure logic to trunk build system conventions
fixed by Dinar, reviewed by miked
cmr=v1.7.4:reviewer=ompi-rm1.7

r29329 [[BR]]
adopt to MXM2 API change
fixed by Igor, reviewed by miked
cmr=v1.7.4:reviewer=ompi-rm1.7

r29330 [[BR]]
fix compile error, bad patch was previously applied
fixed by Igor, reviewed by miked
cmr=v1.7.4:reviewer=ompi-rm1.7

r29332 [[BR]]
implement community feedback
1. The OpenSHMEM specification is silent regarding how OpenSHMEM programs are compiled,
linked and run.  These wrappers are added to meet an example in the specification.
2. remove unused/obsolete files
Implemented by Igor, reviewed by miked
cmr=v1.7.4:reviewer=ompi-rm1.7

r29345 [[BR]]
OSHMEM fixes for MXM 2.0:
    - register memheap with mxm
    - handle zcopy correctly
    - use mxm provided empty memory key instead of NULL

reviewed by miked

r29346 [[BR]]
rename var
fix warn

r29349 [[BR]]
compilation fix for oshmem and mxm
reviewed by miked

r29350 [[BR]]
oshmem & mxm2.0 yet another compilation fix

reviewed by miked

r29351 [[BR]]
fix oshmem static linking
fixed by Roman, reviewed by miked

r29386 [[BR]]
enable ikrit for np>=0 with mxm2
reviewed by Amir
Refs: #3763

r29407 [[BR]]
fixed check availability of mxm atomics. No need to run the code. succesful compilation is enough to detect availability.
reviewed by miked



r29408 [[BR]]
Use the correct macro: OMPI_HAVE_FORTRAN_REAL16

Using the "#if defined(ompi_fortran_real16_t)" band-aid that I applied
in r29165 wasn't correct because if the compiler doesn't have a
fortran REAL16 type, then OMPI may well #define ompi_fortran_real16_t
to be empty, which then expands to Badness in the macro.  Hence, use
OMPI_HAVE_FORTRAN_REAL16, which will also be 0 or 1.

r29410 [[BR]]
Fix typo/misspelling in variable name.

r29429 [[BR]]
tools: Add oshmem_info utility

Reworked ompi_info tool to be close with orte_info implementation.
ompi_info_register_types(), ompi_info_close_components() and
ompi_info_show_ompi_version() are moved to runtime/ompi_info_support.c.

Added runtime/oshmem_info_support layer that exports following api to be
used into oshmem_info tool as
oshmem_info_register_types()
oshmem_info_register_framework_params()
oshmem_info_close_components()
oshmem_info_show_oshmem_version()
These functions call ompi_info_support related interfaces as long as
Oshmem supports Open MPI/SHMEM combination.

Now orte_info/ompi_info/oshmem_info have identical implementation approach.

Possible improvement:
OSHMEM processing of --config option is the same as OMPI`s (code is duplicated).
Probably list of info_support interfaces can be extended by xxx_info_do_config().
developed by Igor, reviewed by miked


r29430 [[BR]]
add globalexit API support.
it is not fully functional yet, but initial version is good enough.
developed by Igor, reviewed by miked

r29431 [[BR]]
fix gcc warnings

r29432 [[BR]]
fix warnings when "--with-pmi" is used

r29434 [[BR]]
globalexit() should use common approach using orte_errmgr.abort()

r29442 [[BR]]
Add missing file to tarball

r29448 [[BR]]
add --enable-oshmem-fortran opt to configure

r29518 [[BR]]
shmem-fortran fix, naming conventions for shmem option, examples

r29519 [[BR]]
fix autogen warn, fixed by Roman, reviewed by miked

r29520 [[BR]]
This commit fixes pointer arithmetic done with void * pointers in memheap. This commit closes #3844

r29521 [[BR]]
This commit (hopefully) fully addresses the enabling of oshmem fortran bindings given its dependency on the building of fortran bindings in OMPI. This commit closes #3851.

r29637 [[BR]]
Significant update of README to include OSHMEM info. Also updated NEWS to include mention of support for PMI2

r29809 [[BR]]
Resolves oshmem_info segfault on OSX. This fixes #3904. Refs #3763

r30305 [[BR]]
OSHMEM: remove unused var

fix for http://www.open-mpi.org/community/lists/devel/2014/01/13779.php
fixed by Roman, reviewed by Igor

cmr=v1.7.4:reviewer=ompi-rm1.7

r30004 [[BR]]
fix compile warning
Refs #3763

r30077 [[BR]]
SHMEM: silence warning
Refs #3763

r30082 [[BR]]
Forward declaration must match eventual function - both must be static

Refs #3763


r30088 [[BR]]
OSHMEM: set default transport for mxm under OSHMEM to be ud, can be overwritten with MXM_OSHMEM_TL= variable
Refs #3763

r30089 [[BR]]
OSHMEM: exchange mxm(ikrit) endpoints via MPI_Allgather, code cleanup, remove unused
Refs #3763

r30129 [[BR]]
OSHMEM: port 6 patches from git mirror to svn

Subject: [PATCH 1/6] OSHMEM: mkey refactoring
mkey can be either shared memory style id or it can be
arbitrary byte string
removed hack that used spml_context to store generic keys
coding style fixes

Subject: [PATCH 2/6] OSHMEM: added support of MXM 2.0 rc transport
coding style fixed, typos, check error condition

Subject: [PATCH 3/6] OSHMEM: mxm2.0: remove PTL_SELF
There is no need to have special case for 'self'
connection in mxm 2.0. It also solves the problem
of passing incorrect mkey when doing put/get to
self

Subject: [PATCH 4/6] OSHMEM: fixes mxm fadd
give a dummy buffer if doing atomic add

Subject: [PATCH 5/6] OSHMEM: mxm2.0: do not use MXM_REQ_FLAG_SEND_LAZY
Subject: [PATCH 6/6] OSHMEM: remove unused include, causes compilation fail on ubuntu

Refs #3763


r30226 [[BR]]
fix broken logic for oshmem:bindings:fort
Refs #3763

r30227 [[BR]]
Portability fix: better checking for MAP_ANONYMOUS and MAP_ANON.

Thanks to Paul Hargrove for identifying the issue and suggesting the
fix.

r20267 [[BR]]
Correctly forward the right module if we call another collective function. Kudos to
Edgar for figuring out this tricky bug.

r30286 [[BR]]
OSHMEM: fix fortran selection logic and refactoring
refactoring inspired by this thread: http://www.open-mpi.org/community/lists/devel/2014/01/13744.php
fix oshmem fortran selection logic, Thanks to Paul for info
Refs #3763

r30304 [[BR]]
OSHMEM: bml initialization is moved into ompi_init
it fixes race of mca_var segfault in finalization of shmem

based on this thread:
http://www.open-mpi.org/community/lists/devel/2014/01/13778.php

Refs #3763

fixed by Igor, reviewed by Brian

r30310 [[BR]]
remove bml_init call, called from btl add_proc.
Refs #3763

r30311 [[BR]]
OSHMEM: Fixes issue with recent segfault in finalize related to mca_base_group_unselect.
We need to explicitly call mca_base_group_unselect in finalize
for each group that are not freed with oshmem_group_cache_list_free before we unloading scoll framework.

Refs #3763

r30340 [[BR]]
OSHMEM: fix fortran binding

The check to enable shmem fortran was too early, MPI can disable fortran but SHMEM fortran check was already done.
Refs #3763

r30391 [[BR]]
OSHMEM: rework fortran support detection

fix the case, to enable oshmem-fortran when "with-shmem" was specified and "ompi-fortran" was enabled and happy.

fixed by Roman, reviewed by Miked

Refs #3763


r30427 [[BR]]
OSHMEM: use shmem barrier instead of internal
Refs: 3763

r30454 [[BR]]
OSHMEM: refactoring to reuse common functions from different components.
This is preparation for moving verbs dependent code out from memheap/base component

Refs: #3763

r30530 [[BR]]
OSHMEM: Apply Jeff`s comments to fortran configure logic
Refs #3763

r30572 [[BR]]
OSHMEM: finalization fixes

Fixes mxm endpoint destruction and hung during
SHMEM finalization.

Add a barrier between spml del procs and finalization.
Not having it caused hungs because ikrit spml can not properly
disconnect if its peer already finizalized.

Refs #3763

r30573 [[BR]]
OSHMEM: MXM2: a2a perf improvement on large scale

Allow only limited number of coonections to have 'puts'
that do not require remote completion ack. That will
greatly improve performance of shmem_fence()/shmem_quiet()
and shmem_barrier() when there are many active connections.

fixed by Alex, reviewed by Miked

Refs #3763

r30140 [[BR]]
Fix longstanding issue with our multi-project support.  Rather than using
pkg{data,lib,includedir}, use our own ompi{data,lib,includedir}, which is
always set to {datadir,libdir,includedir}/openmpi.  This will keep us from
having help files in prefix/share/open-rte when building without Open MPI,
but in prefix/share/openmpi when building with Open MPI.