From b664ca0321f139ad33577066d52a1d4f5e868a28 Mon Sep 17 00:00:00 2001 From: liaogang Date: Sat, 10 Sep 2016 15:36:13 +0800 Subject: [PATCH] auto-tuning SND/REV buff size on MAC OS --- paddle/pserver/LightNetwork.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/paddle/pserver/LightNetwork.cpp b/paddle/pserver/LightNetwork.cpp index 5dc04ee6c..ff2875fc7 100644 --- a/paddle/pserver/LightNetwork.cpp +++ b/paddle/pserver/LightNetwork.cpp @@ -79,6 +79,7 @@ std::string getIpAddr(std::string &device) { * @note adjust some default sock option for better performance */ void setOption(int sockfd) { +#if !defined(__APPLE__) && !defined(__OSX__) int sendSize = FLAGS_sock_send_buf_size; int recvSize = FLAGS_sock_recv_buf_size; CHECK_GE( @@ -87,6 +88,8 @@ void setOption(int sockfd) { CHECK_GE( setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, &sendSize, sizeof(sendSize)), 0); +#endif + if (FLAGS_small_messages) { int optval = 1; CHECK_GE( -- GitLab