/*
 * Copyright (C) by Argonne National Laboratory
 * SPDX-License-Identifier: Apache-2.0
 */

# This file lists all collective algorithms with annotations. It is used by
# maint/gen_coll.py to generate src/mpi/coll/mpir_coll.c, which implements
# top-level collective functions, such as (using bcast for example) --
#     MPIR_Bcast_impl, MPIR_Bcast_fill_sig, MPIR_Ibcast_impl, MPIR_Ibcast_tag, MPIR_Bcast_init_impl
#
# The format is (reference actual examples) --
#
# [func-commkind]
#     [algorithm_name]
#         [key]: [values]
#
# "func-commkind" may be "general", under which the "algorithm_name" is the full name of the
# algorithm function. General algorithm functions takes (coll_sig, cnt) parameters.
#
# In addition, "restrictions" and "conditions" list the CSEL conditions and their checkers,
# in two sections, restrictions first. Together they form one condition table, in file order.
#   - restrictions: "index - name: func", a condition whose checker returns bool:
#     bool (*func)(coll_sig). These are the conditions that can be used as algorithm
#     restrictions. The index is the condition's position in the table, starting at 0, and
#     gen_coll.py checks it. It is also the restriction's bit in the masks of the restriction
#     set names of a tuning file, e.g. bcast-intra-210. Removing a restriction renumbers the
#     ones after it, so tuning files and masks that use bit numbers must be regenerated; add new
#     ones at the end.
#     A restriction's name tells how a JSON tree can use it, because all ranks of a call must reach
#     the same algorithm:
#       - <name>_local can differ between the ranks of a call. The dispatch takes a local set (a
#         restriction set with it in its mask) first, whose leaves are an algorithm restricted
#         on it or "dispatch(<mask>)" leaving it out, which is where the other ranks go.
#         It cannot be tested elsewhere. An algorithm restricted on it clears the condition
#         and selects again from the dispatch, so it must be a general algorithm with
#         inner: $coll-intra@comm[<name>_local=0]. Only algorithms clear it.
#       - <name>_coll is the same on all ranks, by a promise of the user or by a check. It can
#         select completely separate subtrees, like every condition without a suffix, which
#         is the same on all ranks because the arguments it depends on are. A set with it in
#         its mask, e.g. bcast-intra-800, is where an algorithm restricted on it goes, and its
#         "dispatch(<mask>)" leaving it out prefers the -<name> variants of the sets, tuned
#         under it. It excludes the _local restrictions: a call where it holds takes no local set.
#   - conditions: "name(thresh): func", a threshold condition whose checker returns a value:
#     int (*func)(coll_sig). The thresh marks the upper limit (inclusive) of the condition.
#   - func can optionally have a macro-guard, e.g. func #if defined(MPIDI_CH4_SHM_POSIX).
#         A wrapper checker function will be generated that wraps the "func" within macro-guard.
# Both kinds are used as CSEL conditions in JSON files, e.g. inplace, !inplace,
# msg_size(1024). Algorithm restrictions take only restrictions, without negation: a
# restriction that needs a condition to be false uses its own condition, so that every
# restriction is a condition that must hold.
# Most of the checker functions should be inlined to minimize function call overhead.
#
# Notes:
#   * indentations (use 4 spaces) and ':' behind keys are significant
#   * auto and nb algorithms are assumed and not listed
#   * most collectives have 4 variations: blocking/nonblocking-intra/inter,
#     but some don't have intercomm variations (scan, exscan, and neighborhood collectives).
#   * arbitrary keys are allowed in the format as long as it observes indentation and colon.
#
# Recognized attribute keys (by gen_coll.py):
#   * restrictions:
#         A comma-separated list restrictions. All restrictions must be specified in the top
#         conditions list.
#   * extra_params and cvar_params:
#         Additional parameters specific to the algorithm functions. Most algorithm functions
#         use the same arguments (e.g. as MPIR_Bcast), but some may require additional
#         parameters. For csel selections, they are supplied int the container structure (with
#         field name listed in extraparams). For CVAR direct algorithm, they are supplied with
#         CVAR names listed in cvar_params (without the common prefix).
#         Both extra_params and cvar_params must have the same number of parameters and with
#         the same order. In addition, some of the extra parameter can be constant by specify
#         a initialization, e.g. param1=val. Rather than repeating the same constant in the
#         cvar_params, we can use `-` as placeholder for the corresponding constant param.
#   * gpu_swap:
#         1 for an algorithm that can't work on device buffers. When the gpu_local restriction
#         holds, its generated wrapper swaps the buffers for host buffers first,
#         the same way MPIR_Coll_buffer_swap does, and the host path pays nothing. Algorithms
#         without it must work on device buffers.
#   * inplace_copy:
#         1 for an algorithm of the alltoall, alltoallv and alltoallw families that runs with
#         the sendbuf of a not-in-place call only. When sendbuf is MPI_IN_PLACE, its generated
#         wrapper copies the receive buffer to a temporary buffer (MPIR_Coll_inplace_copy) and
#         calls the wrapper again with that copy as the sendbuf. The algorithm then needs no
#         in-place code of its own, and the in-place case costs one copy and p blocks of extra
#         memory. Algorithms without it handle MPI_IN_PLACE themselves or are restricted to it.
#   * inner:
#         The collectives a compositional algorithm calls through the selection, as a
#         comma-separated list of <section>@<communicator>, e.g. bcast-intra@node_comm. The
#         section is one of this file's; the communicator is the field of the comm the call
#         goes to: node_comm, node_roots_comm or local_comm, or comm for the caller's own. Calls
#         to fixed algorithms (e.g. MPIR_Bcast_fallback) are not listed. Tuning tools use it to
#         tune such an algorithm after the collectives it depends on.
#         An algorithm with this key takes (coll_sig, cnt), rather than the collective's
#         arguments, and describes each inner call with MPIR_<Coll>_fill_sig, so that its decisions
#         about the inner call are in the inner coll_sig. The inner call inherits the gpu bits
#         of the coll_sig it is called from. An algorithm that gives an inner call a temporary
#         buffer clears them there first, and restores them before it returns.
#         A general algorithm runs for any collective, so its inner calls are written
#         relative to the caller: $coll is the calling collective's name (e.g. bcast), the
#         communicator comm is the caller's own, and a suffix [k=v] sets restriction k to v
#         (0 or 1) on the inner call, e.g. $coll-intra@comm[gpu_local=0] for the same collective
#         on host buffers. These forms describe the intra case.
#
# Conditions that a device or another component supplies as black boxes (e.g.
# MPIDI_CH4_release_gather) must compose with tuning and with the subsets of a tree:
#   1. free of side effects (setup such as call counting or shared memory belongs in
#      MPID_Init_coll_sig, before the selection);
#   2. a function of the call's input conditions, the comm's layout and the environment only:
#      never of message size or count, and the same on every rank of the call;
#   3. stable after a warm-up of a fixed number of calls on a communicator (release_gather:
#      MPIR_CVAR_POSIX_NUM_COLLS_THRESHOLD);
#   4. optional: where it is false, the selection without it must be valid;
#   5. able to fail at run time only by turning false (e.g. shared memory exhausted), never by
#      returning an error.
#   * disabled:
#         1 to keep an algorithm out of the selection. Forcing it by CVAR fails its
#         restriction check (error or fallback, per MPIR_CVAR_COLLECTIVE_FALLBACK), and a JSON
#         tuning file that names it fails to load.

