1
1
This commit was SVN r6621.
Этот коммит содержится в:
George Bosilca 2005-07-27 19:46:36 +00:00
родитель 08d1ab584a
Коммит e1b3758fa5
12 изменённых файлов: 1695 добавлений и 0 удалений

0
ompi/mca/btl/mx/.ompi_ignore Обычный файл
Просмотреть файл

56
ompi/mca/btl/mx/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,56 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University.
# All rights reserved.
# Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
# All rights reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# Use the top-level Makefile.options
include $(top_ompi_srcdir)/config/Makefile.options
sources = \
btl_mx.c \
btl_mx.h \
btl_mx_component.c \
btl_mx_endpoint.c \
btl_mx_endpoint.h \
btl_mx_frag.c \
btl_mx_frag.h \
btl_mx_proc.c \
btl_mx_proc.h \
btl_mx_error.h
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
if OMPI_BUILD_btl_mx_DSO
lib =
lib_sources =
component = mca_btl_mx.la
component_sources = $(sources)
else
lib = libmca_btl_mx.la
lib_sources = $(sources)
component =
component_sources =
endif
mcacomponentdir = $(libdir)/openmpi
mcacomponent_LTLIBRARIES = $(component)
mca_btl_mx_la_SOURCES = $(component_sources)
mca_btl_mx_la_LDFLAGS = -module -avoid-version
noinst_LTLIBRARIES = $(lib)
libmca_btl_mx_la_SOURCES = $(lib_sources)
libmca_btl_mx_la_LDFLAGS = -module -avoid-version

624
ompi/mca/btl/mx/btl_mx.c Обычный файл
Просмотреть файл

