Coder Social home page Coder Social logo

Comments (2)

surh avatar surh commented on September 21, 2024

It seems like the info messages are incorrect when the max_jobs option is used. I have the following script (test.py)

#!/usr/bin/env python
import fyrd

cmd = 'sleep 180'
job1 = fyrd.Job(cmd,partition = "owners", outpath = 'out', scriptpath = 'sub')
job2 = fyrd.Job(cmd,partition = "owners", outpath = 'out', scriptpath = 'sub')
job3 = fyrd.Job(cmd,partition = "owners", outpath = 'out', scriptpath = 'sub')
job4 = fyrd.Job(cmd,partition = "owners", outpath = 'out', scriptpath = 'sub')
job5 = fyrd.Job(cmd,partition = "owners", outpath = 'out', scriptpath = 'sub')
job6 = fyrd.Job(cmd,partition = "owners", outpath = 'out', scriptpath = 'sub')

job1.submit(max_jobs=2)
job2.submit(max_jobs=2)
job3.submit(max_jobs=2)
job4.submit(max_jobs=2)
job5.submit(max_jobs=2)
job6.submit(max_jobs=2)

And it produces the following output

$ ./test.py 
20170816 15:40:29.530 | INFO --> The queue is full, there are 1 jobs running and 0 jobs queued. Will wait to submit, retrying every 1 seconds.
20170816 15:43:23.612 | INFO --> The queue is full, there are 1 jobs running and 1 jobs queued. Will wait to submit, retrying every 1 seconds.
20170816 15:43:42.145 | INFO --> The queue is full, there are 1 jobs running and 1 jobs queued. Will wait to submit, retrying every 1 seconds.
20170816 15:46:35.936 | INFO --> The queue is full, there are 1 jobs running and 1 jobs queued. Will wait to submit, retrying every 1 seconds.

However manual inspection of the queue shows that there are two jobs running at any given time.

I think it is a good idea to set this at the queue level and not the job level, otherwise I can effectively ignore the max_jobs argument with:

job1.submit(max_jobs=1)
job2.submit(max_jobs=2)
job3.submit(max_jobs=3)
job4.submit(max_jobs=4)
job5.submit(max_jobs=5)
job6.submit(max_jobs=6)

from fyrd.

MikeDacre avatar MikeDacre commented on September 21, 2024

That issue is because the time that the job object is caching job information is different from the queue, it is a little silly, I might try to fix it later. I am working on the change to set the minimum, but it will probably go into the 0.6.2 branch only, to be released with the 0.6.2.a1 release next week.

from fyrd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.