GraphLab: Distributed Graph-Parallel API  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
GraphLab Utility Classes and Functions

Classes

class  graphlab::command_line_options
 The GraphLab command line options class helps parse basic command line options for the GraphLab framework as well as user applications. More...
class  graphlab::mutex
class  graphlab::simple_spinlock
class  graphlab::conditional
class  graphlab::cancellable_barrier
class  graphlab::thread
class  graphlab::thread_group
class  graphlab::thread_pool
class  graphlab::blocking_queue< T >
 Implements a blocking queue useful for producer/consumer models. More...
class  graphlab::dense_bitset
class  graphlab::mutable_queue< T, Priority >
class  graphlab::safe_circular_char_buffer
class  graphlab::timer
 A simple class that can be used for benchmarking/timing up to microsecond resolution. More...

Typedefs

typedef
boost::iostreams::stream
< charstream_impl::resizing_array_sink
< true > > 
graphlab::charstream

Functions

template<typename T >
std::string boost::graphlab_vec_to_string (const std::vector< T > &vec)
template<>
std::string boost::lexical_cast< std::string > (const std::vector< int > &vec)
template<>
std::string boost::lexical_cast< std::string > (const std::vector< uint32_t > &vec)
template<>
std::string boost::lexical_cast< std::string > (const std::vector< uint64_t > &vec)
template<>
std::string boost::lexical_cast< std::string > (const std::vector< double > &vec)
template<>
std::string boost::lexical_cast< std::string > (const std::vector< float > &vec)
template<>
std::string boost::lexical_cast< std::string > (const std::vector< std::string > &vec)
template<typename T >
bool graphlab::atomic_compare_and_swap (T &a, T oldval, T newval)
template<typename T >
bool graphlab::atomic_compare_and_swap (volatile T &a, T oldval, T newval)
template<>
bool graphlab::atomic_compare_and_swap (volatile double &a, double oldval, double newval)
template<>
bool graphlab::atomic_compare_and_swap (volatile float &a, float oldval, float newval)
template<typename T >
void graphlab::atomic_exchange (T &a, T &b)
 Atomically exchanges the values of a and b.
template<typename T >
void graphlab::atomic_exchange (volatile T &a, T &b)
 Atomically exchanges the values of a and b.
template<typename T >
graphlab::fetch_and_store (T &a, const T &newval)
 Atomically sets a to the newval, returning the old value.
uint32_t graphlab::get_local_ip (bool print)
std::string graphlab::get_local_ip_as_str (bool print)
std::pair< size_t, int > graphlab::get_free_tcp_port ()

Detailed Description


Typedef Documentation

typedef boost::iostreams::stream< charstream_impl::resizing_array_sink<true> > graphlab::charstream

A stream object which stores all streamed output in memory. It can be used like any other stream object. For instance:

charstream cstrm;
cstrm << 123 << 10.0 << "hello world" << std::endl;

stream->size() will return the current length of output and stream->c_str() will return a mutable pointer to the string.

Definition at line 136 of file charstream.hpp.


Function Documentation

template<typename T >
bool graphlab::atomic_compare_and_swap ( T &  a,
oldval,
newval 
)

atomic instruction that is equivalent to the following:

if (a==oldval) {
a = newval;
return true;
}
else {
return false;
}

Definition at line 45 of file atomic_ops.hpp.

template<typename T >
bool graphlab::atomic_compare_and_swap ( volatile T &  a,
oldval,
newval 
)

atomic instruction that is equivalent to the following:

if (a==oldval) {
a = newval;
return true;
}
else {
return false;
}

Definition at line 63 of file atomic_ops.hpp.

template<>
bool graphlab::atomic_compare_and_swap ( volatile double &  a,
double  oldval,
double  newval 
)
inline

atomic instruction that is equivalent to the following:

if (a==oldval) {
a = newval;
return true;
}
else {
return false;
}

Definition at line 83 of file atomic_ops.hpp.

template<>
bool graphlab::atomic_compare_and_swap ( volatile float &  a,
float  oldval,
float  newval 
)
inline

atomic instruction that is equivalent to the following:

if (a==oldval) {
a = newval;
return true;
}
else {
return false;
}

Definition at line 106 of file atomic_ops.hpp.

template<typename T >
void graphlab::atomic_exchange ( T &  a,
T &  b 
)

Atomically exchanges the values of a and b.

Warning:
This is not a full atomic exchange. Read of a, and the write of b into a is atomic. But the write into b is not.

Definition at line 122 of file atomic_ops.hpp.

template<typename T >
void graphlab::atomic_exchange ( volatile T &  a,
T &  b 
)

Atomically exchanges the values of a and b.

Warning:
This is not a full atomic exchange. Read of a, and the write of b into a is atomic. But the write into b is not.

Definition at line 133 of file atomic_ops.hpp.

std::pair< size_t, int > graphlab::get_free_tcp_port ( )

Find a free tcp port and binds it. Caller must release the port. Returns a pair of [port, socket handle]

Definition at line 166 of file net_util.cpp.

uint32_t graphlab::get_local_ip ( bool  print = true)

Returns the first non-localhost ipv4 address

Definition at line 63 of file net_util.cpp.

std::string graphlab::get_local_ip_as_str ( bool  print = true)

Returns the first non-localhost ipv4 address as a standard dot delimited string

Definition at line 52 of file net_util.cpp.

template<typename T >
std::string boost::graphlab_vec_to_string ( const std::vector< T > &  vec)

Converts a vector of any stream output-able type to a string

Definition at line 43 of file command_line_options.hpp.

template<>
std::string boost::lexical_cast< std::string > ( const std::vector< int > &  vec)

Provides lexical cast from vector<int> to string. Converts a vector of 1,2,3 to the string "{1, 2, 3}"

Definition at line 29 of file command_line_options.cpp.

template<>
std::string boost::lexical_cast< std::string > ( const std::vector< uint32_t > &  vec)

Provides lexical cast from vector<int> to string. Converts a vector of 1,2,3 to the string "{1, 2, 3}"

Definition at line 34 of file command_line_options.cpp.

template<>
std::string boost::lexical_cast< std::string > ( const std::vector< uint64_t > &  vec)

Provides lexical cast from vector<size_t> to string. Converts a vector of 1,2,3 to the string "{1, 2, 3}"

Definition at line 39 of file command_line_options.cpp.

template<>
std::string boost::lexical_cast< std::string > ( const std::vector< double > &  vec)

Provides lexical cast from vector<double> to string. Converts a vector of 1.1,2.2,3.3 to the string "{1.1, 2.2, 3.3}"

Definition at line 44 of file command_line_options.cpp.

template<>
std::string boost::lexical_cast< std::string > ( const std::vector< float > &  vec)

Provides lexical cast from vector<float> to string. Converts a vector of 1.1,2.2,3.3 to the string "{1.1, 2.2, 3.3}"

Definition at line 49 of file command_line_options.cpp.

template<>
std::string boost::lexical_cast< std::string > ( const std::vector< std::string > &  vec)

Provides lexical cast from vector<string> to string. Converts a vector of "hello", "world" to the string "{hello, world}"

Definition at line 54 of file command_line_options.cpp.