# ----
# Some checkers are defined for only some collectives; loading a tuning file that uses one under
# a collective without it fails (csel_validation.c condition_is_defined, which must match coll_csel.h):
#   * inplace: allgather(v), alltoall(v,w), allreduce, reduce_scatter(_block), scan, exscan.
#     Not the rooted gather(v), scatter(v), reduce: MPI_IN_PLACE is given at the root only, so
#     the value differs between ranks (restriction rule 2 above).
#   * commutative, builtin_op: reduce, allreduce, reduce_scatter(_block), scan, exscan.
#   * msg_size: see MPIR_Csel_msg_size.
#   * gpu_coll: not gatherv, scatterv, alltoallv. MPIR_CVAR_ENABLE_GPU_COLL promises device buffers
#     on all ranks, but a rank with a zero count or negative displacements cannot see any.
restrictions:
    0  - inplace:                  MPIR_Csel_sendbuf_inplace
    1  - pof2:                     MPIR_Csel_comm_size_is_pof2
    2  - commutative:              MPIR_Csel_op_is_commutative
    3  - builtin_op:               MPIR_Csel_op_is_builtin
    4  - hierarchical:             MPIR_Csel_is_hierarchical
    5  - node_consecutive:         MPIR_Csel_is_node_consecutive
    6  - node_regular:             MPIR_Csel_is_node_canonical
    7  - displs_ordered:           MPIR_Csel_displs_ordered
    8  - block_regular:            MPIR_Csel_block_regular
    # conditional conditions - only call the condition function under macro_guard
    9  - MPIDI_CH4_release_gather: MPIDI_POSIX_check_release_gather #if defined(MPIDI_CH4_SHM_POSIX)
    # set by MPIR_Coll_sig_prepare_gpu before the selection
    10 - gpu_local:                MPIR_Csel_is_gpu_local
    11 - gpu_coll:                 MPIR_Csel_is_gpu_coll

