#include <distributed_chromatic_engine.hpp>
Public Types | |
| typedef iengine< Graph > | iengine_base |
|
typedef iengine_base::update_task_type | update_task_type |
| The type of update task. | |
|
typedef iengine_base::update_function_type | update_function_type |
| The type of update function. | |
| typedef iengine_base::termination_function_type | termination_function_type |
| typedef iengine_base::iscope_type | iscope_type |
| The type of scope. | |
|
typedef iengine_base::sync_function_type | sync_function_type |
|
typedef iengine_base::merge_function_type | merge_function_type |
| typedef imonitor< Graph > | imonitor_type |
| The type of monitor. | |
|
typedef redirect_scheduler_callback < Graph, distributed_chromatic_engine < Graph > > | callback_type |
| typedef icallback< Graph > | icallback_type |
Public Member Functions | |
| distributed_chromatic_engine (distributed_control &dc, Graph &graph, size_t ncpus=1) | |
| size_t | get_ncpus () const |
| Get the number of cpus. | |
| void | set_sched_yield (bool value) |
| set sched yield | |
| void | set_cpu_affinities (bool value) |
| void | set_default_scope (scope_range::scope_range_enum default_scope_range_) |
| exec_status | last_exec_status () const |
| size_t | thisproc_update_counts () const |
| size_t | last_update_count () const |
| void | add_terminator (termination_function_type term) |
| void | clear_terminators () |
| void | set_timeout (size_t timeout_seconds=0) |
| void | set_task_budget (size_t max_tasks) |
| void | add_task (update_task_type task, double priority) |
| Adds an update task with a particular priority. add_task on any vertex can be called by any machine. The call is asynchronous and may not be completed until a full_barrier is issued. | |
| void | add_tasks (const std::vector< vertex_id_t > &vertices, update_function_type func, double priority) |
| Creates a collection of tasks on all the vertices in 'vertices', and all with the same update function and priority This function is forwarded to the scheduler. | |
| void | add_task_to_all_from_remote (size_t func, double priority) |
| void | add_task_to_all_impl (update_function_type func, double priority) |
| void | add_task_to_all (update_function_type func, double priority) |
| Creates a collection of tasks on all the vertices in the graph, with the same update function and priority Must be called by all machines simultaneously. | |
| void | set_sync (glshared_base &shared, sync_function_type sync, glshared_base::apply_function_type apply, const any &zero, size_t sync_interval=0, merge_function_type merge=NULL, vertex_id_t rangelow=0, vertex_id_t rangehigh=-1) |
| void | generate_color_blocks () |
| void | init_syncs () |
| void | eval_syncs (vertex_id_t curvertex, iscope_type &scope, size_t threadid) |
| void | sync_end_iteration (size_t threadid) |
| void | compute_sync_schedule (size_t num_executed_tasks) |
| size_t | check_global_termination (bool check_dynamic_schedule) |
| void | start_thread (size_t threadid) |
| void | set_const_edges (bool const_edges_=true) |
| void | set_const_nbr_vertices (bool const_nbr_vertices_=true) |
| void | start () |
| void | sync_now (glshared_base &shared) |
| void | set_engine_options (const scheduler_options &opts) |
| Update the scheduler options. | |
| void | set_scheduler_options (const scheduler_options &opts) |
| Update the scheduler options. | |
| void | set_randomize_schedule (bool randomize_schedule_) |
| void | stop () |
| Force engine to terminate immediately. | |
| void | register_monitor (imonitor_type *listener) |
| Register a monitor with an engine. | |
| size_t | get_tasks_done () const |
| double | get_barrier_time () const |
| long long int | get_total_bytes_sent () |
| metrics | get_metrics () |
| void | reset_metrics () |
Static Public Member Functions | |
| static void | print_options_help (std::ostream &out) |
Public Attributes | |
| size_t | total_update_count |
| double | total_barrier_time |
| long long int | total_bytes_sent |
All processes must receive the same options at the same time. i.e. if set_cpu_affinities is called, all processes mus call it at the same time. This is true for all set_* functions.
Definition at line 55 of file distributed_chromatic_engine.hpp.
| typedef iengine_base::termination_function_type graphlab::distributed_chromatic_engine< Graph >::termination_function_type |
The termination function is a function that reads the shared data and returns true if the engine should terminate execution. The termination function is called at fixed millisecond intervals and therefore the engine may continue to execute even after a termination function evaluates to true. Because termination functions are executed frequently and cannot directly contribut to the computation, they should return quickly.
Reimplemented from graphlab::iengine< Graph >.
Definition at line 60 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::add_terminator | ( | termination_function_type | term | ) | [inline] |
Add a terminator to the engine. Must be called by all machines simultaneously.
Definition at line 255 of file distributed_chromatic_engine.hpp.
| size_t graphlab::distributed_chromatic_engine< Graph >::check_global_termination | ( | bool | check_dynamic_schedule | ) | [inline] |
Checks all machines for termination and sets the termination reason. Also returns the number of update tasks completed globally
Definition at line 568 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::clear_terminators | ( | ) | [inline, virtual] |
Clear all terminators from the engine Must be called by all machines simultaneously.
Implements graphlab::iengine< Graph >.
Definition at line 265 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::compute_sync_schedule | ( | size_t | num_executed_tasks | ) | [inline] |
clears the active sync tasks and figure out what syncs to run next. Called by one thread from each machine after sync_end_iteration
Definition at line 547 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::eval_syncs | ( | vertex_id_t | curvertex, | |
| iscope_type & | scope, | |||
| size_t | threadid | |||
| ) | [inline] |
Called whenever a vertex is executed. Accumulates the available syncs
Definition at line 493 of file distributed_chromatic_engine.hpp.
| metrics graphlab::distributed_chromatic_engine< Graph >::get_metrics | ( | ) | [inline, virtual] |
Return the metrics information logged by the engine.
Reimplemented from graphlab::iengine< Graph >.
Definition at line 874 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::init_syncs | ( | ) | [inline] |
Initialize the sync tasks. Called by start()
Definition at line 478 of file distributed_chromatic_engine.hpp.
| exec_status graphlab::distributed_chromatic_engine< Graph >::last_exec_status | ( | ) | const [inline, virtual] |
Return the reason why the engine last terminated
Implements graphlab::iengine< Graph >.
Definition at line 226 of file distributed_chromatic_engine.hpp.
| size_t graphlab::distributed_chromatic_engine< Graph >::last_update_count | ( | ) | const [inline, virtual] |
Returns the total number of updates executed
Implements graphlab::iengine< Graph >.
Definition at line 246 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::register_monitor | ( | imonitor_type * | listener | ) | [inline, virtual] |
Register a monitor with an engine.
A monitor tracks the execution of an engine can be useful when debugging.
Implements graphlab::iengine< Graph >.
Definition at line 854 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::reset_metrics | ( | ) | [inline, virtual] |
Clears all logged metrics
Reimplemented from graphlab::iengine< Graph >.
Definition at line 879 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::set_cpu_affinities | ( | bool | value | ) | [inline, virtual] |
Set whether cpu affinities should be used.
Reimplemented from graphlab::iengine< Graph >.
Definition at line 205 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::set_default_scope | ( | scope_range::scope_range_enum | default_scope_range_ | ) | [inline, virtual] |
Set the default scope range. The scope ranges are defined in iscope.hpp
Implements graphlab::iengine< Graph >.
Definition at line 215 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::set_sync | ( | glshared_base & | shared, | |
| sync_function_type | sync, | |||
| glshared_base::apply_function_type | apply, | |||
| const any & | zero, | |||
| size_t | sync_interval = 0, |
|||
| merge_function_type | merge = NULL, |
|||
| vertex_id_t | rangelow = 0, |
|||
| vertex_id_t | rangehigh = -1 | |||
| ) | [inline] |
Registers a sync operation. Must be called by all machine simultaneously
Definition at line 370 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::set_task_budget | ( | size_t | max_tasks | ) | [inline, virtual] |
Sets a Task budget - max number of tasks to allow. Disabled if set to 0. Must be called by all machines simultaneously.
Implements graphlab::iengine< Graph >.
Definition at line 286 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::set_timeout | ( | size_t | timeout_seconds = 0 |
) | [inline, virtual] |
Set a timeout. Disabled if set to 0. Must be called by all machines simultaneously.
Implements graphlab::iengine< Graph >.
Definition at line 276 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::start | ( | ) | [inline, virtual] |
Execute the engine
Implements graphlab::iengine< Graph >.
Definition at line 730 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::stop | ( | ) | [inline, virtual] |
Force engine to terminate immediately.
This function is used to stop the engine execution by forcing immediate termination. Any existing update tasks will finish but no new update tasks will be started and the call to start() will return.
Implements graphlab::iengine< Graph >.
Definition at line 850 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::sync_end_iteration | ( | size_t | threadid | ) | [inline] |
Called at the end of the iteration. Called by all threads after a barrier
Definition at line 504 of file distributed_chromatic_engine.hpp.
| void graphlab::distributed_chromatic_engine< Graph >::sync_now | ( | glshared_base & | shared | ) | [inline, virtual] |
Performs a sync immediately. This function requires that the shared variable already be registered with the engine. and that the engine is not currently running All processes must call simultaneously
Implements graphlab::iengine< Graph >.
Definition at line 817 of file distributed_chromatic_engine.hpp.
| size_t graphlab::distributed_chromatic_engine< Graph >::thisproc_update_counts | ( | ) | const [inline] |
This function computes the last update count by adding all the update counts of the individual threads. This is an underestimate if the engine is currently running.
Definition at line 235 of file distributed_chromatic_engine.hpp.
1.7.1