Skip to content

Commit

Permalink
[feat] no diff schedule between group and pipeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunelFeng committed Aug 19, 2024
1 parent b58c6e0 commit 827391c
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 444 deletions.
11 changes: 0 additions & 11 deletions src/GraphCtrl/GraphElement/GElementManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,6 @@ CStatus GElementManager::clear() {
}


GElementManagerPtr GElementManager::setScheduleStrategy(int strategy) {
CGRAPH_ASSERT_NOT_NULL_THROW_ERROR(engine_)
/**
* 如果是 region中的 GElementManager,需要在init完成后,进行这一步赋值
* 否则会因为 engine_ 为空,而导致崩溃
*/
engine_->schedule_strategy_ = strategy;
return this;
}


GElementManagerPtr GElementManager::setEngineType(GEngineType engineType) {
engine_type_ = engineType;
return this;
Expand Down
7 changes: 0 additions & 7 deletions src/GraphCtrl/GraphElement/GElementManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ class GElementManager : public GElementObject,
*/
CStatus clear() final;

/**
* 设置调度策略
* @param type
* @return
*/
GElementManager* setScheduleStrategy(int strategy);

/**
* 设置图引擎运行模式
* @param engineType
Expand Down
2 changes: 0 additions & 2 deletions src/GraphCtrl/GraphElement/GGroup/GRegion/GRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ CStatus GRegion::init() {
this->manager_->setThreadPool(thread_pool_);
status = this->manager_->init();
CGRAPH_FUNCTION_CHECK_STATUS
// 设置调度类型,需要在引擎初始化完成之后
this->manager_->setScheduleStrategy(CGRAPH_POOL_TASK_STRATEGY);

is_init_ = true;
CGRAPH_FUNCTION_END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ CVoid GDynamicEngine::process(GElementPtr element, CBool affinity) {
// 如果 affinity=true,表示用当前的线程,执行这个逻辑。以便增加亲和性
exec();
} else {
thread_pool_->execute(exec, calcIndex(element));
thread_pool_->execute(exec, element->binding_index_);
}
}

Expand Down Expand Up @@ -235,7 +235,7 @@ CVoid GDynamicEngine::parallelRunAll() {
for (int i = 0; i < total_end_size_; i++) {
futures.emplace_back(std::move(thread_pool_->commit([this, i] {
return total_element_arr_[i]->fatProcessor(CFunctionType::RUN);
}, calcIndex(total_element_arr_[i]))));
}, total_element_arr_[i]->binding_index_)));
}

for (auto& fut : futures) {
Expand Down
16 changes: 0 additions & 16 deletions src/GraphCtrl/GraphElement/_GEngine/GEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,6 @@ class GEngine : public GElementObject {
CGRAPH_EMPTY_FUNCTION
}

/**
* 计算出来最终计算的index值
* @param element
* @return
*/
CIndex calcIndex(GElementCPtr element) const {
/**
* 如果没有设定绑定线程的话,就用默认调度策略
* 否则的话,会走绑定的thread。
* 如果设定的 binding_index_ >= thread 总数,会在 threadpool 层做统一判定
*/
return element->isDefaultBinding()
? schedule_strategy_ : element->binding_index_;
}

/**
* 分析所有的可以设置 linkable 的数据
* @param elements
Expand Down Expand Up @@ -76,7 +61,6 @@ class GEngine : public GElementObject {

protected:
UThreadPoolPtr thread_pool_ { nullptr }; // 内部执行的线程池
int schedule_strategy_ = CGRAPH_DEFAULT_TASK_STRATEGY; // 调度策略
CSize linked_size_ = 0; // 标记有多少个element,是 linkable 的数据

friend class GElementManager;
Expand Down
116 changes: 0 additions & 116 deletions src/UtilsCtrl/Trie/UTrie.cpp

This file was deleted.

85 changes: 0 additions & 85 deletions src/UtilsCtrl/Trie/UTrie.h

This file was deleted.

48 changes: 0 additions & 48 deletions src/UtilsCtrl/Trie/UTrieNode.h

This file was deleted.

Loading

0 comments on commit 827391c

Please sign in to comment.