You can pass group names with the -K argument, when you start the process. 
When you queue a task, you must pass in the group_name parameter to 
"reserve" that task for a specific worker.


BTW: did you at least tried to 
read http://web2py.com/books/default/chapter/29/04/the-core#web2py-Scheduler 
before asking ?


On Tuesday, May 20, 2014 9:46:39 PM UTC+2, DeanK wrote:
>
> I'm looking to use the built in scheduler to farm out work, but run gpu 
> dependent code.  Because of this I need to be able to control on which node 
> the task is scheduled.  I thought I could do this using "groups" but I 
> don't see how since you set the group in the scheduler constructor 
> according to the docs?  I was expecting you would set groups that workers 
> are "subscribed" to when you start them on each node and then when you 
> schedule a task you can set which group the task is assigned to.  Is this 
> not possible or have I misinterpreted the documentation?
>
> scheduler.py in models:
>
> def my_task1():
>    #my first task
>
> def my_task2():
>    #another task
>
> from gluon.scheduler import Scheduler
>
> db_sched = 
> DAL('mysql://XXXX:XXXXX@XXXXX/XXXX',pool_size=8,check_reserved=['mysql'],migrate=True,fake_migrate_all=False,lazy_tables=False)
> scheduler = Scheduler(db_sched,heartbeat=2)
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to