提交 4847e502 编写于 作者: W Wang XiangYu 提交者: Jin Hai

Remove unused codes (#732)

* remove unused function and comments

* remove always-true parameter

* run on python2 explicitly

* fix clang-format
上级 ce1b42c6
#!/usr/bin/env python
#!/usr/bin/env python2
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
......
......@@ -21,14 +21,13 @@ namespace milvus {
namespace scheduler {
std::shared_ptr<Resource>
ResourceFactory::Create(const std::string& name, const std::string& type, uint64_t device_id, bool enable_loader,
bool enable_executor) {
ResourceFactory::Create(const std::string& name, const std::string& type, uint64_t device_id, bool enable_executor) {
if (type == "DISK") {
return std::make_shared<DiskResource>(name, device_id, enable_loader, enable_executor);
return std::make_shared<DiskResource>(name, device_id, enable_executor);
} else if (type == "CPU") {
return std::make_shared<CpuResource>(name, device_id, enable_loader, enable_executor);
return std::make_shared<CpuResource>(name, device_id, enable_executor);
} else if (type == "GPU") {
return std::make_shared<GpuResource>(name, device_id, enable_loader, enable_executor);
return std::make_shared<GpuResource>(name, device_id, enable_executor);
} else {
return nullptr;
}
......
......@@ -31,8 +31,7 @@ namespace scheduler {
class ResourceFactory {
public:
static std::shared_ptr<Resource>
Create(const std::string& name, const std::string& type, uint64_t device_id, bool enable_loader = true,
bool enable_executor = true);
Create(const std::string& name, const std::string& type, uint64_t device_id, bool enable_executor = true);
};
} // namespace scheduler
......
......@@ -46,10 +46,10 @@ std::mutex BuildMgrInst::mutex_;
void
load_simple_config() {
// create and connect
ResMgrInst::GetInstance()->Add(ResourceFactory::Create("disk", "DISK", 0, true, false));
ResMgrInst::GetInstance()->Add(ResourceFactory::Create("disk", "DISK", 0, false));
auto io = Connection("io", 500);
ResMgrInst::GetInstance()->Add(ResourceFactory::Create("cpu", "CPU", 0, true, true));
ResMgrInst::GetInstance()->Add(ResourceFactory::Create("cpu", "CPU", 0));
ResMgrInst::GetInstance()->Connect("disk", "cpu", io);
// get resources
......@@ -79,13 +79,12 @@ load_simple_config() {
}
for (auto& gpu_id : gpu_ids) {
ResMgrInst::GetInstance()->Add(ResourceFactory::Create(std::to_string(gpu_id), "GPU", gpu_id, true, true));
ResMgrInst::GetInstance()->Add(ResourceFactory::Create(std::to_string(gpu_id), "GPU", gpu_id));
ResMgrInst::GetInstance()->Connect("cpu", std::to_string(gpu_id), pcie);
}
for (auto& not_find_id : not_find_build_ids) {
ResMgrInst::GetInstance()->Add(
ResourceFactory::Create(std::to_string(not_find_id), "GPU", not_find_id, true, true));
ResMgrInst::GetInstance()->Add(ResourceFactory::Create(std::to_string(not_find_id), "GPU", not_find_id));
ResMgrInst::GetInstance()->Connect("cpu", std::to_string(not_find_id), pcie);
}
}
......
......@@ -77,6 +77,12 @@ Scheduler::Dump() const {
return ret;
}
void
Scheduler::process(const EventPtr& event) {
auto process_event = event_register_.at(static_cast<int>(event->Type()));
process_event(event);
}
void
Scheduler::worker_function() {
while (running_) {
......@@ -88,16 +94,10 @@ Scheduler::worker_function() {
break;
}
Process(event);
process(event);
}
}
void
Scheduler::Process(const EventPtr& event) {
auto process_event = event_register_.at(static_cast<int>(event->Type()));
process_event(event);
}
// TODO(wxyu): refactor the function
void
Scheduler::OnLoadCompleted(const EventPtr& event) {
......
......@@ -41,21 +41,12 @@ class Scheduler : public interface::dumpable {
Scheduler(const Scheduler&) = delete;
Scheduler(Scheduler&&) = delete;
/*
* Start worker thread;
*/
void
Start();
/*
* Stop worker thread, join it;
*/
void
Stop();
/*
* Post event to scheduler event queue;
*/
void
PostEvent(const EventPtr& event);
......@@ -63,55 +54,22 @@ class Scheduler : public interface::dumpable {
Dump() const override;
private:
/******** Events ********/
/*
* Process start up events;
*
* Actions:
* Pull task from neighbours;
*/
void
OnStartUp(const EventPtr& event);
/*
* Process finish task events;
*
* Actions:
* Pull task from neighbours;
*/
void
OnFinishTask(const EventPtr& event);
/*
* Process copy completed events;
*
* Actions:
* Mark task source MOVED;
* Pull task from neighbours;
*/
void
OnLoadCompleted(const EventPtr& event);
/*
* Process task table updated events, which happened on task_table->put;
*
* Actions:
* Push task to neighbours;
*/
void
OnTaskTableUpdated(const EventPtr& event);
private:
/*
* Dispatch event to event handler;
*/
void
Process(const EventPtr& event);
process(const EventPtr& event);
/*
* Called by worker_thread_;
*/
void
worker_function();
......
......@@ -119,9 +119,6 @@ class TaskTable : public interface::dumpable {
subscriber_ = std::move(subscriber);
}
/*
* Put one task;
*/
void
Put(TaskPtr task, TaskTableItemPtr from = nullptr);
......
......@@ -35,14 +35,5 @@ get_current_timestamp() {
return millis;
}
uint64_t
get_num_gpu() {
int n_devices = 0;
#ifdef MILVUS_GPU_VERSION
cudaGetDeviceCount(&n_devices);
#endif
return n_devices;
}
} // namespace scheduler
} // namespace milvus
......@@ -24,8 +24,5 @@ namespace scheduler {
uint64_t
get_current_timestamp();
uint64_t
get_num_gpu();
} // namespace scheduler
} // namespace milvus
......@@ -28,8 +28,8 @@ operator<<(std::ostream& out, const CpuResource& resource) {
return out;
}
CpuResource::CpuResource(std::string name, uint64_t device_id, bool enable_loader, bool enable_executor)
: Resource(std::move(name), ResourceType::CPU, device_id, enable_loader, enable_executor) {
CpuResource::CpuResource(std::string name, uint64_t device_id, bool enable_executor)
: Resource(std::move(name), ResourceType::CPU, device_id, enable_executor) {
}
void
......
......@@ -26,7 +26,7 @@ namespace scheduler {
class CpuResource : public Resource {
public:
explicit CpuResource(std::string name, uint64_t device_id, bool enable_loader, bool enable_executor);
explicit CpuResource(std::string name, uint64_t device_id, bool enable_executor);
friend std::ostream&
operator<<(std::ostream& out, const CpuResource& resource);
......
......@@ -29,8 +29,8 @@ operator<<(std::ostream& out, const DiskResource& resource) {
return out;
}
DiskResource::DiskResource(std::string name, uint64_t device_id, bool enable_loader, bool enable_executor)
: Resource(std::move(name), ResourceType::DISK, device_id, enable_loader, enable_executor) {
DiskResource::DiskResource(std::string name, uint64_t device_id, bool enable_executor)
: Resource(std::move(name), ResourceType::DISK, device_id, enable_executor) {
}
void
......
......@@ -26,7 +26,7 @@ namespace scheduler {
class DiskResource : public Resource {
public:
explicit DiskResource(std::string name, uint64_t device_id, bool enable_loader, bool enable_executor);
explicit DiskResource(std::string name, uint64_t device_id, bool enable_executor);
friend std::ostream&
operator<<(std::ostream& out, const DiskResource& resource);
......
......@@ -26,8 +26,8 @@ operator<<(std::ostream& out, const GpuResource& resource) {
return out;
}
GpuResource::GpuResource(std::string name, uint64_t device_id, bool enable_loader, bool enable_executor)
: Resource(std::move(name), ResourceType::GPU, device_id, enable_loader, enable_executor) {
GpuResource::GpuResource(std::string name, uint64_t device_id, bool enable_executor)
: Resource(std::move(name), ResourceType::GPU, device_id, enable_executor) {
}
void
......
......@@ -27,7 +27,7 @@ namespace scheduler {
class GpuResource : public Resource {
public:
explicit GpuResource(std::string name, uint64_t device_id, bool enable_loader, bool enable_executor);
explicit GpuResource(std::string name, uint64_t device_id, bool enable_executor);
friend std::ostream&
operator<<(std::ostream& out, const GpuResource& resource);
......
......@@ -48,12 +48,8 @@ ToString(ResourceType type) {
}
}
Resource::Resource(std::string name, ResourceType type, uint64_t device_id, bool enable_loader, bool enable_executor)
: name_(std::move(name)),
type_(type),
device_id_(device_id),
enable_loader_(enable_loader),
enable_executor_(enable_executor) {
Resource::Resource(std::string name, ResourceType type, uint64_t device_id, bool enable_executor)
: name_(std::move(name)), type_(type), device_id_(device_id), enable_executor_(enable_executor) {
// register subscriber in tasktable
task_table_.RegisterSubscriber([&] {
if (subscriber_) {
......@@ -66,9 +62,7 @@ Resource::Resource(std::string name, ResourceType type, uint64_t device_id, bool
void
Resource::Start() {
running_ = true;
if (enable_loader_) {
loader_thread_ = std::thread(&Resource::loader_function, this);
}
loader_thread_ = std::thread(&Resource::loader_function, this);
if (enable_executor_) {
executor_thread_ = std::thread(&Resource::executor_function, this);
}
......@@ -77,10 +71,8 @@ Resource::Start() {
void
Resource::Stop() {
running_ = false;
if (enable_loader_) {
WakeupLoader();
loader_thread_.join();
}
WakeupLoader();
loader_thread_.join();
if (enable_executor_) {
WakeupExecutor();
executor_thread_.join();
......@@ -115,7 +107,6 @@ Resource::Dump() const {
{"task_total_cost", total_cost_},
{"total_tasks", total_task_},
{"running", running_},
{"enable_loader", enable_loader_},
{"enable_executor", enable_executor_},
};
return ret;
......
......@@ -102,11 +102,6 @@ class Resource : public Node, public std::enable_shared_from_this<Resource> {
}
public:
inline bool
HasLoader() const {
return enable_loader_;
}
inline bool
HasExecutor() const {
return enable_executor_;
......@@ -134,7 +129,7 @@ class Resource : public Node, public std::enable_shared_from_this<Resource> {
operator<<(std::ostream& out, const Resource& resource);
protected:
Resource(std::string name, ResourceType type, uint64_t device_id, bool enable_loader, bool enable_executor);
Resource(std::string name, ResourceType type, uint64_t device_id, bool enable_executor);
/*
* Implementation by inherit class;
......@@ -193,7 +188,6 @@ class Resource : public Node, public std::enable_shared_from_this<Resource> {
std::function<void(EventPtr)> subscriber_ = nullptr;
bool running_ = false;
bool enable_loader_ = true;
bool enable_executor_ = true;
std::thread loader_thread_;
std::thread executor_thread_;
......
......@@ -28,8 +28,8 @@ operator<<(std::ostream& out, const TestResource& resource) {
return out;
}
TestResource::TestResource(std::string name, uint64_t device_id, bool enable_loader, bool enable_executor)
: Resource(std::move(name), ResourceType::TEST, device_id, enable_loader, enable_executor) {
TestResource::TestResource(std::string name, uint64_t device_id, bool enable_executor)
: Resource(std::move(name), ResourceType::TEST, device_id, enable_executor) {
}
void
......
......@@ -27,7 +27,7 @@ namespace scheduler {
class TestResource : public Resource {
public:
explicit TestResource(std::string name, uint64_t device_id, bool enable_loader, bool enable_executor);
explicit TestResource(std::string name, uint64_t device_id, bool enable_executor);
friend std::ostream&
operator<<(std::ostream& out, const TestResource& resource);
......
......@@ -152,14 +152,14 @@ DBTest::SetUp() {
auto res_mgr = milvus::scheduler::ResMgrInst::GetInstance();
res_mgr->Clear();
res_mgr->Add(milvus::scheduler::ResourceFactory::Create("disk", "DISK", 0, true, false));
res_mgr->Add(milvus::scheduler::ResourceFactory::Create("cpu", "CPU", 0, true, true));
res_mgr->Add(milvus::scheduler::ResourceFactory::Create("disk", "DISK", 0, false));
res_mgr->Add(milvus::scheduler::ResourceFactory::Create("cpu", "CPU", 0));
auto default_conn = milvus::scheduler::Connection("IO", 500.0);
auto PCIE = milvus::scheduler::Connection("IO", 11000.0);
res_mgr->Connect("disk", "cpu", default_conn);
#ifdef MILVUS_GPU_VERSION
res_mgr->Add(milvus::scheduler::ResourceFactory::Create("0", "GPU", 0, true, true));
res_mgr->Add(milvus::scheduler::ResourceFactory::Create("0", "GPU", 0));
res_mgr->Connect("cpu", "0", PCIE);
#endif
res_mgr->Start();
......
......@@ -30,8 +30,8 @@ class AlgorithmTest : public testing::Test {
protected:
void
SetUp() override {
ResourcePtr disk = ResourceFactory::Create("disk", "DISK", 0, true, false);
ResourcePtr cpu0 = ResourceFactory::Create("cpu0", "CPU", 0, true, true);
ResourcePtr disk = ResourceFactory::Create("disk", "DISK", 0, false);
ResourcePtr cpu0 = ResourceFactory::Create("cpu0", "CPU", 0);
ResourcePtr cpu1 = ResourceFactory::Create("cpu1", "CPU", 1);
ResourcePtr cpu2 = ResourceFactory::Create("cpu2", "CPU", 2);
ResourcePtr gpu0 = ResourceFactory::Create("gpu0", "GPU", 0);
......
......@@ -36,69 +36,44 @@ class ResourceBaseTest : public testing::Test {
protected:
void
SetUp() override {
only_loader_ = std::make_shared<DiskResource>(name1, id1, true, false);
only_executor_ = std::make_shared<CpuResource>(name2, id2, false, true);
both_enable_ = std::make_shared<GpuResource>(name3, id3, true, true);
both_disable_ = std::make_shared<TestResource>(name4, id4, false, false);
enable_executor_ = std::make_shared<CpuResource>(name1, id1, true);
disable_executor_ = std::make_shared<GpuResource>(name2, id2, false);
}
const std::string name1 = "only_loader_";
const std::string name2 = "only_executor_";
const std::string name3 = "both_enable_";
const std::string name4 = "both_disable_";
const std::string name1 = "enable_executor_";
const std::string name2 = "disable_executor_";
const uint64_t id1 = 1;
const uint64_t id2 = 2;
const uint64_t id3 = 3;
const uint64_t id4 = 4;
ResourcePtr only_loader_ = nullptr;
ResourcePtr only_executor_ = nullptr;
ResourcePtr both_enable_ = nullptr;
ResourcePtr both_disable_ = nullptr;
ResourcePtr enable_executor_ = nullptr;
ResourcePtr disable_executor_ = nullptr;
};
TEST_F(ResourceBaseTest, NAME) {
ASSERT_EQ(only_loader_->name(), name1);
ASSERT_EQ(only_executor_->name(), name2);
ASSERT_EQ(both_enable_->name(), name3);
ASSERT_EQ(both_disable_->name(), name4);
ASSERT_EQ(enable_executor_->name(), name1);
ASSERT_EQ(disable_executor_->name(), name2);
}
TEST_F(ResourceBaseTest, TYPE) {
ASSERT_EQ(only_loader_->type(), ResourceType::DISK);
ASSERT_EQ(only_executor_->type(), ResourceType::CPU);
ASSERT_EQ(both_enable_->type(), ResourceType::GPU);
ASSERT_EQ(both_disable_->type(), ResourceType::TEST);
ASSERT_EQ(enable_executor_->type(), ResourceType::CPU);
ASSERT_EQ(disable_executor_->type(), ResourceType::GPU);
}
TEST_F(ResourceBaseTest, DEVICE_ID) {
ASSERT_EQ(only_loader_->device_id(), id1);
ASSERT_EQ(only_executor_->device_id(), id2);
ASSERT_EQ(both_enable_->device_id(), id3);
ASSERT_EQ(both_disable_->device_id(), id4);
}
TEST_F(ResourceBaseTest, HAS_LOADER) {
ASSERT_TRUE(only_loader_->HasLoader());
ASSERT_FALSE(only_executor_->HasLoader());
ASSERT_TRUE(both_enable_->HasLoader());
ASSERT_FALSE(both_disable_->HasLoader());
ASSERT_EQ(enable_executor_->device_id(), id1);
ASSERT_EQ(disable_executor_->device_id(), id2);
}
TEST_F(ResourceBaseTest, HAS_EXECUTOR) {
ASSERT_FALSE(only_loader_->HasExecutor());
ASSERT_TRUE(only_executor_->HasExecutor());
ASSERT_TRUE(both_enable_->HasExecutor());
ASSERT_FALSE(both_disable_->HasExecutor());
ASSERT_TRUE(enable_executor_->HasExecutor());
ASSERT_FALSE(disable_executor_->HasExecutor());
}
TEST_F(ResourceBaseTest, DUMP) {
ASSERT_FALSE(only_loader_->Dump().empty());
ASSERT_FALSE(only_executor_->Dump().empty());
ASSERT_FALSE(both_enable_->Dump().empty());
ASSERT_FALSE(both_disable_->Dump().empty());
std::cout << *only_loader_ << *only_executor_ << *both_enable_ << *both_disable_;
ASSERT_FALSE(enable_executor_->Dump().empty());
ASSERT_FALSE(disable_executor_->Dump().empty());
std::cout << *enable_executor_ << *disable_executor_;
}
/************ ResourceAdvanceTest ************/
......@@ -110,7 +85,7 @@ class ResourceAdvanceTest : public testing::Test {
disk_resource_ = ResourceFactory::Create("ssd", "DISK", 0);
cpu_resource_ = ResourceFactory::Create("cpu", "CPU", 0);
gpu_resource_ = ResourceFactory::Create("gpu", "GPU", 0);
test_resource_ = std::make_shared<TestResource>("test", 0, true, true);
test_resource_ = std::make_shared<TestResource>("test", 0, true);
resources_.push_back(disk_resource_);
resources_.push_back(cpu_resource_);
resources_.push_back(gpu_resource_);
......
......@@ -33,9 +33,9 @@ class ResourceMgrBaseTest : public testing::Test {
SetUp() override {
empty_mgr_ = std::make_shared<ResourceMgr>();
mgr1_ = std::make_shared<ResourceMgr>();
disk_res = std::make_shared<DiskResource>("disk", 0, true, false);
cpu_res = std::make_shared<CpuResource>("cpu", 1, true, false);
gpu_res = std::make_shared<GpuResource>("gpu", 2, true, true);
disk_res = std::make_shared<DiskResource>("disk", 0, false);
cpu_res = std::make_shared<CpuResource>("cpu", 1, false);
gpu_res = std::make_shared<GpuResource>("gpu", 2, true);
mgr1_->Add(ResourcePtr(disk_res));
mgr1_->Add(ResourcePtr(cpu_res));
mgr1_->Add(ResourcePtr(gpu_res));
......@@ -53,20 +53,20 @@ class ResourceMgrBaseTest : public testing::Test {
};
TEST_F(ResourceMgrBaseTest, ADD) {
auto resource = std::make_shared<TestResource>("test", 0, true, true);
auto resource = std::make_shared<TestResource>("test", 0, true);
auto ret = empty_mgr_->Add(ResourcePtr(resource));
ASSERT_EQ(ret.lock(), resource);
}
TEST_F(ResourceMgrBaseTest, ADD_DISK) {
auto resource = std::make_shared<DiskResource>("disk", 0, true, true);
auto resource = std::make_shared<DiskResource>("disk", 0, true);
auto ret = empty_mgr_->Add(ResourcePtr(resource));
ASSERT_EQ(ret.lock(), resource);
}
TEST_F(ResourceMgrBaseTest, CONNECT) {
auto resource1 = std::make_shared<TestResource>("resource1", 0, true, true);
auto resource2 = std::make_shared<TestResource>("resource2", 2, true, true);
auto resource1 = std::make_shared<TestResource>("resource1", 0, true);
auto resource2 = std::make_shared<TestResource>("resource2", 2, true);
empty_mgr_->Add(resource1);
empty_mgr_->Add(resource2);
Connection io("io", 500.0);
......@@ -74,8 +74,8 @@ TEST_F(ResourceMgrBaseTest, CONNECT) {
}
TEST_F(ResourceMgrBaseTest, INVALID_CONNECT) {
auto resource1 = std::make_shared<TestResource>("resource1", 0, true, true);
auto resource2 = std::make_shared<TestResource>("resource2", 2, true, true);
auto resource1 = std::make_shared<TestResource>("resource1", 0, true);
auto resource2 = std::make_shared<TestResource>("resource2", 2, true);
empty_mgr_->Add(resource1);
empty_mgr_->Add(resource2);
Connection io("io", 500.0);
......@@ -164,8 +164,8 @@ class ResourceMgrAdvanceTest : public testing::Test {
void
SetUp() override {
mgr1_ = std::make_shared<ResourceMgr>();
disk_res = std::make_shared<DiskResource>("disk", 0, true, false);
cpu_res = std::make_shared<CpuResource>("cpu", 0, true, true);
disk_res = std::make_shared<DiskResource>("disk", 0, false);
cpu_res = std::make_shared<CpuResource>("cpu", 0, true);
mgr1_->Add(ResourcePtr(disk_res));
mgr1_->Add(ResourcePtr(cpu_res));
mgr1_->Start();
......
......@@ -37,10 +37,10 @@ class MockVecIndex : public engine::VecIndex {
const float* xt = nullptr) {
}
// engine::VecIndexPtr
// Clone() override {
// return milvus::engine::VecIndexPtr();
// }
// engine::VecIndexPtr
// Clone() override {
// return milvus::engine::VecIndexPtr();
// }
int64_t
GetDeviceId() override {
......@@ -99,8 +99,8 @@ class SchedulerTest : public testing::Test {
void
SetUp() override {
res_mgr_ = std::make_shared<ResourceMgr>();
ResourcePtr disk = ResourceFactory::Create("disk", "DISK", 0, true, false);
ResourcePtr cpu = ResourceFactory::Create("cpu", "CPU", 0, true, false);
ResourcePtr disk = ResourceFactory::Create("disk", "DISK", 0, false);
ResourcePtr cpu = ResourceFactory::Create("cpu", "CPU", 0, false);
disk_resource_ = res_mgr_->Add(std::move(disk));
cpu_resource_ = res_mgr_->Add(std::move(cpu));
......@@ -143,10 +143,10 @@ class SchedulerTest2 : public testing::Test {
protected:
void
SetUp() override {
ResourcePtr disk = ResourceFactory::Create("disk", "DISK", 0, true, false);
ResourcePtr cpu0 = ResourceFactory::Create("cpu0", "CPU", 0, true, false);
ResourcePtr cpu1 = ResourceFactory::Create("cpu1", "CPU", 1, true, false);
ResourcePtr cpu2 = ResourceFactory::Create("cpu2", "CPU", 2, true, false);
ResourcePtr disk = ResourceFactory::Create("disk", "DISK", 0, false);
ResourcePtr cpu0 = ResourceFactory::Create("cpu0", "CPU", 0, false);
ResourcePtr cpu1 = ResourceFactory::Create("cpu1", "CPU", 1, false);
ResourcePtr cpu2 = ResourceFactory::Create("cpu2", "CPU", 2, false);
res_mgr_ = std::make_shared<ResourceMgr>();
disk_ = res_mgr_->Add(std::move(disk));
......@@ -163,8 +163,8 @@ class SchedulerTest2 : public testing::Test {
res_mgr_->Connect("cpu0", "cpu2", IO);
#ifdef MILVUS_GPU_VERSION
ResourcePtr gpu0 = ResourceFactory::Create("gpu0", "GPU", 0, true, true);
ResourcePtr gpu1 = ResourceFactory::Create("gpu1", "GPU", 1, true, true);
ResourcePtr gpu0 = ResourceFactory::Create("gpu0", "GPU", 0);
ResourcePtr gpu1 = ResourceFactory::Create("gpu1", "GPU", 1);
gpu_0_ = res_mgr_->Add(std::move(gpu0));
gpu_1_ = res_mgr_->Add(std::move(gpu1));
res_mgr_->Connect("cpu1", "gpu0", PCIE1);
......
......@@ -55,9 +55,9 @@ class RpcHandlerTest : public testing::Test {
SetUp() override {
auto res_mgr = milvus::scheduler::ResMgrInst::GetInstance();
res_mgr->Clear();
res_mgr->Add(milvus::scheduler::ResourceFactory::Create("disk", "DISK", 0, true, false));
res_mgr->Add(milvus::scheduler::ResourceFactory::Create("cpu", "CPU", 0, true, true));
res_mgr->Add(milvus::scheduler::ResourceFactory::Create("gtx1660", "GPU", 0, true, true));
res_mgr->Add(milvus::scheduler::ResourceFactory::Create("disk", "DISK", 0, false));
res_mgr->Add(milvus::scheduler::ResourceFactory::Create("cpu", "CPU", 0));
res_mgr->Add(milvus::scheduler::ResourceFactory::Create("gtx1660", "GPU", 0));
auto default_conn = milvus::scheduler::Connection("IO", 500.0);
auto PCIE = milvus::scheduler::Connection("IO", 11000.0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册