distributed_graphlab.hpp

00001 /*
00002 This file is part of GraphLab.
00003 
00004 GraphLab is free software: you can redistribute it and/or modify
00005 it under the terms of the GNU Lesser General Public License as 
00006 published by the Free Software Foundation, either version 3 of 
00007 the License, or (at your option) any later version.
00008 
00009 GraphLab is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU Lesser General Public License for more details.
00013 
00014 You should have received a copy of the GNU Lesser General Public 
00015 License along with GraphLab.  If not, see <http://www.gnu.org/licenses/>.
00016 */
00017 
00018 #ifndef GRAPHLAB_MASTER_INCLUDES
00019 #define GRAPHLAB_MASTER_INCLUDES
00020 
00021 
00022 
00023 //
00024 #include <graphlab/distributed2/distributed2_includes.hpp>
00025 #include <graphlab/engine/engine_includes.hpp>
00026 #include <graphlab/factors/factor_includes.hpp>
00027 #include <graphlab/graph/graph_includes.hpp>
00028 #include <graphlab/logger/logger_includes.hpp>
00029 #include <graphlab/monitoring/monitoring_includes.hpp>
00030 #include <graphlab/parallel/parallel_includes.hpp>
00031 #include <graphlab/schedulers/scheduler_includes.hpp>
00032 #include <graphlab/scope/scope_includes.hpp>
00033 #include <graphlab/serialization/serialization_includes.hpp>
00034 #include <graphlab/shared_data/shared_data_includes.hpp>
00035 #include <graphlab/tasks/task_includes.hpp>
00036 #include <graphlab/util/util_includes.hpp>
00037 
00038 
00039 #include <graphlab/distributed_core.hpp>
00040 
00041 
00042 
00043 
00044 /**
00045    \namespace graphlab
00046    \brief The namespace containing all graphlab objects and functions.
00047 
00048    All objects and functions used in graphlab are contained within the
00049    graphlab namespace.  Forexample to access the graph type a user
00050    must therefore either include the graphlab namespace or use:
00051 
00052    <code>
00053      graphlab::graph<VertexType, EdgeType>
00054    </code>
00055 
00056    Because most of the graphlab types depend on the graph type we have
00057    created a templated struct called graphlab::types. \todo finish
00058    explanation.
00059                            
00060 */
00061 namespace graphlab {
00062  
00063   /**
00064   \brief A types datastructure which provides convenient specializations of all
00065   user-facing GraphLab types.
00066   
00067   GraphLab is heavily templatized. The graphlab::types object provides a 
00068   convenient way to access the GraphLab classes without requiring excessive 
00069   angle brackets (< , >). The GraphLab types object is located in <graphlab.hpp>. 
00070   To define a graphlab type object:
00071   
00072   \code
00073   typedef graphlab::graph<vertex_data, edge_data> graph_type;
00074   typedef graphlab::types<graph_type> gl;
00075   \endcode
00076   
00077   Now we can use gl::... to access all the available graphlab types. 
00078   */
00079   template<typename Graph>
00080   struct distributed_types {
00081    
00082     /**
00083      The type of the shared memory graph
00084     */
00085     typedef graphlab::graph<typename Graph::vertex_data_type,
00086                             typename Graph::edge_data_type> graph;
00087 
00088     /**
00089      The type of the disk graph
00090     */
00091     typedef graphlab::disk_graph<typename Graph::vertex_data_type,
00092                                   typename Graph::edge_data_type> disk_graph;
00093 
00094     /**
00095      The type of the distributed graph
00096     */
00097     typedef graphlab::distributed_graph<typename Graph::vertex_data_type,
00098                                         typename Graph::edge_data_type> distributed_graph;
00099 
00100     /** \brief A convenient wrapper object around the commonly used
00101     portions of GraphLab.  This is useful for most GraphLab
00102     applications. See the \ref graphlab::distributed_core object for more details.
00103     */
00104     typedef graphlab::distributed_core<typename distributed_graph::vertex_data_type,
00105                                        typename distributed_graph::edge_data_type> distributed_core;
00106 
00107     typedef graphlab::command_line_options command_line_options;
00108     typedef graphlab::engine_options engine_options;
00109     
00110     /// \brief The type of the data stored on each vertex of the Graph. 
00111     typedef typename distributed_graph::vertex_data_type vertex_data_type;
00112     
00113     /// \brief The type of the data stored on each edge of the Graph.   
00114     typedef typename distributed_graph::edge_data_type   edge_data_type;
00115     
00116     typedef graphlab::update_task<distributed_graph>        update_task;
00117     typedef typename update_task::update_function_type update_function;
00118     
00119     typedef graphlab::iscope<distributed_graph>              iscope;
00120     typedef graphlab::ischeduler<distributed_graph>          ischeduler;
00121     typedef graphlab::icallback<distributed_graph>           icallback;
00122     typedef graphlab::iengine<distributed_graph>             iengine;
00123     typedef graphlab::imonitor<distributed_graph>            imonitor;
00124 
00125     typedef graphlab::glshared_sync_ops<Graph> glshared_sync_ops;
00126     typedef graphlab::glshared_apply_ops glshared_apply_ops;
00127     typedef graphlab::glshared_merge_ops glshared_merge_ops;
00128 
00129 
00130     template <typename Scheduler>
00131     class distributed_locking_engine: public graphlab::distributed_locking_engine<distributed_graph, Scheduler> { };
00132     class distributed_chromatic_engine: public graphlab::distributed_chromatic_engine<distributed_graph> { };
00133 
00134 
00135     typedef graphlab::fifo_scheduler<distributed_graph> fifo_scheduler;
00136     typedef graphlab::priority_scheduler<distributed_graph> priority_scheduler;
00137     typedef graphlab::sampling_scheduler<distributed_graph> sampling_scheduler;
00138     typedef graphlab::sweep_scheduler<distributed_graph> sweep_scheduler;
00139     typedef graphlab::multiqueue_fifo_scheduler<distributed_graph> multiqueue_fifo_scheduler;
00140     typedef graphlab::multiqueue_priority_scheduler<distributed_graph> multiqueue_priority_scheduler;
00141     typedef graphlab::clustered_priority_scheduler<distributed_graph> clustered_priority_scheduler;
00142     typedef graphlab::round_robin_scheduler<distributed_graph> round_robin_scheduler;
00143     typedef graphlab::chromatic_scheduler<distributed_graph> chromatic_scheduler;
00144     
00145     
00146     
00147     
00148     
00149 
00150     /// \brief The type of id assigned to each vertex. Equivalent to graphlab::vertex_id_t
00151     typedef graphlab::vertex_id_t vertex_id_t;
00152     /// \brief The type of id assigned to each vertex. Equivalent to graphlab::edge_id_t
00153     typedef graphlab::edge_id_t edge_id_t;
00154 
00155     typedef typename distributed_graph::edge_list_type edge_list;
00156        
00157     typedef graphlab::scheduler_options          scheduler_options;
00158     typedef graphlab::sched_status               sched_status;
00159     typedef graphlab::partition_method           partition_method;
00160     typedef graphlab::scope_range scope_range;
00161 
00162     template <typename T>
00163     class glshared:public graphlab::glshared<T> { };
00164 
00165     template <typename T>
00166     class distributed_glshared:public graphlab::distributed_glshared<T> { };
00167   };
00168 
00169 }
00170 
00171 
00172 #endif
00173