34 #ifndef GRAPHLAB_IENGINE_HPP
35 #define GRAPHLAB_IENGINE_HPP
37 #include <boost/bind.hpp>
38 #include <boost/functional.hpp>
40 #include <graphlab/vertex_program/icontext.hpp>
41 #include <graphlab/engine/execution_status.hpp>
42 #include <graphlab/options/graphlab_options.hpp>
43 #include <graphlab/serialization/serialization_includes.hpp>
44 #include <graphlab/aggregation/distributed_aggregator.hpp>
45 #include <graphlab/vertex_program/op_plus_eq_concept.hpp>
46 #include <graphlab/graph/vertex_set.hpp>
49 #if defined(__cplusplus) && __cplusplus >= 201103L
52 #undef BOOST_CONCEPT_ASSERT
53 #define BOOST_CONCEPT_ASSERT(unused)
104 template<
typename VertexProgram>
125 BOOST_CONCEPT_ASSERT((boost::DefaultConstructible<vertex_program_type>));
314 const std::string& order =
"shuffle") = 0;
342 const std::string& order =
"shuffle") = 0;
481 template <
typename ReductionType,
482 typename VertexMapType,
483 typename FinalizerType>
485 VertexMapType map_function,
486 FinalizerType finalize_function) {
491 if(aggregator == NULL) {
492 logstream(
LOG_FATAL) <<
"Aggregation not supported by this engine!"
496 return aggregator->template add_vertex_aggregator<ReductionType>(key, map_function,
500 #if defined(__cplusplus) && __cplusplus >= 201103L
537 template <
typename VertexMapType,
538 typename FinalizerType>
540 VertexMapType map_function,
541 FinalizerType finalize_function) {
543 if(aggregator == NULL) {
544 logstream(
LOG_FATAL) <<
"Aggregation not supported by this engine!"
548 return aggregator->add_vertex_aggregator(key, map_function,
689 template <
typename ReductionType,
690 typename EdgeMapType,
691 typename FinalizerType>
693 EdgeMapType map_function,
694 FinalizerType finalize_function) {
698 if(aggregator == NULL) {
699 logstream(
LOG_FATAL) <<
"Aggregation not supported by this engine!"
703 return aggregator->template add_edge_aggregator<ReductionType>
704 (key, map_function, finalize_function);
708 #if defined(__cplusplus) && __cplusplus >= 201103L
746 template <
typename EdgeMapType,
747 typename FinalizerType>
749 EdgeMapType map_function,
750 FinalizerType finalize_function) {
752 if(aggregator == NULL) {
753 logstream(
LOG_FATAL) <<
"Aggregation not supported by this engine!"
757 return aggregator->add_edge_aggregator(key, map_function,
782 if(aggregator == NULL) {
783 logstream(
LOG_FATAL) <<
"Aggregation not supported by this engine!"
787 return aggregator->aggregate_now(key);
875 template <
typename ReductionType,
typename VertexMapperType>
881 if(aggregator == NULL) {
882 logstream(
LOG_FATAL) <<
"Aggregation not supported by this engine!"
884 return ReductionType();
886 return aggregator->template map_reduce_vertices<ReductionType>(mapfunction);
973 template <
typename ReductionType,
typename EdgeMapperType>
978 if(aggregator == NULL) {
979 logstream(
LOG_FATAL) <<
"Aggregation not supported by this engine!"
981 return ReductionType();
983 return aggregator->template map_reduce_edges<ReductionType>(mapfunction);
1054 template <
typename VertexMapperType>
1057 if(aggregator == NULL) {
1058 logstream(
LOG_FATAL) <<
"Aggregation not supported by this engine!"
1062 aggregator->transform_vertices(mapfunction);
1131 template <
typename EdgeMapperType>
1134 if(aggregator == NULL) {
1135 logstream(
LOG_FATAL) <<
"Aggregation not supported by this engine!"
1139 aggregator->transform_edges(mapfunction);
1171 if(aggregator == NULL) {
1172 logstream(
LOG_FATAL) <<
"Aggregation not supported by this engine!"
1176 return aggregator->aggregate_periodic(key, seconds);