Common Lisp Package: LPARALLEL-TEST

Test suite 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

EXECUTE (&OPTIONAL (TEST-SPEC *SUITE*))

Equivalent to (explain (run TEST-SPEC)).

Private

DEBUG! (&OPTIONAL (TEST-SPEC *SUITE*))

Calls (run! test-spec) but enters the debugger if any kind of error happens.

RUN! (&OPTIONAL (TEST-SPEC *SUITE*))

Equivalent to (explain (run TEST-SPEC)).

Undocumented

%%.DEFPUN.DEFPUN*-ACCEPT (KERNEL1698)

%%.DEFPUN.DEFPUN*-BASIC-TEST-FN (KERNEL1516)

%%.DEFPUN.DEFPUN*-REJECT (KERNEL2065)

%%.DEFPUN.DEFPUN-ACCEPT (KERNEL156)

%%.DEFPUN.DEFPUN-BASIC-TEST-FN (KERNEL0)

%%.DEFPUN.DEFPUN-REJECT (KERNEL396)

%%.DEFPUN.FIB*-PLET (KERNEL2542 N)

%%.DEFPUN.FIB*-PLET-IF (KERNEL2673 N)

%%.DEFPUN.FIB*-PLET-IF/TYPE (KERNEL2964 N)

%%.DEFPUN.FIB*-PLET/TYPE (KERNEL2822 N)

%%.DEFPUN.FIB-PLET (KERNEL675 N)

%%.DEFPUN.FIB-PLET-IF (KERNEL777 N)

%%.DEFPUN.FIB-PLET-IF/TYPE (KERNEL1015 N)

%%.DEFPUN.FIB-PLET/TYPE (KERNEL897 N)

%%.DEFPUN.FOO-APPEND (KERNEL1355 &KEY LEFT RIGHT)

%%.DEFPUN.FOO-APPEND* (KERNEL3129 &KEY LEFT RIGHT)

%%.DEFPUN.FUNC1 (KERNEL1250 X)

%%.DEFPUN.FUNC2 (KERNEL1156 X)

%%.DEFPUN.NOT-PARALLEL* (KERNEL2469 A)

ABORT-FUTURE-TEST

ABORTED-WORKER-TEST

ABORTING-CONTEXT (WORKER-LOOP)

ACTIVE-WORKER-REPLACEMENT-TEST

ALL-WORKERS-ALIVE-P

BASIC-PTREE-2-TEST

BASIC-PTREE-FN-TEST

BASIC-PTREE-TEST

BASIC-THREADING-TEST

BIG-SEQUENTIAL-TEST

CANCEL-TIMEOUT-TEST

CANCELING-TEST

CHANNEL-CAPACITY-TEST

CLEAR-PTREE-ERRORS-TEST

CLEAR-PTREE-TEST

COGNATE-HANDLER-TEST

COGNATE-STEAL-TEST

CONTEXT-ERROR-TEST

CURRY (FN &REST INIT-ARGS)

CUSTOM-KILL-TASK-TEST

DECLAIM-DEFPUN-TEST

DEFAULT-KILL-TASK-TEST

DEFPUN*-ACCEPT

DEFPUN*-ACCEPT-TEST

DEFPUN*-BASIC-TEST

DEFPUN*-BASIC-TEST-FN

DEFPUN*-FIB-TEST

DEFPUN*-LAMBDA-LIST-KEYWORDS-TEST

DEFPUN*-NOT-PARALLEL-TEST

DEFPUN*-REJECT

DEFPUN*-REJECT-TEST

DEFPUN-ACCEPT

DEFPUN-ACCEPT-TEST

DEFPUN-BASIC-TEST

DEFPUN-BASIC-TEST-FN

DEFPUN-FIB-TEST

DEFPUN-LAMBDA-LIST-KEYWORDS-TEST

DEFPUN-REJECT

DEFPUN-REJECT-TEST

DEFPUN/TYPE*-FIB-TEST

DEFPUN/TYPE-FIB-TEST

DEGENERATE-PMAPS-TEST

DELAY-FORCE-TEST

DESTROY-THREAD-CLEANUP-TEST

DOUBLE-END-KERNEL-TEST

END-KERNEL-TEST

END-KERNEL-WAIT-TEST

ERROR-CASCADE-TEST

ERROR-DURING-STEALING-FORCE-2-TEST

ERROR-DURING-STEALING-FORCE-TEST

ERROR-INSIDE-PTREE-FUNCTION-TEST

EXTRACT-QUEUE (QUEUE)

FIB*-LET (N)

FIB*-LET/TYPE (N)

