55 * Copyright (c) 2004-2006 The University of Tennessee and The University
66 * of Tennessee Research Foundation. All rights
77 * reserved.
8- * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
8+ * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
99 * University of Stuttgart. All rights reserved.
1010 * Copyright (c) 2004-2005 The Regents of the University of California.
1111 * All rights reserved.
1212 * Copyright (c) 2008-2012 Oracle and/or all its affiliates. All rights reserved.
1313 * Copyright (c) 2015 Research Organization for Information Science
1414 * and Technology (RIST). All rights reserved.
15+ * Copyright (c) 2017 Intel, Inc. All rights reserved.
1516 * $COPYRIGHT$
1617 *
1718 * Additional copyrights may follow
4142
4243#include "opal/opal_socket_errno.h"
4344#include "ompi/mca/btl/base/btl_base_error.h"
44- #include "btl_tcp_frag.h"
45+ #include "btl_tcp_frag.h"
4546#include "btl_tcp_endpoint.h"
4647
47- static void mca_btl_tcp_frag_common_constructor (mca_btl_tcp_frag_t * frag )
48- {
48+ static void mca_btl_tcp_frag_common_constructor (mca_btl_tcp_frag_t * frag )
49+ {
4950 frag -> base .des_src = NULL ;
5051 frag -> base .des_src_cnt = 0 ;
5152 frag -> base .des_dst = NULL ;
5253 frag -> base .des_dst_cnt = 0 ;
5354}
5455
55- static void mca_btl_tcp_frag_eager_constructor (mca_btl_tcp_frag_t * frag )
56- {
57- frag -> size = mca_btl_tcp_module .super .btl_eager_limit ;
56+ static void mca_btl_tcp_frag_eager_constructor (mca_btl_tcp_frag_t * frag )
57+ {
58+ frag -> size = mca_btl_tcp_module .super .btl_eager_limit ;
5859 frag -> my_list = & mca_btl_tcp_component .tcp_frag_eager ;
59- mca_btl_tcp_frag_common_constructor (frag );
60+ mca_btl_tcp_frag_common_constructor (frag );
6061}
6162
62- static void mca_btl_tcp_frag_max_constructor (mca_btl_tcp_frag_t * frag )
63- {
64- frag -> size = mca_btl_tcp_module .super .btl_max_send_size ;
63+ static void mca_btl_tcp_frag_max_constructor (mca_btl_tcp_frag_t * frag )
64+ {
65+ frag -> size = mca_btl_tcp_module .super .btl_max_send_size ;
6566 frag -> my_list = & mca_btl_tcp_component .tcp_frag_max ;
66- mca_btl_tcp_frag_common_constructor (frag );
67+ mca_btl_tcp_frag_common_constructor (frag );
6768}
6869
69- static void mca_btl_tcp_frag_user_constructor (mca_btl_tcp_frag_t * frag )
70- {
71- frag -> size = 0 ;
70+ static void mca_btl_tcp_frag_user_constructor (mca_btl_tcp_frag_t * frag )
71+ {
72+ frag -> size = 0 ;
7273 frag -> my_list = & mca_btl_tcp_component .tcp_frag_user ;
73- mca_btl_tcp_frag_common_constructor (frag );
74+ mca_btl_tcp_frag_common_constructor (frag );
7475}
7576
7677
7778OBJ_CLASS_INSTANCE (
78- mca_btl_tcp_frag_t ,
79- mca_btl_base_descriptor_t ,
80- NULL ,
81- NULL );
79+ mca_btl_tcp_frag_t ,
80+ mca_btl_base_descriptor_t ,
81+ NULL ,
82+ NULL );
8283
8384OBJ_CLASS_INSTANCE (
84- mca_btl_tcp_frag_eager_t ,
85- mca_btl_base_descriptor_t ,
86- mca_btl_tcp_frag_eager_constructor ,
87- NULL );
85+ mca_btl_tcp_frag_eager_t ,
86+ mca_btl_base_descriptor_t ,
87+ mca_btl_tcp_frag_eager_constructor ,
88+ NULL );
8889
8990OBJ_CLASS_INSTANCE (
90- mca_btl_tcp_frag_max_t ,
91- mca_btl_base_descriptor_t ,
92- mca_btl_tcp_frag_max_constructor ,
93- NULL );
91+ mca_btl_tcp_frag_max_t ,
92+ mca_btl_base_descriptor_t ,
93+ mca_btl_tcp_frag_max_constructor ,
94+ NULL );
9495
9596OBJ_CLASS_INSTANCE (
96- mca_btl_tcp_frag_user_t ,
97- mca_btl_base_descriptor_t ,
98- mca_btl_tcp_frag_user_constructor ,
99- NULL );
97+ mca_btl_tcp_frag_user_t ,
98+ mca_btl_base_descriptor_t ,
99+ mca_btl_tcp_frag_user_constructor ,
100+ NULL );
100101
101102
102103size_t mca_btl_tcp_frag_dump (mca_btl_tcp_frag_t * frag , char * msg , char * buf , size_t length )
@@ -117,7 +118,7 @@ size_t mca_btl_tcp_frag_dump(mca_btl_tcp_frag_t* frag, char* msg, char* buf, siz
117118
118119bool mca_btl_tcp_frag_send (mca_btl_tcp_frag_t * frag , int sd )
119120{
120- int cnt = -1 ;
121+ ssize_t cnt = -1 ;
121122 size_t i , num_vecs ;
122123
123124 /* non-blocking write, but continue if interrupted */
@@ -150,7 +151,7 @@ bool mca_btl_tcp_frag_send(mca_btl_tcp_frag_t* frag, int sd)
150151 /* if the write didn't complete - update the iovec state */
151152 num_vecs = frag -> iov_cnt ;
152153 for (i = 0 ; i < num_vecs ; i ++ ) {
153- if (cnt >= (int )frag -> iov_ptr -> iov_len ) {
154+ if (cnt >= (ssize_t )frag -> iov_ptr -> iov_len ) {
154155 cnt -= frag -> iov_ptr -> iov_len ;
155156 frag -> iov_ptr ++ ;
156157 frag -> iov_idx ++ ;
@@ -232,7 +233,7 @@ bool mca_btl_tcp_frag_recv(mca_btl_tcp_frag_t* frag, int sd)
232233 mca_btl_tcp_endpoint_close (btl_endpoint );
233234 return false;
234235 default :
235- BTL_ERROR (("mca_btl_tcp_frag_recv: readv failed: %s (%d)" ,
236+ BTL_ERROR (("mca_btl_tcp_frag_recv: readv failed: %s (%d)" ,
236237 strerror (opal_socket_errno ),
237238 opal_socket_errno ));
238239 btl_endpoint -> endpoint_state = MCA_BTL_TCP_FAILED ;
@@ -245,7 +246,7 @@ bool mca_btl_tcp_frag_recv(mca_btl_tcp_frag_t* frag, int sd)
245246 /* if the read didn't complete - update the iovec state */
246247 num_vecs = frag -> iov_cnt ;
247248 for ( i = 0 ; i < num_vecs ; i ++ ) {
248- if ( cnt < (int )frag -> iov_ptr -> iov_len ) {
249+ if ( cnt < (ssize_t )frag -> iov_ptr -> iov_len ) {
249250 frag -> iov_ptr -> iov_base = (ompi_iov_base_ptr_t )
250251 (((unsigned char * )frag -> iov_ptr -> iov_base ) + cnt );
251252 frag -> iov_ptr -> iov_len -= cnt ;
0 commit comments