Skip to content

Commit fa3bc79

Browse files
committed
fixed cycle dependency
1 parent 560b750 commit fa3bc79

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

include/chimbuko/ad/ADLocalFuncStatistics.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <chimbuko/ad/AnomalyData.hpp>
66
#include <chimbuko/util/Anomalies.hpp>
77
#include "chimbuko/util/PerfStats.hpp"
8-
#include "chimbuko/chimbuko.hpp"
8+
//#include "chimbuko/chimbuko.hpp"
99

1010
namespace chimbuko{
1111

include/chimbuko/ad/ADNetClient.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ namespace chimbuko{
234234
if(nwork > 0) fatal_error("Worker was shut down before emptying its queue!");
235235
std::cout << "Worker received shutdown request" << std::endl;
236236
}else{
237-
std::this_thread::sleep_for(std::chrono::milliseconds(10));
237+
std::this_thread::sleep_for(std::chrono::milliseconds(20));
238238
}
239239
}
240240
});

test/unit_tests/ad/ADLocalCounterStatistics.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ TEST(ADLocalCounterStatisticsTest, GlobalCounterStatsWorks){
8686

8787

8888
struct ADLocalCounterStatisticsWrapper: public ADLocalCounterStatistics{
89-
static std::pair<size_t, size_t> updateGlobalStatisticsTest(ADNetClient &net_client, const std::string &l_stats, int step){
90-
return ADLocalCounterStatistics::updateGlobalStatistics(net_client, l_stats, step);
89+
static std::pair<size_t, size_t> updateGlobalStatisticsTest(ADNetClient &net_client, const std::string &l_stats, int step, int rank, std::string pserver_addr){
90+
return ADLocalCounterStatistics::updateGlobalStatistics(net_client, l_stats, step, rank, pserver_addr);
9191
}
9292
};
9393

@@ -125,7 +125,7 @@ TEST(ADLocalCounterStatisticsTest, UpdateGlobalStatisticsWithMockPS){
125125
net_client.connect_ps(0, 0, sname);
126126
barrier2.wait();
127127
std::cout << "AD thread updating local stats" << std::endl;
128-
ADLocalCounterStatisticsWrapper::updateGlobalStatisticsTest(net_client, "test",0);
128+
ADLocalCounterStatisticsWrapper::updateGlobalStatisticsTest(net_client, "test",0,0,sname);
129129
barrier2.wait();
130130
std::cout << "AD thread terminating connection" << std::endl;
131131
net_client.disconnect_ps();
@@ -187,9 +187,9 @@ TEST(ADLocalCounterStatisticsTest, UpdateGlobalStatisticsWithRealPS){
187187
net_client.connect_ps(0, 0, sname);
188188

189189
cs.setStats(nm, a);
190-
cs.updateGlobalStatistics(net_client);
190+
cs.updateGlobalStatistics(net_client, 0, sname);
191191
cs.setStats(nm, b);
192-
cs.updateGlobalStatistics(net_client);
192+
cs.updateGlobalStatistics(net_client, 0, sname);
193193

194194
std::cout << "AD thread terminating connection" << std::endl;
195195
net_client.disconnect_ps();

test/unit_tests/ad/ADLocalFuncStatistics.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
using namespace chimbuko;
99

1010
struct ADLocalFuncStatisticsTest: public ADLocalFuncStatistics{
11-
static std::pair<size_t, size_t> updateGlobalStatisticsTest(ADNetClient &net_client, const std::string &l_stats, int step){
12-
return ADLocalFuncStatistics::updateGlobalStatistics(net_client, l_stats, step);
11+
static std::pair<size_t, size_t> updateGlobalStatisticsTest(ADNetClient &net_client, const std::string &l_stats, int step, int rank, std::string pserver_addr){
12+
return ADLocalFuncStatistics::updateGlobalStatistics(net_client, l_stats, step, rank, pserver_addr);
1313
}
1414
};
1515

@@ -76,7 +76,7 @@ TEST(ADLocalFuncStatisticsTestUpdateGlobalStatisticsWithPS, Works){
7676
ADNetClient net_client;
7777
net_client.connect_ps(0, 0, sname);
7878
std::cout << "AD thread updating local stats" << std::endl;
79-
loc.updateGlobalStatistics(net_client);
79+
loc.updateGlobalStatistics(net_client, 0, sname);
8080
std::cout << "AD thread terminating connection" << std::endl;
8181
net_client.disconnect_ps();
8282
}catch(const std::exception &e){

0 commit comments

Comments
 (0)