cleanup pml/ptl init
This commit was SVN r641.
Этот коммит содержится в:
родитель
965c44204c
Коммит
103cb62480
@ -11,7 +11,7 @@
|
|||||||
#include "lam/mem/seg_list.h"
|
#include "lam/mem/seg_list.h"
|
||||||
#include "lam/mem/mem_pool.h"
|
#include "lam/mem/mem_pool.h"
|
||||||
|
|
||||||
extern lam_class_info_t lam_free_lists_cls;
|
extern lam_class_info_t lam_free_list_cls;
|
||||||
|
|
||||||
|
|
||||||
struct lam_free_list_t
|
struct lam_free_list_t
|
||||||
|
@ -30,6 +30,7 @@ struct mca_pml_teg_t {
|
|||||||
mca_ptl_t** teg_ptls;
|
mca_ptl_t** teg_ptls;
|
||||||
size_t teg_num_ptls;
|
size_t teg_num_ptls;
|
||||||
|
|
||||||
|
lam_list_t teg_procs;
|
||||||
lam_list_t teg_incomplete_sends;
|
lam_list_t teg_incomplete_sends;
|
||||||
lam_mutex_t teg_lock;
|
lam_mutex_t teg_lock;
|
||||||
|
|
||||||
@ -38,6 +39,7 @@ struct mca_pml_teg_t {
|
|||||||
int teg_free_list_inc; /* number of elements to grow free list */
|
int teg_free_list_inc; /* number of elements to grow free list */
|
||||||
lam_free_list_t teg_recv_requests;
|
lam_free_list_t teg_recv_requests;
|
||||||
mca_ptl_base_sequence_t teg_recv_sequence;
|
mca_ptl_base_sequence_t teg_recv_sequence;
|
||||||
|
|
||||||
};
|
};
|
||||||
typedef struct mca_pml_teg_t mca_pml_teg_t;
|
typedef struct mca_pml_teg_t mca_pml_teg_t;
|
||||||
|
|
||||||
|
@ -98,7 +98,8 @@ mca_pml_t* mca_pml_teg_module_init(int* priority,
|
|||||||
mca_pml_teg.teg_free_list_inc,
|
mca_pml_teg.teg_free_list_inc,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
lam_list_init(&mca_pml_teg.teg_incomplete_sends);
|
STATIC_INIT(mca_pml_teg.teg_incomplete_sends, &lam_list_cls);
|
||||||
|
STATIC_INIT(mca_pml_teg.teg_procs, &lam_list_cls);
|
||||||
lam_mutex_init(&mca_pml_teg.teg_lock);
|
lam_mutex_init(&mca_pml_teg.teg_lock);
|
||||||
mca_pml_teg.teg_recv_sequence = 0;
|
mca_pml_teg.teg_recv_sequence = 0;
|
||||||
return &mca_pml_teg.super;
|
return &mca_pml_teg.super;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "lam/atomic.h"
|
#include "lam/atomic.h"
|
||||||
|
#include "pml_teg.h"
|
||||||
#include "pml_teg_proc.h"
|
#include "pml_teg_proc.h"
|
||||||
#include "pml_ptl_array.h"
|
#include "pml_ptl_array.h"
|
||||||
|
|
||||||
@ -13,24 +14,25 @@ lam_class_info_t mca_pml_teg_proc_cls = {
|
|||||||
(class_destroy_t) mca_pml_teg_proc_destroy
|
(class_destroy_t) mca_pml_teg_proc_destroy
|
||||||
};
|
};
|
||||||
|
|
||||||
static lam_list_t mca_pml_teg_procs;
|
|
||||||
|
|
||||||
|
|
||||||
void mca_pml_teg_proc_init(mca_pml_proc_t* proc)
|
void mca_pml_teg_proc_init(mca_pml_proc_t* proc)
|
||||||
{
|
{
|
||||||
static int init = 0;
|
|
||||||
if(fetchNset(&init,1) == 0)
|
|
||||||
STATIC_INIT(mca_pml_teg_procs, &lam_list_cls);
|
|
||||||
SUPER_INIT(proc, &lam_list_item_cls);
|
SUPER_INIT(proc, &lam_list_item_cls);
|
||||||
mca_ptl_array_init(&proc->proc_ptl_first);
|
mca_ptl_array_init(&proc->proc_ptl_first);
|
||||||
mca_ptl_array_init(&proc->proc_ptl_next);
|
mca_ptl_array_init(&proc->proc_ptl_next);
|
||||||
lam_list_append(&mca_pml_teg_procs, (lam_list_item_t*)proc);
|
|
||||||
|
THREAD_LOCK(&mca_pml_teg.teg_lock);
|
||||||
|
lam_list_append(&mca_pml_teg.teg_procs, (lam_list_item_t*)proc);
|
||||||
|
THREAD_UNLOCK(&mca_pml_teg.teg_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void mca_pml_teg_proc_destroy(mca_pml_proc_t* proc)
|
void mca_pml_teg_proc_destroy(mca_pml_proc_t* proc)
|
||||||
{
|
{
|
||||||
lam_list_remove_item(&mca_pml_teg_procs, (lam_list_item_t*)proc);
|
THREAD_LOCK(&mca_pml_teg.teg_lock);
|
||||||
|
lam_list_remove_item(&mca_pml_teg.teg_procs, (lam_list_item_t*)proc);
|
||||||
|
THREAD_UNLOCK(&mca_pml_teg.teg_lock);
|
||||||
|
|
||||||
SUPER_DESTROY(proc, &lam_list_item_cls);
|
SUPER_DESTROY(proc, &lam_list_item_cls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ static void mca_ptl_base_check_cantmatch_for_match(
|
|||||||
* - this routine may be called simoultaneously by more than one thread
|
* - this routine may be called simoultaneously by more than one thread
|
||||||
*/
|
*/
|
||||||
int mca_ptl_base_match(mca_ptl_base_header_t *frag_header,
|
int mca_ptl_base_match(mca_ptl_base_header_t *frag_header,
|
||||||
mca_ptl_base_recv_frag_t *frag_desc, int *match_made,
|
mca_ptl_base_recv_frag_t *frag_desc, bool* match_made,
|
||||||
lam_list_t *additional_matches)
|
lam_list_t *additional_matches)
|
||||||
{
|
{
|
||||||
/* local variables */
|
/* local variables */
|
||||||
@ -85,7 +85,7 @@ int mca_ptl_base_match(mca_ptl_base_header_t *frag_header,
|
|||||||
int frag_src;
|
int frag_src;
|
||||||
|
|
||||||
/* initialization */
|
/* initialization */
|
||||||
*match_made=0;
|
*match_made=false;
|
||||||
|
|
||||||
/* communicator pointer */
|
/* communicator pointer */
|
||||||
comm_ptr=lam_comm_lookup(frag_header->hdr_contextid);
|
comm_ptr=lam_comm_lookup(frag_header->hdr_contextid);
|
||||||
@ -128,7 +128,7 @@ int mca_ptl_base_match(mca_ptl_base_header_t *frag_header,
|
|||||||
if (matched_receive) {
|
if (matched_receive) {
|
||||||
|
|
||||||
/* set flag indicating the input fragment was matched */
|
/* set flag indicating the input fragment was matched */
|
||||||
*match_made=1;
|
*match_made=true;
|
||||||
/* associate the receive descriptor with the fragment
|
/* associate the receive descriptor with the fragment
|
||||||
* descriptor */
|
* descriptor */
|
||||||
frag_desc->frag_match=matched_receive;
|
frag_desc->frag_match=matched_receive;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#define MCA_PTL_BASE_MATCH_H
|
#define MCA_PTL_BASE_MATCH_H
|
||||||
|
|
||||||
int mca_ptl_base_match(mca_ptl_base_header_t *frag_header,
|
int mca_ptl_base_match(mca_ptl_base_header_t *frag_header,
|
||||||
mca_ptl_base_recv_frag_t *frag_desc, int *match_made,
|
mca_ptl_base_recv_frag_t *frag_desc, bool *match_made,
|
||||||
lam_list_t *additional_matches);
|
lam_list_t *additional_matches);
|
||||||
|
|
||||||
#endif /* MCA_PTL_BASE_MATCH_H */
|
#endif /* MCA_PTL_BASE_MATCH_H */
|
||||||
|
@ -99,7 +99,7 @@ int mca_ptl_tcp_del_proc(struct mca_ptl_t* ptl, struct lam_proc_t *proc, struct
|
|||||||
|
|
||||||
int mca_ptl_tcp_finalize(struct mca_ptl_t* ptl)
|
int mca_ptl_tcp_finalize(struct mca_ptl_t* ptl)
|
||||||
{
|
{
|
||||||
|
LAM_FREE(ptl);
|
||||||
return LAM_SUCCESS;
|
return LAM_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ struct mca_ptl_tcp_module_1_0_0_t {
|
|||||||
lam_free_list_t tcp_send_requests;
|
lam_free_list_t tcp_send_requests;
|
||||||
lam_free_list_t tcp_send_frags;
|
lam_free_list_t tcp_send_frags;
|
||||||
lam_free_list_t tcp_recv_frags;
|
lam_free_list_t tcp_recv_frags;
|
||||||
|
lam_list_t tcp_procs;
|
||||||
};
|
};
|
||||||
typedef struct mca_ptl_tcp_module_1_0_0_t mca_ptl_tcp_module_1_0_0_t;
|
typedef struct mca_ptl_tcp_module_1_0_0_t mca_ptl_tcp_module_1_0_0_t;
|
||||||
typedef struct mca_ptl_tcp_module_1_0_0_t mca_ptl_tcp_module_t;
|
typedef struct mca_ptl_tcp_module_1_0_0_t mca_ptl_tcp_module_t;
|
||||||
|
@ -127,6 +127,8 @@ int mca_ptl_tcp_module_close(void)
|
|||||||
{
|
{
|
||||||
LAM_FREE(mca_ptl_tcp_module.tcp_if_include);
|
LAM_FREE(mca_ptl_tcp_module.tcp_if_include);
|
||||||
LAM_FREE(mca_ptl_tcp_module.tcp_if_exclude);
|
LAM_FREE(mca_ptl_tcp_module.tcp_if_exclude);
|
||||||
|
if (NULL != mca_ptl_tcp_module.tcp_ptls)
|
||||||
|
LAM_FREE(mca_ptl_tcp_module.tcp_ptls);
|
||||||
return LAM_SUCCESS;
|
return LAM_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,8 +253,10 @@ static int mca_ptl_tcp_module_exchange(void)
|
|||||||
addrs[i].addr_port = mca_ptl_tcp_module.tcp_listen;
|
addrs[i].addr_port = mca_ptl_tcp_module.tcp_listen;
|
||||||
addrs[i].addr_inuse = 0;
|
addrs[i].addr_inuse = 0;
|
||||||
}
|
}
|
||||||
return mca_base_modex_send(&mca_ptl_tcp_module.super.ptlm_version,
|
int rc = mca_base_modex_send(&mca_ptl_tcp_module.super.ptlm_version,
|
||||||
addrs, sizeof(mca_ptl_tcp_t),mca_ptl_tcp_module.tcp_num_ptls);
|
addrs, sizeof(mca_ptl_tcp_t),mca_ptl_tcp_module.tcp_num_ptls);
|
||||||
|
LAM_FREE(addrs);
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -271,10 +275,10 @@ mca_ptl_t** mca_ptl_tcp_module_init(int *num_ptls,
|
|||||||
*have_hidden_threads = false;
|
*have_hidden_threads = false;
|
||||||
|
|
||||||
/* initialize containers */
|
/* initialize containers */
|
||||||
lam_reactor_init(&mca_ptl_tcp_module.tcp_reactor);
|
STATIC_INIT(mca_ptl_tcp_module.tcp_reactor, &lam_reactor_cls);
|
||||||
|
|
||||||
/* initialize free lists */
|
/* initialize free lists */
|
||||||
lam_free_list_init(&mca_ptl_tcp_module.tcp_send_requests);
|
STATIC_INIT(mca_ptl_tcp_module.tcp_send_requests, &lam_free_list_cls);
|
||||||
lam_free_list_init_with(&mca_ptl_tcp_module.tcp_send_requests,
|
lam_free_list_init_with(&mca_ptl_tcp_module.tcp_send_requests,
|
||||||
sizeof(mca_ptl_base_send_request_t) + sizeof(mca_ptl_tcp_send_frag_t),
|
sizeof(mca_ptl_base_send_request_t) + sizeof(mca_ptl_tcp_send_frag_t),
|
||||||
&mca_ptl_base_send_request_cls,
|
&mca_ptl_base_send_request_cls,
|
||||||
@ -283,7 +287,7 @@ mca_ptl_t** mca_ptl_tcp_module_init(int *num_ptls,
|
|||||||
mca_ptl_tcp_module.tcp_free_list_inc,
|
mca_ptl_tcp_module.tcp_free_list_inc,
|
||||||
NULL); /* use default allocator */
|
NULL); /* use default allocator */
|
||||||
|
|
||||||
lam_free_list_init(&mca_ptl_tcp_module.tcp_send_frags);
|
STATIC_INIT(mca_ptl_tcp_module.tcp_send_frags, &lam_free_list_cls);
|
||||||
lam_free_list_init_with(&mca_ptl_tcp_module.tcp_send_frags,
|
lam_free_list_init_with(&mca_ptl_tcp_module.tcp_send_frags,
|
||||||
sizeof(mca_ptl_tcp_send_frag_t),
|
sizeof(mca_ptl_tcp_send_frag_t),
|
||||||
&mca_ptl_tcp_send_frag_cls,
|
&mca_ptl_tcp_send_frag_cls,
|
||||||
@ -292,7 +296,7 @@ mca_ptl_t** mca_ptl_tcp_module_init(int *num_ptls,
|
|||||||
mca_ptl_tcp_module.tcp_free_list_inc,
|
mca_ptl_tcp_module.tcp_free_list_inc,
|
||||||
NULL); /* use default allocator */
|
NULL); /* use default allocator */
|
||||||
|
|
||||||
lam_free_list_init(&mca_ptl_tcp_module.tcp_recv_frags);
|
STATIC_INIT(mca_ptl_tcp_module.tcp_recv_frags, &lam_free_list_cls);
|
||||||
lam_free_list_init_with(&mca_ptl_tcp_module.tcp_recv_frags,
|
lam_free_list_init_with(&mca_ptl_tcp_module.tcp_recv_frags,
|
||||||
sizeof(mca_ptl_tcp_recv_frag_t),
|
sizeof(mca_ptl_tcp_recv_frag_t),
|
||||||
&mca_ptl_tcp_recv_frag_cls,
|
&mca_ptl_tcp_recv_frag_cls,
|
||||||
|
@ -94,7 +94,7 @@ static bool mca_ptl_tcp_recv_frag_header(mca_ptl_tcp_recv_frag_t* frag, int sd)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* attempt to match a posted recv */
|
/* attempt to match a posted recv */
|
||||||
/* ????? */
|
/* FIX */
|
||||||
|
|
||||||
/* match was not made - so allocate buffer for eager send */
|
/* match was not made - so allocate buffer for eager send */
|
||||||
if(NULL == frag->frag_match) {
|
if(NULL == frag->frag_match) {
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user