GraphLab: Distributed Graph-Parallel API
2.1
|
To use GraphLab,
All of GraphLab lives in the graphlab
namespace. You may use
if you wish, but we recommend against it.
Your main function should begin and end with:
dc
is the distributed communication layer which is needed by a number of the core GraphLab objects, whether you are running distributed or not.
Placing the following code in my_first_app.cpp
running "make" in the debug/ release/ build folders will create a program which when executed, will print "Hello World!".
dc.cout() provides a wrapper around standard std::cout
, but wraps it in a way that when used in a distributed environment, only one copy will print, even though all machines execute it. To try that run the following:
mpiexec -n 4 ./my_first_app
This should run 4 instances of "my_first_app" all on the local machine. However, only one "Hello World!" will be printed.
In the next section, we will see how to define a distributed graph.