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)
#define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
namespace SocketConfig {
const int kSocketBufferSize = 100 * 1024;
const int kMaxReceiveSize = 100 * 1024;
const int kSocketBufferSize = 100 * 1000;
const int kMaxReceiveSize = 100 * 1000;
const bool kNoDelay = true;
}
......@@ -119,9 +119,17 @@ public:
if (sockfd_ == INVALID_SOCKET) {
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);
CHECK(setsockopt(sockfd_, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<const char*>(&SocketConfig::kNoDelay), sizeof(SocketConfig::kNoDelay)) == 0);
if (setsockopt(sockfd_, SOL_SOCKET, SO_RCVBUF, reinterpret_cast<const char*>(&SocketConfig::kSocketBufferSize), sizeof(SocketConfig::kSocketBufferSize)) != 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() {
......
......@@ -267,6 +267,7 @@ namespace LightGBM {
class GPUTreeLearner: public SerialTreeLearner {
public:
#pragma warning(disable : 4702)
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");
}
......
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