Commit b09a8549 authored by Stanislav Bohm's avatar Stanislav Bohm

ENH: more logging

parent a0dc1a90
......@@ -133,7 +133,7 @@ void RawData::map(int fd, bool write)
std::string RawData::get_info()
{
return "RawData";
return "RawData file=" + filename;
}
void RawData::init_from_string(Worker &worker, const std::string &str)
......
......@@ -72,7 +72,8 @@ void RunTask::start(DataVector &inputs)
std::string path = get_path(msg.map_inputs(i));
std::string filename = inputs[i]->get_filename();
assert(!filename.empty());
llog->debug("Creating symlink of '{}'", msg.map_inputs(i));
llog->debug("Creating symlink of '{}' for input id={} filename={}",
msg.map_inputs(i), task->get_inputs()[i], filename);
if (symlink(filename.c_str(), path.c_str())) {
log_errno_abort("symlink");
}
......
......@@ -218,7 +218,7 @@ void Worker::start_task(std::unique_ptr<Task> task)
void Worker::publish_data(Id id, const std::shared_ptr<Data> &data)
{
llog->debug("Publishing data id={} size={}", id, data->get_size());
llog->debug("Publishing data id={} size={} info={}", id, data->get_size(), data->get_info());
public_data[id] = data;
check_waiting_tasks();
}
......
......@@ -390,6 +390,17 @@ TaskState &ComputationState::get_state(loom::Id id)
}
TaskState &ComputationState::get_state_or_create(loom::Id id)
{
auto it = states.find(id);
if (it == states.end()) {
loom::llog->debug("Creating state id={}", id);
auto p = states.emplace(std::make_pair(id, TaskState(get_node(id))));
it = p.first;
}
return it->second;
}
void ComputationState::add_ready_nodes(const std::vector<loom::Id> &ids)
{
for (loom::Id id : ids) {
......
......@@ -36,14 +36,7 @@ public:
}
}
TaskState& get_state_or_create(loom::Id id) {
auto it = states.find(id);
if (it == states.end()) {
auto p = states.emplace(std::make_pair(id, TaskState(get_node(id))));
it = p.first;
}
return it->second;
}
TaskState& get_state_or_create(loom::Id id);
const PlanNode& get_node(loom::Id id) {
return plan.get_node(id);
......
......@@ -62,6 +62,7 @@ void TaskManager::start_task(WorkerConnection *wc, Id task_id)
void TaskManager::remove_state(TaskState &state)
{
llog->debug("Removing state id={}", state.get_id());
assert(state.get_ref_counter() == 0);
loom::Id id = state.get_id();
state.foreach_owner([id](WorkerConnection *wc) {
......
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