Skip to content
Snippets Groups Projects
Commit e89132f6 authored by David Verelst's avatar David Verelst
Browse files

cpu_free was not set correctly due usage of two different keywords for the...

cpu_free was not set correctly due usage of two different keywords for the same: cpu_free and cpu_free_min.
parent 5944eeae
No related branches found
No related tags found
No related merge requests found
...@@ -328,7 +328,7 @@ class Scheduler: ...@@ -328,7 +328,7 @@ class Scheduler:
def __init__(self, nr_cpus, path_pbs_files=None, search_crit_re=r'\.p$', def __init__(self, nr_cpus, path_pbs_files=None, search_crit_re=r'\.p$',
dryrun=False, tsleep=5.00, logfile=None, cache=False, dryrun=False, tsleep=5.00, logfile=None, cache=False,
cpu_free_min=48, qsub_cmd='qsub %s', sort=False): cpu_free=48, qsub_cmd='qsub %s', sort=False):
""" """
Regular expression examples: Regular expression examples:
--re .veer-0\\.89_. --re .veer-0\\.89_.
...@@ -358,8 +358,11 @@ class Scheduler: ...@@ -358,8 +358,11 @@ class Scheduler:
cache : boolean, default=False cache : boolean, default=False
cpu_free_min : int, default=48 cpu_free : int, default=48
Minimum defined number of free cpu's that the cluster should have. Minimum defined number of free cpu's that the cluster should have
before another job is launched for the user. This will prevent
more jobs being launced even if the user occupies less than the
number of cpu's defined with nr_cpus.
qsub_cmd : str, default='qsub %s' qsub_cmd : str, default='qsub %s'
When launching from a node on Gorm, ssh to g-000 to bypass the When launching from a node on Gorm, ssh to g-000 to bypass the
...@@ -406,7 +409,7 @@ class Scheduler: ...@@ -406,7 +409,7 @@ class Scheduler:
self.uid = os.getenv('USER') self.uid = os.getenv('USER')
self.nr_cpus = nr_cpus self.nr_cpus = nr_cpus
self.cpu_free_min = cpu_free_min self.cpu_free = cpu_free
self.tsleep = tsleep self.tsleep = tsleep
self.dryrun = dryrun self.dryrun = dryrun
self.tsleep_short = 0.1 self.tsleep_short = 0.1
...@@ -464,7 +467,7 @@ class Scheduler: ...@@ -464,7 +467,7 @@ class Scheduler:
queueing system with jobs that will only queue intstead of run. queueing system with jobs that will only queue intstead of run.
""" """
print ' tsleep_short ; %6.2f' % self.tsleep_short print ' tsleep_short ; %6.2f' % self.tsleep_short
print 'min cpu to be free ; %3i' % self.cpu_free_min print 'min cpu to be free ; %3i' % self.cpu_free
# we can only ask for confirmation when stdout is not going to the log # we can only ask for confirmation when stdout is not going to the log
if self.logfile is None: if self.logfile is None:
print 'Is this ok? You have 5 sec to abort (press CTRL-C to abort)' print 'Is this ok? You have 5 sec to abort (press CTRL-C to abort)'
...@@ -485,7 +488,7 @@ class Scheduler: ...@@ -485,7 +488,7 @@ class Scheduler:
# we only launch a new job when we are not using more than our # we only launch a new job when we are not using more than our
# quota (nr_cpus), or when there is still some room for others # quota (nr_cpus), or when there is still some room for others
# to breath # to breath
if self.nr_cpus > cpu_user and cpu_free > self.cpu_free_min: if self.nr_cpus > cpu_user and cpu_free > self.cpu_free:
fname = self.pbsflist[ii] fname = self.pbsflist[ii]
# read the PBS file # read the PBS file
f = open(fname) f = open(fname)
...@@ -734,6 +737,6 @@ if __name__ == '__main__': ...@@ -734,6 +737,6 @@ if __name__ == '__main__':
ss = Scheduler(options.nr_cpus, path_pbs_files=options.path_pbs_files, ss = Scheduler(options.nr_cpus, path_pbs_files=options.path_pbs_files,
search_crit_re=options.search_crit_re, dryrun=options.dry, search_crit_re=options.search_crit_re, dryrun=options.dry,
tsleep=options.tsleep, logfile=path_log, tsleep=options.tsleep, logfile=path_log,
cache=options.cache, cpu_free_min=options.cpu_free, cache=options.cache, cpu_free=options.cpu_free,
qsub_cmd=options.qsub_cmd, sort=options.sort) qsub_cmd=options.qsub_cmd, sort=options.sort)
ss(options.depend) ss(options.depend)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment