Commit ef148a8d authored by Stanislav Bohm's avatar Stanislav Bohm

RF: "Mode" renamed to "Policy"

parent 29e89444
......@@ -18,37 +18,37 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='loomplan.proto',
package='loomplan',
serialized_pb=_b('\n\x0eloomplan.proto\x12\x08loomplan\"\xae\x01\n\x04Task\x12\x11\n\ttask_type\x18\x01 \x02(\x05\x12\x0e\n\x06\x63onfig\x18\x02 \x02(\x0c\x12\x11\n\tinput_ids\x18\x03 \x03(\x05\x12\x30\n\x04mode\x18\x04 \x01(\x0e\x32\x13.loomplan.Task.Mode:\rMODE_STANDARD\">\n\x04Mode\x12\x11\n\rMODE_STANDARD\x10\x01\x12\x0f\n\x0bMODE_SIMPLE\x10\x02\x12\x12\n\x0eMODE_SCHEDULER\x10\x03\"9\n\x04Plan\x12\x1d\n\x05tasks\x18\x02 \x03(\x0b\x32\x0e.loomplan.Task\x12\x12\n\nresult_ids\x18\x03 \x03(\x05\x42\x02H\x03')
serialized_pb=_b('\n\x0eloomplan.proto\x12\x08loomplan\"\xbc\x01\n\x04Task\x12\x11\n\ttask_type\x18\x01 \x02(\x05\x12\x0e\n\x06\x63onfig\x18\x02 \x02(\x0c\x12\x11\n\tinput_ids\x18\x03 \x03(\x05\x12\x36\n\x06policy\x18\x04 \x01(\x0e\x32\x15.loomplan.Task.Policy:\x0fPOLICY_STANDARD\"F\n\x06Policy\x12\x13\n\x0fPOLICY_STANDARD\x10\x01\x12\x11\n\rPOLICY_SIMPLE\x10\x02\x12\x14\n\x10POLICY_SCHEDULER\x10\x03\"9\n\x04Plan\x12\x1d\n\x05tasks\x18\x02 \x03(\x0b\x32\x0e.loomplan.Task\x12\x12\n\nresult_ids\x18\x03 \x03(\x05\x42\x02H\x03')
)
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
_TASK_MODE = _descriptor.EnumDescriptor(
name='Mode',
full_name='loomplan.Task.Mode',
_TASK_POLICY = _descriptor.EnumDescriptor(
name='Policy',
full_name='loomplan.Task.Policy',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='MODE_STANDARD', index=0, number=1,
name='POLICY_STANDARD', index=0, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='MODE_SIMPLE', index=1, number=2,
name='POLICY_SIMPLE', index=1, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='MODE_SCHEDULER', index=2, number=3,
name='POLICY_SCHEDULER', index=2, number=3,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=141,
serialized_end=203,
serialized_start=147,
serialized_end=217,
)
_sym_db.RegisterEnumDescriptor(_TASK_MODE)
_sym_db.RegisterEnumDescriptor(_TASK_POLICY)
_TASK = _descriptor.Descriptor(
......@@ -80,7 +80,7 @@ _TASK = _descriptor.Descriptor(
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='mode', full_name='loomplan.Task.mode', index=3,
name='policy', full_name='loomplan.Task.policy', index=3,
number=4, type=14, cpp_type=8, label=1,
has_default_value=True, default_value=1,
message_type=None, enum_type=None, containing_type=None,
......@@ -91,7 +91,7 @@ _TASK = _descriptor.Descriptor(
],
nested_types=[],
enum_types=[
_TASK_MODE,
_TASK_POLICY,
],
options=None,
is_extendable=False,
......@@ -99,7 +99,7 @@ _TASK = _descriptor.Descriptor(
oneofs=[
],
serialized_start=29,
serialized_end=203,
serialized_end=217,
)
......@@ -135,12 +135,12 @@ _PLAN = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=205,
serialized_end=262,
serialized_start=219,
serialized_end=276,
)
_TASK.fields_by_name['mode'].enum_type = _TASK_MODE
_TASK_MODE.containing_type = _TASK
_TASK.fields_by_name['policy'].enum_type = _TASK_POLICY
_TASK_POLICY.containing_type = _TASK
_PLAN.fields_by_name['tasks'].message_type = _TASK
DESCRIPTOR.message_types_by_name['Task'] = _TASK
DESCRIPTOR.message_types_by_name['Plan'] = _PLAN
......
......@@ -6,9 +6,9 @@ import gv
import struct
MODE_STANDARD = loomplan_pb2.Task.MODE_STANDARD
MODE_SIMPLE = loomplan_pb2.Task.MODE_SIMPLE
MODE_SCHEDULER = loomplan_pb2.Task.MODE_SCHEDULER
POLICY_STANDARD = loomplan_pb2.Task.POLICY_STANDARD
POLICY_SIMPLE = loomplan_pb2.Task.POLICY_SIMPLE
POLICY_SCHEDULER = loomplan_pb2.Task.POLICY_SCHEDULER
class Task(object):
......@@ -16,13 +16,13 @@ class Task(object):
inputs = ()
id = None
config = ""
mode = MODE_STANDARD
policy = POLICY_STANDARD
def set_message(self, msg, symbols):
msg.config = self.config
msg.task_type = symbols[self.task_type]
msg.input_ids.extend(t.id for t in self.inputs)
msg.mode = self.mode
msg.policy = self.policy
class Plan(object):
......@@ -61,14 +61,14 @@ class Plan(object):
def task_dslice(self, input):
task = Task()
task.task_type = self.TASK_SCHEDULER_DSLICE
task.mode = MODE_SCHEDULER
task.policy = POLICY_SCHEDULER
task.inputs = (input,)
return self.add(task)
def task_dget(self, input):
task = Task()
task.task_type = self.TASK_SCHEDULER_DGET
task.mode = MODE_SCHEDULER
task.policy = POLICY_SCHEDULER
task.inputs = (input,)
return self.add(task)
......@@ -76,28 +76,28 @@ class Plan(object):
task = Task()
task.task_type = self.TASK_DATA_CONST
task.config = data
task.mode = MODE_SIMPLE
task.policy = POLICY_SIMPLE
return self.add(task)
def task_merge(self, inputs):
task = Task()
task.task_type = self.TASK_DATA_MERGE
task.inputs = inputs
task.mode = MODE_SIMPLE
task.policy = POLICY_SIMPLE
return self.add(task)
def task_open(self, filename):
task = Task()
task.task_type = self.TASK_DATA_OPEN
task.config = filename
task.mode = MODE_SIMPLE
task.policy = POLICY_SIMPLE
return self.add(task)
def task_split(self, input, char=None):
task = Task()
task.task_type = self.TASK_DATA_SPLIT
task.inputs = (input,)
task.mode = MODE_SIMPLE
task.policy = POLICY_SIMPLE
return self.add(task)
def task_run(self, args, inputs=(), outputs=(None,), stdin=None):
......@@ -125,21 +125,21 @@ class Plan(object):
task = Task()
task.task_type = self.TASK_ARRAY_MAKE
task.inputs = inputs
task.mode = MODE_SIMPLE
task.policy = POLICY_SIMPLE
return self.add(task)
def task_size(self, input):
task = Task()
task.task_type = self.TASK_BASE_SIZE
task.inputs = (input,)
task.mode = MODE_SIMPLE
task.policy = POLICY_SIMPLE
return self.add(task)
def task_length(self, input):
task = Task()
task.task_type = self.TASK_BASE_LENGTH
task.inputs = (input,)
task.mode = MODE_SIMPLE
task.policy = POLICY_SIMPLE
return self.add(task)
def task_get(self, input, index):
......@@ -147,7 +147,7 @@ class Plan(object):
task.task_type = self.TASK_BASE_GET
task.inputs = (input,)
task.config = self.u64.pack(index)
task.mode = MODE_SIMPLE
task.policy = POLICY_SIMPLE
return self.add(task)
def task_slice(self, input, start, end):
......@@ -155,7 +155,7 @@ class Plan(object):
task.task_type = self.TASK_BASE_SLICE
task.inputs = (input,)
task.config = self.u64u64.pack(start, end)
task.mode = MODE_SIMPLE
task.policy = POLICY_SIMPLE
return self.add(task)
def create_message(self, symbols):
......
......@@ -56,7 +56,7 @@ struct StaticDescriptorInitializer_loomplan_2eproto {
// ===================================================================
bool Task_Mode_IsValid(int value) {
bool Task_Policy_IsValid(int value) {
switch(value) {
case 1:
case 2:
......@@ -68,18 +68,18 @@ bool Task_Mode_IsValid(int value) {
}
#ifndef _MSC_VER
const Task_Mode Task::MODE_STANDARD;
const Task_Mode Task::MODE_SIMPLE;
const Task_Mode Task::MODE_SCHEDULER;
const Task_Mode Task::Mode_MIN;
const Task_Mode Task::Mode_MAX;
const int Task::Mode_ARRAYSIZE;
const Task_Policy Task::POLICY_STANDARD;
const Task_Policy Task::POLICY_SIMPLE;
const Task_Policy Task::POLICY_SCHEDULER;
const Task_Policy Task::Policy_MIN;
const Task_Policy Task::Policy_MAX;
const int Task::Policy_ARRAYSIZE;
#endif // _MSC_VER
#ifndef _MSC_VER
const int Task::kTaskTypeFieldNumber;
const int Task::kConfigFieldNumber;
const int Task::kInputIdsFieldNumber;
const int Task::kModeFieldNumber;
const int Task::kPolicyFieldNumber;
#endif // !_MSC_VER
Task::Task()
......@@ -103,7 +103,7 @@ void Task::SharedCtor() {
_cached_size_ = 0;
task_type_ = 0;
config_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
mode_ = 1;
policy_ = 1;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
......@@ -152,7 +152,7 @@ void Task::Clear() {
config_->clear();
}
}
mode_ = 1;
policy_ = 1;
}
input_ids_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
......@@ -215,20 +215,20 @@ bool Task::MergePartialFromCodedStream(
goto handle_unusual;
}
if (input->ExpectTag(24)) goto parse_input_ids;
if (input->ExpectTag(32)) goto parse_mode;
if (input->ExpectTag(32)) goto parse_policy;
break;
}
// optional .loomplan.Task.Mode mode = 4 [default = MODE_STANDARD];
// optional .loomplan.Task.Policy policy = 4 [default = POLICY_STANDARD];
case 4: {
if (tag == 32) {
parse_mode:
parse_policy:
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::loomplan::Task_Mode_IsValid(value)) {
set_mode(static_cast< ::loomplan::Task_Mode >(value));
if (::loomplan::Task_Policy_IsValid(value)) {
set_policy(static_cast< ::loomplan::Task_Policy >(value));
} else {
unknown_fields_stream.WriteVarint32(tag);
unknown_fields_stream.WriteVarint32(value);
......@@ -282,10 +282,10 @@ void Task::SerializeWithCachedSizes(
3, this->input_ids(i), output);
}
// optional .loomplan.Task.Mode mode = 4 [default = MODE_STANDARD];
if (has_mode()) {
// optional .loomplan.Task.Policy policy = 4 [default = POLICY_STANDARD];
if (has_policy()) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
4, this->mode(), output);
4, this->policy(), output);
}
output->WriteRaw(unknown_fields().data(),
......@@ -311,10 +311,10 @@ int Task::ByteSize() const {
this->config());
}
// optional .loomplan.Task.Mode mode = 4 [default = MODE_STANDARD];
if (has_mode()) {
// optional .loomplan.Task.Policy policy = 4 [default = POLICY_STANDARD];
if (has_policy()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->mode());
::google::protobuf::internal::WireFormatLite::EnumSize(this->policy());
}
}
......@@ -351,8 +351,8 @@ void Task::MergeFrom(const Task& from) {
if (from.has_config()) {
set_config(from.config());
}
if (from.has_mode()) {
set_mode(from.mode());
if (from.has_policy()) {
set_policy(from.policy());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
......@@ -375,7 +375,7 @@ void Task::Swap(Task* other) {
std::swap(task_type_, other->task_type_);
std::swap(config_, other->config_);
input_ids_.Swap(&other->input_ids_);
std::swap(mode_, other->mode_);
std::swap(policy_, other->policy_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
......
......@@ -35,15 +35,15 @@ void protobuf_ShutdownFile_loomplan_2eproto();
class Task;
class Plan;
enum Task_Mode {
Task_Mode_MODE_STANDARD = 1,
Task_Mode_MODE_SIMPLE = 2,
Task_Mode_MODE_SCHEDULER = 3
enum Task_Policy {
Task_Policy_POLICY_STANDARD = 1,
Task_Policy_POLICY_SIMPLE = 2,
Task_Policy_POLICY_SCHEDULER = 3
};
bool Task_Mode_IsValid(int value);
const Task_Mode Task_Mode_Mode_MIN = Task_Mode_MODE_STANDARD;
const Task_Mode Task_Mode_Mode_MAX = Task_Mode_MODE_SCHEDULER;
const int Task_Mode_Mode_ARRAYSIZE = Task_Mode_Mode_MAX + 1;
bool Task_Policy_IsValid(int value);
const Task_Policy Task_Policy_Policy_MIN = Task_Policy_POLICY_STANDARD;
const Task_Policy Task_Policy_Policy_MAX = Task_Policy_POLICY_SCHEDULER;
const int Task_Policy_Policy_ARRAYSIZE = Task_Policy_Policy_MAX + 1;
// ===================================================================
......@@ -106,19 +106,19 @@ class Task : public ::google::protobuf::MessageLite {
// nested types ----------------------------------------------------
typedef Task_Mode Mode;
static const Mode MODE_STANDARD = Task_Mode_MODE_STANDARD;
static const Mode MODE_SIMPLE = Task_Mode_MODE_SIMPLE;
static const Mode MODE_SCHEDULER = Task_Mode_MODE_SCHEDULER;
static inline bool Mode_IsValid(int value) {
return Task_Mode_IsValid(value);
typedef Task_Policy Policy;
static const Policy POLICY_STANDARD = Task_Policy_POLICY_STANDARD;
static const Policy POLICY_SIMPLE = Task_Policy_POLICY_SIMPLE;
static const Policy POLICY_SCHEDULER = Task_Policy_POLICY_SCHEDULER;
static inline bool Policy_IsValid(int value) {
return Task_Policy_IsValid(value);
}
static const Mode Mode_MIN =
Task_Mode_Mode_MIN;
static const Mode Mode_MAX =
Task_Mode_Mode_MAX;
static const int Mode_ARRAYSIZE =
Task_Mode_Mode_ARRAYSIZE;
static const Policy Policy_MIN =
Task_Policy_Policy_MIN;
static const Policy Policy_MAX =
Task_Policy_Policy_MAX;
static const int Policy_ARRAYSIZE =
Task_Policy_Policy_ARRAYSIZE;
// accessors -------------------------------------------------------
......@@ -153,12 +153,12 @@ class Task : public ::google::protobuf::MessageLite {
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
mutable_input_ids();
// optional .loomplan.Task.Mode mode = 4 [default = MODE_STANDARD];
inline bool has_mode() const;
inline void clear_mode();
static const int kModeFieldNumber = 4;
inline ::loomplan::Task_Mode mode() const;
inline void set_mode(::loomplan::Task_Mode value);
// optional .loomplan.Task.Policy policy = 4 [default = POLICY_STANDARD];
inline bool has_policy() const;
inline void clear_policy();
static const int kPolicyFieldNumber = 4;
inline ::loomplan::Task_Policy policy() const;
inline void set_policy(::loomplan::Task_Policy value);
// @@protoc_insertion_point(class_scope:loomplan.Task)
private:
......@@ -166,8 +166,8 @@ class Task : public ::google::protobuf::MessageLite {
inline void clear_has_task_type();
inline void set_has_config();
inline void clear_has_config();
inline void set_has_mode();
inline void clear_has_mode();
inline void set_has_policy();
inline void clear_has_policy();
::std::string _unknown_fields_;
......@@ -175,7 +175,7 @@ class Task : public ::google::protobuf::MessageLite {
mutable int _cached_size_;
::std::string* config_;
::google::protobuf::int32 task_type_;
int mode_;
int policy_;
::google::protobuf::RepeatedField< ::google::protobuf::int32 > input_ids_;
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
friend void protobuf_AddDesc_loomplan_2eproto_impl();
......@@ -432,29 +432,29 @@ Task::mutable_input_ids() {
return &input_ids_;
}
// optional .loomplan.Task.Mode mode = 4 [default = MODE_STANDARD];
inline bool Task::has_mode() const {
// optional .loomplan.Task.Policy policy = 4 [default = POLICY_STANDARD];
inline bool Task::has_policy() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void Task::set_has_mode() {
inline void Task::set_has_policy() {
_has_bits_[0] |= 0x00000008u;
}
inline void Task::clear_has_mode() {
inline void Task::clear_has_policy() {
_has_bits_[0] &= ~0x00000008u;
}
inline void Task::clear_mode() {
mode_ = 1;
clear_has_mode();
inline void Task::clear_policy() {
policy_ = 1;
clear_has_policy();
}
inline ::loomplan::Task_Mode Task::mode() const {
// @@protoc_insertion_point(field_get:loomplan.Task.mode)
return static_cast< ::loomplan::Task_Mode >(mode_);
inline ::loomplan::Task_Policy Task::policy() const {
// @@protoc_insertion_point(field_get:loomplan.Task.policy)
return static_cast< ::loomplan::Task_Policy >(policy_);
}
inline void Task::set_mode(::loomplan::Task_Mode value) {
assert(::loomplan::Task_Mode_IsValid(value));
set_has_mode();
mode_ = value;
// @@protoc_insertion_point(field_set:loomplan.Task.mode)
inline void Task::set_policy(::loomplan::Task_Policy value) {
assert(::loomplan::Task_Policy_IsValid(value));
set_has_policy();
policy_ = value;
// @@protoc_insertion_point(field_set:loomplan.Task.policy)
}
// -------------------------------------------------------------------
......
......@@ -3,16 +3,16 @@ package loomplan;
option optimize_for = LITE_RUNTIME;
message Task {
enum Mode {
MODE_STANDARD = 1;
MODE_SIMPLE = 2;
MODE_SCHEDULER = 3;
enum Policy {
POLICY_STANDARD = 1;
POLICY_SIMPLE = 2;
POLICY_SCHEDULER = 3;
}
required int32 task_type = 1;
required bytes config = 2;
repeated int32 input_ids = 3;
optional Mode mode = 4 [default = MODE_STANDARD];
optional Policy policy = 4 [default = POLICY_STANDARD];
}
message Plan {
......
......@@ -21,16 +21,16 @@ TaskManager::TaskManager(Server &server)
}
static TaskNode::TaskMode read_task_mode(loomplan::Task_Mode mode) {
switch(mode) {
case loomplan::Task_Mode_MODE_STANDARD:
return TaskNode::MODE_STANDARD;
case loomplan::Task_Mode_MODE_SIMPLE:
return TaskNode::MODE_SIMPLE;
case loomplan::Task_Mode_MODE_SCHEDULER:
return TaskNode::MODE_SCHEDULER;
static TaskNode::Policy read_task_policy(loomplan::Task_Policy policy) {
switch(policy) {
case loomplan::Task_Policy_POLICY_STANDARD:
return TaskNode::POLICY_STANDARD;
case loomplan::Task_Policy_POLICY_SIMPLE:
return TaskNode::POLICY_SIMPLE;
case loomplan::Task_Policy_POLICY_SCHEDULER:
return TaskNode::POLICY_SCHEDULER;
default:
llog->critical("Invalid task mode");
llog->critical("Invalid task policy");
exit(1);
}
}
......@@ -43,7 +43,7 @@ void TaskManager::add_plan(const loomplan::Plan &plan, bool distribute)
const auto& pt = plan.tasks(i);
auto id = i + id_base;
tasks[id] = std::make_unique<TaskNode>(
id, i, read_task_mode(pt.mode()), pt.task_type(), pt.config());
id, i, read_task_policy(pt.policy()), pt.task_type(), pt.config());
}
std::vector<TaskNode*> ready_tasks;
......@@ -126,19 +126,19 @@ void TaskManager::on_task_finished(TaskNode &task)
std::vector<TaskNode*> ready;
task.collect_ready_nexts(ready);
bool scheduler_mode = false;
bool scheduler_policy = false;
for (TaskNode *node : ready) {
if (node->get_mode() == TaskNode::MODE_SCHEDULER) {
scheduler_mode = true;
if (node->get_policy() == TaskNode::POLICY_SCHEDULER) {
scheduler_policy = true;
break;
}
}
if (scheduler_mode) {
if (scheduler_policy) {
std::vector<TaskNode*> new_ready;
for (TaskNode *node : ready) {
if (node->get_mode() == TaskNode::MODE_SCHEDULER) {
expand_scheduler_mode_task(node, new_ready);
if (node->get_policy() == TaskNode::POLICY_SCHEDULER) {
expand_scheduler_task(node, new_ready);
} else {
new_ready.push_back(node);
}
......@@ -149,7 +149,7 @@ void TaskManager::on_task_finished(TaskNode &task)
distribute_work(ready);
}
void TaskManager::expand_scheduler_mode_task(TaskNode *node, TaskNode::Vector &tasks)
void TaskManager::expand_scheduler_task(TaskNode *node, TaskNode::Vector &tasks)
{
assert (node->get_inputs().size() == 1); // Todo generalize
TaskNode *input = node->get_inputs()[0];
......@@ -251,12 +251,12 @@ void TaskManager::dynamic_expand_helper(
TaskNode::Vector &tasks2)
{
Id new_id = server.new_id(2);
auto new_slice = std::make_unique<TaskNode>(new_id, -1, TaskNode::MODE_SIMPLE, task_type_id, config);
auto new_slice = std::make_unique<TaskNode>(new_id, -1, TaskNode::POLICY_SIMPLE, task_type_id, config);
new_slice->set_inputs(inputs);
tasks1.push_back(new_slice.get());
auto new_task = std::make_unique<TaskNode>(
new_id + 1, -1, next->get_mode(), next->get_task_type(), next->get_config());
new_id + 1, -1, next->get_policy(), next->get_task_type(), next->get_config());
new_task->add_input(new_slice.get());
new_slice->inc_ref_counter();
tasks2.push_back(new_slice.get());
......
......@@ -58,7 +58,7 @@ private:
void distribute_work(TaskNode::Vector &tasks);
void expand_scheduler_mode_task(TaskNode *node, TaskNode::Vector &tasks);
void expand_scheduler_task(TaskNode *node, TaskNode::Vector &tasks);
void expand_dslice(TaskNode *node, TaskNode::Vector &tasks, size_t length, TaskNode *next);
void expand_dget(TaskNode *node, TaskNode::Vector &tasks, size_t length, TaskNode *next);
void dynamic_expand_helper(
......
......@@ -23,14 +23,14 @@ public:
FINISHED
};
enum TaskMode {
MODE_STANDARD,
MODE_SIMPLE,
MODE_SCHEDULER
enum Policy {
POLICY_STANDARD,
POLICY_SIMPLE,
POLICY_SCHEDULER
};
TaskNode(loom::Id id, loom::Id client_id, TaskMode mode, int task_type, const std::string &config)
: state(WAITING), id(id), mode(mode), ref_count(0), task_type(task_type),
TaskNode(loom::Id id, loom::Id client_id, Policy policy, int task_type, const std::string &config)
: state(WAITING), id(id), policy(policy), ref_count(0), task_type(task_type),
config(config),
size(0), length(0), client_id(client_id)
{}
......@@ -78,8 +78,8 @@ public:
return ref_count;
}
TaskMode get_mode() const {
return mode;
Policy get_policy() const {
return policy;
}
void set_state(State state) {
......@@ -146,7 +146,7 @@ public:
private:
State state;
loom::Id id;
TaskMode mode;
Policy policy;
int ref_count;
loom::TaskId task_type;
Vector inputs;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment