Skip to content

Commit

Permalink
Back out "Log in applications" (#1178)
Browse files Browse the repository at this point in the history
Summary:
X-link: facebookresearch/fbpcs#1178

Pull Request resolved: facebookresearch#248

generated via `hg backout D37323715 (https://github.com/facebookresearch/fbpcf/commit/9fd60f8e04a50976833913560e2a993b00a28482)` to fix an e2e test failure.

Reviewed By: yuyashiraki

Differential Revision: D37529257

fbshipit-source-id: 2a19f203e0be3a1c771734dcb119309366730a80
  • Loading branch information
RuiyuZhu authored and facebook-github-bot committed Jun 29, 2022
1 parent 9fd60f8 commit c9bbe03
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
12 changes: 4 additions & 8 deletions example/billionaire_problem/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
* LICENSE file in the root directory of this source tree.
*/

#include <folly/json.h>
#include <gflags/gflags.h>

#include "./BillionaireProblemGame.h"
#include "fbpcf/engine/communication/SocketPartyCommunicationAgentFactory.h"
#include "fbpcf/scheduler/SchedulerHelper.h"
#include "folly/init/Init.h"
#include "folly/logging/xlog.h"

#include "./BillionaireProblemGame.h"
#include "fbpcf/engine/communication/SocketPartyCommunicationAgentFactory.h"

DEFINE_int32(party, 0, "my party ID");
DEFINE_string(server_ip, "127.0.0.1", "server's ip address");
DEFINE_int32(port, 5000, "server port number");
Expand All @@ -35,7 +34,7 @@ int main(int argc, char* argv[]) {
{1, {FLAGS_server_ip, FLAGS_port}}});
auto factory = std::make_unique<
fbpcf::engine::communication::SocketPartyCommunicationAgentFactory>(
FLAGS_party, partyInfos, "billionaire_problem_traffic");
FLAGS_party, partyInfos);

auto game = std::make_unique<
fbpcf::billionaire_problem::BillionaireProblemGame<0, true>>(
Expand Down Expand Up @@ -80,7 +79,4 @@ int main(int argc, char* argv[]) {
XLOG(FATAL, "Failed to execute the game!");
}
XLOG(INFO, "Game executed successfully!");
XLOG(
INFO,
folly::toPrettyJson(factory->getMetricsCollector()->collectMetrics()));
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace fbpcf::engine::communication {
*/
class IPartyCommunicationAgentFactory {
public:
explicit IPartyCommunicationAgentFactory(std::string name)
IPartyCommunicationAgentFactory(std::string name = "unnamed_traffic")
: metricCollector_(std::make_shared<fbpcf::util::MetricCollector>(name)) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ class InMemoryPartyCommunicationAgentFactory final
InMemoryPartyCommunicationAgentFactory(
int myId,
std::map<int, std::shared_ptr<HostInfo>>&& sharedHosts)
: IPartyCommunicationAgentFactory("in_memory_traffic"),
myId_(myId),
sharedHosts_(sharedHosts) {
: myId_(myId), sharedHosts_(sharedHosts) {
for (auto& item : sharedHosts_) {
createdAgentCount_.emplace(item.first, 0);
}
Expand Down
4 changes: 1 addition & 3 deletions fbpcf/engine/util/test/benchmarks/BenchmarkHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ class BenchmarkSocketAgentFactory final
BenchmarkSocketAgentFactory(
int myId,
std::shared_ptr<AgentsByParty> agentsByParty)
: communication::IPartyCommunicationAgentFactory("benchmark_traffic"),
myId_(myId),
agentsByParty_(agentsByParty) {}
: myId_(myId), agentsByParty_(agentsByParty) {}

// The socket agents are stored in a queue.
// If a party calls create() and the queue is empty, create a new pair of
Expand Down

0 comments on commit c9bbe03

Please sign in to comment.