Skip to content

Commit

Permalink
Updated CUG, added integer exclusions to test battery
Browse files Browse the repository at this point in the history
  • Loading branch information
dvalters committed May 15, 2017
1 parent d919e4a commit 05157aa
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 1 deletion.
35 changes: 34 additions & 1 deletion doc/src/cylc-user-guide/cug.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2684,9 +2684,22 @@ \subsubsection{Graph Section Headings}
# the initial cycle point, but exclude
# 00:00 for 5 days from the 1st January
# 2000.

\end{lstlisting}
\lstset{language=transcript}

You can combine exclusion sequences and single point exclusions within a
comma separated list enclosed in parentheses:

\lstset{language=suiterc}
\begin{lstlisting}
[[[ T-00 ! (20000101T07, PT2H) ]]] # Run hourly on the hour but not at 07:00
# on the 1st Jan, 2000 and not 2-hourly
# on the hour.
\end{lstlisting}
\lstset{language=transcript}


\paragraph{How Multiple Graph Strings Combine}
\label{HowMultipleGraphStringsCombine}

Expand Down Expand Up @@ -3006,7 +3019,7 @@ \subsubsection{Graph Section Headings}
\subparagraph{Advanced Integer Cycling Syntax}

The same syntax used to reference the initial and final cycle points
introduced in~\ref{referencing-the-initial-and-final-cycle-points}) for
(introduced in~\ref{referencing-the-initial-and-final-cycle-points}) for
use with datetime cycling can also be used for integer cycling. For
example you can write:

Expand Down Expand Up @@ -3034,6 +3047,26 @@ \subsubsection{Graph Section Headings}
\end{lstlisting}
\lstset{language=transcript}

Multiple integer exclusions are also valid in the same way as the syntax
in~\ref{excluding-dates}. Integer exclusions may be a list of single
integer points, an integer sequence, or a combination of both:

\lstset{language=suiterc}
\begin{lstlisting}
[[[ R/P1!(2,3,7) ]]] # Run with step 1 to the final cycle point,
# but not at points 2, 3, or 7.
[[[ P1 ! P2 ]]] # Run with step 1 from the initial to final
# cycle point, skipping every other step from
# the initial cycle point.
[[[ P1 ! +P1/P2 ]]] # Run with step 1 from the initial cycle point,
# excluding every other step beginning one step
# after the initial cycle point.
[[[ P1 !(P2,6,8) ]]] # Run with step 1 from the intial cycle point,
# excluding every other step, and also excluding
# steps 6 and 8.
\end{lstlisting}
\lstset{language=transcript}


