libfaster API Documentation  Development Version
Super fast distributted computing
faster::fastContext Class Reference

#include <fastContext.h>

Description

Framework context class.

The context manages communication, scheduler and start Workers. A context is needed to create datasets!

Definition at line 66 of file fastContext.h.

Public Member Functions

 fastContext (int argc=0, char **argv=NULL)
 fastContext default constructor More...
 
 fastContext (const fastSettings &s, int argc, char **argv)
 fastContext constructor with custom settings
 
 ~fastContext ()
 fastContext destructor
 
void startWorkers ()
 Start worker machines computation. More...
 
bool isDriver ()
 Checks for the driver process. More...
 
int numProcs ()
 Return the number of processes running. More...
 
void calibrate ()
 Performs a microbenchmark to do dynamic load balancing (UNUSED)
 
Function and global variables registration
void registerFunction (void *funcP)
 Register a user custom function in the context. More...
 
void registerFunction (void *funcP, const std::string name)
 Register a user custom function in the context. More...
 
template<class T >
void registerGlobal (T *varP)
 Gegisters a primitive global varible to be used inside used defined functions in distributted environment. More...
 
template<class T >
void registerGlobal (T **varP, size_t s)
 Gegisters a global array to be used inside used defined functions in distributted environment. More...
 
template<class T >
void registerGlobal (std::vector< T > *varP)
 Gegisters a global Vector to be used inside used defined functions in distributted environment. More...
 
Online file reading and parsing
template<typename T >
fdd< T > * onlineFullPartRead (std::string path, onlineFullPartFuncP< T > funcP)
 Reads a file with online parsing and partition (NOT IMPLEMENTED) More...
 
template<typename K , typename T >
indexedFdd< K, T > * onlineFullPartRead (std::string path, IonlineFullPartFuncP< K, T > funcP)
 
template<typename K , typename T >
indexedFdd< K, T > * onlinePartRead (std::string path, IonlineFullPartFuncP< K, T > funcP)
 
template<typename T >
fdd< T > * onlineRead (std::string path, onlineFullPartFuncP< T > funcP)
 Reads a file with online parsing and mapping (?) More...
 
template<typename K , typename T >
indexedFdd< K, T > * onlineRead (std::string path, IonlineFullPartFuncP< K, T > funcP)
 
Task execution profiling
void printInfo ()
 Prints task execution information for all tasks executed by the user.
 
void printHeader ()
 Prints a header for task execution information. More...
 
void updateInfo ()
 Prints information from tesk ran since last faster::fastContext::updateInfo() called. More...
 

Constructors and Destructors

§ fastContext()

faster::fastContext::fastContext ( int  argc = 0,
char **  argv = NULL 
)

fastContext default constructor

Parameters
argc- number of arguments from main
argv- arguments from main

Definition at line 8 of file fastContext.cpp.

Member Function Documentation

§ isDriver()

bool faster::fastContext::isDriver ( )

Checks for the driver process.

Returns
- true if the process is the driver process

Definition at line 76 of file fastContext.cpp.

§ numProcs()

int faster::fastContext::numProcs ( )
inline

Return the number of processes running.

Returns
number of active processes

Definition at line 150 of file fastContext.h.

§ onlineFullPartRead()

template<typename T >
fdd<T>* faster::fastContext::onlineFullPartRead ( std::string  path,
onlineFullPartFuncP< T >  funcP 
)

Reads a file with online parsing and partition (NOT IMPLEMENTED)

Template Parameters
T- Dataset type
Parameters
path- Input file path
funcP- partition function pointer of types ::faster::onlineFullPartFuncP or ::faster::IonlineFullPartFuncP
Returns
- a dataset of ::faster::fdd<t> type and faster::indexedFdd<K,T>

§ onlineRead()

template<typename T >
fdd<T>* faster::fastContext::onlineRead ( std::string  path,
onlineFullPartFuncP< T >  funcP 
)

Reads a file with online parsing and mapping (?)

Template Parameters
K- Dataset key type
T- Dataset type
Parameters
path- File path
funcP- (?)
Returns

§ printHeader()

void faster::fastContext::printHeader ( )

Prints a header for task execution information.

To be used with faster::fastContext::updateInfo()

Definition at line 334 of file fastContext.cpp.

§ registerFunction() [1/2]

void faster::fastContext::registerFunction ( void *  funcP)

Register a user custom function in the context.

Registering a user custom functions is necessary in order to pass it as parametes to FDD functions like map and reduce.

Parameters
funcP- Function pointer to a user defined function.

Definition at line 48 of file fastContext.cpp.

§ registerFunction() [2/2]

void faster::fastContext::registerFunction ( void *  funcP,
const std::string  name 
)

Register a user custom function in the context.

Registering a user custom functions is necessary in order to pass it as parametes to FDD functions like map and reduce.

Parameters
funcP- Function pointer to a user defined function.
name- Custom name to registered funciton.

Definition at line 53 of file fastContext.cpp.

§ registerGlobal() [1/3]

template<class T >
void faster::fastContext::registerGlobal ( T *  varP)

Gegisters a primitive global varible to be used inside used defined functions in distributted environment.

Template Parameters
T- Type of the global variable to be registered
Parameters
varP- Global variable to be registered

Definition at line 353 of file fastContext.h.

§ registerGlobal() [2/3]

template<class T >
void faster::fastContext::registerGlobal ( T **  varP,
size_t  s 
)

Gegisters a global array to be used inside used defined functions in distributted environment.

Template Parameters
T- Type of the global array to be registered
Parameters
varP- Global array to be registered
s- Size of the array

Definition at line 357 of file fastContext.h.

§ registerGlobal() [3/3]

template<class T >
void faster::fastContext::registerGlobal ( std::vector< T > *  varP)

Gegisters a global Vector to be used inside used defined functions in distributted environment.

Template Parameters
T- Type of the global vector to be registered
Parameters
varP- Global vector to be registered

Definition at line 362 of file fastContext.h.

§ startWorkers()

void faster::fastContext::startWorkers ( )

Start worker machines computation.

When this function is called, the driver processes and works processes diverge from execution. While the Driver process starts to execute user code, the worker processes start to waiting for tasks. Then workers should exit short after this function is called.

Definition at line 58 of file fastContext.cpp.

§ updateInfo()

void faster::fastContext::updateInfo ( )

Prints information from tesk ran since last faster::fastContext::updateInfo() called.

To be used with faster::fastContext::printHeader()

Definition at line 331 of file fastContext.cpp.


The documentation for this class was generated from the following files: