No real functionality changes, just a bunch of changes to make variable
names and the like more consistent throughout the code This commit was SVN r6563.
Этот коммит содержится в:
родитель
b46023565f
Коммит
3ac83138c2
@ -68,32 +68,31 @@ mca_btl_portals_module_t mca_btl_portals_module = {
|
||||
|
||||
|
||||
int
|
||||
mca_btl_portals_add_procs(struct mca_btl_base_module_t* btl,
|
||||
mca_btl_portals_add_procs(struct mca_btl_base_module_t* btl_base,
|
||||
size_t nprocs, struct ompi_proc_t **procs,
|
||||
struct mca_btl_base_endpoint_t** peers,
|
||||
ompi_bitmap_t* reachable)
|
||||
{
|
||||
struct mca_btl_portals_module_t *btl =
|
||||
(struct mca_btl_portals_module_t*) btl_base;
|
||||
int ret;
|
||||
struct ompi_proc_t *curr_proc = NULL;
|
||||
ptl_process_id_t *portals_procs = NULL;
|
||||
size_t i;
|
||||
unsigned long distance;
|
||||
struct mca_btl_portals_module_t *ptl_btl =
|
||||
(struct mca_btl_portals_module_t*) btl;
|
||||
bool need_recv_setup = false;
|
||||
|
||||
|
||||
/* make sure our environment is fully initialized. At end of this
|
||||
call, we have a working network handle on our module and
|
||||
portals_procs will have the portals process identifier for each
|
||||
proc (ordered, in theory) */
|
||||
ret = mca_btl_portals_add_procs_compat(ptl_btl, nprocs, procs,
|
||||
ret = mca_btl_portals_add_procs_compat(btl, nprocs, procs,
|
||||
&portals_procs);
|
||||
if (OMPI_SUCCESS != ret) return ret;
|
||||
|
||||
OPAL_THREAD_LOCK(&ptl_btl->portals_lock);
|
||||
OPAL_THREAD_LOCK(&btl->portals_lock);
|
||||
|
||||
if (0 == opal_list_get_size(&ptl_btl->portals_endpoint_list)) {
|
||||
if (0 == opal_list_get_size(&btl->portals_endpoint_list)) {
|
||||
need_recv_setup = true;
|
||||
}
|
||||
|
||||
@ -102,16 +101,16 @@ mca_btl_portals_add_procs(struct mca_btl_base_module_t* btl,
|
||||
curr_proc = procs[i];
|
||||
|
||||
peers[i] = OBJ_NEW(mca_btl_portals_endpoint_t);
|
||||
peers[i]->endpoint_btl = ptl_btl;
|
||||
peers[i]->endpoint_btl = btl;
|
||||
peers[i]->endpoint_proc = curr_proc;
|
||||
peers[i]->endpoint_ptl_id = portals_procs[i];
|
||||
|
||||
opal_list_append(&ptl_btl->portals_endpoint_list,
|
||||
opal_list_append(&btl->portals_endpoint_list,
|
||||
(opal_list_item_t*) peers[i]);
|
||||
|
||||
/* make sure we can reach the process - this is supposed to be
|
||||
a cheap-ish operation */
|
||||
ret = PtlNIDist(ptl_btl->portals_ni_h,
|
||||
ret = PtlNIDist(btl->portals_ni_h,
|
||||
portals_procs[i],
|
||||
&distance);
|
||||
if (ret != PTL_OK) {
|
||||
@ -130,38 +129,38 @@ mca_btl_portals_add_procs(struct mca_btl_base_module_t* btl,
|
||||
/* create eqs */
|
||||
int i;
|
||||
for (i = 0 ; i < MCA_BTL_PORTALS_EQ_SIZE ; ++i) {
|
||||
int ptl_ret = PtlEQAlloc(ptl_btl->portals_ni_h,
|
||||
ptl_btl->portals_eq_sizes[i],
|
||||
int ptl_ret = PtlEQAlloc(btl->portals_ni_h,
|
||||
btl->portals_eq_sizes[i],
|
||||
PTL_EQ_HANDLER_NONE,
|
||||
&(ptl_btl->portals_eq_handles[i]));
|
||||
&(btl->portals_eq_handles[i]));
|
||||
if (PTL_OK != ptl_ret) {
|
||||
opal_output(mca_btl_portals_component.portals_output,
|
||||
"Error creating EQ %d: %d", i, ptl_ret);
|
||||
OPAL_THREAD_UNLOCK(&ptl_btl->portals_lock);
|
||||
OPAL_THREAD_UNLOCK(&btl->portals_lock);
|
||||
/* BWB - better error code? */
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
ret = mca_btl_portals_recv_enable(ptl_btl);
|
||||
ret = mca_btl_portals_recv_enable(btl);
|
||||
} else {
|
||||
ret = OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
OPAL_THREAD_UNLOCK(&ptl_btl->portals_lock);
|
||||
OPAL_THREAD_UNLOCK(&btl->portals_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_btl_portals_del_procs(struct mca_btl_base_module_t *btl,
|
||||
mca_btl_portals_del_procs(struct mca_btl_base_module_t *btl_base,
|
||||
size_t nprocs,
|
||||
struct ompi_proc_t **procs,
|
||||
struct mca_btl_base_endpoint_t **peers)
|
||||
{
|
||||
mca_btl_portals_module_t *ptl_btl =
|
||||
(mca_btl_portals_module_t*) btl;
|
||||
mca_btl_portals_module_t *btl =
|
||||
(mca_btl_portals_module_t*) btl_base;
|
||||
size_t i = 0;
|
||||
int ret = OMPI_SUCCESS;
|
||||
bool need_recv_shutdown = false;
|
||||
@ -169,26 +168,26 @@ mca_btl_portals_del_procs(struct mca_btl_base_module_t *btl,
|
||||
opal_output_verbose(100, mca_btl_portals_component.portals_output,
|
||||
"del_procs called for %ld procs", (long) nprocs);
|
||||
|
||||
OPAL_THREAD_LOCK(&ptl_btl->portals_lock);
|
||||
OPAL_THREAD_LOCK(&btl->portals_lock);
|
||||
|
||||
for (i = 0 ; i < nprocs ; ++i) {
|
||||
opal_list_remove_item(&ptl_btl->portals_endpoint_list,
|
||||
opal_list_remove_item(&btl->portals_endpoint_list,
|
||||
(opal_list_item_t*) peers[i]);
|
||||
OBJ_RELEASE(peers[i]);
|
||||
}
|
||||
|
||||
if (0 == opal_list_get_size(&ptl_btl->portals_endpoint_list)) {
|
||||
if (0 == opal_list_get_size(&btl->portals_endpoint_list)) {
|
||||
need_recv_shutdown = true;
|
||||
}
|
||||
|
||||
if (need_recv_shutdown) {
|
||||
int i;
|
||||
|
||||
ret = mca_btl_portals_recv_disable(ptl_btl);
|
||||
ret = mca_btl_portals_recv_disable(btl);
|
||||
|
||||
/* destroy eqs */
|
||||
for (i = 0 ; i < MCA_BTL_PORTALS_EQ_SIZE ; ++i) {
|
||||
int ptl_ret = PtlEQFree(ptl_btl->portals_eq_handles[i]);
|
||||
int ptl_ret = PtlEQFree(btl->portals_eq_handles[i]);
|
||||
if (PTL_OK != ptl_ret) {
|
||||
opal_output(mca_btl_portals_component.portals_output,
|
||||
"Error freeing EQ %d: %d", i, ptl_ret);
|
||||
@ -199,7 +198,7 @@ mca_btl_portals_del_procs(struct mca_btl_base_module_t *btl,
|
||||
ret = OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
OPAL_THREAD_UNLOCK(&ptl_btl->portals_lock);
|
||||
OPAL_THREAD_UNLOCK(&btl->portals_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -246,18 +245,18 @@ mca_btl_portals_alloc(struct mca_btl_base_module_t* btl,
|
||||
|
||||
|
||||
int
|
||||
mca_btl_portals_free(struct mca_btl_base_module_t* btl,
|
||||
mca_btl_portals_free(struct mca_btl_base_module_t* btl_base,
|
||||
mca_btl_base_descriptor_t* des)
|
||||
{
|
||||
mca_btl_portals_module_t* portals_btl = (mca_btl_portals_module_t*) btl;
|
||||
mca_btl_portals_module_t* btl = (mca_btl_portals_module_t*) btl_base;
|
||||
mca_btl_portals_frag_t* frag = (mca_btl_portals_frag_t*) des;
|
||||
|
||||
if (frag->size == 0) {
|
||||
MCA_BTL_PORTALS_FRAG_RETURN_USER(btl, frag);
|
||||
} else if (frag->size == btl->btl_eager_limit){
|
||||
MCA_BTL_PORTALS_FRAG_RETURN_EAGER(btl, frag);
|
||||
} else if (frag->size == btl->btl_max_send_size) {
|
||||
MCA_BTL_PORTALS_FRAG_RETURN_MAX(btl, frag);
|
||||
MCA_BTL_PORTALS_FRAG_RETURN_USER(&btl->super, frag);
|
||||
} else if (frag->size == btl->super.btl_eager_limit){
|
||||
MCA_BTL_PORTALS_FRAG_RETURN_EAGER(&btl->super, frag);
|
||||
} else if (frag->size == btl->super.btl_max_send_size) {
|
||||
MCA_BTL_PORTALS_FRAG_RETURN_MAX(&btl->super, frag);
|
||||
} else {
|
||||
return OMPI_ERR_BAD_PARAM;
|
||||
}
|
||||
@ -355,10 +354,10 @@ mca_btl_portals_finalize(struct mca_btl_base_module_t *btl_base)
|
||||
opal_list_get_size(&(btl->portals_queued_sends)));
|
||||
}
|
||||
|
||||
OPAL_THREAD_LOCK(&ptl_btl->portals_lock);
|
||||
OPAL_THREAD_LOCK(&btl->portals_lock);
|
||||
|
||||
if (0 != opal_list_get_size(&btl->portals_endpoint_list)) {
|
||||
OPAL_THREAD_LOCK(&ptl_btl->portals_lock);
|
||||
OPAL_THREAD_LOCK(&btl->portals_lock);
|
||||
while (NULL !=
|
||||
(item = opal_list_remove_first(&btl->portals_endpoint_list))) {
|
||||
OBJ_RELEASE(item);
|
||||
|
@ -138,8 +138,8 @@ int mca_btl_portals_component_close(void);
|
||||
|
||||
|
||||
mca_btl_base_module_t** mca_btl_portals_component_init(int *num_btls,
|
||||
bool has_progress_threads,
|
||||
bool has_mpi_threads);
|
||||
bool has_progress_threads,
|
||||
bool has_mpi_threads);
|
||||
|
||||
int mca_btl_portals_component_progress(void);
|
||||
|
||||
@ -160,35 +160,36 @@ int mca_btl_portals_add_procs_compat(mca_btl_portals_module_t* btl,
|
||||
/*
|
||||
* Module configuration functions (btl_portals.c)
|
||||
*/
|
||||
int mca_btl_portals_finalize(struct mca_btl_base_module_t* btl);
|
||||
int mca_btl_portals_finalize(struct mca_btl_base_module_t* btl_base);
|
||||
|
||||
int mca_btl_portals_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);
|
||||
int mca_btl_portals_add_procs(struct mca_btl_base_module_t* btl_base,
|
||||
size_t nprocs,
|
||||
struct ompi_proc_t **procs,
|
||||
struct mca_btl_base_endpoint_t** peers,
|
||||
ompi_bitmap_t* reachable);
|
||||
|
||||
int mca_btl_portals_del_procs(struct mca_btl_base_module_t* btl_base,
|
||||
size_t nprocs,
|
||||
struct ompi_proc_t **procs,
|
||||
struct mca_btl_base_endpoint_t** peers);
|
||||
|
||||
int mca_btl_portals_del_procs(struct mca_btl_base_module_t* btl,
|
||||
size_t nprocs,
|
||||
struct ompi_proc_t **procs,
|
||||
struct mca_btl_base_endpoint_t** peers);
|
||||
/*
|
||||
* stubbed functions
|
||||
*/
|
||||
int mca_btl_portals_register(struct mca_btl_base_module_t* btl,
|
||||
int mca_btl_portals_register(struct mca_btl_base_module_t* btl_base,
|
||||
mca_btl_base_tag_t tag,
|
||||
mca_btl_base_module_recv_cb_fn_t cbfunc,
|
||||
void* cbdata);
|
||||
|
||||
mca_btl_base_descriptor_t*
|
||||
mca_btl_portals_alloc(struct mca_btl_base_module_t* btl,
|
||||
mca_btl_portals_alloc(struct mca_btl_base_module_t* btl_base,
|
||||
size_t size);
|
||||
|
||||
int mca_btl_portals_free(struct mca_btl_base_module_t* btl,
|
||||
int mca_btl_portals_free(struct mca_btl_base_module_t* btl_base,
|
||||
mca_btl_base_descriptor_t* des);
|
||||
|
||||
mca_btl_base_descriptor_t*
|
||||
mca_btl_portals_prepare_src(struct mca_btl_base_module_t* btl,
|
||||
mca_btl_portals_prepare_src(struct mca_btl_base_module_t* btl_base,
|
||||
struct mca_btl_base_endpoint_t* peer,
|
||||
mca_mpool_base_registration_t* registration,
|
||||
struct ompi_convertor_t* convertor,
|
||||
@ -196,24 +197,24 @@ mca_btl_portals_prepare_src(struct mca_btl_base_module_t* btl,
|
||||
size_t* size);
|
||||
|
||||
mca_btl_base_descriptor_t*
|
||||
mca_btl_portals_prepare_dst(struct mca_btl_base_module_t* btl,
|
||||
mca_btl_portals_prepare_dst(struct mca_btl_base_module_t* btl_base,
|
||||
struct mca_btl_base_endpoint_t* peer,
|
||||
mca_mpool_base_registration_t* registration,
|
||||
struct ompi_convertor_t* convertor,
|
||||
size_t reserve,
|
||||
size_t* size);
|
||||
|
||||
int mca_btl_portals_send(struct mca_btl_base_module_t* btl,
|
||||
int mca_btl_portals_send(struct mca_btl_base_module_t* btl_base,
|
||||
struct mca_btl_base_endpoint_t* btl_peer,
|
||||
struct mca_btl_base_descriptor_t* descriptor,
|
||||
mca_btl_base_tag_t tag);
|
||||
|
||||
int mca_btl_portals_put(struct mca_btl_base_module_t* btl,
|
||||
int mca_btl_portals_put(struct mca_btl_base_module_t* btl_base,
|
||||
struct mca_btl_base_endpoint_t* btl_peer,
|
||||
struct mca_btl_base_descriptor_t* decriptor);
|
||||
|
||||
|
||||
int mca_btl_portals_get(struct mca_btl_base_module_t* btl,
|
||||
int mca_btl_portals_get(struct mca_btl_base_module_t* btl_base,
|
||||
struct mca_btl_base_endpoint_t* btl_peer,
|
||||
struct mca_btl_base_descriptor_t* decriptor);
|
||||
|
||||
|
@ -147,19 +147,21 @@ mca_btl_portals_add_procs_compat(struct mca_btl_portals_module_t* btl,
|
||||
size_t nprocs, struct ompi_proc_t **procs,
|
||||
ptl_process_id_t **portals_procs)
|
||||
{
|
||||
int ret, my_rid;
|
||||
ptl_process_id_t *info;
|
||||
char *nidmap = NULL;
|
||||
char *pidmap = NULL;
|
||||
char *nid_str;
|
||||
char *pid_str;
|
||||
const size_t map_size = nprocs * 12 + 1; /* 12 is max length of long in decimal */
|
||||
size_t size, i;
|
||||
char *tmp;
|
||||
ompi_proc_t* proc_self = ompi_proc_local();
|
||||
int max_interfaces;
|
||||
int ret;
|
||||
|
||||
if (use_modex) {
|
||||
int my_rid;
|
||||
ptl_process_id_t *info;
|
||||
char *nidmap = NULL;
|
||||
char *pidmap = NULL;
|
||||
char *nid_str;
|
||||
char *pid_str;
|
||||
const size_t map_size = nprocs * 12 + 1; /* 12 is max length of long in decimal */
|
||||
size_t size, i;
|
||||
char *tmp;
|
||||
ompi_proc_t* proc_self = ompi_proc_local();
|
||||
int max_interfaces;
|
||||
|
||||
/*
|
||||
* Do all the NID/PID map setup
|
||||
*/
|
||||
@ -258,19 +260,15 @@ mca_btl_portals_add_procs_compat(struct mca_btl_portals_module_t* btl,
|
||||
"PtlNIInit failed, returning %d\n", ret);
|
||||
return OMPI_ERR_FATAL;
|
||||
}
|
||||
|
||||
#if 0
|
||||
PtlNIDebug(btl->portals_ni_h, PTL_DBG_ALL | PTL_DBG_NI_ALL);
|
||||
#endif
|
||||
} else { /* use_modex */
|
||||
int nptl_procs = 0;
|
||||
unsigned int nptl_procs, rank, i;
|
||||
|
||||
/*
|
||||
* FIXME - XXX - FIXME
|
||||
* BWB - implicit assumption that cnos procs list will match our
|
||||
* procs list. Don't know what to do about that...
|
||||
*/
|
||||
ret = PtlGetRank(&my_rid, &nptl_procs);
|
||||
ret = PtlGetRank(&rank, &nptl_procs);
|
||||
if (ret != PTL_OK) {
|
||||
opal_output_verbose(10, mca_btl_portals_component.portals_output,
|
||||
"PtlGetRank() returned %d", ret);
|
||||
@ -301,6 +299,10 @@ mca_btl_portals_add_procs_compat(struct mca_btl_portals_module_t* btl,
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
PtlNIDebug(btl->portals_ni_h, PTL_DBG_ALL | PTL_DBG_NI_ALL);
|
||||
#endif
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ static opal_output_stream_t portals_output_stream = {
|
||||
|
||||
static inline char*
|
||||
param_register_string(const char* param_name,
|
||||
const char* default_value)
|
||||
const char* default_value)
|
||||
{
|
||||
char *param_value;
|
||||
int id = mca_base_param_register_string("btl", "portals",
|
||||
@ -94,7 +94,7 @@ param_register_string(const char* param_name,
|
||||
|
||||
static inline int
|
||||
param_register_int(const char* param_name,
|
||||
int default_value)
|
||||
int default_value)
|
||||
{
|
||||
int id = mca_base_param_register_int("btl", "portals", param_name,
|
||||
NULL, default_value);
|
||||
@ -241,7 +241,7 @@ mca_btl_portals_component_init(int *num_btls,
|
||||
|
||||
*num_btls = 0;
|
||||
|
||||
if (enable_progress_threads || enable_mpi_threads) {
|
||||
if (enable_progress_threads) {
|
||||
opal_output_verbose(20, mca_btl_portals_component.portals_output,
|
||||
"disabled because threads enabled");
|
||||
return NULL;
|
||||
|
@ -33,7 +33,7 @@ extern "C" {
|
||||
*/
|
||||
|
||||
struct mca_btl_base_endpoint_t {
|
||||
opal_list_item_t super;
|
||||
opal_list_item_t super;
|
||||
|
||||
/** BTL instance that created this connection */
|
||||
struct mca_btl_portals_module_t* endpoint_btl;
|
||||
|
@ -29,7 +29,7 @@ OBJ_CLASS_INSTANCE(mca_btl_portals_recv_chunk_t,
|
||||
NULL, NULL);
|
||||
|
||||
int
|
||||
mca_btl_portals_recv_enable(mca_btl_portals_module_t *module)
|
||||
mca_btl_portals_recv_enable(mca_btl_portals_module_t *btl)
|
||||
{
|
||||
ptl_md_t md;
|
||||
ptl_handle_md_t md_h;
|
||||
@ -46,40 +46,40 @@ mca_btl_portals_recv_enable(mca_btl_portals_module_t *module)
|
||||
md.user_ptr = NULL;
|
||||
md.eq_handle = PTL_EQ_NONE;
|
||||
|
||||
ret = PtlMEAttach(module->portals_ni_h,
|
||||
ret = PtlMEAttach(btl->portals_ni_h,
|
||||
BTL_PORTALS_SEND_TABLE_ID,
|
||||
any_proc,
|
||||
0, /* match */
|
||||
0, /* ignore */
|
||||
PTL_RETAIN,
|
||||
PTL_INS_AFTER,
|
||||
&(module->portals_recv_reject_me_h));
|
||||
&(btl->portals_recv_reject_me_h));
|
||||
if (PTL_OK != ret) {
|
||||
opal_output(mca_btl_portals_component.portals_output,
|
||||
"Error creating recv reject ME: %d", ret);
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
ret = PtlMDAttach(module->portals_recv_reject_me_h,
|
||||
ret = PtlMDAttach(btl->portals_recv_reject_me_h,
|
||||
md,
|
||||
PTL_RETAIN,
|
||||
&md_h);
|
||||
if (PTL_OK != ret) {
|
||||
opal_output(mca_btl_portals_component.portals_output,
|
||||
"Error attaching recv reject MD: %d", ret);
|
||||
mca_btl_portals_recv_disable(module);
|
||||
mca_btl_portals_recv_disable(btl);
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
/* create the recv chunks */
|
||||
for (i = 0 ; i < module->portals_recv_mds_num ; ++i) {
|
||||
for (i = 0 ; i < btl->portals_recv_mds_num ; ++i) {
|
||||
mca_btl_portals_recv_chunk_t *chunk =
|
||||
mca_btl_portals_recv_chunk_init(module);
|
||||
mca_btl_portals_recv_chunk_init(btl);
|
||||
if (NULL == chunk) {
|
||||
mca_btl_portals_recv_disable(module);
|
||||
mca_btl_portals_recv_disable(btl);
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
opal_list_append(&(module->portals_recv_chunks),
|
||||
opal_list_append(&(btl->portals_recv_chunks),
|
||||
(opal_list_item_t*) chunk);
|
||||
mca_btl_portals_activate_chunk(chunk);
|
||||
}
|
||||
@ -89,23 +89,23 @@ mca_btl_portals_recv_enable(mca_btl_portals_module_t *module)
|
||||
|
||||
|
||||
int
|
||||
mca_btl_portals_recv_disable(mca_btl_portals_module_t *module)
|
||||
mca_btl_portals_recv_disable(mca_btl_portals_module_t *btl)
|
||||
{
|
||||
opal_list_item_t *item;
|
||||
|
||||
if (opal_list_get_size(&module->portals_recv_chunks) > 0) {
|
||||
if (opal_list_get_size(&btl->portals_recv_chunks) > 0) {
|
||||
while (NULL !=
|
||||
(item = opal_list_remove_first(&module->portals_recv_chunks))) {
|
||||
(item = opal_list_remove_first(&btl->portals_recv_chunks))) {
|
||||
mca_btl_portals_recv_chunk_t *chunk =
|
||||
(mca_btl_portals_recv_chunk_t*) item;
|
||||
mca_btl_portals_recv_chunk_free(chunk);
|
||||
}
|
||||
}
|
||||
|
||||
if (PTL_INVALID_HANDLE != module->portals_recv_reject_me_h) {
|
||||
if (PTL_INVALID_HANDLE != btl->portals_recv_reject_me_h) {
|
||||
/* destroy the reject entry */
|
||||
PtlMEUnlink(module->portals_recv_reject_me_h);
|
||||
module->portals_recv_reject_me_h = PTL_INVALID_HANDLE;
|
||||
PtlMEUnlink(btl->portals_recv_reject_me_h);
|
||||
btl->portals_recv_reject_me_h = PTL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
@ -113,13 +113,13 @@ mca_btl_portals_recv_disable(mca_btl_portals_module_t *module)
|
||||
|
||||
|
||||
mca_btl_portals_recv_chunk_t*
|
||||
mca_btl_portals_recv_chunk_init(mca_btl_portals_module_t *module)
|
||||
mca_btl_portals_recv_chunk_init(mca_btl_portals_module_t *btl)
|
||||
{
|
||||
mca_btl_portals_recv_chunk_t *chunk;
|
||||
|
||||
chunk = OBJ_NEW(mca_btl_portals_recv_chunk_t);
|
||||
chunk->btl = module;
|
||||
chunk->length = module->portals_recv_mds_size;
|
||||
chunk->btl = btl;
|
||||
chunk->length = btl->portals_recv_mds_size;
|
||||
chunk->start = malloc(chunk->length);
|
||||
if (chunk->start == NULL) return NULL;
|
||||
|
||||
@ -158,7 +158,7 @@ mca_btl_portals_recv_chunk_free(mca_btl_portals_recv_chunk_t *chunk)
|
||||
|
||||
|
||||
int
|
||||
mca_btl_portals_process_recv(mca_btl_portals_module_t *module,
|
||||
mca_btl_portals_process_recv(mca_btl_portals_module_t *btl,
|
||||
ptl_event_t *ev)
|
||||
{
|
||||
mca_btl_portals_frag_t *frag = NULL;
|
||||
@ -197,7 +197,7 @@ mca_btl_portals_process_recv(mca_btl_portals_module_t *module,
|
||||
"received data for tag %d\n", tag);
|
||||
|
||||
/* it's a user, so we have to manually setup the segment */
|
||||
MCA_BTL_PORTALS_FRAG_ALLOC_USER(module, frag, ret);
|
||||
MCA_BTL_PORTALS_FRAG_ALLOC_USER(btl, frag, ret);
|
||||
frag->type = MCA_BTL_PORTALS_FRAG_RECV;
|
||||
frag->size = ev->mlength;
|
||||
frag->base.des_dst = &frag->segment;
|
||||
@ -220,12 +220,12 @@ mca_btl_portals_process_recv(mca_btl_portals_module_t *module,
|
||||
opal_atomic_mb();
|
||||
}
|
||||
|
||||
module->portals_reg[tag].cbfunc(&module->super,
|
||||
btl->portals_reg[tag].cbfunc(&btl->super,
|
||||
tag,
|
||||
&frag->base,
|
||||
module->portals_reg[tag].cbdata);
|
||||
mca_btl_portals_return_chunk_part(module, frag);
|
||||
MCA_BTL_PORTALS_FRAG_RETURN_USER(&module->super, frag);
|
||||
btl->portals_reg[tag].cbdata);
|
||||
mca_btl_portals_return_chunk_part(btl, frag);
|
||||
MCA_BTL_PORTALS_FRAG_RETURN_USER(&btl->super, frag);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -36,11 +36,11 @@ typedef struct mca_btl_portals_recv_chunk_t mca_btl_portals_recv_chunk_t;
|
||||
OBJ_CLASS_DECLARATION(mca_btl_portals_recv_chunk_t);
|
||||
|
||||
|
||||
int mca_btl_portals_recv_enable(mca_btl_portals_module_t *module);
|
||||
int mca_btl_portals_recv_enable(mca_btl_portals_module_t *btl);
|
||||
|
||||
int mca_btl_portals_recv_disable(mca_btl_portals_module_t *module);
|
||||
int mca_btl_portals_recv_disable(mca_btl_portals_module_t *btl);
|
||||
|
||||
int mca_btl_portals_process_recv(mca_btl_portals_module_t *module,
|
||||
int mca_btl_portals_process_recv(mca_btl_portals_module_t *btl,
|
||||
ptl_event_t *ev);
|
||||
|
||||
/**
|
||||
@ -51,7 +51,7 @@ int mca_btl_portals_process_recv(mca_btl_portals_module_t *module,
|
||||
* Module lock must be held before calling this function
|
||||
*/
|
||||
mca_btl_portals_recv_chunk_t*
|
||||
mca_btl_portals_recv_chunk_init(mca_btl_portals_module_t *module);
|
||||
mca_btl_portals_recv_chunk_init(mca_btl_portals_module_t *btl);
|
||||
|
||||
|
||||
/**
|
||||
@ -123,7 +123,7 @@ mca_btl_portals_activate_chunk(mca_btl_portals_recv_chunk_t *chunk)
|
||||
|
||||
|
||||
static inline void
|
||||
mca_btl_portals_return_chunk_part(mca_btl_portals_module_t *module,
|
||||
mca_btl_portals_return_chunk_part(mca_btl_portals_module_t *btl,
|
||||
mca_btl_portals_frag_t *frag)
|
||||
{
|
||||
mca_btl_portals_recv_chunk_t *chunk = frag->u.recv_frag.chunk;
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
|
||||
int
|
||||
mca_btl_portals_process_send(mca_btl_portals_module_t *module,
|
||||
mca_btl_portals_process_send(mca_btl_portals_module_t *btl,
|
||||
ptl_event_t *ev)
|
||||
{
|
||||
mca_btl_portals_frag_t *frag =
|
||||
@ -39,7 +39,7 @@ mca_btl_portals_process_send(mca_btl_portals_module_t *module,
|
||||
if (ev->ni_fail_type != PTL_NI_OK) {
|
||||
opal_output(mca_btl_portals_component.portals_output,
|
||||
"Failure to start send event\n");
|
||||
frag->base.des_cbfunc(&module->super,
|
||||
frag->base.des_cbfunc(&btl->super,
|
||||
frag->u.send_frag.endpoint,
|
||||
&frag->base,
|
||||
OMPI_ERROR);
|
||||
@ -53,7 +53,7 @@ mca_btl_portals_process_send(mca_btl_portals_module_t *module,
|
||||
if (ev->ni_fail_type != PTL_NI_OK) {
|
||||
opal_output(mca_btl_portals_component.portals_output,
|
||||
"Failure to end send event\n");
|
||||
frag->base.des_cbfunc(&module->super,
|
||||
frag->base.des_cbfunc(&btl->super,
|
||||
frag->u.send_frag.endpoint,
|
||||
&frag->base,
|
||||
OMPI_ERROR);
|
||||
@ -70,7 +70,7 @@ mca_btl_portals_process_send(mca_btl_portals_module_t *module,
|
||||
if (ev->ni_fail_type != PTL_NI_OK) {
|
||||
opal_output(mca_btl_portals_component.portals_output,
|
||||
"Failure to end send event\n");
|
||||
frag->base.des_cbfunc(&module->super,
|
||||
frag->base.des_cbfunc(&btl->super,
|
||||
frag->u.send_frag.endpoint,
|
||||
&frag->base,
|
||||
OMPI_ERROR);
|
||||
@ -80,25 +80,25 @@ mca_btl_portals_process_send(mca_btl_portals_module_t *module,
|
||||
/* BWB - implement check for retransmit */
|
||||
opal_output(mca_btl_portals_component.portals_output,
|
||||
"message was dropped. Adding to front of queue list");
|
||||
opal_list_prepend(&(module->portals_queued_sends),
|
||||
opal_list_prepend(&(btl->portals_queued_sends),
|
||||
(opal_list_item_t*) frag);
|
||||
|
||||
} else {
|
||||
/* the other side received the message */
|
||||
OPAL_THREAD_ADD32(&module->portals_outstanding_sends, -1);
|
||||
OPAL_THREAD_ADD32(&btl->portals_outstanding_sends, -1);
|
||||
/* we're done with the md - return it. Do this before
|
||||
anything else in case the PML releases resources, then
|
||||
gets more resources (ie, what's currently in this
|
||||
md) */
|
||||
PtlMDUnlink(ev->md_handle);
|
||||
/* let the PML know we're done... */
|
||||
frag->base.des_cbfunc(&module->super,
|
||||
frag->base.des_cbfunc(&btl->super,
|
||||
frag->u.send_frag.endpoint,
|
||||
&frag->base,
|
||||
OMPI_SUCCESS);
|
||||
|
||||
/* see if we can send someone else */
|
||||
mca_btl_portals_progress_queued_sends(module);
|
||||
mca_btl_portals_progress_queued_sends(btl);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -116,35 +116,35 @@ mca_btl_portals_process_send(mca_btl_portals_module_t *module,
|
||||
|
||||
|
||||
int
|
||||
mca_btl_portals_send(struct mca_btl_base_module_t* btl,
|
||||
mca_btl_portals_send(struct mca_btl_base_module_t* btl_base,
|
||||
struct mca_btl_base_endpoint_t* endpoint,
|
||||
struct mca_btl_base_descriptor_t* descriptor,
|
||||
mca_btl_base_tag_t tag)
|
||||
{
|
||||
mca_btl_portals_module_t *ptl_btl = (mca_btl_portals_module_t*) btl;
|
||||
mca_btl_portals_module_t *btl = (mca_btl_portals_module_t*) btl_base;
|
||||
mca_btl_portals_frag_t *frag = (mca_btl_portals_frag_t*) descriptor;
|
||||
int32_t num_sends;
|
||||
int ret;
|
||||
|
||||
frag->u.send_frag.endpoint = endpoint;
|
||||
frag->u.send_frag.hdr.tag = tag;
|
||||
frag->u.send_frag.btl = ptl_btl;
|
||||
frag->u.send_frag.btl = btl;
|
||||
|
||||
num_sends = OPAL_THREAD_ADD32(&ptl_btl->portals_outstanding_sends, 1);
|
||||
num_sends = OPAL_THREAD_ADD32(&btl->portals_outstanding_sends, 1);
|
||||
|
||||
/* BWB - implement check for too many pending messages */
|
||||
opal_output_verbose(90, mca_btl_portals_component.portals_output,
|
||||
"send called for frag 0x%x, 0x%x",
|
||||
frag, frag->base.des_cbfunc);
|
||||
|
||||
if (num_sends >= ptl_btl->portals_max_outstanding_sends) {
|
||||
if (num_sends >= btl->portals_max_outstanding_sends) {
|
||||
opal_output(mca_btl_portals_component.portals_output,
|
||||
"no space for message 0x%x. Adding to back of queue",
|
||||
frag);
|
||||
opal_list_append(&(ptl_btl->portals_queued_sends),
|
||||
opal_list_append(&(btl->portals_queued_sends),
|
||||
(opal_list_item_t*) frag);
|
||||
|
||||
OPAL_THREAD_ADD32(&ptl_btl->portals_outstanding_sends, 1);
|
||||
OPAL_THREAD_ADD32(&btl->portals_outstanding_sends, 1);
|
||||
|
||||
ret = OMPI_SUCCESS;
|
||||
} else {
|
||||
|
@ -70,17 +70,17 @@ mca_btl_portals_send_frag(mca_btl_portals_frag_t *frag)
|
||||
|
||||
|
||||
static inline int
|
||||
mca_btl_portals_progress_queued_sends(struct mca_btl_portals_module_t *module)
|
||||
mca_btl_portals_progress_queued_sends(struct mca_btl_portals_module_t *btl)
|
||||
{
|
||||
if ((0 != opal_list_get_size(&(module->portals_queued_sends))) &&
|
||||
(module->portals_outstanding_sends <
|
||||
module->portals_max_outstanding_sends)) {
|
||||
if ((0 != opal_list_get_size(&(btl->portals_queued_sends))) &&
|
||||
(btl->portals_outstanding_sends <
|
||||
btl->portals_max_outstanding_sends)) {
|
||||
mca_btl_portals_frag_t *frag = (mca_btl_portals_frag_t*)
|
||||
opal_list_remove_first(&(module->portals_queued_sends));
|
||||
opal_list_remove_first(&(btl->portals_queued_sends));
|
||||
opal_output_verbose(90, mca_btl_portals_component.portals_output,
|
||||
"retransmit for frag 0x%x, 0x%x",
|
||||
frag, frag->base.des_cbfunc);
|
||||
return mca_btl_portals_send(&module->super,
|
||||
return mca_btl_portals_send(&btl->super,
|
||||
frag->u.send_frag.endpoint,
|
||||
&(frag->base),
|
||||
frag->u.send_frag.hdr.tag);
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
mca_btl_base_descriptor_t*
|
||||
mca_btl_portals_prepare_dst(struct mca_btl_base_module_t* btl,
|
||||
mca_btl_portals_prepare_dst(struct mca_btl_base_module_t* btl_base,
|
||||
struct mca_btl_base_endpoint_t* peer,
|
||||
mca_mpool_base_registration_t* registration,
|
||||
struct ompi_convertor_t* convertor,
|
||||
@ -44,7 +44,7 @@ mca_btl_portals_prepare_dst(struct mca_btl_base_module_t* btl,
|
||||
|
||||
|
||||
int
|
||||
mca_btl_portals_put(struct mca_btl_base_module_t* btl,
|
||||
mca_btl_portals_put(struct mca_btl_base_module_t* btl_base,
|
||||
struct mca_btl_base_endpoint_t* btl_peer,
|
||||
struct mca_btl_base_descriptor_t* decriptor)
|
||||
{
|
||||
@ -54,7 +54,7 @@ mca_btl_portals_put(struct mca_btl_base_module_t* btl,
|
||||
|
||||
|
||||
int
|
||||
mca_btl_portals_get(struct mca_btl_base_module_t* btl,
|
||||
mca_btl_portals_get(struct mca_btl_base_module_t* btl_base,
|
||||
struct mca_btl_base_endpoint_t* btl_peer,
|
||||
struct mca_btl_base_descriptor_t* decriptor)
|
||||
{
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user