conditions:
    comm_size(thresh):      MPIR_Csel_comm_size
    msg_size(thresh):       MPIR_Csel_msg_size
    num_nodes(thresh):      MPIR_Csel_num_nodes
    ppn(thresh):            MPIR_Csel_ppn

# ----
general:
    MPIR_Coll_nb
        inner: i$coll-intra@comm
    MPIR_Coll_buffer_swap
        restrictions: gpu_local
        inner: $coll-intra@comm[gpu_local=0]

# ----
barrier-intra:
    k_dissemination
        extra_params: k
        cvar_params: DISSEM_KVAL
    recexch
        extra_params: k, single_phase_recv
        cvar_params: RECEXCH_KVAL, RECEXCH_SINGLE_PHASE_RECV
    smp
        restrictions: hierarchical
        inner: barrier-intra@node_comm, barrier-intra@node_roots_comm, bcast-intra@node_comm
    release_gather
        func_name: MPIDI_POSIX_mpi_barrier_release_gather
        inline: 1
        macro_guard: defined(MPIDI_CH4_SHM_POSIX)
        restrictions: MPIDI_CH4_release_gather
    cnc
        macro_guard: defined(ENABLE_CNC)
barrier-inter:
    bcast
        inner: barrier-intra@local_comm, bcast-inter@comm
ibarrier-intra:
    sched_recursive_doubling
    tsp_recexch
        extra_params: k
        cvar_params: RECEXCH_KVAL
    tsp_k_dissemination
        extra_params: k
        cvar_params: DISSEM_KVAL
ibarrier-inter:
    sched_bcast
        inner: ibarrier-intra@local_comm, ibcast-inter@comm

bcast-intra:
    binomial
    scatter_recursive_doubling_allgather
    scatter_ring_allgather
    circ_graph
    smp
        restrictions: hierarchical
        inner: bcast-intra@node_comm, bcast-intra@node_roots_comm
    smp_node_first
        restrictions: hierarchical
        inner: bcast-intra@node_comm, bcast-intra@node_roots_comm
    tree
        extra_params: tree_type, k, is_non_blocking
        cvar_params: TREE_TYPE, TREE_KVAL, IS_NON_BLOCKING
    pipelined_tree
        extra_params: tree_type, k, is_non_blocking, chunk_size, recv_pre_posted
        cvar_params: TREE_TYPE, TREE_KVAL, IS_NON_BLOCKING, TREE_PIPELINE_CHUNK_SIZE, RECV_PRE_POST 
    release_gather
        func_name: MPIDI_POSIX_mpi_bcast_release_gather
        inline: 1
        macro_guard: defined(MPIDI_CH4_SHM_POSIX)
        restrictions: MPIDI_CH4_release_gather
    cnc
        macro_guard: defined(ENABLE_CNC)
ibcast-intra:
    sched_binomial
    sched_smp
        restrictions: hierarchical
        inner: ibcast-intra@node_comm, ibcast-intra@node_roots_comm
    sched_scatter_recursive_doubling_allgather
        restrictions: pof2
    sched_scatter_ring_allgather
    tsp_tree
        extra_params: tree_type, k, chunk_size
        cvar_params: TREE_TYPE, TREE_KVAL, TREE_PIPELINE_CHUNK_SIZE
    tsp_scatterv_allgatherv
        extra_params: use_ring=0, scatterv_k, allgatherv_k
        cvar_params: -, SCATTERV_KVAL, ALLGATHERV_RECEXCH_KVAL
    tsp_scatterv_recexch_allgatherv
        extra_params: scatterv_k, allgatherv_k
        cvar_params: SCATTERV_KVAL, ALLGATHERV_RECEXCH_KVAL
    tsp_scatterv_ring_allgatherv
        extra_params: scatterv_k
        cvar_params:  SCATTERV_KVAL
    tsp_ring
        extra_params: chunk_size
        cvar_params: RING_CHUNK_SIZE
    circ_graph
bcast-inter:
    remote_send_local_bcast
        inner: bcast-intra@local_comm
ibcast-inter:
    sched_flat
        inner: ibcast-intra@local_comm

