Skip to content

Commit

Permalink
Merge branch '119.iso8601-cycling' of github.com:cylc/cylc into iso.s…
Browse files Browse the repository at this point in the history
…uite-rc-intervals
  • Loading branch information
benfitzpatrick committed Jul 9, 2014
2 parents 0de84c5 + 6e26156 commit 5ad7e46
Show file tree
Hide file tree
Showing 140 changed files with 283 additions and 211 deletions.
2 changes: 1 addition & 1 deletion bin/cylc-restart
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ where they got to while the suite was down."""
else:
raise Exception( 'ERROR: unknown task state for ' + itask.id )

self.pool.add( itask )
self.pool.add_to_runahead_pool( itask )


if __name__ == '__main__':
Expand Down
6 changes: 3 additions & 3 deletions bin/cylc-run
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ initial and final cycle point variables persists across suite restarts."""
itask = self.config.get_task_proxy( name, tag, 'waiting', stopctime=None, startup=True, submit_num=0, exists=False )

if itask.tag:
self.pool.add( itask )
self.pool.add_to_runahead_pool( itask )
else:
self.log.info( "Not loading " + name + " (out of sequence bounds)" )
del itask
Expand Down Expand Up @@ -157,7 +157,7 @@ initial and final cycle point variables persists across suite restarts."""
itask.prerequisites.set_all_satisfied()
itask.outputs.set_all_completed()

self.pool.add( itask )
self.pool.add_to_runahead_pool( itask )

def load_tasks_raw( self ):
if self.start_point is not None:
Expand All @@ -180,7 +180,7 @@ initial and final cycle point variables persists across suite restarts."""
del itask
continue

self.pool.add( itask )
self.pool.add_to_runahead_pool( itask )

if __name__ == '__main__':
main("run", start)
2 changes: 1 addition & 1 deletion lib/cylc/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def command_insert_task( self, name, tag, is_family, stop_string ):
# TODO - insertion of start-up tasks? (startup=False is assumed here)
new_task = self.config.get_task_proxy( name, point, 'waiting', stop_point, startup=False, submit_num=self.db.get_task_current_submit_num(name, tag), exists=self.db.get_task_state_exists(name, tag))
if new_task:
self.pool.add( new_task )
self.pool.add_to_runahead_pool( new_task )


def command_nudge( self ):
Expand Down
53 changes: 30 additions & 23 deletions lib/cylc/task_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,47 +100,54 @@ def assign_queues( self ):
self.myq[taskname] = queue



def add( self, itask ):

def add_to_runahead_pool( self, itask ):
"""Add a new task to the runahead pool if possible.
Tasks whose recurrences allow them to spawn beyond the suite
stop point are added to the pool in the held state, ready to be
released if the suite stop point is changed."""

# do not add if a task with the same ID already exists
# e.g. an inserted task caught up with an existing one
if self.id_exists( itask.id ):
# e.g. an inserted task caught up with an existing one with the same ID.
self.log.warning( itask.id + ' cannot be added: task ID already exists' )
self.log.warning( itask.id + ' cannot be added to pool: task ID already exists' )
del itask
return False

# TODO ISO - no longer needed due to recurrence bounds?
# do not add if an inserted task is beyond its own stop point
# (note this is not the same as recurrence bounds)
if itask.stop_c_time and itask.c_time > itask.stop_c_time:
itask.log( 'WARNING', "not adding (beyond my stop cycle)" )
self.log.info( itask.id + ' not adding to pool: beyond task stop cycle' )
del itask
return False

# check cycle stop or hold conditions
# add in held state if beyond the suite stop point
if self.stop_point and itask.c_time > self.stop_point:
# itask.log( 'WARNING', "not adding (beyond suite stop cycle) " + str(self.stop_point) )
itask.log( 'NORMAL', "holding (beyond suite stop point) " + str(self.stop_point) )
itask.reset_state_held()
# return

# TODO ISO -restore suite hold functionality
#if self.hold_time and itask.c_time > self.hold_time:
# itask.log( 'DEBUG', "not adding (beyond suite hold cycle) " + str(self.hold_time) )
# add in held state if beyond the suite hold point
# TODO ISO -restore this functionality
#elif self.hold_time and itask.c_time > self.hold_time:
# itask.log( 'NORMAL', "holding (beyond suite hold point) " + str(self.hold_time) )
# itask.reset_state_held()
# return

# hold tasks with future triggers beyond the final cycle point
if self.task_has_future_trigger_overrun( itask ):
itask.log( "WARNING", "not adding (future trigger beyond stop cycle)" )
# add in held state if a future trigger goes beyond the suite stop point
# (note this only applies to tasks below the suite stop point themselves)
elif self.task_has_future_trigger_overrun( itask ):
itask.log( "NORMAL", "holding (future trigger beyond stop point)" )
self.held_future_tasks.append( itask.id )
itask.reset_state_held()
return

# add to the runahead pool
self.runahead_pool[itask.id] = itask

self.rhpool_changed = True

return True


def get_task_proxy( self, *args, **kwargs ):
return self.config.get_task_proxy(*args, **kwargs)


def release_runahead_tasks( self ):

# compute runahead base: the oldest task not succeeded or failed
Expand Down Expand Up @@ -452,7 +459,7 @@ def reload_taskdefs( self ):


