LibCircle  0.3.0
A simple interface for processing workloads using an automatically distributed global queue.
lib.c File Reference
+ Include dependency graph for lib.c:

Functions

CIRCLE_handleCIRCLE_get_handle ()
 
__inline__ int32_t CIRCLE_init (int argc, char *argv[], int user_options)
 
__inline__ void CIRCLE_cb_create (CIRCLE_cb func)
 
void CIRCLE_set_options (int user_options)
 
void CIRCLE_set_tree_width (int width)
 
void CIRCLE_set_reduce_period (int secs)
 
__inline__ void CIRCLE_cb_process (CIRCLE_cb func)
 
__inline__ void CIRCLE_cb_reduce_init (CIRCLE_cb_reduce_init_fn func)
 
__inline__ void CIRCLE_cb_reduce_op (CIRCLE_cb_reduce_op_fn func)
 
__inline__ void CIRCLE_cb_reduce_fini (CIRCLE_cb_reduce_fini_fn func)
 
__inline__ void CIRCLE_reduce (const void *buf, size_t size)
 
__inline__ void CIRCLE_begin (void)
 
__inline__ void CIRCLE_checkpoint (void)
 
__inline__ void CIRCLE_read_restarts (void)
 
__inline__ void CIRCLE_abort (void)
 
__inline__ void CIRCLE_finalize (void)
 
__inline__ void CIRCLE_enable_logging (enum CIRCLE_loglevel level)
 
__inline__ double CIRCLE_wtime (void)
 

Variables

FILE * CIRCLE_debug_stream
 
enum CIRCLE_loglevel CIRCLE_debug_level
 
int32_t CIRCLE_global_rank
 
char CIRCLE_WORK_COMM_NAME [32] = "Libcircle Work Comm"
 
CIRCLE_input_st CIRCLE_INPUT_ST
 
CIRCLE_handle queue_handle
 

Detailed Description

The library source contains the internal implementation of each API hook.

Function Documentation

◆ CIRCLE_abort()

__inline__ void CIRCLE_abort ( void  )

Call this function to have all ranks dump a checkpoint file and exit.

References CIRCLE_bcast_abort().

+ Here is the call graph for this function:

◆ CIRCLE_begin()

__inline__ void CIRCLE_begin ( void  )

Once you've defined and told libcircle about your callbacks, use this to execute your program.

References CIRCLE_worker().

+ Here is the call graph for this function:

◆ CIRCLE_cb_create()

__inline__ void CIRCLE_cb_create ( CIRCLE_cb  func)

Processing and creating work is done through callbacks. Here's how we tell libcircle about our function which creates an initial workload. This call is optional.

Parameters
functhe callback to be used in the creation stage.

References CIRCLE_INPUT_ST.

◆ CIRCLE_cb_process()

__inline__ void CIRCLE_cb_process ( CIRCLE_cb  func)

After you give libcircle a way to create work, you need to tell it how that work should be processed.

Parameters
functhe callback to be used in the process stage.

References CIRCLE_INPUT_ST.

◆ CIRCLE_cb_reduce_fini()

__inline__ void CIRCLE_cb_reduce_fini ( CIRCLE_cb_reduce_fini_fn  func)

This function will be invoked on the root (rank 0) to provide the final result of the reduction.

Parameters
functhe callback to be provide reduction output on root.

References CIRCLE_INPUT_ST.

◆ CIRCLE_cb_reduce_init()

__inline__ void CIRCLE_cb_reduce_init ( CIRCLE_cb_reduce_init_fn  func)

This function will be invoked on all processes to get initial input data for the reduction.

Parameters
functhe callback to be used to provide data for reduction.

References CIRCLE_INPUT_ST.

◆ CIRCLE_cb_reduce_op()

__inline__ void CIRCLE_cb_reduce_op ( CIRCLE_cb_reduce_op_fn  func)

This function will be invoked on processes to execute the reduction tree.

Parameters
functhe callback to be used to combine data during reduction.

