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

◆ broadcast_array_1d_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 >::broadcast_array_1d_cached ( typename T_cache::cache_t &  data)
inlineprivate

Performs a cached broadcast of a 1D array (std::vector).

On the first call the data on the root is broadcasted to all workers and is stored in the cache locally. This marks the cache as valid and any subsequent calls will immediately return the cached results. Thus, after calling this function it is guaranteed that on all workers a call to T_cache::data() will return the same vector within each process of the cluster.

Template Parameters
T_cachestatic data storage type for the 1D array
Parameters
datavector to be broadcasted from the root and a dummy argument on workers
Returns
broadcasted vector originating from the root

Definition at line 483 of file mpi_parallel_call.hpp.