FIB*-PLET (N)

FIB*-PLET-IF (N)

FIB*-PLET-IF/TYPE (N)

FIB*-PLET/TYPE (N)

FIB-LET (N)

FIB-LET/TYPE (N)

FIB-PLET (N)

FIB-PLET-IF (N)

FIB-PLET-IF/TYPE (N)

FIB-PLET/TYPE (N)

FIXED-CAPACITY-QUEUE-TEST

FLOOD-TEST

FOO-APPEND (&REST ARGS1483)

FOO-APPEND* (&REST ARGS3284)

FORCE-CHAIN-TEST

FULFILL-CHAIN-TEST

FUNC1 (X)

FUNC2 (X)

FUNCTION-DESIGNATORS-TEST

FUTURE-FORCE-TEST

FUTURE-RECURSION-TEST

FUTURE-RESTART-TEST

FUTURE-STORE-VALUE-TEST

FUTURES-TEST

GRIND-FIXED-CAPACITY-QUEUE-TEST

GRIND-PEVERY-TEST

GRIND-PMAP-TEST

GRIND-PMAPLIST-TEST

GRIND-PREDUCE-TEST

GRIND-PTREE-TEST

GRIND-QUEUE-TEST

GRIND-SPIN-QUEUE-TEST

GRIND-VECTOR-QUEUE-TEST

HANDLER-BIND-TEST

INFINITE-LOOP

INVOKE-ABORT-THREAD

KERNEL-BINDING-TEST

KERNEL-CLIENT-ERROR-TEST

KERNEL-READER-TEST

KERNEL-STORE-VALUE-TEST

KERNEL-TEST

KERNEL-WARNINGS-TEST

KERNEL-WORKER-CONTEXT-TEST

KILL-DURING-END-KERNEL-TEST

KILL-TIMEOUT-TEST

LAMBDA-LIST-KEYWORDS-IN-PTREE-TEST

MAKE-QUEUE*

MAKE-RANDOM-LIST (SIZE)

MAKE-RANDOM-VECTOR (SIZE)

MAKE-VECTOR-QUEUE*

MAKE-VECTOR-QUEUE**

MANY-TASK-TEST

MISSING-PTREE-FUNCTION-TEST

MULTI-FUTURE-STORE-VALUE-TEST

MULTIPLE-VALUE-TEST

NESTED-CHAIN-TEST

NO-KERNEL-RESTART-TEST

NO-KERNEL-TEST

NON-ERROR-CONDITION-TEST

NON-FUNCALLING-CONTEXT (WORKER-LOOP)

NON-FUNCALLING-CONTEXT-TEST

NON-PROMISE-TEST

NONEXISTENT-CONTEXT-TEST

NOT-PARALLEL* (A)

PAND-POR-TEST

PARTS-ARG-TEST

PCOUNT-IF-TEST

PCOUNT-TEST

PDOTIMES-SECOND-TEST

PDOTIMES-TEST

PFIND-IF-TEST

PFIND-TEST

PFUNCALL-TEST

PLET-IF-TEST

PLET-TEST

PLET-TEST-FN

PMAP-COMPILER-MACRO-PARTS-TEST

PMAP-COMPILER-MACRO-TEST

PMAP-HANDLER-TEST

PMAP-INTO-BOUNDS-TEST

PMAP-INTO-CLOSED-EDGE-TEST

PMAP-INTO-DEGENERATE-INPUT-TEST

PMAP-INTO-LIST-TEST

PMAP-INTO-OPEN-EDGE-TEST

PMAP-INTO-TEST

PMAP-NIL-TEST

PMAP-NOTINLINE-TEST

PMAP-RESTART-TEST

PMAP-WITH-SIZE-CONSTRAINT-TEST

PMAPCAR-HANDLES-SEQUENCES-TEST

PMAPCAR-TEST

PMAPLIST-INTO-DEGENERATE-INPUT-TEST

PMAPLIST-TEST

POP-SPIN-QUEUE/WAIT (QUEUE)

PREDUCE-PARTIAL-TEST

PREMOVE-IF-TEST

PREMOVE-TEST

PROMISES-TEST

PSORT*-TEST

PSORT-TEST

PTREE-BASIC-RESTART-TEST

PTREE-KILL-TEST

PTREE-LONE-FN-TEST

PTREE-MISSING-NODE-TEST

PTREE-MULTI-ERROR-TEST

PTREE-NO-DOUBLE-COMPUTE-TEST

PTREE-NODE-ID-TEST

PTREE-NODE-KERNEL-TEST

PTREE-QUERY-TEST