@ -0,0 +1,624 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <string.h>
#include "opal/util/output.h"
#include "opal/util/if.h"
#include "mca/pml/pml.h"
#include "mca/btl/btl.h"
#include "btl_template.h"
#include "btl_template_frag.h"
#include "btl_template_proc.h"
#include "btl_template_endpoint.h"
#include "datatype/convertor.h"
#include "mca/mpool/base/base.h"
#include "mca/mpool/mpool.h"
mca_btl_template_module_t mca_btl_template_module = {
{
&mca_btl_template_component.super,
0, /* max size of first fragment */
0, /* min send fragment size */
0, /* max send fragment size */
0, /* min rdma fragment size */
0, /* max rdma fragment size */
0, /* exclusivity */
0, /* latency */
0, /* bandwidth */
0, /* flags */
mca_btl_template_add_procs,
mca_btl_template_del_procs,
mca_btl_template_register,
mca_btl_template_finalize,
mca_btl_template_alloc,
mca_btl_template_free,
mca_btl_template_prepare_src,
mca_btl_template_prepare_dst,
mca_btl_template_send,
mca_btl_template_put,
NULL /* get */
}
};
/**
*
*/
int mca_btl_template_add_procs(
struct mca_btl_base_module_t* btl,
size_t nprocs,
struct ompi_proc_t **ompi_procs,
struct mca_btl_base_endpoint_t** peers,
ompi_bitmap_t* reachable)
{
mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*)btl;
int i, rc;
for(i = 0; i < (int) nprocs; i++) {
struct ompi_proc_t* ompi_proc = ompi_procs[i];
mca_btl_template_proc_t* template_proc;
mca_btl_base_endpoint_t* template_endpoint;
if(NULL == (template_proc = mca_btl_template_proc_create(ompi_proc))) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
/*
* Check to make sure that the peer has at least as many interface
* addresses exported as we are trying to use. If not, then
* don't bind this PTL instance to the proc.
*/
OPAL_THREAD_LOCK(&template_proc->proc_lock);
/* The btl_proc datastructure is shared by all TEMPLATE PTL
* instances that are trying to reach this destination.
* Cache the peer instance on the btl_proc.
*/
template_endpoint = OBJ_NEW(mca_btl_template_endpoint_t);
if(NULL == template_endpoint) {
OPAL_THREAD_UNLOCK(&module_proc->proc_lock);
return OMPI_ERR_OUT_OF_RESOURCE;
}
template_endpoint->endpoint_btl = template_btl;
rc = mca_btl_template_proc_insert(template_proc, template_endpoint);
if(rc != OMPI_SUCCESS) {
OBJ_RELEASE(template_endpoint);
OPAL_THREAD_UNLOCK(&module_proc->proc_lock);
continue;
}
ompi_bitmap_set_bit(reachable, i);
OPAL_THREAD_UNLOCK(&module_proc->proc_lock);
peers[i] = template_endpoint;
}
return OMPI_SUCCESS;
}
int mca_btl_template_del_procs(struct mca_btl_base_module_t* btl,
size_t nprocs,
struct ompi_proc_t **procs,
struct mca_btl_base_endpoint_t ** peers)
{
/* TODO */
return OMPI_SUCCESS;
}
/**
* Register callback function to support send/recv semantics
*/
int mca_btl_template_register(
struct mca_btl_base_module_t* btl,
mca_btl_base_tag_t tag,
mca_btl_base_module_recv_cb_fn_t cbfunc,
void* cbdata)
{
mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*) btl;
template_btl->template_reg[tag].cbfunc = cbfunc;
template_btl->template_reg[tag].cbdata = cbdata;
return OMPI_SUCCESS;
}
/**
* Allocate a segment.
*
* @param btl (IN) BTL module
* @param size (IN) Request segment size.
*/
mca_btl_base_descriptor_t* mca_btl_template_alloc(
struct mca_btl_base_module_t* btl,
size_t size)
{
mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*) btl;
mca_btl_template_frag_t* frag;
int rc;
if(size <= btl->btl_eager_limit){
MCA_BTL_TEMPLATE_FRAG_ALLOC_EAGER(template_btl, frag, rc);
frag->segment.seg_len =
size <= btl->btl_eager_limit ?
size : btl->btl_eager_limit ;
} else {
MCA_BTL_TEMPLATE_FRAG_ALLOC_MAX(template_btl, frag, rc);
frag->segment.seg_len =
size <= btl->btl_max_send_size ?
size : btl->btl_max_send_size ;
}
frag->base.des_flags = 0;
return (mca_btl_base_descriptor_t*)frag;
}
/**
* Return a segment
*/
int mca_btl_template_free(
struct mca_btl_base_module_t* btl,
mca_btl_base_descriptor_t* des)
{
mca_btl_template_frag_t* frag = (mca_btl_template_frag_t*)des;
if(frag->size == 0) {
#if MCA_BTL_HAS_MPOOL
OBJ_RELEASE(frag->registration);
#endif
MCA_BTL_TEMPLATE_FRAG_RETURN_USER(btl, frag);
} else if(frag->size == btl->btl_eager_limit){
MCA_BTL_TEMPLATE_FRAG_RETURN_EAGER(btl, frag);
} else if(frag->size == btl->btl_max_send_size) {
MCA_BTL_TEMPLATE_FRAG_RETURN_EAGER(btl, frag);
} else {
return OMPI_ERR_BAD_PARAM;
}
return OMPI_SUCCESS;
}
/**
* Pack data and return a descriptor that can be
* used for send/put.
*
* @param btl (IN) BTL module
* @param peer (IN) BTL peer addressing
*/
mca_btl_base_descriptor_t* mca_btl_template_prepare_src(
struct mca_btl_base_module_t* btl,
struct mca_btl_base_endpoint_t* endpoint,
struct mca_mpool_base_registration_t* registration,
struct ompi_convertor_t* convertor,
size_t reserve,
size_t* size
)
{
mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*)btl;
mca_btl_template_frag_t* frag;
struct iovec iov;
uint32_t iov_count = 1;
size_t max_data = *size;
int32_t free_after;
int rc;
#if MCA_BTL_HAS_MPOOL
/*
* If the data has already been pinned and is contigous than we can
* use it in place.
*/
if (NULL != registration && 0 == ompi_convertor_need_buffers(convertor)) {
size_t reg_len;
MCA_BTL_TEMPLATE_FRAG_ALLOC_USER(template_btl, frag, rc);
if(NULL == frag){
return NULL;
}
iov.iov_len = max_data;
iov.iov_base = NULL;
ompi_convertor_pack(convertor, &iov, &iov_count, &max_data, &free_after);
frag->segment.seg_len = max_data;
frag->segment.seg_addr.pval = iov.iov_base;
reg_len = (unsigned char*)registration->bound - (unsigned char*)iov.iov_base + 1;
if(frag->segment.seg_len > reg_len) {
mca_mpool_base_module_t* mpool = template_btl->template_mpool;
size_t new_len = (unsigned char*)iov.iov_base -
(unsigned char *) registration->base + max_data;
void* base_addr = registration->base;
/* remove old registration from tree and decrement reference count */
mca_mpool_base_remove(base_addr);
OBJ_RELEASE(registration);
/* re-register at new size */
rc = mpool->mpool_register(
mpool,
base_addr,
new_len,
&registration);
if(rc != OMPI_SUCCESS) {
MCA_BTL_TEMPLATE_FRAG_RETURN_USER(btl,frag);
return NULL;
}
/* re-insert into tree with new registration */
rc = mca_mpool_base_insert(
base_addr,
new_len,
mpool,
btl,
registration);
if(rc != OMPI_SUCCESS) {
MCA_BTL_TEMPLATE_FRAG_RETURN_USER(btl,frag);
OBJ_RELEASE(registration);
return NULL;
}
}
/* bump reference count as so that the registration
* doesn't go away when the operation completes
*/
OBJ_RETAIN(registration);
frag->registration = registration;
/*
* if the data is not already pinned - but the leave pinned option is set,
* then go ahead and pin contigous data. however, if a reserve is required
* then we must allocated a fragment w/ buffer space
*/
} else if ((mca_btl_template_component.leave_pinned || max_data > btl->btl_max_send_size) &&
ompi_convertor_need_buffers(convertor) == 0 &&
reserve == 0) {
mca_mpool_base_module_t* mpool = template_btl->template_mpool;
MCA_BTL_TEMPLATE_FRAG_ALLOC_USER(template_btl, frag, rc);
if(NULL == frag){
return NULL;
}
iov.iov_len = max_data;
iov.iov_base = NULL;
ompi_convertor_pack(convertor, &iov, &iov_count, &max_data, &free_after);
frag->segment.seg_len = max_data;
frag->segment.seg_addr.pval = iov.iov_base;
rc = mpool->mpool_register(
mpool,
iov.iov_base,
max_data,
&registration);
if(rc != OMPI_SUCCESS) {
MCA_BTL_TEMPLATE_FRAG_RETURN_USER(btl,frag);
return NULL;
}
if(mca_btl_template_component.leave_pinned) {
/*
* insert the registration into the tree and bump the reference
* count so that it doesn't go away on completion.
*/
rc = mca_mpool_base_insert(
iov.iov_base,
iov.iov_len,
mpool,
btl,
registration);
if(rc != OMPI_SUCCESS) {
MCA_BTL_TEMPLATE_FRAG_RETURN_USER(btl,frag);
OBJ_RELEASE(registration);
return NULL;
}
OBJ_RETAIN(registration);
}
frag->registration = registration;
} else
#endif
/*
* if we aren't pinning the data and the requested size is less
* than the eager limit pack into a fragment from the eager pool
*/
if (max_data+reserve <= btl->btl_eager_limit) {
MCA_BTL_TEMPLATE_FRAG_ALLOC_EAGER(btl, frag, rc);
if(NULL == frag) {
return NULL;
}
iov.iov_len = max_data;
iov.iov_base = (unsigned char*) frag->segment.seg_addr.pval + reserve;
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data, &free_after);
*size = max_data;
if( rc < 0 ) {
MCA_BTL_TEMPLATE_FRAG_RETURN_EAGER(btl, frag);
return NULL;
}
frag->segment.seg_len = max_data + reserve;
}
/*
* otherwise pack as much data as we can into a fragment
* that is the max send size.
*/
else {
MCA_BTL_TEMPLATE_FRAG_ALLOC_MAX(btl, frag, rc);
if(NULL == frag) {
return NULL;
}
if(max_data + reserve > frag->size){
max_data = frag->size - reserve;
}
iov.iov_len = max_data;
iov.iov_base = (unsigned char*) frag->segment.seg_addr.pval + reserve;
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data, &free_after);
*size = max_data;
if( rc < 0 ) {
MCA_BTL_TEMPLATE_FRAG_RETURN_MAX(btl, frag);
return NULL;
}
frag->segment.seg_len = max_data + reserve;
}
frag->base.des_src = &frag->segment;
frag->base.des_src_cnt = 1;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
return &frag->base;
}
/**
* Prepare a descriptor for send/rdma using the supplied
* convertor. If the convertor references data that is contigous,
* the descriptor may simply point to the user buffer. Otherwise,
* this routine is responsible for allocating buffer space and
* packing if required.
*
* @param btl (IN) BTL module
* @param endpoint (IN) BTL peer addressing
* @param convertor (IN) Data type convertor
* @param reserve (IN) Additional bytes requested by upper layer to precede user data
* @param size (IN/OUT) Number of bytes to prepare (IN), number of bytes actually prepared (OUT)
*/
mca_btl_base_descriptor_t* mca_btl_template_prepare_dst(
struct mca_btl_base_module_t* btl,
struct mca_btl_base_endpoint_t* endpoint,
struct mca_mpool_base_registration_t* registration,
struct ompi_convertor_t* convertor,
size_t reserve,
size_t* size)
{
mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*) btl;
mca_btl_template_frag_t* frag;
int rc;
MCA_BTL_TEMPLATE_FRAG_ALLOC_USER(btl, frag, rc);
if(NULL == frag) {
return NULL;
}
frag->segment.seg_len = *size;
frag->segment.seg_addr.pval = convertor->pBaseBuf + convertor->bConverted;
frag->base.des_src = NULL;
frag->base.des_src_cnt = 0;
frag->base.des_dst = &frag->segment;
frag->base.des_dst_cnt = 1;
frag->base.des_flags = 0;
#if MCA_BTL_HAS_MPOOL
if(NULL != registration) {
size_t reg_len = (unsigned char*)registration->bound - (unsigned char*)frag->segment.seg_addr.pval + 1;
if(frag->segment.seg_len > reg_len) {
mca_mpool_base_module_t* mpool = template_btl->template_mpool;
size_t new_len = (unsigned char*)frag->segment.seg_addr.pval -
(unsigned char*) registration->base +
frag->segment.seg_len;
void* base_addr = registration->base;
/* remove old registration from tree and decrement reference count */
mca_mpool_base_remove(base_addr);
OBJ_RELEASE(registration);
/* re-register at new size */
rc = mpool->mpool_register(
mpool,
base_addr,
new_len,
&registration);
if(rc != OMPI_SUCCESS) {
MCA_BTL_TEMPLATE_FRAG_RETURN_USER(btl,frag);
return NULL;
}
/* re-insert into tree with new registration */
rc = mca_mpool_base_insert(
base_addr,
new_len,
mpool,
btl,
registration);
if(rc != OMPI_SUCCESS) {
MCA_BTL_TEMPLATE_FRAG_RETURN_USER(btl,frag);
OBJ_RELEASE(registration);
return NULL;
}
}
/* bump reference count as so that the registration
* doesn't go away when the operation completes
*/
OBJ_RETAIN(registration);
frag->registration = registration;
} else {
mca_mpool_base_module_t* mpool = template_btl->template_mpool;
rc = mpool->mpool_register(
mpool,
frag->segment.seg_addr.pval,
frag->segment.seg_len,
&registration);
if(rc != OMPI_SUCCESS) {
MCA_BTL_TEMPLATE_FRAG_RETURN_USER(btl,frag);
return NULL;
}
if(mca_btl_template_component.leave_pinned) {
/*
* insert the registration into the tree and bump the reference
* count so that it doesn't go away on completion.
*/
rc = mca_mpool_base_insert(
frag->segment.seg_addr.pval,
frag->segment.seg_len,
mpool,
btl,
registration);
if(rc != OMPI_SUCCESS) {
MCA_BTL_TEMPLATE_FRAG_RETURN_USER(btl,frag);
OBJ_RELEASE(registration);
return NULL;
}
OBJ_RETAIN(registration);
}
frag->registration = registration;
}
#endif
return &frag->base;
}
/**
* Initiate an asynchronous send.
*
* @param btl (IN) BTL module
* @param endpoint (IN) BTL addressing information
* @param descriptor (IN) Description of the data to be transfered
* @param tag (IN) The tag value used to notify the peer.
*/
int mca_btl_template_send(
struct mca_btl_base_module_t* btl,
struct mca_btl_base_endpoint_t* endpoint,
struct mca_btl_base_descriptor_t* descriptor,
mca_btl_base_tag_t tag)
{
/* mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*) btl; */
mca_btl_template_frag_t* frag = (mca_btl_template_frag_t*)descriptor;
frag->endpoint = endpoint;
/* TODO */
return OMPI_ERR_NOT_IMPLEMENTED;
}
/**
* Initiate an asynchronous put.
*
* @param btl (IN) BTL module
* @param endpoint (IN) BTL addressing information
* @param descriptor (IN) Description of the data to be transferred
*/
int mca_btl_template_put(
mca_btl_base_module_t* btl,
mca_btl_base_endpoint_t* endpoint,
mca_btl_base_descriptor_t* descriptor)
{
/* mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*) btl; */
mca_btl_template_frag_t* frag = (mca_btl_template_frag_t*) descriptor;
frag->endpoint = endpoint;
/* TODO */
return OMPI_ERR_NOT_IMPLEMENTED;
}
/**
* Initiate an asynchronous get.
*
* @param btl (IN) BTL module
* @param endpoint (IN) BTL addressing information
* @param descriptor (IN) Description of the data to be transferred
*
*/
int mca_btl_template_get(
mca_btl_base_module_t* btl,
mca_btl_base_endpoint_t* endpoint,
mca_btl_base_descriptor_t* descriptor)
{
/* mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*) btl; */
mca_btl_template_frag_t* frag = (mca_btl_template_frag_t*) descriptor;
frag->endpoint = endpoint;
/* TODO */
return OMPI_ERR_NOT_IMPLEMENTED;
}
/*
* Cleanup/release module resources.
*/
int mca_btl_template_finalize(struct mca_btl_base_module_t* btl)
{
mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*) btl;
if(template_btl->template_frag_eager.fl_num_allocated !=
template_btl->template_frag_eager.super.opal_list_length){
opal_output(0, "btl template_frag_eager: %d allocated %d returned \n",
template_btl->template_frag_eager.fl_num_allocated,
template_btl->template_frag_eager.super.opal_list_length);
}
if(template_btl->template_frag_max.fl_num_allocated !=
template_btl->template_frag_max.super.opal_list_length) {
opal_output(0, "btl template_frag_max: %d allocated %d returned \n",
template_btl->template_frag_max.fl_num_allocated,
template_btl->template_frag_max.super.opal_list_length);
}
if(template_btl->template_frag_user.fl_num_allocated !=
template_btl->template_frag_user.super.opal_list_length){
opal_output(0, "btl template_frag_user: %d allocated %d returned \n",
template_btl->template_frag_user.fl_num_allocated,
template_btl->template_frag_user.super.opal_list_length);
}
OBJ_DESTRUCT(&template_btl->template_lock);
OBJ_DESTRUCT(&template_btl->template_frag_eager);
OBJ_DESTRUCT(&template_btl->template_frag_max);
OBJ_DESTRUCT(&template_btl->template_frag_user);
free(template_btl);
return OMPI_SUCCESS;
}

