3#ifndef STAN_MATH_PRIM_FUNCTOR_MPI_DISTRIBUTED_APPLY_HPP
4#define STAN_MATH_PRIM_FUNCTOR_MPI_DISTRIBUTED_APPLY_HPP
8#include <boost/serialization/nvp.hpp>
9#include <boost/serialization/serialization.hpp>
10#include <boost/serialization/access.hpp>
11#include <boost/serialization/base_object.hpp>
31 template <
class Archive>
32 void serialize(Archive& ar,
const unsigned int version) {
33 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(
mpi_command);
40 void run()
const { F::distributed_apply(); }
46#define STAN_REGISTER_MPI_DISTRIBUTED_APPLY(APPLY_FUNCTOR) \
47 STAN_REGISTER_MPI_COMMAND(stan::math::mpi_distributed_apply<APPLY_FUNCTOR>)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
A MPI command object is used to execute code on worker nodes.
friend class boost::serialization::access
void run() const
Executes the static member distributed_apply of the given functor F.
void serialize(Archive &ar, const unsigned int version)
MPI command template which calls the static method distributed_apply of the given class F.