1
1
openmpi/opal/mca/common/ugni/common_ugni.h
Ralph Castain 552c9ca5a0 George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT:    Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL

All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies.  This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP.  Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose.  UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs.  A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.

This commit was SVN r32317.
2014-07-26 00:47:28 +00:00

116 строки
2.9 KiB
C

/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2011 UT-Battelle, LLC. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "opal_config.h"
#include "opal/util/output.h"
#include "opal/class/opal_list.h"
#include "opal/include/opal/prefetch.h"
#include "opal_stdint.h"
#include "ompi/runtime/ompi_module_exchange.h"
#include <errno.h>
#include <stdint.h>
#include <sys/types.h>
#include <assert.h>
#include <sys/time.h>
#include <gni_pub.h>
#include "common_ugni_ep.h"
#if !defined(MPI_COMMON_UGNI_H)
#define MPI_COMMON_UGNI_H
struct opal_common_ugni_modex_t {
uint32_t addr;
int id;
};
typedef struct opal_common_ugni_modex_t opal_common_ugni_modex_t;
struct opal_common_ugni_device_t {
opal_object_t super;
gni_nic_handle_t dev_handle;
/* Minor number of the Gemini NIC */
int32_t dev_id;
uint32_t dev_pe_addr;
uint32_t dev_addr;
uint32_t dev_cpu_id;
size_t dev_ep_count;
void *btl_ctx;
};
typedef struct opal_common_ugni_device_t opal_common_ugni_device_t;
struct opal_common_ugni_module_t {
/* protection tag */
uint8_t ptag;
/* unique id for this process assigned by the system */
uint32_t cookie;
/* communication domain handle */
gni_cdm_handle_t cd_handle;
/* device count. to be used if we have more than 1 common per ugni device */
int device_count;
opal_common_ugni_device_t *devices;
int rdma_max_retries;
};
typedef struct opal_common_ugni_module_t opal_common_ugni_module_t;
struct opal_common_ugni_post_desc_t {
gni_post_descriptor_t base;
opal_common_ugni_endpoint_t *endpoint;
int tries;
};
typedef struct opal_common_ugni_post_desc_t opal_common_ugni_post_desc_t;
extern opal_common_ugni_module_t opal_common_ugni_module;
extern mca_base_component_t opal_common_ugni_component;
static inline int
opal_common_rc_ugni_to_opal (gni_return_t rc)
{
int codes[] = {OPAL_SUCCESS,
OPAL_ERR_RESOURCE_BUSY,
OPAL_ERR_BAD_PARAM,
OPAL_ERR_OUT_OF_RESOURCE,
OPAL_ERR_TIMEOUT,
OPAL_ERR_PERM,
OPAL_ERROR,
OPAL_ERR_BAD_PARAM,
OPAL_ERR_BAD_PARAM,
OPAL_ERR_NOT_FOUND,
OPAL_ERR_VALUE_OUT_OF_BOUNDS,
OPAL_ERROR,
OPAL_ERR_NOT_SUPPORTED,
OPAL_ERR_OUT_OF_RESOURCE};
return codes[rc];
}
/*
* Initialize uGNI communication domain and device(s).
*/
int opal_common_ugni_init (void);
/*
* Finalize uGNI communication domain and device(s).
*/
int opal_common_ugni_fini (void);
#endif /* MPI_COMMON_UGNI_H */