311
ompi/mca/btl/mx/btl_mx.h Обычный файл
Просмотреть файл

@ -0,0 +1,311 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*/
#ifndef MCA_PTL_TEMPLATE_H
#define MCA_PTL_TEMPLATE_H
/* Standard system includes */
#include <sys/types.h>
#include <string.h>
/* Open MPI includes */
#include "class/ompi_free_list.h"
#include "class/ompi_bitmap.h"
#include "opal/event/event.h"
#include "mca/pml/pml.h"
#include "mca/btl/btl.h"
#include "mca/btl/base/base.h"
#include "opal/util/output.h"
#include "mca/mpool/mpool.h"
#include "mca/btl/btl.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
#define MCA_BTL_HAS_MPOOL 1
/**
* Infiniband (TEMPLATE) BTL component.
*/
struct mca_btl_template_component_t {
mca_btl_base_component_1_0_0_t super; /**< base BTL component */
uint32_t template_num_btls;
/**< number of hcas available to the TEMPLATE component */
struct mca_btl_template_module_t *template_btls;
/**< array of available BTL modules */
int template_free_list_num;
/**< initial size of free lists */
int template_free_list_max;
/**< maximum size of free lists */
int template_free_list_inc;
/**< number of elements to alloc when growing free lists */
opal_list_t template_procs;
/**< list of template proc structures */
opal_mutex_t template_lock;
/**< lock for accessing module state */
char* template_mpool_name;
/**< name of memory pool */
bool leave_pinned;
/**< pin memory on first use and leave pinned */
};
typedef struct mca_btl_template_component_t mca_btl_template_component_t;
extern mca_btl_template_component_t mca_btl_template_component;
/**
* BTL Module Interface
*/
struct mca_btl_template_module_t {
mca_btl_base_module_t super; /**< base BTL interface */
mca_btl_base_recv_reg_t template_reg[MCA_BTL_TAG_MAX];
/* free list of fragment descriptors */
ompi_free_list_t template_frag_eager;
ompi_free_list_t template_frag_max;
ompi_free_list_t template_frag_user;
/* lock for accessing module state */
opal_mutex_t template_lock;
#if MCA_BTL_HAS_MPOOL
struct mca_mpool_base_module_t* template_mpool;
#endif
};
typedef struct mca_btl_template_module_t mca_btl_template_module_t;
extern mca_btl_template_module_t mca_btl_template_module;
/**
* Register TEMPLATE component parameters with the MCA framework
*/
extern int mca_btl_template_component_open(void);
/**
* Any final cleanup before being unloaded.
*/
extern int mca_btl_template_component_close(void);
/**
* TEMPLATE component initialization.
*
* @param num_btl_modules (OUT) Number of BTLs returned in BTL array.
* @param allow_multi_user_threads (OUT) Flag indicating wether BTL supports user threads (TRUE)
* @param have_hidden_threads (OUT) Flag indicating wether BTL uses threads (TRUE)
*/
extern mca_btl_base_module_t** mca_btl_template_component_init(
int *num_btl_modules,
bool allow_multi_user_threads,
bool have_hidden_threads
);
/**
* TEMPLATE component progress.
*/
extern int mca_btl_template_component_progress(void);
/**
* Cleanup any resources held by the BTL.
*
* @param btl BTL instance.
* @return OMPI_SUCCESS or error status on failure.
*/
extern int mca_btl_template_finalize(
struct mca_btl_base_module_t* btl
);
/**
* PML->BTL notification of change in the process list.
*
* @param btl (IN)
* @param nprocs (IN) Number of processes
* @param procs (IN) Set of processes
* @param peers (OUT) Set of (optional) peer addressing info.
* @param peers (IN/OUT) Set of processes that are reachable via this BTL.
* @return OMPI_SUCCESS or error status on failure.
*
*/
extern int mca_btl_template_add_procs(
struct mca_btl_base_module_t* btl,
size_t nprocs,
struct ompi_proc_t **procs,
struct mca_btl_base_endpoint_t** peers,
ompi_bitmap_t* reachable
);
/**
* PML->BTL notification of change in the process list.
*
* @param btl (IN) BTL instance
* @param nproc (IN) Number of processes.
* @param procs (IN) Set of processes.
* @param peers (IN) Set of peer data structures.
* @return Status indicating if cleanup was successful
*
*/
extern int mca_btl_template_del_procs(
struct mca_btl_base_module_t* btl,
size_t nprocs,
struct ompi_proc_t **procs,
struct mca_btl_base_endpoint_t** peers
);
/**
* Initiate an asynchronous send.
*
* @param btl (IN) BTL module
* @param endpoint (IN) BTL addressing information
* @param descriptor (IN) Description of the data to be transfered
* @param tag (IN) The tag value used to notify the peer.
*/
extern int mca_btl_template_send(
struct mca_btl_base_module_t* btl,
struct mca_btl_base_endpoint_t* btl_peer,
struct mca_btl_base_descriptor_t* descriptor,
mca_btl_base_tag_t tag
);
/**
* Initiate an asynchronous put.
*
* @param btl (IN) BTL module
* @param endpoint (IN) BTL addressing information
* @param descriptor (IN) Description of the data to be transferred
*/
extern int mca_btl_template_put(
struct mca_btl_base_module_t* btl,
struct mca_btl_base_endpoint_t* btl_peer,
struct mca_btl_base_descriptor_t* decriptor
);
/**
* Initiate an asynchronous get.
*
* @param btl (IN) BTL module
* @param endpoint (IN) BTL addressing information
* @param descriptor (IN) Description of the data to be transferred
*/
extern int mca_btl_template_get(
struct mca_btl_base_module_t* btl,
struct mca_btl_base_endpoint_t* btl_peer,
struct mca_btl_base_descriptor_t* decriptor
);
/**
* Register a callback function that is called on receipt
* of a fragment.
*
* @param btl (IN) BTL module
* @return Status indicating if registration was successful
*
*/
extern int mca_btl_template_register(
struct mca_btl_base_module_t* btl,
mca_btl_base_tag_t tag,
mca_btl_base_module_recv_cb_fn_t cbfunc,
void* cbdata);
/**
* Allocate a descriptor with a segment of the requested size.
* Note that the BTL layer may choose to return a smaller size
* if it cannot support the request.
*
* @param btl (IN) BTL module
* @param size (IN) Request segment size.
*/
extern mca_btl_base_descriptor_t* mca_btl_template_alloc(
struct mca_btl_base_module_t* btl,
size_t size);
/**
* Return a segment allocated by this BTL.
*
* @param btl (IN) BTL module
* @param descriptor (IN) Allocated descriptor.
*/
extern int mca_btl_template_free(
struct mca_btl_base_module_t* btl,
mca_btl_base_descriptor_t* des);
/**
* Prepare a descriptor for send/rdma using the supplied
* convertor. If the convertor references data that is contigous,
* the descriptor may simply point to the user buffer. Otherwise,
* this routine is responsible for allocating buffer space and
* packing if required.
*
* @param btl (IN) BTL module
* @param endpoint (IN) BTL peer addressing
* @param convertor (IN) Data type convertor
* @param reserve (IN) Additional bytes requested by upper layer to precede user data
* @param size (IN/OUT) Number of bytes to prepare (IN), number of bytes actually prepared (OUT)
*/
mca_btl_base_descriptor_t* mca_btl_template_prepare_src(
struct mca_btl_base_module_t* btl,
struct mca_btl_base_endpoint_t* peer,
struct mca_mpool_base_registration_t*,
struct ompi_convertor_t* convertor,
size_t reserve,
size_t* size
);
extern mca_btl_base_descriptor_t* mca_btl_template_prepare_dst(
struct mca_btl_base_module_t* btl,
struct mca_btl_base_endpoint_t* peer,
struct mca_mpool_base_registration_t*,
struct ompi_convertor_t* convertor,
size_t reserve,
size_t* size);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif

168
ompi/mca/btl/mx/btl_mx_component.c Обычный файл
Просмотреть файл

@ -0,0 +1,168 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "include/constants.h"
#include "opal/event/event.h"
#include "opal/util/if.h"
#include "opal/util/argv.h"
#include "opal/util/output.h"
#include "mca/pml/pml.h"
#include "mca/btl/btl.h"
#include "mca/base/mca_base_param.h"
#include "mca/pml/base/pml_base_module_exchange.h"
#include "mca/errmgr/errmgr.h"
#include "mca/mpool/base/base.h"
#include "btl_template.h"
#include "btl_template_frag.h"
#include "btl_template_endpoint.h"
#include "mca/btl/base/base.h"
#include "datatype/convertor.h"
mca_btl_template_component_t mca_btl_template_component = {
{
/* First, the mca_base_component_t struct containing meta information
about the component itself */
{
/* Indicate that we are a pml v1.0.0 component (which also implies a
specific MCA version) */
MCA_BTL_BASE_VERSION_1_0_0,
"ib", /* MCA component name */
OMPI_MAJOR_VERSION, /* MCA component major version */
OMPI_MINOR_VERSION, /* MCA component minor version */
OMPI_RELEASE_VERSION, /* MCA component release version */
mca_btl_template_component_open, /* component open */
mca_btl_template_component_close /* component close */
},
/* Next the MCA v1.0.0 component meta data */
{
/* Whether the component is checkpointable or not */
false
},
mca_btl_template_component_init,
mca_btl_template_component_progress,
}
};
/*
* utility routines for parameter registration
*/
static inline char* mca_btl_template_param_register_string(
const char* param_name,
const char* default_value)
{
char *param_value;
int id = mca_base_param_register_string("btl","ib",param_name,NULL,default_value);
mca_base_param_lookup_string(id, &param_value);
return param_value;
}
static inline int mca_btl_template_param_register_int(
const char* param_name,
int default_value)
{
int id = mca_base_param_register_int("btl","ib",param_name,NULL,default_value);
int param_value = default_value;
mca_base_param_lookup_int(id,&param_value);
return param_value;
}
/*
* Called by MCA framework to open the component, registers
* component parameters.
*/
int mca_btl_template_component_open(void)
{
/* initialize state */
mca_btl_template_component.template_num_btls=0;
mca_btl_template_component.template_btls=NULL;
/* initialize objects */
OBJ_CONSTRUCT(&mca_btl_template_component.template_procs, opal_list_t);
/* register TEMPLATE component parameters */
mca_btl_template_component.template_free_list_num =
mca_btl_template_param_register_int ("free_list_num", 8);
mca_btl_template_component.template_free_list_max =
mca_btl_template_param_register_int ("free_list_max", 1024);
mca_btl_template_component.template_free_list_inc =
mca_btl_template_param_register_int ("free_list_inc", 32);
mca_btl_template_component.template_mpool_name =
mca_btl_template_param_register_string("mpool", "ib");
mca_btl_template_module.super.btl_exclusivity =
mca_btl_template_param_register_int ("exclusivity", 0);
mca_btl_template_module.super.btl_eager_limit =
mca_btl_template_param_register_int ("first_frag_size", 64*1024) - sizeof(mca_btl_base_header_t);
mca_btl_template_module.super.btl_min_send_size =
mca_btl_template_param_register_int ("min_send_size", 64*1024) - sizeof(mca_btl_base_header_t);
mca_btl_template_module.super.btl_max_send_size =
mca_btl_template_param_register_int ("max_send_size", 128*1024) - sizeof(mca_btl_base_header_t);
mca_btl_template_module.super.btl_min_rdma_size =
mca_btl_template_param_register_int("min_rdma_size", 1024*1024);
mca_btl_template_module.super.btl_max_rdma_size =
mca_btl_template_param_register_int("max_rdma_size", 1024*1024);
mca_btl_template_module.super.btl_flags =
mca_btl_template_param_register_int("flags", MCA_BTL_FLAGS_RDMA);
return OMPI_SUCCESS;
}
/*
* component cleanup - sanity checking of queue lengths
*/
int mca_btl_template_component_close(void)
{
return OMPI_SUCCESS;
}
/*
* TEMPLATE component initialization:
* (1) read interface list from kernel and compare against component parameters
* then create a BTL instance for selected interfaces
* (2) setup TEMPLATE listen socket for incoming connection attempts
* (3) register BTL parameters with the MCA
*/
mca_btl_base_module_t** mca_btl_template_component_init(int *num_btl_modules,
bool enable_progress_threads,
bool enable_mpi_threads)
{
return NULL;
}
/*
* TEMPLATE component progress.
*/
int mca_btl_template_component_progress()
{
return 0;
}

