fixed more 64 bit SCTP BTL warnings
This commit was SVN r17022.
Этот коммит содержится в:
родитель
95fa693273
Коммит
4c2571b54c
@ -818,9 +818,11 @@ mca_btl_base_module_t** mca_btl_sctp_component_init(int *num_btl_modules,
|
||||
for(i = 0; i < MCA_BTL_SCTP_PROC_TABLE_SIZE; i++) {
|
||||
recvr_proc_table[i].valid = 0;
|
||||
recvr_proc_table[i].sctp_assoc_id = 0;
|
||||
recvr_proc_table[i].vpid = 0;
|
||||
recvr_proc_table[i].proc = NULL;
|
||||
sender_proc_table[i].valid = 0;
|
||||
sender_proc_table[i].sctp_assoc_id = 0;
|
||||
sender_proc_table[i].vpid = 0;
|
||||
sender_proc_table[i].proc = NULL;
|
||||
}
|
||||
#endif
|
||||
|
@ -361,16 +361,16 @@ int mca_btl_sctp_endpoint_send(mca_btl_base_endpoint_t* btl_endpoint, mca_btl_sc
|
||||
int rc = OMPI_SUCCESS;
|
||||
|
||||
/* What if there are multiple procs on this endpoint? Possible? */
|
||||
sctp_assoc_t vpid = (sctp_assoc_t) btl_endpoint->endpoint_proc->proc_name.vpid;
|
||||
orte_vpid_t vpid = btl_endpoint->endpoint_proc->proc_name.vpid;
|
||||
OPAL_THREAD_LOCK(&btl_endpoint->endpoint_send_lock);
|
||||
|
||||
if((mca_btl_sctp_proc_check(vpid, sender_proc_table)) == INVALID_ENTRY) {
|
||||
if((mca_btl_sctp_proc_check_vpid(vpid, sender_proc_table)) == INVALID_ENTRY) {
|
||||
opal_list_append(&btl_endpoint->endpoint_frags, (opal_list_item_t*)frag);
|
||||
|
||||
rc = mca_btl_sctp_endpoint_start_connect(btl_endpoint);
|
||||
|
||||
/* add the proc to sender_proc_table somewhere here */
|
||||
mca_btl_sctp_proc_add(vpid, btl_endpoint->endpoint_proc, sender_proc_table);
|
||||
mca_btl_sctp_proc_add_vpid(vpid, btl_endpoint->endpoint_proc, sender_proc_table);
|
||||
}
|
||||
else { /* VALID_ENTRY */
|
||||
|
||||
@ -1183,11 +1183,11 @@ static void mca_btl_sctp_endpoint_send_handler(int sd, short flags, void* user)
|
||||
/* 1 to many */
|
||||
mca_btl_sctp_endpoint_t* btl_endpoint = (mca_btl_sctp_endpoint_t *)user;
|
||||
our_sctp_endpoint *current_our_endpoint = NULL;
|
||||
sctp_assoc_t vpid;
|
||||
orte_vpid_t vpid;
|
||||
send_handler_1_to_many_different_endpoint:
|
||||
vpid = (sctp_assoc_t) btl_endpoint->endpoint_proc->proc_name.vpid;
|
||||
vpid = btl_endpoint->endpoint_proc->proc_name.vpid;
|
||||
OPAL_THREAD_LOCK(&btl_endpoint->endpoint_send_lock);
|
||||
if((mca_btl_sctp_proc_check(vpid, sender_proc_table)) == VALID_ENTRY) {
|
||||
if((mca_btl_sctp_proc_check_vpid(vpid, sender_proc_table)) == VALID_ENTRY) {
|
||||
/* complete the current send */
|
||||
do {
|
||||
mca_btl_sctp_frag_t* frag = btl_endpoint->endpoint_send_frag;
|
||||
|
@ -362,16 +362,17 @@ bool mca_btl_sctp_proc_accept(mca_btl_sctp_proc_t* btl_proc, struct sockaddr_in*
|
||||
*
|
||||
* TODO - change this to use a hash for constant time performance
|
||||
*/
|
||||
int mca_btl_sctp_proc_check(sctp_assoc_t id, struct mca_btl_sctp_proc_table_node *table) {
|
||||
static int mca_btl_sctp_proc_check(int is_vpid, sctp_assoc_t id, orte_vpid_t vpid, struct mca_btl_sctp_proc_table_node *table) {
|
||||
#if MCA_BTL_SCTP_DONT_USE_HASH
|
||||
int i;
|
||||
for(i = 0; i < MCA_BTL_SCTP_PROC_TABLE_SIZE; i++) {
|
||||
/* sender_proc_table uses orte_vpid_t.
|
||||
* recvr_proc_table uses sctp_assoc_id.
|
||||
* This code assumes sizeof(sctp_assoc_id) >= sizeof(orte_vpid_t). if this
|
||||
* is false, we need a second _check function.
|
||||
* Calls using this function use one or the other.
|
||||
*/
|
||||
if(table[i].valid && table[i].sctp_assoc_id == id) {
|
||||
if((0 == is_vpid && table[i].valid && table[i].sctp_assoc_id == id) ||
|
||||
(1 == is_vpid && table[i].valid && table[i].vpid == vpid))
|
||||
{
|
||||
return VALID_ENTRY;
|
||||
} else if(table[i].valid == 0) {
|
||||
/* once invalid is found, can return INVALID_ENTRY (added incrementally) */
|
||||
@ -391,6 +392,15 @@ int mca_btl_sctp_proc_check(sctp_assoc_t id, struct mca_btl_sctp_proc_table_node
|
||||
#endif
|
||||
}
|
||||
|
||||
int mca_btl_sctp_proc_check_vpid(orte_vpid_t vpid, struct mca_btl_sctp_proc_table_node *table) {
|
||||
return mca_btl_sctp_proc_check(1, 0, vpid, table);
|
||||
}
|
||||
|
||||
int mca_btl_sctp_proc_check_assoc_id(sctp_assoc_t id, struct mca_btl_sctp_proc_table_node *table) {
|
||||
return mca_btl_sctp_proc_check(0, id, 0, table);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* void mca_btl_sctp_proc_add
|
||||
@ -400,12 +410,13 @@ int mca_btl_sctp_proc_check(sctp_assoc_t id, struct mca_btl_sctp_proc_table_node
|
||||
* TODO change this to a hash table that can expand to eliminate
|
||||
* MCA_BTL_SCTP_PROC_TABLE_SIZE limitation
|
||||
*/
|
||||
void mca_btl_sctp_proc_add(sctp_assoc_t id, struct mca_btl_sctp_proc_t *proc, struct mca_btl_sctp_proc_table_node *table) {
|
||||
static void mca_btl_sctp_proc_add(sctp_assoc_t id, orte_vpid_t vpid, struct mca_btl_sctp_proc_t *proc, struct mca_btl_sctp_proc_table_node *table) {
|
||||
#if MCA_BTL_SCTP_DONT_USE_HASH
|
||||
int i;
|
||||
for(i = 0; i < MCA_BTL_SCTP_PROC_TABLE_SIZE; i++) {
|
||||
if(table[i].sctp_assoc_id == 0 && table[i].valid == 0) {
|
||||
if(table[i].sctp_assoc_id == 0 && table[i].vpid == 0 && table[i].valid == 0) {
|
||||
table[i].sctp_assoc_id = id;
|
||||
table[i].vpid = vpid;
|
||||
table[i].proc = proc;
|
||||
table[i].valid = 1;
|
||||
return;
|
||||
@ -418,6 +429,14 @@ void mca_btl_sctp_proc_add(sctp_assoc_t id, struct mca_btl_sctp_proc_t *proc, st
|
||||
#endif
|
||||
}
|
||||
|
||||
void mca_btl_sctp_proc_add_vpid(orte_vpid_t vpid, struct mca_btl_sctp_proc_t *proc, struct mca_btl_sctp_proc_table_node *table) {
|
||||
mca_btl_sctp_proc_add(0, vpid, proc, table);
|
||||
}
|
||||
|
||||
void mca_btl_sctp_proc_add_assoc_id(sctp_assoc_t id, struct mca_btl_sctp_proc_t *proc, struct mca_btl_sctp_proc_table_node *table) {
|
||||
mca_btl_sctp_proc_add(id, 0, proc, table);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* mca_btl_sctp_proc_t* mca_btl_sctp_proc_get
|
||||
|
@ -96,6 +96,7 @@ enum {
|
||||
struct mca_btl_sctp_proc_table_node {
|
||||
int valid;
|
||||
sctp_assoc_t sctp_assoc_id;
|
||||
orte_vpid_t vpid;
|
||||
struct mca_btl_sctp_proc_t *proc;
|
||||
};
|
||||
typedef struct mca_btl_sctp_proc_table_node mca_btl_sctp_proc_table_node;
|
||||
@ -103,8 +104,10 @@ typedef struct mca_btl_sctp_proc_table_node mca_btl_sctp_proc_table_node;
|
||||
extern struct mca_btl_sctp_proc_table_node *recvr_proc_table;
|
||||
extern struct mca_btl_sctp_proc_table_node *sender_proc_table;
|
||||
|
||||
int mca_btl_sctp_proc_check(sctp_assoc_t id, struct mca_btl_sctp_proc_table_node *table);
|
||||
void mca_btl_sctp_proc_add(sctp_assoc_t id, struct mca_btl_sctp_proc_t *proc, struct mca_btl_sctp_proc_table_node *table);
|
||||
int mca_btl_sctp_proc_check_vpid(orte_vpid_t vpid, struct mca_btl_sctp_proc_table_node *table);
|
||||
int mca_btl_sctp_proc_check_assoc_id(sctp_assoc_t id, struct mca_btl_sctp_proc_table_node *table);
|
||||
void mca_btl_sctp_proc_add_vpid(orte_vpid_t vpid, struct mca_btl_sctp_proc_t *proc, struct mca_btl_sctp_proc_table_node *table);
|
||||
void mca_btl_sctp_proc_add_assoc_id(sctp_assoc_t id, struct mca_btl_sctp_proc_t *proc, struct mca_btl_sctp_proc_table_node *table);
|
||||
mca_btl_sctp_proc_t *mca_btl_sctp_proc_get(sctp_assoc_t id, struct mca_btl_sctp_proc_table_node *table);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
|
@ -141,7 +141,7 @@ void mca_btl_sctp_recv_handler(int sd, short flags, void *user) {
|
||||
|
||||
/* Check if sender is known to us. */
|
||||
|
||||
if((mca_btl_sctp_proc_check(sri.sinfo_assoc_id, recvr_proc_table)) == VALID_ENTRY) {
|
||||
if((mca_btl_sctp_proc_check_assoc_id(sri.sinfo_assoc_id, recvr_proc_table)) == VALID_ENTRY) {
|
||||
|
||||
mca_btl_base_endpoint_t *btl_endpoint;
|
||||
mca_btl_sctp_frag_t* frag;
|
||||
@ -233,7 +233,7 @@ data_still_pending_on_endpoint:
|
||||
CLOSE_THE_SOCKET(sd);
|
||||
return;
|
||||
}
|
||||
mca_btl_sctp_proc_add(sri.sinfo_assoc_id, btl_proc, recvr_proc_table);
|
||||
mca_btl_sctp_proc_add_assoc_id(sri.sinfo_assoc_id, btl_proc, recvr_proc_table);
|
||||
|
||||
|
||||
/* are there any existing peer instances will to accept this connection */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user