self.remove( itask, '(suite definition reload)' )
self.add( new_task )
self.add_to_runahead_pool( new_task )

self.reconfiguring = found

Expand Down Expand Up @@ -631,7 +638,7 @@ def force_spawn( self, itask ):
itask.state.set_spawned()
itask.log( 'DEBUG', 'forced spawning')
new_task = itask.spawn( 'waiting' )
if new_task and self.add( new_task ):
if new_task and self.add_to_runahead_pool( new_task ):
return new_task
else:
return None
Expand Down
2 changes: 1 addition & 1 deletion tests/broadcast/00-simple.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test broadcasts
# Test broadcasts
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
2 changes: 1 addition & 1 deletion tests/broadcast/01-dependencies.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test broadcasts
# Test broadcasts
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
2 changes: 1 addition & 1 deletion tests/broadcast/02-inherit.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test broadcasts, with overriding inheritance.
# Test broadcasts, with overriding inheritance.
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
2 changes: 1 addition & 1 deletion tests/cat-log/00-local.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test cat-log, localhost
# Test cat-log, localhost
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 3
Expand Down
2 changes: 1 addition & 1 deletion tests/cat-log/01-remote.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test cat-log, localhost
# Test cat-log, localhost
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
export CYLC_TEST_HOST=$(cylc get-global-config -i '[test battery]remote host')
Expand Down
4 changes: 2 additions & 2 deletions tests/combined/00-simple.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test triggering of asynchronous one-off, synchronous one-off
#C: (start-up), and cycling tasks in one suite.
# Test triggering of asynchronous one-off, synchronous one-off
# (start-up), and cycling tasks in one suite.
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
2 changes: 1 addition & 1 deletion tests/cyclers/00-daily.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test intercycle dependencies.
# Test intercycle dependencies.
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
2 changes: 1 addition & 1 deletion tests/cyclers/23-multidaily_local.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test intercycle dependencies, local time.
# Test intercycle dependencies, local time.
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
2 changes: 1 addition & 1 deletion tests/cyclers/24-360_calendar.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test intercycle dependencies.
# Test intercycle dependencies.
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
2 changes: 1 addition & 1 deletion tests/cycletime/00-time.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: basic jinja2 expansion test
# basic jinja2 expansion test
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 27
Expand Down
2 changes: 1 addition & 1 deletion tests/cycletime/01-iso_timeparser.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Run the time_parser.py tests
# Run the time_parser.py tests
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 1
Expand Down
2 changes: 1 addition & 1 deletion tests/cylc-cat-state/00-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test cat-check against suite database
# Test cat-check against suite database
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 3
Expand Down
2 changes: 1 addition & 1 deletion tests/cylc-get-config/00-simple.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test cylc get-config
# Test cylc get-config
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 14
Expand Down
2 changes: 1 addition & 1 deletion tests/cylc-get-site-config/00-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test cylc-get-site-config
# Test cylc-get-site-config
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 9
Expand Down
2 changes: 1 addition & 1 deletion tests/cylc-ping/00-simple.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test cylc ping behaviour
# Test cylc ping behaviour
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
2 changes: 1 addition & 1 deletion tests/cylc-poll/00-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test cat-check against suite database
# Test cat-check against suite database
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
2 changes: 1 addition & 1 deletion tests/cylc-remove/00-simple.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test cylc remove
# Test cylc remove
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
2 changes: 1 addition & 1 deletion tests/cylc-scan/00-simple.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test cylc scan is picking up running suite
# Test cylc scan is picking up running suite
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
2 changes: 1 addition & 1 deletion tests/database/00-simple.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: basic tests for suite database contents
# basic tests for suite database contents
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 5
Expand Down
6 changes: 3 additions & 3 deletions tests/directives/00-loadleveler.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test loadleveler directives
#C: This test requires a [directive-tests]loadleveler-host entry in
#C: site/user config in order to run, otherwise it will be bypassed
# Test loadleveler directives
# This test requires a [directive-tests]loadleveler-host entry in
# site/user config in order to run, otherwise it will be bypassed
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
2 changes: 1 addition & 1 deletion tests/directives/01-at.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test at submission
# Test at submission
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
2 changes: 1 addition & 1 deletion tests/documentation/00-make.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test documentation can be made
# Test documentation can be made
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 1
Expand Down
2 changes: 1 addition & 1 deletion tests/events/00-suite.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Validate and run the events/suite test suite
# Validate and run the events/suite test suite
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
2 changes: 1 addition & 1 deletion tests/events/01-task.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Validate and run the task events suite.
# Validate and run the task events suite.
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
Expand Down
6 changes: 3 additions & 3 deletions tests/graph-equivalence/00-oneline.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test graph="a=>b=>c" gives the same result as
#C: graph = """a => b\
#C: => c"""
# Test graph="a=>b=>c" gives the same result as
# graph = """a => b\
# => c"""
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 5
Expand Down
6 changes: 3 additions & 3 deletions tests/graph-equivalence/01-twolines.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#C: You should have received a copy of the GNU General Public License
#C: along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#C: Test graph = """a => b
#C: b => c""" gives the same result as
#C: graph = "a => b => c"
# Test graph = """a => b
# b => c""" gives the same result as
# graph = "a => b => c"
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 5
Expand Down
Loading

0 comments on commit 5ad7e46

Please sign in to comment.