59
ompi/mca/btl/mx/btl_mx_endpoint.c Обычный файл
Просмотреть файл

@ -0,0 +1,59 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <sys/time.h>
#include <time.h>
#include "include/types.h"
#include "mca/ns/base/base.h"
#include "mca/oob/base/base.h"
#include "mca/rml/rml.h"
#include "mca/errmgr/errmgr.h"
#include "dps/dps.h"
#include "btl_template.h"
#include "btl_template_endpoint.h"
#include "btl_template_proc.h"
#include "btl_template_frag.h"
/*
* Initialize state of the endpoint instance.
*
*/
static void mca_btl_template_endpoint_construct(mca_btl_base_endpoint_t* endpoint)
{
endpoint->endpoint_btl = 0;
endpoint->endpoint_proc = 0;
}
/*
* Destroy a endpoint
*
*/
static void mca_btl_template_endpoint_destruct(mca_btl_base_endpoint_t* endpoint)
{
}
OBJ_CLASS_INSTANCE(
mca_btl_template_endpoint_t,
opal_list_item_t,
mca_btl_template_endpoint_construct,
mca_btl_template_endpoint_destruct);

56
ompi/mca/btl/mx/btl_mx_endpoint.h Обычный файл
Просмотреть файл

@ -0,0 +1,56 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef MCA_BTL_TEMPLATE_ENDPOINT_H
#define MCA_BTL_TEMPLATE_ENDPOINT_H
#include "opal/class/opal_list.h"
#include "opal/event/event.h"
#include "mca/pml/pml.h"
#include "mca/btl/btl.h"
#include "btl_template_frag.h"
#include "btl_template.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
OBJ_CLASS_DECLARATION(mca_btl_template_endpoint_t);
/**
* An abstraction that represents a connection to a endpoint process.
* An instance of mca_btl_base_endpoint_t is associated w/ each process
* and BTL pair at startup. However, connections to the endpoint
* are established dynamically on an as-needed basis:
*/
struct mca_btl_base_endpoint_t {
opal_list_item_t super;
struct mca_btl_template_module_t* endpoint_btl;
/**< BTL instance that created this connection */
struct mca_btl_template_proc_t* endpoint_proc;
/**< proc structure corresponding to endpoint */
};
typedef struct mca_btl_base_endpoint_t mca_btl_base_endpoint_t;
typedef mca_btl_base_endpoint_t mca_btl_template_endpoint_t;
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif

