A core calculation in some methods of fitting generalized linear models (GLMs) is updating a vector (the mean vector) by applying a scalar function (called the "inverse link") to the elements of another vector (the linear predictor). Other, similar, updates are also involved in the Iteratively Reweighted Least Squares (IRLS) algorithm.
I would like to be able to apply this operation in parallel if the vectors in question are in either DArray or SharedArray storage. Is there a general idiom for doing this or am I better off using method dispatch to handle the different cases? I can assume that the chunks of the vectors for different processes are aligned.