Commit 588e6e5a authored by Millian Poquet's avatar Millian Poquet

[code] kill progress: handle unstarted sequences

parent 28440496
...@@ -120,12 +120,17 @@ void BatTask::compute_leaf_progress() ...@@ -120,12 +120,17 @@ void BatTask::compute_leaf_progress()
if (profile->is_parallel_task()) if (profile->is_parallel_task())
{ {
xbt_assert(ptask != nullptr, "Internal error"); if (ptask != nullptr) // The parallel task has already started
{
// WARNING: This is not returning the flops amount but the remainin quantity of work // WARNING: This is not returning the flops amount but the remainin quantity of work
// from 1 (not started yet) to 0 (completely finished) // from 1 (not started yet) to 0 (completely finished)
current_task_progress_ratio = 1 - MSG_task_get_remaining_work_ratio(ptask); current_task_progress_ratio = 1 - MSG_task_get_remaining_work_ratio(ptask);
} }
else
{
current_task_progress_ratio = 0;
}
}
else if (profile->type == ProfileType::DELAY) else if (profile->type == ProfileType::DELAY)
{ {
xbt_assert(delay_task_start != -1, "Internal error"); xbt_assert(delay_task_start != -1, "Internal error");
......
...@@ -330,11 +330,22 @@ Value generate_task_tree(BatTask* task_tree, rapidjson::Document::AllocatorType ...@@ -330,11 +330,22 @@ Value generate_task_tree(BatTask* task_tree, rapidjson::Document::AllocatorType
else else
{ {
task.AddMember("profile_name", Value().SetString(task_tree->profile->name.c_str(), _alloc), _alloc); task.AddMember("profile_name", Value().SetString(task_tree->profile->name.c_str(), _alloc), _alloc);
if (task_tree->current_task_index != (unsigned int)-1) // Started parallel task
{
task.AddMember("current_task_index", Value().SetInt(task_tree->current_task_index), _alloc); task.AddMember("current_task_index", Value().SetInt(task_tree->current_task_index), _alloc);
BatTask * btask = task_tree->sub_tasks[task_tree->current_task_index]; BatTask * btask = task_tree->sub_tasks[task_tree->current_task_index];
task.AddMember("current_task", generate_task_tree(btask, _alloc, forward_profiles), _alloc); task.AddMember("current_task", generate_task_tree(btask, _alloc, forward_profiles), _alloc);
} }
else
{
task.AddMember("current_task_index", Value().SetInt(-1), _alloc);
XBT_WARN("Cannot generate the execution task tree of job %s, "
"as its execution has not started.",
task_tree->parent_job->id.to_string().c_str());
}
}
return task; return task;
} }
......
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