58
ompi/mca/btl/mx/btl_mx_frag.c Обычный файл
Просмотреть файл

@ -0,0 +1,58 @@
#include "btl_template_frag.h"
static void mca_btl_template_frag_common_constructor(mca_btl_template_frag_t* frag)
{
mca_btl_template_frag_common_constructor(frag);
frag->base.des_src = NULL;
frag->base.des_src_cnt = 0;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
}
static void mca_btl_template_frag_eager_constructor(mca_btl_template_frag_t* frag)
{
frag->registration = NULL;
frag->size = mca_btl_template_module.super.btl_eager_limit;
mca_btl_template_frag_common_constructor(frag);
}
static void mca_btl_template_frag_max_constructor(mca_btl_template_frag_t* frag)
{
frag->registration = NULL;
frag->size = mca_btl_template_module.super.btl_max_send_size;
mca_btl_template_frag_common_constructor(frag);
}
static void mca_btl_template_frag_user_constructor(mca_btl_template_frag_t* frag)
{
frag->size = 0;
mca_btl_template_frag_common_constructor(frag);
}
OBJ_CLASS_INSTANCE(
mca_btl_template_frag_t,
mca_btl_base_descriptor_t,
NULL,
NULL);
OBJ_CLASS_INSTANCE(
mca_btl_template_frag_eager_t,
mca_btl_base_descriptor_t,
mca_btl_template_frag_eager_constructor,
NULL);
OBJ_CLASS_INSTANCE(
mca_btl_template_frag_max_t,
mca_btl_base_descriptor_t,
mca_btl_template_frag_max_constructor,
NULL);
OBJ_CLASS_INSTANCE(
mca_btl_template_frag_user_t,
mca_btl_base_descriptor_t,
mca_btl_template_frag_user_constructor,
NULL);

