Common Lisp Package: LPARALLEL-BENCH

Benchmarks for lparallel.

README:

lparallel

lparallel is a library for parallel programming in Common Lisp, featuring

  • a simple model of task submission with receiving queue
  • constructs for expressing fine-grained parallelism
  • asynchronous condition handling across thread boundaries
  • parallel versions of map, reduce, sort, remove, and many others
  • promises, futures, and delayed evaluation constructs
  • computation trees for parallelizing interconnected tasks
  • bounded and unbounded FIFO queues
  • high and low priority tasks
  • task killing by category
  • integrated timeouts

See http://lparallel.org for documentation and examples.

Running

lparallel should run on any Common Lisp implementation supported by bordeaux-threads. The following implementations successfully pass the test suite:

  • ABCL
  • Allegro
  • Clozure
  • LispWorks
  • SBCL

To run tests, load lparallel-test.asd and call (lparallel-test:execute).

To run benchmarks, load lparallel-bench.asd and call (lparallel-bench:execute N) where N is the number of worker threads.

Author

James M. Lawrence <llmjjmll@gmail.com>

FUNCTION

Public

Undocumented

EXECUTE (NUM-WORKERS &REST FNS)

PROFILE (&REST ARGS)

STAT-PROFILE (&REST ARGS)

Private

%%%%.BENCH-SPEC.ARGS-FN (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

%%%%.BENCH-SPEC.DESC-FN (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

%%%%.BENCH-SPEC.EXEC-FN (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

ARGS-FN (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

BENCH (NUM-FNS NUM-TRIALS NUM-REHEARSALS SPECS)

Run bench specs. To minimize GC interactions, all arguments are generated at the outset and each benchmarked function is held constant while the generated argument lists are applied successively. When benchmarks are complete, the rehearsals are discarded and the results are riffled for comparison.

DESC-FN (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

EXEC-FN (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GC (&KEY FULL VERBOSE)

Initiates a garbage collection. @code{full} forces the collection of all generations, when applicable. When @code{verbose} is @em{true}, diagnostic information about the collection is printed if possible.

Undocumented

SETF%%%%.BENCH-SPEC.ARGS-FN (NEW-VALUE INSTANCE)

SETF%%%%.BENCH-SPEC.DESC-FN (NEW-VALUE INSTANCE)

SETF%%%%.BENCH-SPEC.EXEC-FN (NEW-VALUE INSTANCE)

%%.DEFPUN.FIB-PLET

%%.DEFPUN.FIB-PLET-IF

%%.DEFPUN.PMATRIX-MUL

BENCH-PFIB

BENCH-PMAP

BENCH-PMATRIX-MUL

BENCH-PREDUCE

BENCH-PSORT

BENCH-SPEC-P (OBJECT)

CALL-WITH-TEMP-KERNEL (WORKER-COUNT FN)

COMPOSE (&REST FNS)

COPY-BENCH-SPEC (INSTANCE)

CURRY (FN &REST INIT-ARGS)

DATA (NAME)

DESC-N (N FN TIME)

DESC-SIZE-OP (SIZE OP FN TIME)

ENABLE-PROFILING

FIB-LET

FIB-PLET (N)

FIB-PLET-IF (N)

FLATTEN (LIST)

GET-TIME

GROUPS-OF (N LIST)

HOME-FUNCTIONS (PKG)

HOME-FUNCTIONS-IN-PACKAGES-PASSING (PREDICATE)

HOME-SYMBOLS (PKG)

IDENTITY-ARGS (&REST ARGS)

MAKE-BENCH-SPEC (&KEY ((ARGS-FN DUM159) (ERROR slot ~a in ~a not initialized 'ARGS-FN 'BENCH-SPEC)) ((EXEC-FN DUM160) (ERROR slot ~a in ~a not initialized 'EXEC-FN 'BENCH-SPEC)) ((DESC-FN DUM161) (ERROR slot ~a in ~a not initialized 'DESC-FN 'BENCH-SPEC)))

MAKE-BENCH-SPEC-INSTANCE (&KEY ((ARGS-FN DUM159) (ERROR slot ~a in ~a not initialized 'ARGS-FN 'BENCH-SPEC)) ((EXEC-FN DUM160) (ERROR slot ~a in ~a not initialized 'EXEC-FN 'BENCH-SPEC)) ((DESC-FN DUM161) (ERROR slot ~a in ~a not initialized 'DESC-FN 'BENCH-SPEC)))

MAKE-RANDOM-VECTOR (SIZE)

MATCH-PACKAGE-P (STRING PKG)

MATRIX-MUL

PACKAGES-PASSING (PREDICATE)

PING (X)

PMATRIX-MUL (N M1 M2 M3)

RESET

RIFFLE (GROUPS DECK)

RUN-MM (FN N)

SELECT-BENCHES (FN-NAMES)

TIME-INTERVAL (START END)

TO-MICROSECONDS (TIME)

WALL-TIME (FN ARGS)

ZIP (&REST ARGS)

MACRO

Public

Undocumented

WITH-TEMP-KERNEL ((&REST MAKE-KERNEL-ARGS) &BODY BODY)

WITH-WALL-TIME (&BODY BODY)

Private

Undocumented

COLLECT-TRIALS (TRIALS &BODY BODY)

COLLECTING1 (&BODY BODY)

DEFBENCH (NAME PARAMS &BODY BODY)

DEFINE-MM (NAME DEF XLET)

PROFILE-FNS (SYMS)

REBIND (VARS &BODY BODY)

WITH-BENCH-SPEC-SLOTS (SLOTS INSTANCE &BODY BODY)

WITH-FNS (FNS &BODY BODY)

WITHOUT-WARNINGS (&BODY BODY)

VARIABLE

Private

Undocumented

*BENCHES*

*LAST-RANDOM-STATE*

*ONE-WORKER-LESS*

*REHEARSALS*

*REPEAT-GC*

*SPIN-COUNT*

*TRIALS*

CLASS

Private

BENCH-SPEC

A benchmark specification. `args-fn' creates the arguments to be passed to `exec-fn'. The execution time of `exec-fn' is passed to `desc-fn', which returns a descriptive string.