\subsubsection{Trigger Types}
\label{TriggerTypes}
Expand Down
47 changes: 47 additions & 0 deletions tests/cyclers/40-integer_exclusions_advanced.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash
# THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) 2008-2017 NIWA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
# Test intercycle dependencies.
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
if [[ -f "$TEST_SOURCE_DIR/$TEST_NAME_BASE-find.out" ]]; then
set_test_number 4
else
set_test_number 3
fi
#-------------------------------------------------------------------------------
CHOSEN_SUITE=$(basename $0 | sed "s/^.*-\(.*\)\.t/\1/g")
install_suite $TEST_NAME_BASE $CHOSEN_SUITE
#-------------------------------------------------------------------------------
TEST_NAME=$TEST_NAME_BASE-validate
run_ok $TEST_NAME cylc validate "$SUITE_NAME"
#-------------------------------------------------------------------------------
TEST_NAME=$TEST_NAME_BASE-graph
graph_suite "$SUITE_NAME" "$SUITE_NAME.graph.plain"
cmp_ok "$SUITE_NAME.graph.plain" "$TEST_SOURCE_DIR/$CHOSEN_SUITE/graph.plain.ref"
#-------------------------------------------------------------------------------
TEST_NAME=$TEST_NAME_BASE-run
suite_run_ok $TEST_NAME cylc run --reference-test --debug $SUITE_NAME
#-------------------------------------------------------------------------------
if [[ -f "$TEST_SOURCE_DIR/$TEST_NAME_BASE-find.out" ]]; then
TEST_NAME="$TEST_NAME_BASE-find"
SUITE_DIR="$(cylc get-global-config --print-run-dir)/$SUITE_NAME"
(cd "$SUITE_DIR"; find log/job work -type f | sort -V) >"$TEST_NAME"
cmp_ok "$TEST_NAME" "$TEST_SOURCE_DIR/$TEST_NAME_BASE-find.out"
fi
#-------------------------------------------------------------------------------
purge_suite $SUITE_NAME
37 changes: 37 additions & 0 deletions tests/cyclers/integer_exclusions_advanced/graph.plain.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
graph
node "bar.1" "bar\n1" unfilled box black
node "bar.3" "bar\n3" unfilled box black
node "bar.5" "bar\n5" unfilled box black
node "bar.7" "bar\n7" unfilled box black
node "bar.9" "bar\n9" unfilled box black
node "bar.11" "bar\n11" unfilled box black
node "bar.13" "bar\n13" unfilled box black
node "bar.15" "bar\n15" unfilled box black
node "foo.1" "foo\n1" unfilled box black
node "foo.4" "foo\n4" unfilled box black
node "foo.5" "foo\n5" unfilled box black
node "foo.6" "foo\n6" unfilled box black
node "foo.8" "foo\n8" unfilled box black
node "foo.9" "foo\n9" unfilled box black
node "foo.10" "foo\n10" unfilled box black
node "foo.11" "foo\n11" unfilled box black
node "foo.12" "foo\n12" unfilled box black
node "foo.13" "foo\n13" unfilled box black
node "foo.14" "foo\n14" unfilled box black
node "foo.15" "foo\n15" unfilled box black
node "foo.16" "foo\n16" unfilled box black
node "qux.2" "qux\n2" unfilled box black
node "qux.4" "qux\n4" unfilled box black
node "qux.10" "qux\n10" unfilled box black
node "qux.12" "qux\n12" unfilled box black
node "qux.14" "qux\n14" unfilled box black
node "qux.16" "qux\n16" unfilled box black
node "woo.2" "woo\n2" unfilled box black
node "woo.4" "woo\n4" unfilled box black
node "woo.6" "woo\n6" unfilled box black
node "woo.8" "woo\n8" unfilled box black
node "woo.10" "woo\n10" unfilled box black
node "woo.12" "woo\n12" unfilled box black
node "woo.14" "woo\n14" unfilled box black
node "woo.16" "woo\n16" unfilled box black
stop
37 changes: 37 additions & 0 deletions tests/cyclers/integer_exclusions_advanced/reference.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
2017-05-15T14:30:39+01 INFO - Initial point: 1
2017-05-15T14:30:39+01 INFO - Final point: 16
2017-05-15T14:30:39+01 INFO - [woo.2] -triggered off []
2017-05-15T14:30:39+01 INFO - [bar.1] -triggered off []
2017-05-15T14:30:39+01 INFO - [foo.1] -triggered off []
2017-05-15T14:30:39+01 INFO - [qux.2] -triggered off []
2017-05-15T14:30:41+01 INFO - [qux.4] -triggered off []
2017-05-15T14:30:41+01 INFO - [foo.4] -triggered off []
2017-05-15T14:30:41+01 INFO - [bar.3] -triggered off []
2017-05-15T14:30:41+01 INFO - [woo.4] -triggered off []
2017-05-15T14:30:44+01 INFO - [foo.5] -triggered off []
2017-05-15T14:30:44+01 INFO - [woo.6] -triggered off []
2017-05-15T14:30:44+01 INFO - [qux.10] -triggered off []
2017-05-15T14:30:44+01 INFO - [bar.5] -triggered off []
2017-05-15T14:30:46+01 INFO - [foo.6] -triggered off []
2017-05-15T14:30:46+01 INFO - [woo.8] -triggered off []
2017-05-15T14:30:46+01 INFO - [bar.7] -triggered off []
2017-05-15T14:30:46+01 INFO - [qux.12] -triggered off []
2017-05-15T14:30:48+01 INFO - [woo.10] -triggered off []
2017-05-15T14:30:48+01 INFO - [bar.9] -triggered off []
2017-05-15T14:30:48+01 INFO - [foo.8] -triggered off []
2017-05-15T14:30:50+01 INFO - [woo.12] -triggered off []
2017-05-15T14:30:50+01 INFO - [bar.11] -triggered off []
2017-05-15T14:30:50+01 INFO - [foo.9] -triggered off []
2017-05-15T14:30:52+01 INFO - [woo.14] -triggered off []
2017-05-15T14:30:52+01 INFO - [bar.13] -triggered off []
2017-05-15T14:30:52+01 INFO - [qux.14] -triggered off []
2017-05-15T14:30:52+01 INFO - [foo.10] -triggered off []
2017-05-15T14:30:54+01 INFO - [qux.16] -triggered off []
2017-05-15T14:30:54+01 INFO - [woo.16] -triggered off []
2017-05-15T14:30:54+01 INFO - [bar.15] -triggered off []
2017-05-15T14:30:54+01 INFO - [foo.11] -triggered off []
2017-05-15T14:30:57+01 INFO - [foo.12] -triggered off []
2017-05-15T14:30:59+01 INFO - [foo.13] -triggered off []
2017-05-15T14:31:01+01 INFO - [foo.14] -triggered off []
2017-05-15T14:31:03+01 INFO - [foo.15] -triggered off []
2017-05-15T14:31:05+01 INFO - [foo.16] -triggered off []
31 changes: 31 additions & 0 deletions tests/cyclers/integer_exclusions_advanced/suite.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[cylc]
[[reference test]]
live mode suite timeout = PT3M
[scheduling]
initial cycle point = 1
final cycle point = +P15 # = 16
runahead limit = P12
cycling mode = integer
[[dependencies]]
[[[ R/P1!(2,3,7) ]]]
graph = foo
[[[ P1 ! P2 ]]]
graph = woo
[[[ P1 ! +P1/P2 ]]]
graph = bar
[[[ P1 !(P2,6,8) ]]]
graph = qux
[runtime]
[[foo]]
script = """
sleep 5
cylc task message "the cheese is ready"
sleep 5
touch typing
"""
[[[outputs]]]
out1 = "the cheese is ready"

[visualization]
initial cycle point = 1
final cycle point = 16

0 comments on commit 05157aa

Please sign in to comment.