114
ompi/mca/btl/mx/btl_mx_frag.h Обычный файл
Просмотреть файл

@ -0,0 +1,114 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef MCA_BTL_TEMPLATE_FRAG_H
#define MCA_BTL_TEMPLATE_FRAG_H
#define MCA_BTL_TEMPLATE_FRAG_ALIGN (8)
#include "ompi_config.h"
#include "btl_template.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_btl_template_frag_t);
/**
* TEMPLATE send fratemplateent derived type.
*/
struct mca_btl_template_frag_t {
mca_btl_base_descriptor_t base;
mca_btl_base_segment_t segment;
struct mca_btl_base_endpoint_t *endpoint;
mca_btl_base_header_t *hdr;
size_t size;
#if MCA_BTL_HAS_MPOOL
struct mca_mpool_base_registration_t* registration;
#endif
};
typedef struct mca_btl_template_frag_t mca_btl_template_frag_t;
OBJ_CLASS_DECLARATION(mca_btl_template_frag_t);
typedef struct mca_btl_template_frag_t mca_btl_template_frag_eager_t;
OBJ_CLASS_DECLARATION(mca_btl_template_frag_eager_t);
typedef struct mca_btl_template_frag_t mca_btl_template_frag_max_t;
OBJ_CLASS_DECLARATION(mca_btl_template_frag_max_t);
typedef struct mca_btl_template_frag_t mca_btl_template_frag_user_t;
OBJ_CLASS_DECLARATION(mca_btl_template_frag_user_t);
/*
* Macros to allocate/return descriptors from module specific
* free list(s).
*/
#define MCA_BTL_TEMPLATE_FRAG_ALLOC_EAGER(btl, frag, rc) \
{ \
\
opal_list_item_t *item; \
OMPI_FREE_LIST_WAIT(&((mca_btl_template_module_t*)btl)->template_frag_eager, item, rc); \
frag = (mca_btl_template_frag_t*) item; \
}
#define MCA_BTL_TEMPLATE_FRAG_RETURN_EAGER(btl, frag) \
{ \
OMPI_FREE_LIST_RETURN(&((mca_btl_template_module_t*)btl)->template_frag_eager, \
(opal_list_item_t*)(frag)); \
}
#define MCA_BTL_TEMPLATE_FRAG_ALLOC_MAX(btl, frag, rc) \
{ \
\
opal_list_item_t *item; \
OMPI_FREE_LIST_WAIT(&((mca_btl_template_module_t*)btl)->template_frag_max, item, rc); \
frag = (mca_btl_template_frag_t*) item; \
}
#define MCA_BTL_TEMPLATE_FRAG_RETURN_MAX(btl, frag) \
{ \
OMPI_FREE_LIST_RETURN(&((mca_btl_template_module_t*)btl)->template_frag_max, \
(opal_list_item_t*)(frag)); \
}
#define MCA_BTL_TEMPLATE_FRAG_ALLOC_USER(btl, frag, rc) \
{ \
opal_list_item_t *item; \
OMPI_FREE_LIST_WAIT(&((mca_btl_template_module_t*)btl)->template_frag_user, item, rc); \
frag = (mca_btl_template_frag_t*) item; \
}
#define MCA_BTL_TEMPLATE_FRAG_RETURN_USER(btl, frag) \
{ \
OMPI_FREE_LIST_RETURN(&((mca_btl_template_module_t*)btl)->template_frag_user, \
(opal_list_item_t*)(frag)); \
}
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif

160
ompi/mca/btl/mx/btl_mx_proc.c Обычный файл
Просмотреть файл

