Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cover change with gtest unittests, clean up cmake script and code includes #106

Merged
merged 28 commits into from
Sep 26, 2019
Merged
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
36e4c2f
remove no need env
chenqin Sep 17, 2019
77eea8d
use rand back off to avoid swap tracker
Sep 17, 2019
4ff7cee
use determinstic backoff retry considering smooth traffic
Sep 18, 2019
415f4c6
adding googletests support
Sep 18, 2019
6aefaa0
add unittests on allreduce parameters init
Sep 19, 2019
8224bda
Merge branch 'master' of github.com:chenqin/rabit
chenqin Sep 19, 2019
566e7bc
per feedback
chenqin Sep 19, 2019
7a44877
revert main
chenqin Sep 19, 2019
bd8227f
fix failure
chenqin Sep 19, 2019
700c86c
use test_main
chenqin Sep 19, 2019
58344af
fix rabit_reduce_ring_mincount parser
Sep 20, 2019
3346a46
add README
Sep 20, 2019
216610b
Clean up CMake scripts.
trivialfis Sep 21, 2019
d4abb6d
Setup gtest on travis.
trivialfis Sep 21, 2019
72a5f33
Install tree.
trivialfis Sep 21, 2019
5650d99
Use before_install.
trivialfis Sep 21, 2019
64963dc
Specify GTEST_ROOT.
trivialfis Sep 21, 2019
0f6bc00
Force c++11 in test.
trivialfis Sep 21, 2019
3fa3803
Merge pull request #5 from trivialfis/clean-cmake
chenqin Sep 22, 2019
8188f0a
add back cpplint
chenqin Sep 22, 2019
6e13671
move pip3 install before setup script
chenqin Sep 22, 2019
16d5f0d
try fix cmake test issue on osx
chenqin Sep 22, 2019
0e90e01
spring clean includes
chenqin Sep 23, 2019
492024a
downgrade cmake
chenqin Sep 23, 2019
65eb5c0
more cleanup on DMLC_ROOT
Sep 23, 2019
4114087
build engempty for win32 asis
Sep 23, 2019
5bb3045
fix relateive path of install prefix
Sep 23, 2019
f0cfd4c
revert backoff change for another pr
Sep 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions src/allreduce_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
#define _CRT_SECURE_NO_DEPRECATE
#define NOMINMAX
#include <map>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include "./allreduce_base.h"

namespace rabit {
Expand All @@ -22,6 +24,7 @@ namespace utils {
namespace engine {
// constructor
AllreduceBase::AllreduceBase(void) {
std::srand(std::time(nullptr));
tracker_uri = "NULL";
tracker_port = 9000;
host_uri = "";
Expand All @@ -39,16 +42,8 @@ AllreduceBase::AllreduceBase(void) {
err_link = NULL;
dmlc_role = "worker";
this->SetParam("rabit_reduce_buffer", "256MB");
// setup possible enviroment variable of intrest
env_vars.push_back("rabit_task_id");
chenqin marked this conversation as resolved.
Show resolved Hide resolved
env_vars.push_back("rabit_num_trial");
env_vars.push_back("rabit_reduce_buffer");
env_vars.push_back("rabit_reduce_ring_mincount");
env_vars.push_back("rabit_tracker_uri");
env_vars.push_back("rabit_tracker_port");
env_vars.push_back("rabit_bootstrap_cache");
env_vars.push_back("rabit_debug");
// also include dmlc support direct variables
// setup possible enviroment variable of interest
// include dmlc support direct variables
env_vars.push_back("DMLC_TASK_ID");
env_vars.push_back("DMLC_ROLE");
env_vars.push_back("DMLC_NUM_ATTEMPT");
Expand Down Expand Up @@ -241,11 +236,7 @@ utils::TCPSocket AllreduceBase::ConnectTracker(void) const {
utils::Socket::Error("Connect");
} else {
fprintf(stderr, "retry connect to ip(retry time %d): [%s]\n", retry, tracker_uri.c_str());
#if defined(_MSC_VER) || defined (__MINGW32__)
Sleep(retry << 1);
#else
sleep(retry << 1);
#endif
sleep(std::rand()%30 + 1);
chenqin marked this conversation as resolved.
Show resolved Hide resolved
continue;
}
}
Expand Down