Skip to content

Commit

Permalink
add gflags
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Apr 10, 2022
1 parent ca3515a commit a3d5543
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/graph/executor/algo/BFSShortestPathExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "graph/planner/plan/Algo.h"

DECLARE_int32(num_operator_threads);
namespace nebula {
namespace graph {
folly::Future<Status> BFSShortestPathExecutor::execute() {
Expand Down Expand Up @@ -126,9 +127,8 @@ folly::Future<Status> BFSShortestPathExecutor::conjunctPath() {
if (meetVids.empty()) {
return Status::OK();
}
static size_t NUM_PROC = 5;
size_t totalSize = meetVids.size();
size_t batchSize = totalSize / NUM_PROC;
size_t batchSize = totalSize / static_cast<size_t>(FLAGS_num_operator_threads);
std::vector<Value> batchVids;
batchVids.reserve(batchSize);
std::vector<folly::Future<DataSet>> futures;
Expand Down
5 changes: 2 additions & 3 deletions src/graph/executor/algo/MultiShortestPathExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "graph/executor/algo/MultiShortestPathExecutor.h"

#include "graph/planner/plan/Algo.h"

DECLARE_int32(num_operator_threads);
namespace nebula {
namespace graph {
folly::Future<Status> MultiShortestPathExecutor::execute() {
Expand Down Expand Up @@ -161,8 +161,7 @@ DataSet MultiShortestPathExecutor::doConjunct(Interims::iterator startIter,
}

folly::Future<bool> MultiShortestPathExecutor::conjunctPath(bool oddStep) {
static size_t NUM_PROC = 5;
size_t batchSize = leftPaths_.size() / NUM_PROC;
size_t batchSize = leftPaths_.size() / static_cast<size_t>(FLAGS_num_operator_threads);
std::vector<folly::Future<DataSet>> futures;
size_t i = 0;

Expand Down
5 changes: 2 additions & 3 deletions src/graph/executor/algo/ProduceAllPathsExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This source code is licensed under Apache 2.0 License.
#include "graph/executor/algo/ProduceAllPathsExecutor.h"
#include "graph/planner/plan/Algo.h"

DECLARE_int32(num_operator_threads);
namespace nebula {
namespace graph {
folly::Future<Status> ProduceAllPathsExecutor::execute() {
Expand Down Expand Up @@ -126,8 +126,7 @@ DataSet ProduceAllPathsExecutor::doConjunct(Interims::iterator startIter,
}

folly::Future<Status> ProduceAllPathsExecutor::conjunctPath() {
static size_t NUM_PROC = 5;
auto batchSize = leftPaths_.size() / NUM_PROC;
auto batchSize = leftPaths_.size() / static_cast<size_t>(FLAGS_num_operator_threads);
std::vector<folly::Future<DataSet>> futures;
size_t i = 0;

Expand Down
1 change: 1 addition & 0 deletions src/graph/service/GraphFlags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ DEFINE_int32(num_netio_threads,
"The number of networking threads, 0 for number of physical CPU cores");
DEFINE_int32(num_accept_threads, 1, "Number of threads to accept incoming connections");
DEFINE_int32(num_worker_threads, 0, "Number of threads to execute user queries");
DEFINE_int32(num_operator_threads, 5, "Number of threads to execute a single operator");
DEFINE_bool(reuse_port, true, "Whether to turn on the SO_REUSEPORT option");
DEFINE_int32(listen_backlog, 1024, "Backlog of the listen socket");
DEFINE_string(listen_netdev, "any", "The network device to listen on");
Expand Down
1 change: 1 addition & 0 deletions src/graph/service/GraphFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ DECLARE_int32(session_reclaim_interval_secs);
DECLARE_int32(num_netio_threads);
DECLARE_int32(num_accept_threads);
DECLARE_int32(num_worker_threads);
DECLARE_int32(num_operator_threads);
DECLARE_bool(reuse_port);
DECLARE_int32(listen_backlog);
DECLARE_string(listen_netdev);
Expand Down

0 comments on commit a3d5543

Please sign in to comment.