@ -0,0 +1,160 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "class/opal_hash_table.h"
#include "mca/pml/base/pml_base_module_exchange.h"
#include "btl_template.h"
#include "btl_template_proc.h"
static void mca_btl_template_proc_construct(mca_btl_template_proc_t* proc);
static void mca_btl_template_proc_destruct(mca_btl_template_proc_t* proc);
OBJ_CLASS_INSTANCE(mca_btl_template_proc_t,
opal_list_item_t, mca_btl_template_proc_construct,
mca_btl_template_proc_destruct);
void mca_btl_template_proc_construct(mca_btl_template_proc_t* proc)
{
proc->proc_ompi = 0;
proc->proc_addr_count = 0;
proc->proc_endpoints = 0;
proc->proc_endpoint_count = 0;
OBJ_CONSTRUCT(&proc->proc_lock, opal_mutex_t);
/* add to list of all proc instance */
OPAL_THREAD_LOCK(&mca_btl_template_component.template_lock);
opal_list_append(&mca_btl_template_component.template_procs, &proc->super);
OPAL_THREAD_UNLOCK(&mca_btl_template_component.template_lock);
}
/*
* Cleanup ib proc instance
*/
void mca_btl_template_proc_destruct(mca_btl_template_proc_t* proc)
{
/* remove from list of all proc instances */
OPAL_THREAD_LOCK(&mca_btl_template_component.template_lock);
opal_list_remove_item(&mca_btl_template_component.template_procs, &proc->super);
OPAL_THREAD_UNLOCK(&mca_btl_template_component.template_lock);
/* release resources */
if(NULL != proc->proc_endpoints) {
free(proc->proc_endpoints);
}
}
/*
* Look for an existing TEMPLATE process instances based on the associated
* ompi_proc_t instance.
*/
static mca_btl_template_proc_t* mca_btl_template_proc_lookup_ompi(ompi_proc_t* ompi_proc)
{
mca_btl_template_proc_t* template_proc;
OPAL_THREAD_LOCK(&mca_btl_template_component.template_lock);
for(template_proc = (mca_btl_template_proc_t*)
opal_list_get_first(&mca_btl_template_component.template_procs);
template_proc != (mca_btl_template_proc_t*)
opal_list_get_end(&mca_btl_template_component.template_procs);
template_proc = (mca_btl_template_proc_t*)opal_list_get_next(template_proc)) {
if(template_proc->proc_ompi == ompi_proc) {
OPAL_THREAD_UNLOCK(&mca_btl_template_component.template_lock);
return template_proc;
}
}
OPAL_THREAD_UNLOCK(&mca_btl_template_component.template_lock);
return NULL;
}
/*
* Create a TEMPLATE process structure. There is a one-to-one correspondence
* between a ompi_proc_t and a mca_btl_template_proc_t instance. We cache
* additional data (specifically the list of mca_btl_template_endpoint_t instances,
* and published addresses) associated w/ a given destination on this
* datastructure.
*/
mca_btl_template_proc_t* mca_btl_template_proc_create(ompi_proc_t* ompi_proc)
{
mca_btl_template_proc_t* module_proc = NULL;
/* Check if we have already created a TEMPLATE proc
* structure for this ompi process */
module_proc = mca_btl_template_proc_lookup_ompi(ompi_proc);
if(module_proc != NULL) {
/* Gotcha! */
return module_proc;
}
/* Oops! First time, gotta create a new TEMPLATE proc
* out of the ompi_proc ... */
module_proc = OBJ_NEW(mca_btl_template_proc_t);
/* Initialize number of peer */
module_proc->proc_endpoint_count = 0;
module_proc->proc_ompi = ompi_proc;
/* build a unique identifier (of arbitrary
* size) to represent the proc */
module_proc->proc_guid = ompi_proc->proc_name;
/* TEMPLATE module doesn't have addresses exported at
* initialization, so the addr_count is set to one. */
module_proc->proc_addr_count = 1;
/* XXX: Right now, there can be only 1 peer associated
* with a proc. Needs a little bit change in
* mca_btl_template_proc_t to allow on demand increasing of
* number of endpoints for this proc */
module_proc->proc_endpoints = (mca_btl_base_endpoint_t**)
malloc(module_proc->proc_addr_count * sizeof(mca_btl_base_endpoint_t*));
if(NULL == module_proc->proc_endpoints) {
OBJ_RELEASE(module_proc);
return NULL;
}
return module_proc;
}
/*
* Note that this routine must be called with the lock on the process
* already held. Insert a btl instance into the proc array and assign
* it an address.
*/
int mca_btl_template_proc_insert(mca_btl_template_proc_t* module_proc,
mca_btl_base_endpoint_t* module_endpoint)
{
/* insert into endpoint array */
module_endpoint->endpoint_proc = module_proc;
module_proc->proc_endpoints[module_proc->proc_endpoint_count++] = module_endpoint;
return OMPI_SUCCESS;
}

67
ompi/mca/btl/mx/btl_mx_proc.h Обычный файл
Просмотреть файл

@ -0,0 +1,67 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef MCA_BTL_TEMPLATE_PROC_H
#define MCA_BTL_TEMPLATE_PROC_H
#include "mca/ns/ns.h"
#include "opal/class/opal_object.h"
#include "proc/proc.h"
#include "btl_template.h"
#include "btl_template_endpoint.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
OBJ_CLASS_DECLARATION(mca_btl_template_proc_t);
/**
* Represents the state of a remote process and the set of addresses
* that it exports. Also cache an instance of mca_btl_base_endpoint_t for
* each
* BTL instance that attempts to open a connection to the process.
*/
struct mca_btl_template_proc_t {
opal_list_item_t super;
/**< allow proc to be placed on a list */
ompi_proc_t *proc_ompi;
/**< pointer to corresponding ompi_proc_t */
orte_process_name_t proc_guid;
/**< globally unique identifier for the process */
size_t proc_addr_count;
/**< number of addresses published by endpoint */
struct mca_btl_base_endpoint_t **proc_endpoints;
/**< array of endpoints that have been created to access this proc */
size_t proc_endpoint_count;
/**< number of endpoints */
opal_mutex_t proc_lock;
/**< lock to protect against concurrent access to proc state */
};
typedef struct mca_btl_template_proc_t mca_btl_template_proc_t;
mca_btl_template_proc_t* mca_btl_template_proc_create(ompi_proc_t* ompi_proc);
int mca_btl_template_proc_insert(mca_btl_template_proc_t*, mca_btl_base_endpoint_t*);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif

22
ompi/mca/btl/mx/configure.params Обычный файл
Просмотреть файл

@ -0,0 +1,22 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University.
# All rights reserved.
# Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
# All rights reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# Specific to this module
PARAM_INIT_FILE=btl_mx.c
PARAM_CONFIG_HEADER_FILE="mx_config.h"
PARAM_CONFIG_FILES="Makefile"