gather-intra:
    binomial
    cnc
        macro_guard: defined(ENABLE_CNC)
gather-inter:
    linear
    local_gather_remote_send
        inner: gather-intra@local_comm
igather-intra:
    sched_binomial
    tsp_tree
        extra_params: k
        cvar_params: TREE_KVAL
igather-inter:
    sched_long
    sched_short
        inner: igather-intra@local_comm

gatherv-intra:
    linear
        allcomm: 1
    cnc
        macro_guard: defined(ENABLE_CNC)
gatherv-inter:
    linear
        allcomm: 1
igatherv-intra:
    sched_linear
        allcomm: 1
    tsp_linear
        allcomm: 1
igatherv-inter:
    sched_linear
        allcomm: 1
    tsp_linear
        allcomm: 1

scatter-intra:
    binomial
    cnc
        macro_guard: defined(ENABLE_CNC)
scatter-inter:
    linear
    remote_send_local_scatter
        inner: scatter-intra@local_comm
iscatter-intra:
    sched_binomial
    tsp_tree
        extra_params: k
        cvar_params: TREE_KVAL
iscatter-inter:
    sched_linear
    sched_remote_send_local_scatter
        inner: iscatter-intra@local_comm

scatterv-intra:
    linear
        allcomm: 1
    cnc
        macro_guard: defined(ENABLE_CNC)
scatterv-inter:
    linear
        allcomm: 1
iscatterv-intra:
    sched_linear
        allcomm: 1
    tsp_linear
        allcomm: 1
iscatterv-inter:
    sched_linear
        allcomm: 1
    tsp_linear
        allcomm: 1

allgather-intra:
    brucks
    k_brucks
        extra_params: k
        cvar_params: BRUCKS_KVAL
    recursive_doubling
        restrictions: pof2
    ring
    recexch_doubling
        extra_params: k, single_phase_recv
        cvar_params: RECEXCH_KVAL, RECEXCH_SINGLE_PHASE_RECV
    recexch_halving
        extra_params: k, single_phase_recv
        cvar_params: RECEXCH_KVAL, RECEXCH_SINGLE_PHASE_RECV
    circ_graph
    cnc
        macro_guard: defined(ENABLE_CNC)
allgather-inter:
    local_gather_remote_bcast
        inner: gather-intra@local_comm, bcast-inter@comm
iallgather-intra:
    sched_ring
    sched_brucks
    sched_recursive_doubling
        restrictions: pof2
    tsp_ring
    tsp_brucks
        extra_params: k
        cvar_params: BRUCKS_KVAL
    tsp_recexch_doubling
        extra_params: k
        cvar_params: RECEXCH_KVAL
    tsp_recexch_halving
        extra_params: k
        cvar_params: RECEXCH_KVAL
iallgather-inter:
    sched_local_gather_remote_bcast
        inner: igather-intra@local_comm, ibcast-inter@comm

allgatherv-intra:
    brucks
    recursive_doubling
        restrictions: pof2
    ring
    cnc
        macro_guard: defined(ENABLE_CNC)
allgatherv-inter:
    remote_gather_local_bcast
        inner: gatherv-inter@comm
iallgatherv-intra:
    sched_brucks
    sched_recursive_doubling
        restrictions: pof2
    sched_ring
    tsp_recexch_doubling
        restrictions: displs_ordered
        extra_params: k
        cvar_params: RECEXCH_KVAL
    tsp_recexch_halving
        restrictions: displs_ordered
        extra_params: k
        cvar_params: RECEXCH_KVAL
    tsp_ring
    tsp_brucks
        extra_params: k
        cvar_params: BRUCKS_KVAL
iallgatherv-inter:
    sched_remote_gather_local_bcast
        inner: igatherv-inter@comm, ibcast-intra@local_comm

alltoall-intra:
    brucks
        inplace_copy: 1
    k_brucks
        extra_params: k
        cvar_params: BRUCKS_KVAL
    pairwise
        inplace_copy: 1
    pairwise_sendrecv_replace
        restrictions: inplace
    scattered
        inplace_copy: 1
    cnc
        macro_guard: defined(ENABLE_CNC)
alltoall-inter:
    pairwise_exchange
ialltoall-intra:
    sched_brucks
        inplace_copy: 1
    sched_inplace
        restrictions: inplace
    sched_pairwise
        inplace_copy: 1
    sched_permuted_sendrecv
        inplace_copy: 1
    tsp_ring
    tsp_brucks
        extra_params: k, buffer_per_phase
        cvar_params: BRUCKS_KVAL, BRUCKS_BUFFER_PER_NBR
    tsp_scattered
        extra_params: batch_size, bblock
        cvar_params: SCATTERED_BATCH_SIZE, SCATTERED_OUTSTANDING_TASKS
