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

[code] kill progress: handle unstarted sequences

parent 28440496
......@@ -120,11 +120,16 @@ void BatTask::compute_leaf_progress()
if (profile->is_parallel_task())
{
xbt_assert(ptask != nullptr, "Internal error");
// WARNING: This is not returning the flops amount but the remainin quantity of work
// from 1 (not started yet) to 0 (completely finished)
current_task_progress_ratio = 1 - MSG_task_get_remaining_work_ratio(ptask);
if (ptask != nullptr) // The parallel task has already started
{
// WARNING: This is not returning the flops amount but the remainin quantity of work
// from 1 (not started yet) to 0 (completely finished)
current_task_progress_ratio = 1 - MSG_task_get_remaining_work_ratio(ptask);
}
else
{
current_task_progress_ratio = 0;
}
}
else if (profile->type == ProfileType::DELAY)
{
......
......@@ -330,10 +330,21 @@ Value generate_task_tree(BatTask* task_tree, rapidjson::Document::AllocatorType
else
{
task.AddMember("profile_name", Value().SetString(task_tree->profile->name.c_str(), _alloc), _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];
task.AddMember("current_task", generate_task_tree(btask, _alloc, forward_profiles), _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);
BatTask * btask = task_tree->sub_tasks[task_tree->current_task_index];
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;
}
......
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