PTREE-REDEFINITION-TEST

PTREE-RESTART-TEST

PTREE-TRANSFER-ERROR-TEST

PTREE-UNKNOWN-NODE-TEST

QUEUE-INITIAL-CONTENTS-TEST

QUEUE-TEST

RAW-QUEUE-TEST

REDEFINED-DEFPUN*-TEST

REDEFINED-DEFPUN-TEST

REJECT-KILL-NIL-TEST

SECOND-PCOUNT-IF-TEST

SECOND-PFIND-IF-TEST

SECOND-PREMOVE-IF-TEST

SECOND-PTREE-KILL-TEST

SEQUENTIAL-FORCE-TEST

SIGNALING-AFTER-SIGNAL-TEST

SLEEPING-WORKER-REPLACEMENT-TEST

SPECULATE-FORCE-TEST

SPECULATION-RESTART-TEST

SPECULATIONS-TEST

SPIN-QUEUE-TEST

STEAL-WORK-TEST

SUBMIT-AFTER-END-KERNEL-TEST

SUBMIT-TIMEOUT-TEST

TASK-CATEGORIES-TEST

THIRD-PTREE-KILL-TEST

THREAD-BINDINGS-TEST

THREAD-COUNT

TRY-RECEIVE-TEST

USER-RESTART-TEST

VECTOR-QUEUE-BLOCKING-TEST

VECTOR-QUEUE-TEST

WORKER-CONTEXT-TEST

WORKER-SUICIDE-TEST

MACRO

Private

COLLECT-N (N &BODY BODY)

Execute `body' `n' times, collecting the results into a list.

IN-SUITE* (SUITE-NAME &KEY IN)

Just like in-suite, but silently creates missing suites.

IS (TEST &REST REASON-ARGS)

The DWIM checking operator. If TEST returns a true value a test-passed result is generated, otherwise a test-failure result is generated. The reason, unless REASON-ARGS is provided, is generated based on the form of TEST: (predicate expected actual) - Means that we want to check whether, according to PREDICATE, the ACTUAL value is in fact what we EXPECTED. (predicate value) - Means that we want to ensure that VALUE satisfies PREDICATE. Wrapping the TEST form in a NOT simply preducse a negated reason string.

SIGNALS (CONDITION-SPEC &BODY BODY)

Generates a pass if BODY signals a condition of type CONDITION. BODY is evaluated in a block named NIL, CONDITION is not evaluated.

TEST (NAME &BODY BODY)

Create a test named NAME. If NAME is a list it must be of the form: (name &key depends-on suite fixture compile-at) NAME is the symbol which names the test. DEPENDS-ON is a list of the form: (AND . test-names) - This test is run only if all of the tests in TEST-NAMES have passed, otherwise a single test-skipped result is generated. (OR . test-names) - If any of TEST-NAMES has passed this test is run, otherwise a test-skipped result is generated. (NOT test-name) - This is test is run only if TEST-NAME failed. AND, OR and NOT can be combined to produce complex dependencies. If DEPENDS-ON is a symbol it is interpreted as `(AND ,depends-on), this is accomadate the common case of one test depending on another. FIXTURE specifies a fixtrue to wrap the body in.

Undocumented

DEFINE-BIG-SEQUENTIAL

DEFINE-FORCE-TEST (DEFER)

DEFINE-GRIND-QUEUE (NAME &KEY MAKE-QUEUE PUSH-QUEUE POP-QUEUE QUEUE-COUNT)

DEFINE-PLET-TEST (TEST-NAME FN-NAME DEFUN STORE-VALUE-P)

DEFINE-PMAP-INTO-EDGE-TEST (NAME DECL)

DEFINE-PSORT-TEST (NAME PSORT)

DEFINE-QUEUE-TEST (NAME &KEY MAKE-QUEUE PUSH-QUEUE POP-QUEUE TRY-POP-QUEUE QUEUE-EMPTY-P QUEUE-COUNT PEEK-QUEUE)

FOR-RANGE ((VAR PAIR) &BODY BODY)

LP-BASE-TEST (NAME &BODY BODY)

LP-TEST (NAME &BODY BODY)

WITH-NEW-KERNEL ((&REST ARGS) &BODY BODY)

WITH-THREAD-COUNT-CHECK (&BODY BODY)

VARIABLE

Private

Undocumented

*GRIND-QUEUE-COUNT*

*LAST-RANDOM-STATE*

*MEMO*

*NIL*

CONDITION

Private

Undocumented

CLIENT-ERROR

FOO-CONDITION

FOO-CONDITION-2

FOO-ERROR

FOO-WARNING