ialltoall-inter:
    sched_pairwise_exchange

alltoallv-intra:
    pairwise_sendrecv_replace
        restrictions: inplace
    scattered
        inplace_copy: 1
    cnc
        macro_guard: defined(ENABLE_CNC)
alltoallv-inter:
    pairwise_exchange
ialltoallv-intra:
    sched_blocked
        inplace_copy: 1
    sched_inplace
        restrictions: inplace
    tsp_scattered
        inplace_copy: 1
        extra_params: batch_size, bblock
        cvar_params: SCATTERED_BATCH_SIZE, SCATTERED_OUTSTANDING_TASKS
    tsp_blocked
        inplace_copy: 1
        extra_params: bblock
        cvar_params: THROTTLE
    tsp_inplace
        restrictions: inplace
ialltoallv-inter:
    sched_pairwise_exchange

alltoallw-intra:
    pairwise_sendrecv_replace
        restrictions: inplace
    scattered
        inplace_copy: 1
alltoallw-inter:
    pairwise_exchange
ialltoallw-intra:
    sched_blocked
        inplace_copy: 1
    sched_inplace
        restrictions: inplace
    tsp_blocked
        inplace_copy: 1
        extra_params: bblock
        cvar_params: THROTTLE
    tsp_inplace
        restrictions: inplace
ialltoallw-inter:
    sched_pairwise_exchange

reduce-intra:
    binomial
    circ_graph
        restrictions: commutative
    smp
        restrictions: commutative, hierarchical
        inner: reduce-intra@node_comm, reduce-intra@node_roots_comm
    reduce_scatter_gather
        restrictions: builtin_op
    release_gather
        func_name: MPIDI_POSIX_mpi_reduce_release_gather
        inline: 1
        macro_guard: defined(MPIDI_CH4_SHM_POSIX)
        restrictions: MPIDI_CH4_release_gather
    cnc
        macro_guard: defined(ENABLE_CNC)
reduce-inter:
    local_reduce_remote_send
        inner: reduce-intra@local_comm
ireduce-intra:
    sched_smp
        restrictions: commutative, hierarchical
        inner: ireduce-intra@node_comm, ireduce-intra@node_roots_comm
    sched_binomial
    sched_reduce_scatter_gather
        restrictions: builtin_op
    tsp_tree
        restrictions: commutative
        extra_params: tree_type, k, chunk_size, buffer_per_child
        cvar_params: TREE_TYPE, TREE_KVAL, TREE_PIPELINE_CHUNK_SIZE, TREE_BUFFER_PER_CHILD
    tsp_ring
        extra_params: chunk_size, buffer_per_child
        cvar_params: RING_CHUNK_SIZE, TREE_BUFFER_PER_CHILD
ireduce-inter:
    sched_local_reduce_remote_send
        inner: ireduce-intra@local_comm

allreduce-intra:
    smp
        restrictions: commutative, hierarchical
        inner: reduce-intra@node_comm, allreduce-intra@node_roots_comm, bcast-intra@node_comm
    recursive_doubling
    recursive_multiplying
        extra_params: k
        cvar_params: RECURSIVE_MULTIPLYING_KVAL
        restrictions: commutative
    reduce_scatter_allgather
        restrictions: builtin_op
    tree
        extra_params: tree_type, k, chunk_size, buffer_per_child
        cvar_params: TREE_TYPE, TREE_KVAL, TREE_PIPELINE_CHUNK_SIZE, TREE_BUFFER_PER_CHILD
    recexch
        extra_params: k, single_phase_recv
        cvar_params: RECEXCH_KVAL, RECEXCH_SINGLE_PHASE_RECV
    ring
        restrictions: commutative
    k_reduce_scatter_allgather
        restrictions: commutative
        extra_params: k, single_phase_recv
        cvar_params: RECEXCH_KVAL, RECEXCH_SINGLE_PHASE_RECV
    ccl
        extra_params: ccl
        cvar_params: CCL
    release_gather
        func_name: MPIDI_POSIX_mpi_allreduce_release_gather
        inline: 1
        macro_guard: defined(MPIDI_CH4_SHM_POSIX)
        restrictions: MPIDI_CH4_release_gather
    cnc
        macro_guard: defined(ENABLE_CNC)
