#!jinja2

# A suite designed to test cylc's handling of ensemble-type dependencies.

# Implemented using jinja2 rather than parameterized tasks to allow for
# profiling with older cylc versions.

{% if not batch_system is defined %}
    {% set batch_system = 'background' %}
{% endif %}
{% if not tasks is defined %}
    {% set tasks = 100 %}
{% endif %}
{% if not sleep_time is defined %}
    {% set script = 'true' %}
{% else %}
    {% set script = 'sleep ' + sleep_time %}
{% endif %}

[scheduling]
    cycling mode = integer
    initial cycle point = 1
    {% if cycles is defined %}
    final cycle point = {{cycles}}
    {% endif %}
    [[dependencies]]
        [[[P1]]]
            graph = """
            end[-P1] => start
            {% for task_no in range(tasks|int) -%}
                start => task_{{task_no}} => end
            {% endfor -%}
            """
[runtime]
    [[root]]
    {% if cylc_compat_mode is defined and cylc_compat_mode == '6' %}
        command scripting = {{ script }}
        [[[job submission]]]
            method = {{ batch_system }}
    {% else %}
        script = {{ script }}
        [[[job]]]
            batch system = {{ batch_system }}
    {% endif %}
