Most reduction types do not work when chares in a section contribute to a reduction where each chare contributes a list of values. Some reduction types do not work when the chares are contributing to a section at all.
When the chares attempt to contribute to their respective sections, the program crashes with the following:
Fatal error on PE 1> TypeError: unsupported operand type(s) for +: 'int' and 'list'
It seems that a function equivalent to Python's built-in sum is called when the chares contribute to a section, while a different function is used when no section is specified. Running sum([list(),list()]) produces the same error.
If the chares contribute single values to the reduction, the program behaves as expected. Changing the contr calls to the following runs as expected:
Reducer.sum is used as an illustrative example, but many of the default reducer types have similar issues. The built-in reduction types that do not work and the incorrect behavior they exhibit are as follows:
Reducer.sum: program crashes as described above.
Reducer.product: program crashes with an error similar to that produced by Reducer.sum.
Reducer.logical_and, Reducer.logical_or, Reducer.logical_xor: Each of these reduction types returns None rather than producing the expected value. These boolean logic reductions do not work at all with sections, even when each chare contributes exactly one value.
The default reduction types that work as expected are Reducer.min and Reducer.max.
Most reduction types do not work when chares in a section contribute to a reduction where each chare contributes a list of values. Some reduction types do not work when the chares are contributing to a section at all.
An example program using
Reducer.sum
:When the chares attempt to contribute to their respective sections, the program crashes with the following:
It seems that a function equivalent to Python's built-in
sum
is called when the chares contribute to a section, while a different function is used when no section is specified. Runningsum([list(),list()])
produces the same error.If the chares contribute single values to the reduction, the program behaves as expected. Changing the
contr
calls to the following runs as expected:Reducer.sum
is used as an illustrative example, but many of the default reducer types have similar issues. The built-in reduction types that do not work and the incorrect behavior they exhibit are as follows:Reducer.sum
: program crashes as described above.Reducer.product
: program crashes with an error similar to that produced byReducer.sum
.Reducer.logical_and
,Reducer.logical_or
,Reducer.logical_xor
: Each of these reduction types returnsNone
rather than producing the expected value. These boolean logic reductions do not work at all with sections, even when each chare contributes exactly one value.The default reduction types that work as expected are
Reducer.min
andReducer.max
.