Skip to content

Commit 23d90b4

Browse files
committed
coll/csel: specify complete CSEL conditions
Standardize CSEL conditions so we maintain a single source and can generate most of the CSEL parsing and CSEL searching.
1 parent 2d033ae commit 23d90b4

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/mpi/coll/coll_algorithms.txt

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,17 @@
1919
# "func-commkind" may be "general", under which the "algorithm_name" is the full name of the
2020
# algorithm function. General algorithm functions takes (coll_sig, cnt) parameters.
2121
#
22-
# In addition, "restrictions" list all restrictions and their corresponding checkers. If the
23-
# checkers are prefixed with MPIR_COLL_ATTR__, it checks the corresponding attr bit in
24-
# coll_sig; otherwise, the checker is a function with signature: bool (*checker)(coll_sig).
22+
# In addition, "conditions" list all conditions and their corresponding checkers. There are
23+
# a few types of conditions distinguished by the format:
24+
# - condition_name: MPIR_COLL_ATTR__name
25+
# The condition checks a bit in coll_sig->attr.
26+
# - conidtion_name: func
27+
# The condition calls checker function with signature: bool (*func)(coll_sig).
28+
# - condition_name(thresh): func
29+
# This condition calls a query function that returns a value: int (*func)(coll_sig)
30+
The thresh marks the upper limit (inclusive) of the condition.
31+
# The conditions are used in specifying both algorithm restrictions and CSEL conditions.
32+
# Most of the checker functions should be inlined to minimize function call overhead.
2533
#
2634
# Notes:
2735
# * indentations (use 4 spaces) and ':' behind keys are significant
@@ -33,7 +41,7 @@
3341
# Recognized attribute keys (by gen_coll.py):
3442
# * restrictions:
3543
# A comma-separated list restrictions. All restrictions must be specificed in the top
36-
# restriction list.
44+
# conditions list.
3745
# * extra_params and cvar_params:
3846
# Additional parameters specific to the algorithm functions. Most algorithm functions
3947
# use the same arguments (e.g. as MPIR_Bcast), but some may require additional
@@ -46,7 +54,7 @@
4654
# cvar_params, we can use `-` as placeholder for the corresponding constant param.
4755

4856
# ----
49-
restrictions:
57+
conditions:
5058
inplace: MPIR_COLL_ATTR__inplace
5159
pof2: MPIR_COLL_ATTR__pof2
5260
commutative: MPIR_COLL_ATTR__commutative
@@ -56,6 +64,9 @@ restrictions:
5664
node-regular: MPII_Comm_is_node_canonical
5765
size-ge-pof2: MPIR_Csel_size_ge_pof2
5866
displs-ordered: MPIR_Csel_displs_ordered
67+
comm_size(thresh): MPIR_Csel_comm_size
68+
avg_msg_size(thresh): MPIR_Csel_avg_msg_size
69+
total_msg_size(thresh): MPIR_Csel_total_msg_size
5970

6071
# ----
6172
general:

0 commit comments

Comments
 (0)