GraphLab: Distributed Graph-Parallel API  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
fake_chandy_misra.hpp
1 /*
2  * Copyright (c) 2009 Carnegie Mellon University.
3  * All rights reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing,
12  * software distributed under the License is distributed on an "AS
13  * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14  * express or implied. See the License for the specific language
15  * governing permissions and limitations under the License.
16  *
17  * For more about this software visit:
18  *
19  * http://www.graphlab.ml.cmu.edu
20  *
21  */
22 
23 
24 #ifndef GRAPHLAB_FAKE_CHANDY_MISRA_HPP
25 #define GRAPHLAB_FAKE_CHANDY_MISRA_HPP
26 #include <vector>
27 #include <graphlab/rpc/dc_dist_object.hpp>
28 #include <graphlab/rpc/distributed_event_log.hpp>
29 #include <graphlab/engine/chandy_misra_interface.hpp>
30 #include <graphlab/logger/assertions.hpp>
31 #include <graphlab/parallel/pthread_tools.hpp>
32 #include <graphlab/graph/graph_basic_types.hpp>
33 #include <graphlab/macros_def.hpp>
34 namespace graphlab {
35 
36 /**
37  *
38  * \internal
39  */
40 template <typename GraphType>
41 class fake_chandy_misra: public chandy_misra_interface<GraphType> {
42  public:
43  typedef typename GraphType::local_vertex_type local_vertex_type;
44  typedef typename GraphType::local_edge_type local_edge_type;
45 
46  typedef typename GraphType::vertex_id_type vertex_id_type;
47  typedef typename GraphType::lvid_type lvid_type;
48 
49  typedef fake_chandy_misra<GraphType> dcm_type;
50  private:
51  boost::function<void(lvid_type)> callback;
52  boost::function<void(lvid_type)> hors_doeuvre_callback;
53 
54  public:
55  inline fake_chandy_misra(distributed_control &dc,
56  GraphType &graph,
57  boost::function<void(lvid_type)> callback,
58  boost::function<void(lvid_type)> hors_doeuvre_callback = NULL
59  ):
60  callback(callback),
61  hors_doeuvre_callback(hors_doeuvre_callback){
62  }
63 
64  size_t num_clean_forks() const {
65  return 0;
66  }
67 
68  void make_philosopher_hungry_per_replica(lvid_type p_id) {
69  }
70 
71 
72  void philosopher_stops_eating_per_replica(lvid_type p_id) {
73  }
74 };
75 
76 }
77 
78 #include <graphlab/macros_undef.hpp>
79 
80 #endif