namespace math { \
namespace internal { \
typedef FUNCTOR mpi_mr_##CALLID##_##SHARED##_##JOB##_; \
typedef map_rect_reduce<mpi_mr_##CALLID##_##SHARED##_##JOB##_, SHARED, JOB> \
mpi_mr_##CALLID##_##SHARED##_##JOB##_red_; \
typedef map_rect_combine<mpi_mr_##CALLID##_##SHARED##_##JOB##_, \
Eigen::Matrix<SHARED, Eigen::Dynamic, 1>, JOB> \
mpi_mr_##CALLID##_##SHARED##_##JOB##_comb_; \
typedef mpi_parallel_call<CALLID, mpi_mr_##CALLID##_##SHARED##_##JOB##_red_, \
mpi_mr_##CALLID##_##SHARED##_##JOB##_comb_> \
mpi_mr_##CALLID##_##SHARED##_##JOB##_pcall_; \
} \
} \
} \
STAN_REGISTER_MPI_DISTRIBUTED_APPLY( \
stan::math::internal::mpi_mr_##CALLID##_##SHARED##_##JOB##_pcall_)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...