allreduce-inter:
    reduce_exchange_bcast
        inner: reduce-intra@local_comm, bcast-intra@local_comm
iallreduce-intra:
    sched_naive
        inner: ireduce-intra@comm, ibcast-intra@comm
    sched_smp
        restrictions: commutative, hierarchical
        inner: ireduce-intra@node_comm, iallreduce-intra@node_roots_comm, ibcast-intra@node_comm
    sched_recursive_doubling
    sched_reduce_scatter_allgather
        restrictions: builtin_op
    tsp_recexch_single_buffer
        extra_params: k
        cvar_params: RECEXCH_KVAL
    tsp_recexch_multiple_buffer
        extra_params: k
        cvar_params: RECEXCH_KVAL
    tsp_recexch
        extra_params: per_nbr_buffer=1, k
        cvar_params: -, RECEXCH_KVAL
    tsp_tree
        extra_params: tree_type, k, chunk_size, buffer_per_child
        cvar_params: TREE_TYPE, TREE_KVAL, TREE_PIPELINE_CHUNK_SIZE, TREE_BUFFER_PER_CHILD
    tsp_ring
        restrictions: commutative
    tsp_recexch_reduce_scatter_recexch_allgatherv
        restrictions: commutative
        extra_params: k
        cvar_params: RECEXCH_KVAL
iallreduce-inter:
    sched_remote_reduce_local_bcast
        inner: ireduce-inter@comm, ibcast-intra@local_comm

reduce_scatter-intra:
    noncommutative
        restrictions: pof2, block_regular
    pairwise
        restrictions: commutative
    recursive_doubling
    recursive_halving
        restrictions: commutative
reduce_scatter-inter:
    remote_reduce_local_scatter
        inner: reduce-inter@comm, scatterv-intra@local_comm
ireduce_scatter-intra:
    sched_noncommutative
        restrictions: pof2, block_regular
    sched_recursive_doubling
    sched_pairwise
        restrictions: commutative
    sched_recursive_halving
        restrictions: commutative
    tsp_recexch
        restrictions: commutative
        extra_params: is_dist_halving=0, k
        cvar_params: -, RECEXCH_KVAL
ireduce_scatter-inter:
    sched_remote_reduce_local_scatterv
        inner: ireduce-inter@comm, iscatterv-intra@local_comm

reduce_scatter_block-intra:
    noncommutative
        restrictions: pof2
    recursive_doubling
    pairwise
        restrictions: commutative
    recursive_halving
        restrictions: commutative
    cnc
        macro_guard: defined(ENABLE_CNC)
reduce_scatter_block-inter:
    remote_reduce_local_scatter
        inner: reduce-inter@comm, scatter-intra@local_comm
ireduce_scatter_block-intra:
    sched_noncommutative
        restrictions: pof2
    sched_recursive_doubling
    sched_pairwise
        restrictions: commutative
    sched_recursive_halving
        restrictions: commutative
    tsp_recexch
        restrictions: commutative
        extra_params: k
        cvar_params: RECEXCH_KVAL
ireduce_scatter_block-inter:
    sched_remote_reduce_local_scatterv
        inner: ireduce-inter@comm, iscatter-intra@local_comm

scan-intra:
    smp
        restrictions: commutative, node_consecutive
        inner: scan-intra@node_comm, scan-intra@node_roots_comm, bcast-intra@node_comm
    recursive_doubling
iscan-intra:
    sched_smp
        restrictions: commutative, node_consecutive
        inner: iscan-intra@node_comm, iscan-intra@node_roots_comm, ibcast-intra@node_comm
    sched_recursive_doubling
    tsp_recursive_doubling

exscan-intra:
    recursive_doubling
iexscan-intra:
    sched_recursive_doubling

neighbor_allgather-intra:
ineighbor_allgather-intra:
    sched_linear
        allcomm: 1
    tsp_linear
        allcomm: 1
neighbor_allgatherv-intra:
ineighbor_allgatherv-intra:
    sched_linear
        allcomm: 1
    tsp_linear
        allcomm: 1
neighbor_alltoall-intra:
ineighbor_alltoall-intra:
    sched_linear
        allcomm: 1
    tsp_linear
        allcomm: 1
neighbor_alltoallv-intra:
ineighbor_alltoallv-intra:
    sched_linear
        allcomm: 1
    tsp_linear
        allcomm: 1
neighbor_alltoallw-intra:
ineighbor_alltoallw-intra:
    sched_linear
        allcomm: 1
    tsp_linear
        allcomm: 1
