Commit 5c2b22c2 authored by Guolin Ke's avatar Guolin Ke
Browse files

change socket set fail to warning.

parent 582ded51
...@@ -81,8 +81,8 @@ inline int inet_pton(int af, const char *src, void *dst) ...@@ -81,8 +81,8 @@ inline int inet_pton(int af, const char *src, void *dst)
#define FREE(x) HeapFree(GetProcessHeap(), 0, (x)) #define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
namespace SocketConfig { namespace SocketConfig {
const int kSocketBufferSize = 100 * 1024; const int kSocketBufferSize = 100 * 1000;
const int kMaxReceiveSize = 100 * 1024; const int kMaxReceiveSize = 100 * 1000;
const bool kNoDelay = true; const bool kNoDelay = true;
} }
...@@ -119,9 +119,17 @@ public: ...@@ -119,9 +119,17 @@ public:
if (sockfd_ == INVALID_SOCKET) { if (sockfd_ == INVALID_SOCKET) {
return; return;
} }
CHECK(setsockopt(sockfd_, SOL_SOCKET, SO_RCVBUF, reinterpret_cast<const char*>(&SocketConfig::kSocketBufferSize), sizeof(SocketConfig::kSocketBufferSize)) == 0);
CHECK(setsockopt(sockfd_, SOL_SOCKET, SO_SNDBUF, reinterpret_cast<const char*>(&SocketConfig::kSocketBufferSize), sizeof(SocketConfig::kSocketBufferSize)) == 0); if (setsockopt(sockfd_, SOL_SOCKET, SO_RCVBUF, reinterpret_cast<const char*>(&SocketConfig::kSocketBufferSize), sizeof(SocketConfig::kSocketBufferSize)) != 0) {
CHECK(setsockopt(sockfd_, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<const char*>(&SocketConfig::kNoDelay), sizeof(SocketConfig::kNoDelay)) == 0); Log::Warning("Set SO_RCVBUF failed, please increase your net.core.rmem_max to 100k at least.");
}
if (setsockopt(sockfd_, SOL_SOCKET, SO_SNDBUF, reinterpret_cast<const char*>(&SocketConfig::kSocketBufferSize), sizeof(SocketConfig::kSocketBufferSize)) != 0) {
Log::Warning("Set SO_SNDBUF failed, please increase your net.core.wmem_max to 100k at least.");
}
if (setsockopt(sockfd_, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<const char*>(&SocketConfig::kNoDelay), sizeof(SocketConfig::kNoDelay)) != 0) {
Log::Warning("Set TCP_NODELAY failed.");
}
} }
inline static void Startup() { inline static void Startup() {
......
...@@ -267,6 +267,7 @@ namespace LightGBM { ...@@ -267,6 +267,7 @@ namespace LightGBM {
class GPUTreeLearner: public SerialTreeLearner { class GPUTreeLearner: public SerialTreeLearner {
public: public:
#pragma warning(disable : 4702)
explicit GPUTreeLearner(const TreeConfig* tree_config) : SerialTreeLearner(tree_config) { explicit GPUTreeLearner(const TreeConfig* tree_config) : SerialTreeLearner(tree_config) {
Log::Fatal("GPU Tree Learner was not enabled in this build. Recompile with CMake option -DUSE_GPU=1"); Log::Fatal("GPU Tree Learner was not enabled in this build. Recompile with CMake option -DUSE_GPU=1");
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment