Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to assign tasks correctly #69

Closed
chenxi-shi opened this issue Feb 17, 2018 · 6 comments
Closed

Failed to assign tasks correctly #69

chenxi-shi opened this issue Feb 17, 2018 · 6 comments

Comments

@chenxi-shi
Copy link

Hi, I wrote a small piece of python code on a macbook which has 10 + 1 tasks. 10 similar sleeping task and 1 joint task. I am running it by 4 processes and found that sometime Jug cannot assign task correctly. It happens like one process does all tasks along and, at the same time, another 3 share the 11 tasks.

@luispedro
Copy link
Owner

If I'm understanding your issue, correctly (and I may not), this is actually not a bug as it is outside of control of jug. Jug makes no attempt at "fairly" distributing tasks.

The distribution of tasks depends only on the scheduling of processes by the operating system, which can be very stochastic. If there are processes that are idle for a long time, this may be a jug issue, but what you describe seems like the expected behaviour.

@chenxi-shi
Copy link
Author

I see what you mean, but the problem is the 11 tasks are executed twice. It's reasonable that tasks are assigned stochastically.

@luispedro
Copy link
Owner

Ah, then it is a big problem.

Please post some code with more information.

@chenxi-shi
Copy link
Author

exmp

call_exmp

@luispedro
Copy link
Owner

Actually, jug is working as expected as the task depends on the time(): every time you call it, you are generating a different set of tasks (unless they are called in the same second).

This is a variant of this issue: http://jug.readthedocs.io/en/latest/faq.html#it-doesn-t-work-with-random-input

@chenxi-shi
Copy link
Author

I see. I changed the argument "start_time" to a fixed number and the problem is fixed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants