LibCircle  0.2.1-rc.1
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)
 
__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_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

Handle to the queue

Referenced by CIRCLE_get_handle(), and CIRCLE_worker().

CIRCLE_internal_queue_dump
void CIRCLE_internal_queue_dump(CIRCLE_internal_queue_t *qp)
Definition: queue.c:92
CIRCLE_get_next_proc
void CIRCLE_get_next_proc(CIRCLE_state_st *st)
Definition: token.c:623
CIRCLE_workreq_check
void CIRCLE_workreq_check(CIRCLE_internal_queue_t *qp, CIRCLE_state_st *st, int cleanup)
Definition: token.c:1046
CIRCLE_debug_level
enum CIRCLE_loglevel CIRCLE_debug_level
Definition: lib.c:18
CIRCLE_request_work
int32_t CIRCLE_request_work(CIRCLE_internal_queue_t *qp, CIRCLE_state_st *st, int cleanup)
Requests work from other ranks.
Definition: token.c:798
CIRCLE_wtime
__inline__ double CIRCLE_wtime(void)
Definition: lib.c:276
CIRCLE_global_rank
int32_t CIRCLE_global_rank
Definition: lib.c:21
CIRCLE_bcast_abort
void CIRCLE_bcast_abort(void)
Definition: token.c:413
CIRCLE_reduce
__inline__ void CIRCLE_reduce(const void *buf, size_t size)
Definition: lib.c:179
CIRCLE_WORK_COMM_NAME
char CIRCLE_WORK_COMM_NAME[32]
Definition: lib.c:27
CIRCLE_cb_create
__inline__ void CIRCLE_cb_create(CIRCLE_cb func)
Definition: lib.c:110
CIRCLE_internal_queue_str_extend
int8_t CIRCLE_internal_queue_str_extend(CIRCLE_internal_queue_t *qp, int32_t new_size)
Definition: queue.c:125
CIRCLE_INPUT_ST
CIRCLE_input_st CIRCLE_INPUT_ST
Definition: lib.c:31
CIRCLE_enable_logging
__inline__ void CIRCLE_enable_logging(enum CIRCLE_loglevel level)
Definition: lib.c:266
CIRCLE_internal_queue_extend
int8_t CIRCLE_internal_queue_extend(CIRCLE_internal_queue_t *qp, size_t new_size)
Definition: queue.c:154
CIRCLE_check_for_term
int CIRCLE_check_for_term(CIRCLE_state_st *st)
Definition: token.c:568
_CIRCLE_read_restarts
int8_t _CIRCLE_read_restarts(void)
Definition: worker.c:93
CIRCLE_cb_reduce_init
__inline__ void CIRCLE_cb_reduce_init(CIRCLE_cb_reduce_init_fn func)
Definition: lib.c:146
CIRCLE_init
__inline__ int32_t CIRCLE_init(int argc, char *argv[], int user_options)
Definition: lib.c:50
CIRCLE_internal_queue_free
int8_t CIRCLE_internal_queue_free(CIRCLE_internal_queue_t *qp)
Definition: queue.c:63
CIRCLE_internal_queue_write
int8_t CIRCLE_internal_queue_write(CIRCLE_internal_queue_t *qp, int rank)
Definition: queue.c:349
CIRCLE_abort
__inline__ void CIRCLE_abort(void)
Definition: lib.c:234
CIRCLE_cb_reduce_fini
__inline__ void CIRCLE_cb_reduce_fini(CIRCLE_cb_reduce_fini_fn func)
Definition: lib.c:168
CIRCLE_send_no_work
void CIRCLE_send_no_work(int dest)
Definition: token.c:895
CIRCLE_worker
int8_t CIRCLE_worker()
Sets up libcircle, calls work loop function.
Definition: worker.c:322
CIRCLE_finalize
__inline__ void CIRCLE_finalize(void)
Definition: lib.c:243
queue_handle
CIRCLE_handle queue_handle
Definition: worker.c:23
CIRCLE_internal_queue_pop
int8_t CIRCLE_internal_queue_pop(CIRCLE_internal_queue_t *qp, char *str)
Definition: queue.c:252
CIRCLE_print_offsets
void CIRCLE_print_offsets(uint32_t *offsets, int32_t count)
Definition: token.c:1117
CIRCLE_INPUT_ST
CIRCLE_input_st CIRCLE_INPUT_ST
Definition: lib.c:31
CIRCLE_cb_reduce_op
__inline__ void CIRCLE_cb_reduce_op(CIRCLE_cb_reduce_op_fn func)
Definition: lib.c:157
CIRCLE_read_restarts
__inline__ void CIRCLE_read_restarts(void)
Definition: lib.c:226
CIRCLE_checkpoint
__inline__ void CIRCLE_checkpoint(void)
Definition: lib.c:218
CIRCLE_handle
Definition: libcircle.h:45
_CIRCLE_checkpoint
int8_t _CIRCLE_checkpoint(void)
Definition: worker.c:102
CIRCLE_INPUT_ST
CIRCLE_input_st CIRCLE_INPUT_ST
Definition: lib.c:31
CIRCLE_internal_queue_init
CIRCLE_internal_queue_t * CIRCLE_internal_queue_init(void)
Definition: queue.c:26
CIRCLE_internal_queue_read
int8_t CIRCLE_internal_queue_read(CIRCLE_internal_queue_t *qp, int rank)
Definition: queue.c:287
CIRCLE_extend_offsets
int8_t CIRCLE_extend_offsets(CIRCLE_state_st *st, int32_t size)
Extend the offset arrays.
Definition: token.c:640
CIRCLE_begin
__inline__ void CIRCLE_begin(void)
Definition: lib.c:209
CIRCLE_set_options
void CIRCLE_set_options(int user_options)
Definition: lib.c:119
CIRCLE_debug_stream
FILE * CIRCLE_debug_stream
Definition: lib.c:15
CIRCLE_get_handle
CIRCLE_handle * CIRCLE_get_handle()
Definition: lib.c:36
queue_handle
CIRCLE_handle queue_handle
Definition: worker.c:23
CIRCLE_internal_queue_push
int8_t CIRCLE_internal_queue_push(CIRCLE_internal_queue_t *qp, char *str)
Definition: queue.c:185
CIRCLE_cb_process
__inline__ void CIRCLE_cb_process(CIRCLE_cb func)
Definition: lib.c:131
CIRCLE_internal_queue_print
void CIRCLE_internal_queue_print(CIRCLE_internal_queue_t *qp)
Definition: queue.c:112