The second cut of MX ... still not working yet
This commit was SVN r6666.
Этот коммит содержится в:
родитель
c4f0c14407
Коммит
c8bc529df4
@ -21,18 +21,18 @@
|
||||
#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 "btl_mx.h"
|
||||
#include "btl_mx_frag.h"
|
||||
#include "btl_mx_proc.h"
|
||||
#include "btl_mx_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_mx_module_t mca_btl_mx_module = {
|
||||
{
|
||||
&mca_btl_template_component.super,
|
||||
&mca_btl_mx_component.super,
|
||||
0, /* max size of first fragment */
|
||||
0, /* min send fragment size */
|
||||
0, /* max send fragment size */
|
||||
@ -42,16 +42,16 @@ mca_btl_template_module_t mca_btl_template_module = {
|
||||
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,
|
||||
mca_btl_mx_add_procs,
|
||||
mca_btl_mx_del_procs,
|
||||
mca_btl_mx_register,
|
||||
mca_btl_mx_finalize,
|
||||
mca_btl_mx_alloc,
|
||||
mca_btl_mx_free,
|
||||
mca_btl_mx_prepare_src,
|
||||
mca_btl_mx_prepare_dst,
|
||||
mca_btl_mx_send,
|
||||
mca_btl_mx_put,
|
||||
NULL /* get */
|
||||
}
|
||||
};
|
||||
@ -60,23 +60,23 @@ mca_btl_template_module_t mca_btl_template_module = {
|
||||
*
|
||||
*/
|
||||
|
||||
int mca_btl_template_add_procs(
|
||||
int mca_btl_mx_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;
|
||||
mca_btl_mx_module_t* mx_btl = (mca_btl_mx_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;
|
||||
mca_btl_mx_proc_t* mx_proc;
|
||||
mca_btl_base_endpoint_t* mx_endpoint;
|
||||
|
||||
if(NULL == (template_proc = mca_btl_template_proc_create(ompi_proc))) {
|
||||
if(NULL == (mx_proc = mca_btl_mx_proc_create(ompi_proc))) {
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
@ -86,35 +86,35 @@ int mca_btl_template_add_procs(
|
||||
* don't bind this PTL instance to the proc.
|
||||
*/
|
||||
|
||||
OPAL_THREAD_LOCK(&template_proc->proc_lock);
|
||||
OPAL_THREAD_LOCK(&mx_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) {
|
||||
mx_endpoint = OBJ_NEW(mca_btl_mx_endpoint_t);
|
||||
if(NULL == mx_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);
|
||||
mx_endpoint->endpoint_btl = mx_btl;
|
||||
rc = mca_btl_mx_proc_insert(mx_proc, mx_endpoint);
|
||||
if(rc != OMPI_SUCCESS) {
|
||||
OBJ_RELEASE(template_endpoint);
|
||||
OBJ_RELEASE(mx_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;
|
||||
peers[i] = mx_endpoint;
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int mca_btl_template_del_procs(struct mca_btl_base_module_t* btl,
|
||||
int mca_btl_mx_del_procs(struct mca_btl_base_module_t* btl,
|
||||
size_t nprocs,
|
||||
struct ompi_proc_t **procs,
|
||||
struct mca_btl_base_endpoint_t ** peers)
|
||||
@ -128,15 +128,15 @@ int mca_btl_template_del_procs(struct mca_btl_base_module_t* btl,
|
||||
* Register callback function to support send/recv semantics
|
||||
*/
|
||||
|
||||
int mca_btl_template_register(
|
||||
int mca_btl_mx_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;
|
||||
mca_btl_mx_module_t* mx_btl = (mca_btl_mx_module_t*) btl;
|
||||
mx_btl->mx_reg[tag].cbfunc = cbfunc;
|
||||
mx_btl->mx_reg[tag].cbdata = cbdata;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -148,21 +148,21 @@ int mca_btl_template_register(
|
||||
* @param size (IN) Request segment size.
|
||||
*/
|
||||
|
||||
mca_btl_base_descriptor_t* mca_btl_template_alloc(
|
||||
mca_btl_base_descriptor_t* mca_btl_mx_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;
|
||||
mca_btl_mx_module_t* mx_btl = (mca_btl_mx_module_t*) btl;
|
||||
mca_btl_mx_frag_t* frag;
|
||||
int rc;
|
||||
|
||||
if(size <= btl->btl_eager_limit){
|
||||
MCA_BTL_TEMPLATE_FRAG_ALLOC_EAGER(template_btl, frag, rc);
|
||||
MCA_BTL_TEMPLATE_FRAG_ALLOC_EAGER(mx_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);
|
||||
MCA_BTL_TEMPLATE_FRAG_ALLOC_MAX(mx_btl, frag, rc);
|
||||
frag->segment.seg_len =
|
||||
size <= btl->btl_max_send_size ?
|
||||
size : btl->btl_max_send_size ;
|
||||
@ -177,11 +177,11 @@ mca_btl_base_descriptor_t* mca_btl_template_alloc(
|
||||
* Return a segment
|
||||
*/
|
||||
|
||||
int mca_btl_template_free(
|
||||
int mca_btl_mx_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;
|
||||
mca_btl_mx_frag_t* frag = (mca_btl_mx_frag_t*)des;
|
||||
if(frag->size == 0) {
|
||||
#if MCA_BTL_HAS_MPOOL
|
||||
OBJ_RELEASE(frag->registration);
|
||||
@ -204,7 +204,7 @@ int mca_btl_template_free(
|
||||
* @param btl (IN) BTL module
|
||||
* @param peer (IN) BTL peer addressing
|
||||
*/
|
||||
mca_btl_base_descriptor_t* mca_btl_template_prepare_src(
|
||||
mca_btl_base_descriptor_t* mca_btl_mx_prepare_src(
|
||||
struct mca_btl_base_module_t* btl,
|
||||
struct mca_btl_base_endpoint_t* endpoint,
|
||||
struct mca_mpool_base_registration_t* registration,
|
||||
@ -213,8 +213,8 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_src(
|
||||
size_t* size
|
||||
)
|
||||
{
|
||||
mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*)btl;
|
||||
mca_btl_template_frag_t* frag;
|
||||
mca_btl_mx_module_t* mx_btl = (mca_btl_mx_module_t*)btl;
|
||||
mca_btl_mx_frag_t* frag;
|
||||
struct iovec iov;
|
||||
uint32_t iov_count = 1;
|
||||
size_t max_data = *size;
|
||||
@ -229,7 +229,7 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_src(
|
||||
if (NULL != registration && 0 == ompi_convertor_need_buffers(convertor)) {
|
||||
|
||||
size_t reg_len;
|
||||
MCA_BTL_TEMPLATE_FRAG_ALLOC_USER(template_btl, frag, rc);
|
||||
MCA_BTL_TEMPLATE_FRAG_ALLOC_USER(mx_btl, frag, rc);
|
||||
if(NULL == frag){
|
||||
return NULL;
|
||||
}
|
||||
@ -244,7 +244,7 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_src(
|
||||
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;
|
||||
mca_mpool_base_module_t* mpool = mx_btl->mx_mpool;
|
||||
size_t new_len = (unsigned char*)iov.iov_base -
|
||||
(unsigned char *) registration->base + max_data;
|
||||
void* base_addr = registration->base;
|
||||
@ -289,12 +289,12 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_src(
|
||||
* 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) &&
|
||||
} else if ((mca_btl_mx_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);
|
||||
mca_mpool_base_module_t* mpool = mx_btl->mx_mpool;
|
||||
MCA_BTL_TEMPLATE_FRAG_ALLOC_USER(mx_btl, frag, rc);
|
||||
if(NULL == frag){
|
||||
return NULL;
|
||||
}
|
||||
@ -316,7 +316,7 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_src(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(mca_btl_template_component.leave_pinned) {
|
||||
if(mca_btl_mx_component.leave_pinned) {
|
||||
/*
|
||||
* insert the registration into the tree and bump the reference
|
||||
* count so that it doesn't go away on completion.
|
||||
@ -411,7 +411,7 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_src(
|
||||
* @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(
|
||||
mca_btl_base_descriptor_t* mca_btl_mx_prepare_dst(
|
||||
struct mca_btl_base_module_t* btl,
|
||||
struct mca_btl_base_endpoint_t* endpoint,
|
||||
struct mca_mpool_base_registration_t* registration,
|
||||
@ -419,8 +419,8 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_dst(
|
||||
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;
|
||||
mca_btl_mx_module_t* mx_btl = (mca_btl_mx_module_t*) btl;
|
||||
mca_btl_mx_frag_t* frag;
|
||||
int rc;
|
||||
|
||||
MCA_BTL_TEMPLATE_FRAG_ALLOC_USER(btl, frag, rc);
|
||||
@ -441,7 +441,7 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_dst(
|
||||
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;
|
||||
mca_mpool_base_module_t* mpool = mx_btl->mx_mpool;
|
||||
size_t new_len = (unsigned char*)frag->segment.seg_addr.pval -
|
||||
(unsigned char*) registration->base +
|
||||
frag->segment.seg_len;
|
||||
@ -484,7 +484,7 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_dst(
|
||||
|
||||
} else {
|
||||
|
||||
mca_mpool_base_module_t* mpool = template_btl->template_mpool;
|
||||
mca_mpool_base_module_t* mpool = mx_btl->mx_mpool;
|
||||
rc = mpool->mpool_register(
|
||||
mpool,
|
||||
frag->segment.seg_addr.pval,
|
||||
@ -495,7 +495,7 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_dst(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(mca_btl_template_component.leave_pinned) {
|
||||
if(mca_btl_mx_component.leave_pinned) {
|
||||
/*
|
||||
* insert the registration into the tree and bump the reference
|
||||
* count so that it doesn't go away on completion.
|
||||
@ -529,15 +529,15 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_dst(
|
||||
* @param tag (IN) The tag value used to notify the peer.
|
||||
*/
|
||||
|
||||
int mca_btl_template_send(
|
||||
int mca_btl_mx_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;
|
||||
/* mca_btl_mx_module_t* mx_btl = (mca_btl_mx_module_t*) btl; */
|
||||
mca_btl_mx_frag_t* frag = (mca_btl_mx_frag_t*)descriptor;
|
||||
frag->endpoint = endpoint;
|
||||
/* TODO */
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
@ -552,13 +552,13 @@ int mca_btl_template_send(
|
||||
* @param descriptor (IN) Description of the data to be transferred
|
||||
*/
|
||||
|
||||
int mca_btl_template_put(
|
||||
int mca_btl_mx_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;
|
||||
/* mca_btl_mx_module_t* mx_btl = (mca_btl_mx_module_t*) btl; */
|
||||
mca_btl_mx_frag_t* frag = (mca_btl_mx_frag_t*) descriptor;
|
||||
frag->endpoint = endpoint;
|
||||
/* TODO */
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
@ -574,13 +574,13 @@ int mca_btl_template_put(
|
||||
*
|
||||
*/
|
||||
|
||||
int mca_btl_template_get(
|
||||
int mca_btl_mx_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;
|
||||
/* mca_btl_mx_module_t* mx_btl = (mca_btl_mx_module_t*) btl; */
|
||||
mca_btl_mx_frag_t* frag = (mca_btl_mx_frag_t*) descriptor;
|
||||
frag->endpoint = endpoint;
|
||||
/* TODO */
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
@ -591,34 +591,34 @@ int mca_btl_template_get(
|
||||
* Cleanup/release module resources.
|
||||
*/
|
||||
|
||||
int mca_btl_template_finalize(struct mca_btl_base_module_t* btl)
|
||||
int mca_btl_mx_finalize(struct mca_btl_base_module_t* btl)
|
||||
{
|
||||
mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*) btl;
|
||||
mca_btl_mx_module_t* mx_btl = (mca_btl_mx_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(mx_btl->mx_frag_eager.fl_num_allocated !=
|
||||
mx_btl->mx_frag_eager.super.opal_list_length){
|
||||
opal_output(0, "btl mx_frag_eager: %d allocated %d returned \n",
|
||||
mx_btl->mx_frag_eager.fl_num_allocated,
|
||||
mx_btl->mx_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(mx_btl->mx_frag_max.fl_num_allocated !=
|
||||
mx_btl->mx_frag_max.super.opal_list_length) {
|
||||
opal_output(0, "btl mx_frag_max: %d allocated %d returned \n",
|
||||
mx_btl->mx_frag_max.fl_num_allocated,
|
||||
mx_btl->mx_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);
|
||||
if(mx_btl->mx_frag_user.fl_num_allocated !=
|
||||
mx_btl->mx_frag_user.super.opal_list_length){
|
||||
opal_output(0, "btl mx_frag_user: %d allocated %d returned \n",
|
||||
mx_btl->mx_frag_user.fl_num_allocated,
|
||||
mx_btl->mx_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);
|
||||
OBJ_DESTRUCT(&mx_btl->mx_lock);
|
||||
OBJ_DESTRUCT(&mx_btl->mx_frag_eager);
|
||||
OBJ_DESTRUCT(&mx_btl->mx_frag_max);
|
||||
OBJ_DESTRUCT(&mx_btl->mx_frag_user);
|
||||
free(mx_btl);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -45,74 +45,74 @@ extern "C" {
|
||||
* Infiniband (TEMPLATE) BTL component.
|
||||
*/
|
||||
|
||||
struct mca_btl_template_component_t {
|
||||
struct mca_btl_mx_component_t {
|
||||
mca_btl_base_component_1_0_0_t super; /**< base BTL component */
|
||||
|
||||
uint32_t template_num_btls;
|
||||
uint32_t mx_num_btls;
|
||||
/**< number of hcas available to the TEMPLATE component */
|
||||
|
||||
struct mca_btl_template_module_t *template_btls;
|
||||
struct mca_btl_mx_module_t *mx_btls;
|
||||
/**< array of available BTL modules */
|
||||
|
||||
int template_free_list_num;
|
||||
int mx_free_list_num;
|
||||
/**< initial size of free lists */
|
||||
|
||||
int template_free_list_max;
|
||||
int mx_free_list_max;
|
||||
/**< maximum size of free lists */
|
||||
|
||||
int template_free_list_inc;
|
||||
int mx_free_list_inc;
|
||||
/**< number of elements to alloc when growing free lists */
|
||||
|
||||
opal_list_t template_procs;
|
||||
/**< list of template proc structures */
|
||||
opal_list_t mx_procs;
|
||||
/**< list of mx proc structures */
|
||||
|
||||
opal_mutex_t template_lock;
|
||||
opal_mutex_t mx_lock;
|
||||
/**< lock for accessing module state */
|
||||
|
||||
char* template_mpool_name;
|
||||
char* mx_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;
|
||||
typedef struct mca_btl_mx_component_t mca_btl_mx_component_t;
|
||||
|
||||
extern mca_btl_template_component_t mca_btl_template_component;
|
||||
extern mca_btl_mx_component_t mca_btl_mx_component;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* BTL Module Interface
|
||||
*/
|
||||
struct mca_btl_template_module_t {
|
||||
struct mca_btl_mx_module_t {
|
||||
mca_btl_base_module_t super; /**< base BTL interface */
|
||||
mca_btl_base_recv_reg_t template_reg[MCA_BTL_TAG_MAX];
|
||||
mca_btl_base_recv_reg_t mx_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;
|
||||
ompi_free_list_t mx_frag_eager;
|
||||
ompi_free_list_t mx_frag_max;
|
||||
ompi_free_list_t mx_frag_user;
|
||||
|
||||
/* lock for accessing module state */
|
||||
opal_mutex_t template_lock;
|
||||
opal_mutex_t mx_lock;
|
||||
|
||||
#if MCA_BTL_HAS_MPOOL
|
||||
struct mca_mpool_base_module_t* template_mpool;
|
||||
struct mca_mpool_base_module_t* mx_mpool;
|
||||
#endif
|
||||
};
|
||||
typedef struct mca_btl_template_module_t mca_btl_template_module_t;
|
||||
extern mca_btl_template_module_t mca_btl_template_module;
|
||||
typedef struct mca_btl_mx_module_t mca_btl_mx_module_t;
|
||||
extern mca_btl_mx_module_t mca_btl_mx_module;
|
||||
|
||||
|
||||
/**
|
||||
* Register TEMPLATE component parameters with the MCA framework
|
||||
*/
|
||||
extern int mca_btl_template_component_open(void);
|
||||
extern int mca_btl_mx_component_open(void);
|
||||
|
||||
/**
|
||||
* Any final cleanup before being unloaded.
|
||||
*/
|
||||
extern int mca_btl_template_component_close(void);
|
||||
extern int mca_btl_mx_component_close(void);
|
||||
|
||||
/**
|
||||
* TEMPLATE component initialization.
|
||||
@ -121,7 +121,7 @@ extern int mca_btl_template_component_close(void);
|
||||
* @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(
|
||||
extern mca_btl_base_module_t** mca_btl_mx_component_init(
|
||||
int *num_btl_modules,
|
||||
bool allow_multi_user_threads,
|
||||
bool have_hidden_threads
|
||||
@ -131,7 +131,7 @@ extern mca_btl_base_module_t** mca_btl_template_component_init(
|
||||
/**
|
||||
* TEMPLATE component progress.
|
||||
*/
|
||||
extern int mca_btl_template_component_progress(void);
|
||||
extern int mca_btl_mx_component_progress(void);
|
||||
|
||||
|
||||
|
||||
@ -142,7 +142,7 @@ extern int mca_btl_template_component_progress(void);
|
||||
* @return OMPI_SUCCESS or error status on failure.
|
||||
*/
|
||||
|
||||
extern int mca_btl_template_finalize(
|
||||
extern int mca_btl_mx_finalize(
|
||||
struct mca_btl_base_module_t* btl
|
||||
);
|
||||
|
||||
@ -159,7 +159,7 @@ extern int mca_btl_template_finalize(
|
||||
*
|
||||
*/
|
||||
|
||||
extern int mca_btl_template_add_procs(
|
||||
extern int mca_btl_mx_add_procs(
|
||||
struct mca_btl_base_module_t* btl,
|
||||
size_t nprocs,
|
||||
struct ompi_proc_t **procs,
|
||||
@ -178,7 +178,7 @@ extern int mca_btl_template_add_procs(
|
||||
*
|
||||
*/
|
||||
|
||||
extern int mca_btl_template_del_procs(
|
||||
extern int mca_btl_mx_del_procs(
|
||||
struct mca_btl_base_module_t* btl,
|
||||
size_t nprocs,
|
||||
struct ompi_proc_t **procs,
|
||||
@ -195,7 +195,7 @@ extern int mca_btl_template_del_procs(
|
||||
* @param tag (IN) The tag value used to notify the peer.
|
||||
*/
|
||||
|
||||
extern int mca_btl_template_send(
|
||||
extern int mca_btl_mx_send(
|
||||
struct mca_btl_base_module_t* btl,
|
||||
struct mca_btl_base_endpoint_t* btl_peer,
|
||||
struct mca_btl_base_descriptor_t* descriptor,
|
||||
@ -211,7 +211,7 @@ extern int mca_btl_template_send(
|
||||
* @param descriptor (IN) Description of the data to be transferred
|
||||
*/
|
||||
|
||||
extern int mca_btl_template_put(
|
||||
extern int mca_btl_mx_put(
|
||||
struct mca_btl_base_module_t* btl,
|
||||
struct mca_btl_base_endpoint_t* btl_peer,
|
||||
struct mca_btl_base_descriptor_t* decriptor
|
||||
@ -226,7 +226,7 @@ extern int mca_btl_template_put(
|
||||
* @param descriptor (IN) Description of the data to be transferred
|
||||
*/
|
||||
|
||||
extern int mca_btl_template_get(
|
||||
extern int mca_btl_mx_get(
|
||||
struct mca_btl_base_module_t* btl,
|
||||
struct mca_btl_base_endpoint_t* btl_peer,
|
||||
struct mca_btl_base_descriptor_t* decriptor
|
||||
@ -241,7 +241,7 @@ extern int mca_btl_template_get(
|
||||
*
|
||||
*/
|
||||
|
||||
extern int mca_btl_template_register(
|
||||
extern int mca_btl_mx_register(
|
||||
struct mca_btl_base_module_t* btl,
|
||||
mca_btl_base_tag_t tag,
|
||||
mca_btl_base_module_recv_cb_fn_t cbfunc,
|
||||
@ -256,7 +256,7 @@ extern int mca_btl_template_register(
|
||||
* @param size (IN) Request segment size.
|
||||
*/
|
||||
|
||||
extern mca_btl_base_descriptor_t* mca_btl_template_alloc(
|
||||
extern mca_btl_base_descriptor_t* mca_btl_mx_alloc(
|
||||
struct mca_btl_base_module_t* btl,
|
||||
size_t size);
|
||||
|
||||
@ -268,7 +268,7 @@ extern mca_btl_base_descriptor_t* mca_btl_template_alloc(
|
||||
* @param descriptor (IN) Allocated descriptor.
|
||||
*/
|
||||
|
||||
extern int mca_btl_template_free(
|
||||
extern int mca_btl_mx_free(
|
||||
struct mca_btl_base_module_t* btl,
|
||||
mca_btl_base_descriptor_t* des);
|
||||
|
||||
@ -287,7 +287,7 @@ extern int mca_btl_template_free(
|
||||
* @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(
|
||||
mca_btl_base_descriptor_t* mca_btl_mx_prepare_src(
|
||||
struct mca_btl_base_module_t* btl,
|
||||
struct mca_btl_base_endpoint_t* peer,
|
||||
struct mca_mpool_base_registration_t*,
|
||||
@ -296,7 +296,7 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_src(
|
||||
size_t* size
|
||||
);
|
||||
|
||||
extern mca_btl_base_descriptor_t* mca_btl_template_prepare_dst(
|
||||
extern mca_btl_base_descriptor_t* mca_btl_mx_prepare_dst(
|
||||
struct mca_btl_base_module_t* btl,
|
||||
struct mca_btl_base_endpoint_t* peer,
|
||||
struct mca_mpool_base_registration_t*,
|
||||
|
@ -28,12 +28,12 @@
|
||||
#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 "btl_mx.h"
|
||||
#include "btl_mx_frag.h"
|
||||
#include "btl_mx_endpoint.h"
|
||||
#include "mca/btl/base/base.h"
|
||||
#include "datatype/convertor.h"
|
||||
mca_btl_template_component_t mca_btl_template_component = {
|
||||
mca_btl_mx_component_t mca_btl_mx_component = {
|
||||
{
|
||||
/* First, the mca_base_component_t struct containing meta information
|
||||
about the component itself */
|
||||
@ -48,8 +48,8 @@ mca_btl_template_component_t mca_btl_template_component = {
|
||||
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 */
|
||||
mca_btl_mx_component_open, /* component open */
|
||||
mca_btl_mx_component_close /* component close */
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
@ -60,8 +60,8 @@ mca_btl_template_component_t mca_btl_template_component = {
|
||||
false
|
||||
},
|
||||
|
||||
mca_btl_template_component_init,
|
||||
mca_btl_template_component_progress,
|
||||
mca_btl_mx_component_init,
|
||||
mca_btl_mx_component_progress,
|
||||
}
|
||||
};
|
||||
|
||||
@ -70,7 +70,7 @@ mca_btl_template_component_t mca_btl_template_component = {
|
||||
* utility routines for parameter registration
|
||||
*/
|
||||
|
||||
static inline char* mca_btl_template_param_register_string(
|
||||
static inline char* mca_btl_mx_param_register_string(
|
||||
const char* param_name,
|
||||
const char* default_value)
|
||||
{
|
||||
@ -80,7 +80,7 @@ static inline char* mca_btl_template_param_register_string(
|
||||
return param_value;
|
||||
}
|
||||
|
||||
static inline int mca_btl_template_param_register_int(
|
||||
static inline int mca_btl_mx_param_register_int(
|
||||
const char* param_name,
|
||||
int default_value)
|
||||
{
|
||||
@ -95,40 +95,40 @@ static inline int mca_btl_template_param_register_int(
|
||||
* component parameters.
|
||||
*/
|
||||
|
||||
int mca_btl_template_component_open(void)
|
||||
int mca_btl_mx_component_open(void)
|
||||
{
|
||||
|
||||
|
||||
/* initialize state */
|
||||
mca_btl_template_component.template_num_btls=0;
|
||||
mca_btl_template_component.template_btls=NULL;
|
||||
mca_btl_mx_component.mx_num_btls=0;
|
||||
mca_btl_mx_component.mx_btls=NULL;
|
||||
|
||||
/* initialize objects */
|
||||
OBJ_CONSTRUCT(&mca_btl_template_component.template_procs, opal_list_t);
|
||||
OBJ_CONSTRUCT(&mca_btl_mx_component.mx_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);
|
||||
mca_btl_mx_component.mx_free_list_num =
|
||||
mca_btl_mx_param_register_int ("free_list_num", 8);
|
||||
mca_btl_mx_component.mx_free_list_max =
|
||||
mca_btl_mx_param_register_int ("free_list_max", 1024);
|
||||
mca_btl_mx_component.mx_free_list_inc =
|
||||
mca_btl_mx_param_register_int ("free_list_inc", 32);
|
||||
mca_btl_mx_component.mx_mpool_name =
|
||||
mca_btl_mx_param_register_string("mpool", "ib");
|
||||
mca_btl_mx_module.super.btl_exclusivity =
|
||||
mca_btl_mx_param_register_int ("exclusivity", 0);
|
||||
mca_btl_mx_module.super.btl_eager_limit =
|
||||
mca_btl_mx_param_register_int ("first_frag_size", 64*1024) - sizeof(mca_btl_base_header_t);
|
||||
mca_btl_mx_module.super.btl_min_send_size =
|
||||
mca_btl_mx_param_register_int ("min_send_size", 64*1024) - sizeof(mca_btl_base_header_t);
|
||||
mca_btl_mx_module.super.btl_max_send_size =
|
||||
mca_btl_mx_param_register_int ("max_send_size", 128*1024) - sizeof(mca_btl_base_header_t);
|
||||
mca_btl_mx_module.super.btl_min_rdma_size =
|
||||
mca_btl_mx_param_register_int("min_rdma_size", 1024*1024);
|
||||
mca_btl_mx_module.super.btl_max_rdma_size =
|
||||
mca_btl_mx_param_register_int("max_rdma_size", 1024*1024);
|
||||
mca_btl_mx_module.super.btl_flags =
|
||||
mca_btl_mx_param_register_int("flags", MCA_BTL_FLAGS_RDMA);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ int mca_btl_template_component_open(void)
|
||||
* component cleanup - sanity checking of queue lengths
|
||||
*/
|
||||
|
||||
int mca_btl_template_component_close(void)
|
||||
int mca_btl_mx_component_close(void)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
@ -149,7 +149,7 @@ int mca_btl_template_component_close(void)
|
||||
* (3) register BTL parameters with the MCA
|
||||
*/
|
||||
|
||||
mca_btl_base_module_t** mca_btl_template_component_init(int *num_btl_modules,
|
||||
mca_btl_base_module_t** mca_btl_mx_component_init(int *num_btl_modules,
|
||||
bool enable_progress_threads,
|
||||
bool enable_mpi_threads)
|
||||
{
|
||||
@ -161,7 +161,7 @@ mca_btl_base_module_t** mca_btl_template_component_init(int *num_btl_modules,
|
||||
*/
|
||||
|
||||
|
||||
int mca_btl_template_component_progress()
|
||||
int mca_btl_mx_component_progress()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -24,10 +24,10 @@
|
||||
#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"
|
||||
#include "btl_mx.h"
|
||||
#include "btl_mx_endpoint.h"
|
||||
#include "btl_mx_proc.h"
|
||||
#include "btl_mx_frag.h"
|
||||
|
||||
|
||||
/*
|
||||
@ -35,7 +35,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
static void mca_btl_template_endpoint_construct(mca_btl_base_endpoint_t* endpoint)
|
||||
static void mca_btl_mx_endpoint_construct(mca_btl_base_endpoint_t* endpoint)
|
||||
{
|
||||
endpoint->endpoint_btl = 0;
|
||||
endpoint->endpoint_proc = 0;
|
||||
@ -46,14 +46,14 @@ static void mca_btl_template_endpoint_construct(mca_btl_base_endpoint_t* endpoin
|
||||
*
|
||||
*/
|
||||
|
||||
static void mca_btl_template_endpoint_destruct(mca_btl_base_endpoint_t* endpoint)
|
||||
static void mca_btl_mx_endpoint_destruct(mca_btl_base_endpoint_t* endpoint)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
OBJ_CLASS_INSTANCE(
|
||||
mca_btl_template_endpoint_t,
|
||||
mca_btl_mx_endpoint_t,
|
||||
opal_list_item_t,
|
||||
mca_btl_template_endpoint_construct,
|
||||
mca_btl_template_endpoint_destruct);
|
||||
mca_btl_mx_endpoint_construct,
|
||||
mca_btl_mx_endpoint_destruct);
|
||||
|
||||
|
@ -21,13 +21,13 @@
|
||||
#include "opal/event/event.h"
|
||||
#include "mca/pml/pml.h"
|
||||
#include "mca/btl/btl.h"
|
||||
#include "btl_template_frag.h"
|
||||
#include "btl_template.h"
|
||||
#include "btl_mx_frag.h"
|
||||
#include "btl_mx.h"
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
OBJ_CLASS_DECLARATION(mca_btl_template_endpoint_t);
|
||||
OBJ_CLASS_DECLARATION(mca_btl_mx_endpoint_t);
|
||||
|
||||
/**
|
||||
* An abstraction that represents a connection to a endpoint process.
|
||||
@ -39,15 +39,15 @@ OBJ_CLASS_DECLARATION(mca_btl_template_endpoint_t);
|
||||
struct mca_btl_base_endpoint_t {
|
||||
opal_list_item_t super;
|
||||
|
||||
struct mca_btl_template_module_t* endpoint_btl;
|
||||
struct mca_btl_mx_module_t* endpoint_btl;
|
||||
/**< BTL instance that created this connection */
|
||||
|
||||
struct mca_btl_template_proc_t* endpoint_proc;
|
||||
struct mca_btl_mx_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;
|
||||
typedef mca_btl_base_endpoint_t mca_btl_mx_endpoint_t;
|
||||
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
|
@ -1,58 +1,58 @@
|
||||
#include "btl_template_frag.h"
|
||||
#include "btl_mx_frag.h"
|
||||
|
||||
|
||||
|
||||
static void mca_btl_template_frag_common_constructor(mca_btl_template_frag_t* frag)
|
||||
static void mca_btl_mx_frag_common_constructor(mca_btl_mx_frag_t* frag)
|
||||
{
|
||||
mca_btl_template_frag_common_constructor(frag);
|
||||
mca_btl_mx_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)
|
||||
static void mca_btl_mx_frag_eager_constructor(mca_btl_mx_frag_t* frag)
|
||||
{
|
||||
frag->registration = NULL;
|
||||
frag->size = mca_btl_template_module.super.btl_eager_limit;
|
||||
mca_btl_template_frag_common_constructor(frag);
|
||||
frag->size = mca_btl_mx_module.super.btl_eager_limit;
|
||||
mca_btl_mx_frag_common_constructor(frag);
|
||||
}
|
||||
|
||||
static void mca_btl_template_frag_max_constructor(mca_btl_template_frag_t* frag)
|
||||
static void mca_btl_mx_frag_max_constructor(mca_btl_mx_frag_t* frag)
|
||||
{
|
||||
frag->registration = NULL;
|
||||
frag->size = mca_btl_template_module.super.btl_max_send_size;
|
||||
mca_btl_template_frag_common_constructor(frag);
|
||||
frag->size = mca_btl_mx_module.super.btl_max_send_size;
|
||||
mca_btl_mx_frag_common_constructor(frag);
|
||||
}
|
||||
|
||||
static void mca_btl_template_frag_user_constructor(mca_btl_template_frag_t* frag)
|
||||
static void mca_btl_mx_frag_user_constructor(mca_btl_mx_frag_t* frag)
|
||||
{
|
||||
frag->size = 0;
|
||||
mca_btl_template_frag_common_constructor(frag);
|
||||
mca_btl_mx_frag_common_constructor(frag);
|
||||
}
|
||||
|
||||
|
||||
OBJ_CLASS_INSTANCE(
|
||||
mca_btl_template_frag_t,
|
||||
mca_btl_mx_frag_t,
|
||||
mca_btl_base_descriptor_t,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
OBJ_CLASS_INSTANCE(
|
||||
mca_btl_template_frag_eager_t,
|
||||
mca_btl_mx_frag_eager_t,
|
||||
mca_btl_base_descriptor_t,
|
||||
mca_btl_template_frag_eager_constructor,
|
||||
mca_btl_mx_frag_eager_constructor,
|
||||
NULL);
|
||||
|
||||
OBJ_CLASS_INSTANCE(
|
||||
mca_btl_template_frag_max_t,
|
||||
mca_btl_mx_frag_max_t,
|
||||
mca_btl_base_descriptor_t,
|
||||
mca_btl_template_frag_max_constructor,
|
||||
mca_btl_mx_frag_max_constructor,
|
||||
NULL);
|
||||
|
||||
OBJ_CLASS_INSTANCE(
|
||||
mca_btl_template_frag_user_t,
|
||||
mca_btl_mx_frag_user_t,
|
||||
mca_btl_base_descriptor_t,
|
||||
mca_btl_template_frag_user_constructor,
|
||||
mca_btl_mx_frag_user_constructor,
|
||||
NULL);
|
||||
|
||||
|
@ -20,19 +20,19 @@
|
||||
|
||||
#define MCA_BTL_TEMPLATE_FRAG_ALIGN (8)
|
||||
#include "ompi_config.h"
|
||||
#include "btl_template.h"
|
||||
#include "btl_mx.h"
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_btl_template_frag_t);
|
||||
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_btl_mx_frag_t);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* TEMPLATE send fratemplateent derived type.
|
||||
* TEMPLATE send framxent derived type.
|
||||
*/
|
||||
struct mca_btl_template_frag_t {
|
||||
struct mca_btl_mx_frag_t {
|
||||
mca_btl_base_descriptor_t base;
|
||||
mca_btl_base_segment_t segment;
|
||||
struct mca_btl_base_endpoint_t *endpoint;
|
||||
@ -42,21 +42,21 @@ struct mca_btl_template_frag_t {
|
||||
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_mx_frag_t mca_btl_mx_frag_t;
|
||||
OBJ_CLASS_DECLARATION(mca_btl_mx_frag_t);
|
||||
|
||||
|
||||
typedef struct mca_btl_template_frag_t mca_btl_template_frag_eager_t;
|
||||
typedef struct mca_btl_mx_frag_t mca_btl_mx_frag_eager_t;
|
||||
|
||||
OBJ_CLASS_DECLARATION(mca_btl_template_frag_eager_t);
|
||||
OBJ_CLASS_DECLARATION(mca_btl_mx_frag_eager_t);
|
||||
|
||||
typedef struct mca_btl_template_frag_t mca_btl_template_frag_max_t;
|
||||
typedef struct mca_btl_mx_frag_t mca_btl_mx_frag_max_t;
|
||||
|
||||
OBJ_CLASS_DECLARATION(mca_btl_template_frag_max_t);
|
||||
OBJ_CLASS_DECLARATION(mca_btl_mx_frag_max_t);
|
||||
|
||||
typedef struct mca_btl_template_frag_t mca_btl_template_frag_user_t;
|
||||
typedef struct mca_btl_mx_frag_t mca_btl_mx_frag_user_t;
|
||||
|
||||
OBJ_CLASS_DECLARATION(mca_btl_template_frag_user_t);
|
||||
OBJ_CLASS_DECLARATION(mca_btl_mx_frag_user_t);
|
||||
|
||||
|
||||
/*
|
||||
@ -68,13 +68,13 @@ OBJ_CLASS_DECLARATION(mca_btl_template_frag_user_t);
|
||||
{ \
|
||||
\
|
||||
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; \
|
||||
OMPI_FREE_LIST_WAIT(&((mca_btl_mx_module_t*)btl)->mx_frag_eager, item, rc); \
|
||||
frag = (mca_btl_mx_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, \
|
||||
OMPI_FREE_LIST_RETURN(&((mca_btl_mx_module_t*)btl)->mx_frag_eager, \
|
||||
(opal_list_item_t*)(frag)); \
|
||||
}
|
||||
|
||||
@ -82,13 +82,13 @@ OBJ_CLASS_DECLARATION(mca_btl_template_frag_user_t);
|
||||
{ \
|
||||
\
|
||||
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; \
|
||||
OMPI_FREE_LIST_WAIT(&((mca_btl_mx_module_t*)btl)->mx_frag_max, item, rc); \
|
||||
frag = (mca_btl_mx_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, \
|
||||
OMPI_FREE_LIST_RETURN(&((mca_btl_mx_module_t*)btl)->mx_frag_max, \
|
||||
(opal_list_item_t*)(frag)); \
|
||||
}
|
||||
|
||||
@ -96,13 +96,13 @@ OBJ_CLASS_DECLARATION(mca_btl_template_frag_user_t);
|
||||
#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; \
|
||||
OMPI_FREE_LIST_WAIT(&((mca_btl_mx_module_t*)btl)->mx_frag_user, item, rc); \
|
||||
frag = (mca_btl_mx_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, \
|
||||
OMPI_FREE_LIST_RETURN(&((mca_btl_mx_module_t*)btl)->mx_frag_user, \
|
||||
(opal_list_item_t*)(frag)); \
|
||||
}
|
||||
|
||||
|
@ -19,17 +19,17 @@
|
||||
#include "class/opal_hash_table.h"
|
||||
#include "mca/pml/base/pml_base_module_exchange.h"
|
||||
|
||||
#include "btl_template.h"
|
||||
#include "btl_template_proc.h"
|
||||
#include "btl_mx.h"
|
||||
#include "btl_mx_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);
|
||||
static void mca_btl_mx_proc_construct(mca_btl_mx_proc_t* proc);
|
||||
static void mca_btl_mx_proc_destruct(mca_btl_mx_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);
|
||||
OBJ_CLASS_INSTANCE(mca_btl_mx_proc_t,
|
||||
opal_list_item_t, mca_btl_mx_proc_construct,
|
||||
mca_btl_mx_proc_destruct);
|
||||
|
||||
void mca_btl_template_proc_construct(mca_btl_template_proc_t* proc)
|
||||
void mca_btl_mx_proc_construct(mca_btl_mx_proc_t* proc)
|
||||
{
|
||||
proc->proc_ompi = 0;
|
||||
proc->proc_addr_count = 0;
|
||||
@ -37,21 +37,21 @@ void mca_btl_template_proc_construct(mca_btl_template_proc_t* proc)
|
||||
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);
|
||||
OPAL_THREAD_LOCK(&mca_btl_mx_component.mx_lock);
|
||||
opal_list_append(&mca_btl_mx_component.mx_procs, &proc->super);
|
||||
OPAL_THREAD_UNLOCK(&mca_btl_mx_component.mx_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* Cleanup ib proc instance
|
||||
*/
|
||||
|
||||
void mca_btl_template_proc_destruct(mca_btl_template_proc_t* proc)
|
||||
void mca_btl_mx_proc_destruct(mca_btl_mx_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);
|
||||
OPAL_THREAD_LOCK(&mca_btl_mx_component.mx_lock);
|
||||
opal_list_remove_item(&mca_btl_mx_component.mx_procs, &proc->super);
|
||||
OPAL_THREAD_UNLOCK(&mca_btl_mx_component.mx_lock);
|
||||
|
||||
/* release resources */
|
||||
if(NULL != proc->proc_endpoints) {
|
||||
@ -64,45 +64,45 @@ void mca_btl_template_proc_destruct(mca_btl_template_proc_t* proc)
|
||||
* 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)
|
||||
static mca_btl_mx_proc_t* mca_btl_mx_proc_lookup_ompi(ompi_proc_t* ompi_proc)
|
||||
{
|
||||
mca_btl_template_proc_t* template_proc;
|
||||
mca_btl_mx_proc_t* mx_proc;
|
||||
|
||||
OPAL_THREAD_LOCK(&mca_btl_template_component.template_lock);
|
||||
OPAL_THREAD_LOCK(&mca_btl_mx_component.mx_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)) {
|
||||
for(mx_proc = (mca_btl_mx_proc_t*)
|
||||
opal_list_get_first(&mca_btl_mx_component.mx_procs);
|
||||
mx_proc != (mca_btl_mx_proc_t*)
|
||||
opal_list_get_end(&mca_btl_mx_component.mx_procs);
|
||||
mx_proc = (mca_btl_mx_proc_t*)opal_list_get_next(mx_proc)) {
|
||||
|
||||
if(template_proc->proc_ompi == ompi_proc) {
|
||||
OPAL_THREAD_UNLOCK(&mca_btl_template_component.template_lock);
|
||||
return template_proc;
|
||||
if(mx_proc->proc_ompi == ompi_proc) {
|
||||
OPAL_THREAD_UNLOCK(&mca_btl_mx_component.mx_lock);
|
||||
return mx_proc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
OPAL_THREAD_UNLOCK(&mca_btl_template_component.template_lock);
|
||||
OPAL_THREAD_UNLOCK(&mca_btl_mx_component.mx_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,
|
||||
* between a ompi_proc_t and a mca_btl_mx_proc_t instance. We cache
|
||||
* additional data (specifically the list of mca_btl_mx_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_mx_proc_t* mca_btl_mx_proc_create(ompi_proc_t* ompi_proc)
|
||||
{
|
||||
mca_btl_template_proc_t* module_proc = NULL;
|
||||
mca_btl_mx_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);
|
||||
module_proc = mca_btl_mx_proc_lookup_ompi(ompi_proc);
|
||||
|
||||
if(module_proc != NULL) {
|
||||
|
||||
@ -113,7 +113,7 @@ mca_btl_template_proc_t* mca_btl_template_proc_create(ompi_proc_t* ompi_proc)
|
||||
/* Oops! First time, gotta create a new TEMPLATE proc
|
||||
* out of the ompi_proc ... */
|
||||
|
||||
module_proc = OBJ_NEW(mca_btl_template_proc_t);
|
||||
module_proc = OBJ_NEW(mca_btl_mx_proc_t);
|
||||
|
||||
/* Initialize number of peer */
|
||||
module_proc->proc_endpoint_count = 0;
|
||||
@ -130,7 +130,7 @@ mca_btl_template_proc_t* mca_btl_template_proc_create(ompi_proc_t* ompi_proc)
|
||||
|
||||
/* 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
|
||||
* mca_btl_mx_proc_t to allow on demand increasing of
|
||||
* number of endpoints for this proc */
|
||||
|
||||
module_proc->proc_endpoints = (mca_btl_base_endpoint_t**)
|
||||
@ -149,7 +149,7 @@ mca_btl_template_proc_t* mca_btl_template_proc_create(ompi_proc_t* ompi_proc)
|
||||
* 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,
|
||||
int mca_btl_mx_proc_insert(mca_btl_mx_proc_t* module_proc,
|
||||
mca_btl_base_endpoint_t* module_endpoint)
|
||||
{
|
||||
/* insert into endpoint array */
|
||||
|
@ -20,13 +20,13 @@
|
||||
#include "mca/ns/ns.h"
|
||||
#include "opal/class/opal_object.h"
|
||||
#include "proc/proc.h"
|
||||
#include "btl_template.h"
|
||||
#include "btl_template_endpoint.h"
|
||||
#include "btl_mx.h"
|
||||
#include "btl_mx_endpoint.h"
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
OBJ_CLASS_DECLARATION(mca_btl_template_proc_t);
|
||||
OBJ_CLASS_DECLARATION(mca_btl_mx_proc_t);
|
||||
|
||||
/**
|
||||
* Represents the state of a remote process and the set of addresses
|
||||
@ -34,7 +34,7 @@ OBJ_CLASS_DECLARATION(mca_btl_template_proc_t);
|
||||
* each
|
||||
* BTL instance that attempts to open a connection to the process.
|
||||
*/
|
||||
struct mca_btl_template_proc_t {
|
||||
struct mca_btl_mx_proc_t {
|
||||
opal_list_item_t super;
|
||||
/**< allow proc to be placed on a list */
|
||||
|
||||
@ -56,10 +56,10 @@ struct mca_btl_template_proc_t {
|
||||
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;
|
||||
typedef struct mca_btl_mx_proc_t mca_btl_mx_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*);
|
||||
mca_btl_mx_proc_t* mca_btl_mx_proc_create(ompi_proc_t* ompi_proc);
|
||||
int mca_btl_mx_proc_insert(mca_btl_mx_proc_t*, mca_btl_base_endpoint_t*);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user