Hi,
Documentation states:
maxjobspersecond Maximal number of cluster/drmaa jobs per second, default is 10, fractions allowed. Default: 10
The problem is that even though they do no raise any error, values below 1 are ignored (1 job per second will be submitted). This is due to the way RateLimiter works.
If we want to allow users to submit less than 1 job per second, we need to play with the max_calls and period parameters of RateLimiter. For instance, replacing:
if self.max_jobs_per_second and not self.dryrun: self.rate_limiter = RateLimiter(max_calls=self.max_jobs_per_second, period=1)
by:
from fractions import Fraction if self.max_jobs_per_second and not self.dryrun: max_jobs_frac = Fraction(self.max_jobs_per_second).limit_denominator() self.rate_limiter = RateLimiter(max_calls=max_jobs_frac.numerator, period=max_jobs_frac.denominator)
The code above should work with any value of max_jobs_per_second, and ensure that floating value are properly taken into account.
Cheers,
−Nils
Comments (2)


 changed status to resolved
Merged in nigiord/snakemake/fixratelimiter (pull request #410)
Fix
#1236: use of fractions for maxjobspersecond (currently ignored)→ <<cset bd2c5a70d130>>
 Log in to comment
See pull request #410