Get rid of some annoying compiler warnings.
This commit was SVN r1898.
Этот коммит содержится в:
родитель
e30b55565c
Коммит
d2df4acb65
@ -267,7 +267,7 @@ static void mca_oob_tcp_recv_handler(int sd, short flags, void* user)
|
||||
mca_oob_t* mca_oob_tcp_init(bool *allow_multi_user_threads, bool *have_hidden_threads)
|
||||
{
|
||||
/* initialize data structures */
|
||||
ompi_rb_tree_init(&mca_oob_tcp_component.tcp_peer_tree, (ompi_rb_tree_comp_fn_t)ompi_process_name_compare);
|
||||
ompi_rb_tree_init(&mca_oob_tcp_component.tcp_peer_tree, (ompi_rb_tree_comp_fn_t)mca_oob_tcp_process_name_compare);
|
||||
|
||||
ompi_free_list_init(&mca_oob_tcp_component.tcp_peer_free,
|
||||
sizeof(mca_oob_tcp_peer_t),
|
||||
@ -322,3 +322,33 @@ int mca_oob_tcp_finalize(void)
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare two process names for equality.
|
||||
*
|
||||
* @param n1 Process name 1.
|
||||
* @param n2 Process name 2.
|
||||
* @return (-1 for n1<n2 0 for equality, 1 for n1>n2)
|
||||
*
|
||||
* Note that the definition of < or > is somewhat arbitrary -
|
||||
* just needs to be consistently applied to maintain an ordering
|
||||
* when process names are used as indices.
|
||||
*/
|
||||
|
||||
|
||||
int mca_oob_tcp_process_name_compare(const ompi_process_name_t* n1, const ompi_process_name_t* n2)
|
||||
{
|
||||
if(n1->cellid < n2->cellid)
|
||||
return -1;
|
||||
else if(n1->cellid > n2->cellid)
|
||||
return 1;
|
||||
else if(n1->jobid < n2->jobid)
|
||||
return -1;
|
||||
else if(n1->jobid > n2->jobid)
|
||||
return 1;
|
||||
else if(n1->vpid < n2->vpid)
|
||||
return -1;
|
||||
else if(n1->vpid > n2->vpid)
|
||||
return 1;
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
@ -67,23 +67,7 @@ int mca_oob_tcp_finalize(void);
|
||||
* just needs to be consistently applied to maintain an ordering
|
||||
* when process names are used as indices.
|
||||
*/
|
||||
|
||||
static int ompi_process_name_compare(const ompi_process_name_t* n1, const ompi_process_name_t* n2)
|
||||
{
|
||||
if(n1->cellid < n2->cellid)
|
||||
return -1;
|
||||
else if(n1->cellid > n2->cellid)
|
||||
return 1;
|
||||
else if(n1->jobid < n2->jobid)
|
||||
return -1;
|
||||
else if(n1->jobid > n2->jobid)
|
||||
return 1;
|
||||
else if(n1->vpid < n2->vpid)
|
||||
return -1;
|
||||
else if(n1->vpid > n2->vpid)
|
||||
return 1;
|
||||
return(0);
|
||||
}
|
||||
int mca_oob_tcp_process_name_compare(const ompi_process_name_t* n1, const ompi_process_name_t* n2);
|
||||
|
||||
/**
|
||||
* Similiar to unix writev(2).
|
||||
|
@ -211,8 +211,8 @@ mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_recv(const ompi_process_name_t* name, i
|
||||
msg != (mca_oob_tcp_msg_t*) ompi_list_get_end(&mca_oob_tcp_component.tcp_msg_recv);
|
||||
msg = (mca_oob_tcp_msg_t*) ompi_list_get_next(msg)) {
|
||||
|
||||
if((0 == ompi_process_name_compare(name,MCA_OOB_NAME_ANY) ||
|
||||
(0 == ompi_process_name_compare(name, &msg->msg_peer)))) {
|
||||
if((0 == mca_oob_tcp_process_name_compare(name,MCA_OOB_NAME_ANY) ||
|
||||
(0 == mca_oob_tcp_process_name_compare(name, &msg->msg_peer)))) {
|
||||
if (tag == MCA_OOB_TAG_ANY || tag == msg->msg_hdr.msg_tag) {
|
||||
return msg;
|
||||
}
|
||||
@ -237,8 +237,8 @@ mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_post(const ompi_process_name_t* name, i
|
||||
msg != (mca_oob_tcp_msg_t*) ompi_list_get_end(&mca_oob_tcp_component.tcp_msg_post);
|
||||
msg = (mca_oob_tcp_msg_t*) ompi_list_get_next(msg)) {
|
||||
|
||||
if((0 == ompi_process_name_compare(&msg->msg_peer,MCA_OOB_NAME_ANY) ||
|
||||
(0 == ompi_process_name_compare(&msg->msg_peer,name)))) {
|
||||
if((0 == mca_oob_tcp_process_name_compare(&msg->msg_peer,MCA_OOB_NAME_ANY) ||
|
||||
(0 == mca_oob_tcp_process_name_compare(&msg->msg_peer,name)))) {
|
||||
if (msg->msg_hdr.msg_tag == MCA_OOB_TAG_ANY || msg->msg_hdr.msg_tag == tag) {
|
||||
if((msg->msg_flags & MCA_OOB_PEEK) == 0 || peek) {
|
||||
ompi_list_remove_item(&mca_oob_tcp_component.tcp_msg_post, &msg->super);
|
||||
|
@ -706,7 +706,7 @@ bool mca_oob_tcp_peer_accept(mca_oob_tcp_peer_t* peer, int sd)
|
||||
OMPI_THREAD_LOCK(&peer->peer_lock);
|
||||
if ((peer->peer_state == MCA_OOB_TCP_CLOSED) ||
|
||||
(peer->peer_state != MCA_OOB_TCP_CONNECTED &&
|
||||
ompi_process_name_compare(&peer->peer_name, MCA_OOB_NAME_SELF) < 0)) {
|
||||
mca_oob_tcp_process_name_compare(&peer->peer_name, MCA_OOB_NAME_SELF) < 0)) {
|
||||
mca_oob_tcp_peer_close(peer);
|
||||
peer->peer_sd = sd;
|
||||
mca_oob_tcp_peer_event_init(peer);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user