References CIRCLE_INPUT_ST.

◆ CIRCLE_checkpoint()

__inline__ void CIRCLE_checkpoint ( void  )

Call this function to checkpoint libcircle's distributed queue. Each rank writes a file called circle<rank>.txt

References _CIRCLE_checkpoint().

+ Here is the call graph for this function:

◆ CIRCLE_enable_logging()

__inline__ void CIRCLE_enable_logging ( enum CIRCLE_loglevel  level)

Set the logging level that libcircle should use.

Parameters
levelthe logging level that libcircle should output.

References CIRCLE_debug_level.

◆ CIRCLE_finalize()

__inline__ void CIRCLE_finalize ( void  )

After your program has executed, give libcircle a chance to clean up after itself by calling this. This should be called after all libcircle API calls.

References CIRCLE_INPUT_ST, and CIRCLE_internal_queue_free().

+ Here is the call graph for this function:

◆ CIRCLE_get_handle()

CIRCLE_handle* CIRCLE_get_handle ( void  )

Function to return a pointer to the handle. Useful for threaded applications. You are responsible for maintaining mutual exclusion.

References queue_handle.

◆ CIRCLE_init()

__inline__ int32_t CIRCLE_init ( int  argc,
char *  argv[],
int  user_options 
)

Initialize internal state needed by libcircle. This should be called before any other libcircle API call.

Parameters
argcthe number of arguments passed into the program.
argvthe vector of arguments passed into the program.
Returns
the rank value of the current process.

References CIRCLE_debug_level, CIRCLE_debug_stream, CIRCLE_INPUT_ST, and CIRCLE_set_options().

+ Here is the call graph for this function:

◆ CIRCLE_read_restarts()

__inline__ void CIRCLE_read_restarts ( void  )

Call this function to read in libcircle restart files.

References _CIRCLE_read_restarts().

+ Here is the call graph for this function:

◆ CIRCLE_reduce()

__inline__ void CIRCLE_reduce ( const void *  buf,
size_t  size 
)

Call this function to give libcircle initial reduction data.

Parameters
bufpointer to buffer holding reduction data
sizesize of buffer in bytes

◆ CIRCLE_set_options()

void CIRCLE_set_options ( int  user_options)

Change run time flags

References CIRCLE_INPUT_ST.

Referenced by CIRCLE_init().

+ Here is the caller graph for this function:

◆ CIRCLE_set_reduce_period()

void CIRCLE_set_reduce_period ( int  secs)

Change the number of seconds between consecutive reductions.

References CIRCLE_INPUT_ST.

◆ CIRCLE_set_tree_width()

void CIRCLE_set_tree_width ( int  width)

Change the width of the k-ary communication tree.

References CIRCLE_INPUT_ST.

◆ CIRCLE_wtime()

__inline__ double CIRCLE_wtime ( void  )

Returns an elapsed time on the calling processor for benchmarking purposes.

Returns
time in seconds since an arbitrary time in the past.

Variable Documentation

◆ CIRCLE_debug_level

enum CIRCLE_loglevel CIRCLE_debug_level

The current log level of library logging output.

Referenced by CIRCLE_enable_logging(), and CIRCLE_init().

◆ CIRCLE_debug_stream

FILE* CIRCLE_debug_stream

The debug stream for all logging messages.

Referenced by CIRCLE_init().

◆ CIRCLE_global_rank

int32_t CIRCLE_global_rank

The rank value of the current node.

Referenced by _CIRCLE_checkpoint(), _CIRCLE_read_restarts(), and CIRCLE_bcast_abort().

◆ CIRCLE_INPUT_ST

◆ CIRCLE_WORK_COMM_NAME

char CIRCLE_WORK_COMM_NAME[32] = "Libcircle Work Comm"

Communicator names

◆ queue_handle

CIRCLE_handle queue_handle
extern

Handle to the queue

Referenced by CIRCLE_get_handle(), and CIRCLE_worker().