Build: Static constructors for built-in providers

Change how internal and external providers are built to fix static
build issues.  External providers are now required to export a
well known API that is invoked by the libfabric framework.  This
replaces the fi_register call that libfabric exported.

Update the build configuration to better handle building in-tree
providers as separate DLLs (for testing purposes).  When building
an in-tree provider as a separate DLL, it now needs to export
the required fi_prov_ini function.

Signed-off-by: pmmccorm <patrick.m.mccormick@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
psm: calloc the size that is needed

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Merge pull request #405 from jsquyres/pr/psm-voidstar-deref

psm: calloc the size that is needed
Brought usnic_direct update-to-date

Signed-off-by: Xuyang Wang <xuywang@cisco.com>
Merge pull request #406 from xuywang/pr/usd_udpate

Brought usnic_direct update-to-date
fi_tostr: do not use thread-specific data

Take inspiration from strerror(): just declare that fi_tostr() is not
thread safe.  Do not use __thread, because it is a GCC extension (and
it's not worth using pthread function calls to make portable thread
safe data).

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
fi_tostr: ensure that fi_tostr does not overflow the buffer

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Merge pull request #402 from jsquyres/pr/fi-tostr-tsd

fi_tostr fixes
Updated nroff-generated man pages
added back declaration of usd_fill_udp_dest as it is used by usdf externally

Signed-off-by: Xuyang Wang <xuywang@cisco.com>
Merge pull request #407 from xuywang/pr/add_func_dec

added back declaration of usd_fill_udp_dest as it is used by usdf extern...
Fixed a bug to give correct iov buf length in usdf prefix_recv implementation

Signed-off-by: Xuyang Wang <xuywang@cisco.com>
Merge pull request #408 from xuywang/pr/prefix_recv

Fixed a bug to give correct iov buf length in usdf prefix_recv implement...
Makefile.am: updates on linkback scheme
Several changes:

* Change the definition of $(linkback) to link to libfabric.la in the
  build tree (i.e., let Libtool figure out what the right directory
  is)
* Move $(linkback) and other -l libraries to provider DL LIBADD lines
  -- they do not belong in LDFLAGS
* Add $(linkback) to provider DL DEPENDENCIES to guarantee that
  libfabric is built before the provider DLs (e.g., in a parallel
  build)

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Merge pull request #399 from shefty/master

Build: Static constructors for built-in providers
fabric: Rename FI_WAIT_MUT_COND to FI_WAIT_MUTEX_COND

Align name better with pthread names.
fabric: Defined fi_mut_cond structure

Define structure for use with FI_GETWAIT when a mutex-cond
pair are used as wait objects.

Signed-off-by: Jithin Jose <jithin.jose@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
fabric: Remove fi_control from defined wait set interface

The primary function of a wait set is to allow multiple underlying
objects to share a single wait object.  However, a wait set is
defined such that it could be implemented with multiple wait
objects, which are visible to the application.  Rather than
defining a wait set in this way, limit the definition to the
intended use case.  Any use of multiple wait objects then becomes
an implementation specific problem.

The use of multiple wait objects is exposed through the wait
set control FI_GETWAIT operation.  Remove this functionality from
the defined interfaces.

This also fixes an issue where the wait set lacks an interface
to reset a signaled wait object that has been exposed to an app.
For example, if a wait set were implemented using a FD, and an
app obtained that FD, it can wait until the FD has been signaled
using select or poll, but no interface is defined for clearing
such a signal from the FD.

This above mentioned functionality and control operation is
deferred until a future time when it can be more fully defined
with a clearer usage model.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
fabric: Clarify which buffers FI_OPT_MIN_MULTI_RECV apply to

Improve documentation regarding the expected behavior when an
app modifies the MIN_MULTI_RECV endpoint option.

Recommend that the option be set before an endpoint is enabled,
in order to support the broadest array of implementations, and
that it only applies to buffers posted after the value has been
set.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
prov/psm: fix the return code of fi_cq_read for error completions

When an error entry is created from PSM status, the function returned 1
incorrectly. The correct way is to continue to the CQ dequeue step, where
the error entry will be discovered and the proper value will be returned.

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>