Bug 307662 - Resources misusage/unallocated.
Summary: Resources misusage/unallocated.
Status: RESOLVED FIXED
Alias: None
Product: calligraplan
Classification: Applications
Component: general (show other bugs)
Version: 2.4.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Dag Andersen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-01 10:07 UTC by Raúl
Modified: 2018-11-19 11:29 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.6


Attachments
Gantt chart for the scheduling result. (71.44 KB, image/png)
2012-10-01 10:09 UTC, Raúl
Details
Resource allocation breakdown. (21.97 KB, image/png)
2012-10-01 10:11 UTC, Raúl
Details
Gantt chart for network planner with overloaded resources. (30.89 KB, image/png)
2012-10-01 21:56 UTC, Raúl
Details
Netowork scheduling overloads resource (breakdown) (12.31 KB, image/png)
2012-10-01 21:57 UTC, Raúl
Details
TJ scheluder failure log. (20.67 KB, image/png)
2012-10-09 09:23 UTC, Raúl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raúl 2012-10-01 10:07:30 UTC
Hello:
After #306734 I noticed that resources were not allocated properly, for instance, there were days where no resource were allocated even some free were available. I can reproduce it for all 3 schedules: network, rpcs and TJ.

Reproducible: Always

Steps to Reproduce:
1. Open https://bugs.kde.org/attachment.cgi?id=73883
2. Go to Planning section, check the selected scheduler.
3. Press calculate button in the toolbar.
Actual Results:  
See in the gantt chart how resources are misallocated sometimes, leaving them free instead of assigning some pending task.

Expected Results:  
Resources are always allocated in 100% of their time.

Attaching screenshots of Gantt chart and resource allocation chart.
Comment 1 Raúl 2012-10-01 10:09:54 UTC
Created attachment 74263 [details]
Gantt chart for the scheduling result.

See how there's a resouce assigned blank at the beginning of august.
Comment 2 Raúl 2012-10-01 10:11:43 UTC
Created attachment 74264 [details]
Resource allocation breakdown.

See how only 0.6h out of 3,5h are allocated. Similar to the following days.
Comment 3 Raúl 2012-10-01 10:13:36 UTC
This tests have been carried out on 2.4.3 patched as per #306734 and additionally with proposed patch at #301888, the results were the same before applying this second patch.
Comment 4 Dag Andersen 2012-10-01 11:38:34 UTC
> After #306734 I noticed that resources were not allocated properly, for instance, there were days where no resource were allocated even some free were available. I can reproduce it for all 3 schedules: network, rpcs and TJ.
I can only reproduce blank days using rcps (reason below), network and TJ should always use all available time.
Are you certain you have actually changed scheduler? (Qt can be a bit tricky, if you edit something and directly hit a command button (like caclulate) you edition might get lost.)
Could you verify this again?

> See how there's a resouce assigned blank at the beginning of august.
The RCPS scheduler operates as follows:
1) All allocated resources are mandatory, if a resource is not available, no work is assigned for any resource.
2) A task cannot be interupted by other tasks, it will schedule the task when all of the task can be done in one go.

This has the implication that when there are tasks with time constraints and the time between the time constrained tasks is shorter than other possible tasks requires, the other tasks will be scheduled after the time constrained tasks. (As is the case with T42/T43 and T211)

> See how only 0.6h out of 3,5h are allocated. Similar to the following days.
Note that the task does not start at the beginning of a day so only 1.9 h is done first day, hence 0.6 h the last day is needed to complete the task.

Imo this is not quite a bug, more like a wish, but I agree it could be confusing.
Comment 5 Raúl 2012-10-01 21:56:38 UTC
Created attachment 74270 [details]
Gantt chart for network planner with overloaded resources.

Thanks for the quick reply, Dag.

I see what you mean about the scheduler choice. I may have kept trying with RPCS. Now I've noticed that to make sure I've change scheduler I need to:
1- Double click on Scheduler cell in the scheduling list.
2- Select the one I want in the listbox.
3- Click on blank, for instance, below the last scheduling row

Now I press on the calculate button. I've done more tests, this time with 2.5.1. Let's talk about schedulers now.

RPCS: I see what you mean. With those guideliness, looks scheduler is working properliy.
Network: I've tried with this one (for real). What I see now is resources overloading, specially when fixed tasks like T42 appear. I'll attach some screenshots.
TJ: Scheduling simply fails. I see some progress but it shortly stops and goes back to 0% without any result.

With all this, I think the resources are not assigned properly and maybe we could keep this bug open. Also I admit your suggestion that this may not be a bug, but a wishlisht. Feel free to update bug headers.

