Automatic Differentiation
 
Loading...
Searching...
No Matches
mpi_command.hpp
Go to the documentation of this file.
1#ifdef STAN_MPI
2
3#ifndef STAN_MATH_PRIM_FUNCTOR_MPI_COMMAND_HPP
4#define STAN_MATH_PRIM_FUNCTOR_MPI_COMMAND_HPP
5
6#include <boost/serialization/serialization.hpp>
7#include <boost/serialization/access.hpp>
8#include <boost/serialization/base_object.hpp>
9#include <boost/serialization/export.hpp>
10
11namespace stan {
12namespace math {
13
33 // declarations needed for boost.serialization (see
34 // https://www.boost.org/doc/libs/1_66_0/libs/serialization/doc/index.html)
36 template <class Archive>
37 void serialize(Archive& ar, const unsigned int version) {}
38
39 virtual void run() const = 0;
40};
41
42} // namespace math
43} // namespace stan
44
45BOOST_SERIALIZATION_ASSUME_ABSTRACT(stan::math::mpi_command)
46
47#define STAN_REGISTER_MPI_COMMAND(command) \
48 BOOST_CLASS_IMPLEMENTATION(command, \
49 boost::serialization::object_serializable) \
50 BOOST_CLASS_EXPORT(command) \
51 BOOST_CLASS_TRACKING(command, boost::serialization::track_never)
52
53#endif
54
55#endif
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9
void serialize(Archive &ar, const unsigned int version)
friend class boost::serialization::access
virtual void run() const =0
A MPI command object is used to execute code on worker nodes.