Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ scatter_array_2d_cached()

template<int call_id, typename ReduceF , typename CombineF >
template<typename T_cache >
T_cache::cache_t & stan::math::mpi_parallel_call< call_id, ReduceF, CombineF >::scatter_array_2d_cached ( typename T_cache::cache_t &  data)
inlineprivate

Performs a cached scatter of a 2D array (nested std::vector).

On the first call the data on the root is scattered to all workers and is stored in the cache locally. Each worker only receives its respective chunk and marks the cache as valid such that any subsequent calls will immediately return the cached chunk. Thus, after calling this function it is guaranteed that on all workers a call to T_cache::data() will return the same chunk within each process of the cluster.

Template Parameters
T_cachestatic data storage type for the 2D array
Parameters
data2D array to be scattered from the root and a dummy argument on workers
Returns
2D array chunk of the worker

Definition at line 423 of file mpi_parallel_call.hpp.