I wonder if there's any place I could learn about these schedulers. Regards,
Comment 6 Raúl 2012-10-01 21:57:28 UTC
Created attachment 74271 [details]
Netowork scheduling overloads resource (breakdown)
Comment 7 Dag Andersen 2012-10-02 13:39:54 UTC
Git commit 918dfdeb2229620642a7ee5cf003c5051f560182 by Dag Andersen.
Committed on 02/10/2012 at 13:31.
Pushed by danders into branch 'master'.

Always check appointments to avoid overbooking resources

This only bites when a task is interrupted bu another task,
e.g. when there are timing constraints.

M  +1    -1    plan/libs/kernel/kptresource.cpp

http://commits.kde.org/calligra/918dfdeb2229620642a7ee5cf003c5051f560182
Comment 8 Dag Andersen 2012-10-02 13:39:54 UTC
Git commit c4fe1ee0d4daa4c88e0656078078a6d20ae0dbf4 by Dag Andersen.
Committed on 02/10/2012 at 15:37.
Pushed by danders into branch 'master'.

Set number of hours pr day so TJ can handle estimate correctly

M  +2    -0    plan/plugins/schedulers/tj/PlanTJScheduler.cpp

http://commits.kde.org/calligra/c4fe1ee0d4daa4c88e0656078078a6d20ae0dbf4
Comment 9 Dag Andersen 2012-10-02 13:48:24 UTC
Git commit ac59c056c6f4158a0c6490fe2ee3b389e88d07f7 by Dag Andersen.
Committed on 02/10/2012 at 15:42.
Pushed by danders into branch 'calligra/2.5'.

Backport: Set number of hours pr day so TJ can handle estimate correctly

M  +2    -0    plan/plugins/schedulers/tj/PlanTJScheduler.cpp

http://commits.kde.org/calligra/ac59c056c6f4158a0c6490fe2ee3b389e88d07f7
Comment 10 Dag Andersen 2012-10-02 13:48:24 UTC
Git commit 27242f8819b2f582a08d2d81ca75526c016af0ac by Dag Andersen.
Committed on 02/10/2012 at 15:41.
Pushed by danders into branch 'calligra/2.5'.

Backport: Always check appointments to avoid overbooking resources

    This only bites when a task is interrupted bu another task,
    e.g. when there are timing constraints.

M  +1    -1    plan/libs/kernel/kptresource.cpp

http://commits.kde.org/calligra/27242f8819b2f582a08d2d81ca75526c016af0ac
Comment 11 Raúl 2012-10-03 14:42:16 UTC
Hi:
I've applied both 2.5 backported patches on both, 2.5 and 2.4. For network scheduler it seems I'm not getting the resources overload, but I'd need to check a littler further since it's hard to appreciate on general Gantt chart.
For TJ scheduler, it still fails to schedule de project. It aborts at about 2%, but maybe another bug should be opened for this instead.
Thanks a lot, Dag.
Comment 12 Dag Andersen 2012-10-04 07:36:55 UTC
TJ never stops here :(
I found (and fixed) a different bug, the availablefrom/until was not respected.
Hmmm, could this be the cause, the bug might bite a bit at random, I think.
Do get anything in the scheduling log?
Also try the log views context-menu->Show debug information.
You can select all and copy into text editor if you think there is smething I should look at.

Regarding the schedulers, there is some info here:
http://www.librcps.org
http://taskjuggler.org (afaicr there isn't much info on the actual scheduler here)
Comment 13 Raúl 2012-10-09 09:23:56 UTC
Created attachment 74441 [details]
TJ scheluder failure log.

Sorry for the delay. I've retested with TJ scheduler and I'm attaching a screenshot with the debug log. It always fails here. HTH,
Comment 14 Dag Andersen 2012-10-09 12:59:17 UTC
Ahhh, yes, totally forgot. I have fixed this for 2.6, it did not make it into 2.5.3 but I think there is a work around:
Please try to set estimate to 0 for the  fixed interval tasks (T41, T42, T43)
It turns out tj regards an estmate > 0 for fixed interval tasks to be an error.

If this works (should) I think we'll have to live with it until 2.6 is released.
Comment 15 Raúl 2012-10-15 07:57:37 UTC
I think that known limitation is bearable. If you think it's correct you could close this for versions where patches apply, not sure if 2.5.3 or maybe 2.6.
Thanks for your work. Regards,
Comment 16 Andrew Crouthamel 2018-11-09 00:54:18 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 17 Andrew Crouthamel 2018-11-18 03:27:48 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!