1
1
openmpi/opal/mca/btl/usnic/btl_usnic_compat.c
Jeff Squyres 984982790a usnic: convert from verbs to libfabric (yay!)
This commit represents the conversion of the usnic BTL from verbs to
libfabric.

For the moment, libfabric is embedded in Open MPI (currently in the
usnic BTL).  This is because the libfabric API is still changing, and
also has not yet been released.  Ultimately, this embedded copy of
libfabric will likely disappear and the usnic BTL will rely on an
external installation of libfabric.

New configure options:

* --with-libfabric: will cause configure to fail if libfabric support
    cannot be built
* --without-libfabric: will prevent libfabric support from being built
* --with-libfabric=DIR: use an external libfabric installation
* --with-libfabric-libdir=LIBDIR: when paired with --with-libfabric=DIR,
    use LIBDIR for the libfabric installation library dir

The --with-libnl3[-libdir] arguments are now gone.
2014-12-08 11:37:37 -08:00

118 строки
3.0 KiB
C

/*
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#if BTL_IN_OPAL
#include "opal_config.h"
#else
#include "ompi_config.h"
#endif
#include "opal/mca/mca.h"
#include "opal_stdint.h"
#include "btl_usnic_compat.h"
#include "btl_usnic_endpoint.h"
/************************************************************************/
/* v1.9 and beyond */
#if (OPAL_MAJOR_VERSION == 1 && OPAL_MINOR_VERSION >= 9) || \
(OPAL_MAJOR_VERSION >= 2)
#include "opal/util/proc.h"
/**************************
* usNIC BTL-specific functions to hide differences between master and
* v1.8
**************************/
void usnic_compat_modex_send(int *rc,
mca_base_component_t *component,
opal_btl_usnic_modex_t *modexes,
size_t size)
{
OPAL_MODEX_SEND(*rc, PMIX_SYNC_REQD, PMIX_REMOTE, component,
modexes, size);
}
void usnic_compat_modex_recv(int *rc,
mca_base_component_t *component,
opal_proc_t *proc,
opal_btl_usnic_modex_t **modexes,
size_t *size)
{
OPAL_MODEX_RECV(*rc, component, proc, (uint8_t**) modexes, size);
}
uint64_t usnic_compat_rte_hash_name(opal_process_name_t *pname)
{
uint64_t name = pname->jobid;
name <<= 32;
name += pname->vpid;
return name;
}
const char *usnic_compat_proc_name_print(opal_process_name_t *pname)
{
return OPAL_NAME_PRINT(*pname);
}
/************************************************************************/
/* v1.7 and v1.8 */
#elif (OPAL_MAJOR_VERSION == 1 && OPAL_MINOR_VERSION >= 7)
#include "ompi/proc/proc.h"
#include "ompi/mca/rte/rte.h"
#include "ompi/mca/rte/base/base.h"
#include "ompi/runtime/ompi_module_exchange.h"
/**************************
* Replicate functions that exist on master
**************************/
char* opal_get_proc_hostname(opal_proc_t *proc)
{
return proc->proc_hostname;
}
/**************************
* usNIC BTL-specific functions to hide differences between master and
* v1.8
**************************/
void usnic_compat_modex_send(int *rc,
mca_base_component_t *component,
struct opal_btl_usnic_modex_t *modexes,
size_t size)
{
*rc = ompi_modex_send(component, modexes, size);
}
void usnic_compat_modex_recv(int *rc,
mca_base_component_t *component,
opal_proc_t *proc,
struct opal_btl_usnic_modex_t **modexes,
size_t *size)
{
*rc = ompi_modex_recv(component, proc, (void*) modexes, size);
}
uint64_t usnic_compat_rte_hash_name(opal_process_name_t *pname)
{
return ompi_rte_hash_name(pname);
}
const char *usnic_compat_proc_name_print(opal_process_name_t *pname)
{
return OMPI_NAME_PRINT(pname);
}
#endif