Classes | Typedefs | Functions

GraphLab Utility Classes and Functions

Classes

class  graphlab::atomic< T >
 atomic object toolkitA templated class for creating atomic numbers. More...
class  graphlab::mutex
class  graphlab::spinlock
class  graphlab::simple_spinlock
class  graphlab::conditional
class  graphlab::barrier
class  graphlab::thread
class  graphlab::thread_group
class  graphlab::blocking_queue< T >
 Implements a blocking queue useful for producer/consumer models. More...
class  graphlab::command_line_options
class  graphlab::dense_bitset
class  graphlab::mutable_queue< T, Priority, Compare >
class  graphlab::safe_circular_char_buffer
class  graphlab::timer

Typedefs

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

Functions

template<typename T >
bool graphlab::atomic_compare_and_swap (T &a, const T &oldval, const T &newval)
template<typename T >
bool graphlab::atomic_compare_and_swap (volatile T &a, const T &oldval, const T &newval)
template<>
bool graphlab::atomic_compare_and_swap (double &a, const double &oldval, const double &newval)
template<>
bool graphlab::atomic_compare_and_swap (float &a, const float &oldval, const float &newval)
template<typename T >
void graphlab::atomic_exchange (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.
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< size_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< 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)
uint32_t graphlab::get_local_ip ()
std::string graphlab::get_local_ip_as_str ()
std::pair< size_t, int > graphlab::get_free_tcp_port ()

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 91 of file charstream.hpp.


Function Documentation

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

atomic instruction that is equivalent to the following:

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

Definition at line 73 of file atomic.hpp.

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

atomic instruction that is equivalent to the following:

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

Definition at line 91 of file atomic.hpp.

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

atomic instruction that is equivalent to the following:

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

Definition at line 133 of file atomic.hpp.

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

atomic instruction that is equivalent to the following:

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

Definition at line 111 of file atomic.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]

uint32_t graphlab::get_local_ip (  ) 

Returns the first non-localhost ipv4 address

std::string graphlab::get_local_ip_as_str (  ) 

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

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 36 of file command_line_options.hpp.

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}"

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

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

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}"

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}"

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}"