| 206 | """ |
| 207 | from .algorithms import global_func |
| 208 | class MaxImpl: |
| 209 | def op(self): |
| 210 | return algs.max |
| 211 | |
| 212 | def mpi_op(self): |
| 213 | from mpi4py import MPI |
| 214 | return MPI.MAX |
| 215 | |
| 216 | def serial_composite(self, array, axis): |
| 217 | res = _apply_func2(algs.max, array, (axis,)) |
| 218 | clean_list = [] |
| 219 | for a in res: |
| 220 | if a is not dsa.NoneArray: |
| 221 | clean_list.append(a) |
| 222 | if clean_list is []: |
| 223 | return None |
| 224 | return algs.max(clean_list, axis=0).astype(numpy.float64) |
| 225 | |
| 226 | def default(self): |
| 227 | return numpy.finfo(numpy.float64).min |
| 228 | |
| 229 | return global_func(MaxImpl(), array, axis, controller) |
| 230 | |