Common Lisp Package: LFARM-CLIENT.COGNATE

Promises and futures.

README:

FUNCTION

Private

MAKE-INPUT-PARTS (SEQUENCES SIZE PARTS-HINT)

Subdivide and interleave sequences for parallel mapping.

Undocumented

%PREDUCE-PARTIAL (TASK SEQUENCE START SIZE PARTS &REST KEYWORD-ARGS)

CALL-WITH-MAX-FILL-POINTER (BODY-FN261 SEQ)

FIND-MIN-LENGTH (SEQS)

FIND-NUM-PARTS (SIZE PARTS-HINT)

GET-PARTS-HINT (PARTS-HINT)

MAKE-PARTS (RESULT SIZE PARTS-HINT)

MAPPING-TASK (SUBRESULT-TYPE TASK)

MAYBE-CONVERT-KEY-FORM (KEYWORD-ARGS ENV)

MAYBE-CONVERT-TASK (FORM)

MAYBE-CONVERT-TASK-FORM (FORM ENV)

PAIRP (FORM)

PARSE-BINDINGS (BINDINGS)

PMAP-INTO-THUNK-FORM (TASK)

PMAP-INTO/FN (RESULT-SEQUENCE TASK &REST SEQUENCES)

PMAP-INTO/PARSED (RESULT-SEQ TASK SEQUENCES SIZE PARTS-HINT)

PMAP-INTO/RECEIVE (CHANNEL RESULT-SEQ SIZE PARTS-HINT)

PMAP-INTO/SUBMIT (CHANNEL RESULT-SEQ TASK SEQUENCES SIZE PARTS-HINT)

PMAP-INTO/UNPARSED (RESULT-SEQ TASK SEQS)

PMAP/FN (RESULT-TYPE TASK FIRST-SEQUENCE &REST MORE-SEQUENCES)

PMAP/PARSED (RESULT-TYPE FUNCTION SEQUENCES SIZE PARTS-HINT)

PMAP/UNPARSED (RESULT-TYPE FUNCTION SEQUENCES)

PMAPCAR/FN (TASK FIRST-SEQUENCE &REST MORE-SEQUENCES)

PREDUCE-PARTIAL/FN (TASK SEQUENCE &REST ARGS &KEY KEY FROM-END (START 0) END INITIAL-VALUE PARTS)

PREDUCE-PARTIAL/LIST (TASK SEQUENCE START SIZE PARTS &REST KEYWORD-ARGS)

PREDUCE-PARTIAL/VECTOR (TASK SEQUENCE START SIZE PARTS &REST KEYWORD-ARGS)

PREDUCE/COMMON (TASK SEQUENCE SUBSIZE &KEY KEY FROM-END (START 0) END (INITIAL-VALUE NIL INITIAL-VALUE-GIVEN-P) PARTS RECURSE PARTIAL)

PREDUCE/FN (TASK SEQUENCE &REST ARGS &KEY KEY FROM-END (START 0) END INITIAL-VALUE PARTS RECURSE)

RECEIVE-INDEXED (CHANNEL COUNT)

REDUCE/REMOTE (TASK RESULTS)

REDUCING-TASK (TASK KEYWORD-ARGS)

SUBDIVIDE-ARRAY (ARRAY SIZE PARTS-HINT)

SUBDIVIDE-LIST (LIST SIZE PARTS-HINT)

SUBRESULT-TYPE (RESULT-SEQ)

SUBSIZE (SEQ SIZE START END)

TASK->FN-FORM (TASK)

ZIP/VECTOR (SEQS)

MACRO

Public

PLET (BINDINGS &BODY BODY)

The syntax of `plet' matches that of `let'. plet ({var-no-init | (var [init-form])}*) form* For each (var init-form) pair, a future is created which executes `init-form'. Inside `body', `var' is a symbol macro which expands to a `force' form for the corresponding future. Each `var-no-init' is bound to nil and each `var' without `init-form' is bound to nil (no future is created).

PMAP (RESULT-TYPE TASK FIRST-SEQUENCE &REST MORE-SEQUENCES &ENVIRONMENT ENV)

Parallel version of `map'. Keyword arguments `parts' and `size' are also accepted. The `parts' option divides each sequence into `parts' number of parts. Default is (kernel-worker-count). The `size' option limits the number of elements mapped to `size'. When given, no `length' calls are made on the sequence(s) passed. Warning: `size' must be less than or equal to the length of the smallest sequence passed. It is unspecified what happens when that condition is not met.

PMAP-INTO (RESULT-SEQUENCE TASK &REST SEQUENCES &ENVIRONMENT ENV)

Parallel version of `map-into'. Keyword arguments `parts' and `size' are also accepted (see `pmap').

PMAP-REDUCE (MAP-FUNCTION REDUCE-FUNCTION SEQUENCE &REST ARGS &KEY START END INITIAL-VALUE PARTS RECURSE)

Equivalent to (preduce reduce-function sequence :key map-function ...).

PMAPCAR (TASK FIRST-SEQUENCE &REST MORE-SEQUENCES &ENVIRONMENT ENV)

Parallel version of `mapcar'. Keyword arguments `parts' and `size' are also accepted (see `pmap'). Unlike `mapcar', `pmapcar' also accepts vectors.

PREDUCE (TASK SEQUENCE &REST ARGS &KEY KEY FROM-END (START 0) END INITIAL-VALUE PARTS RECURSE &ENVIRONMENT ENV)

Parallel version of `reduce'. `preduce' subdivides the input sequence into `parts' number of parts and, in parallel, calls `reduce' on each part. The partial results are then reduced again, either by `reduce' (the default) or, if `recurse' is non-nil, by `preduce'. `parts' defaults to (kernel-worker-count). `key' is thrown out while reducing the partial results. It applies to the first pass only. `start' and `end' have the same meaning as in `reduce'. `from-end' means "from the end of each part". `initial-value' means "initial value of each part".

PREDUCE-PARTIAL (TASK SEQUENCE &REST ARGS &KEY KEY FROM-END (START 0) END INITIAL-VALUE PARTS &ENVIRONMENT ENV)

Like `preduce' but only does a single reducing pass. The length of `sequence' must not be zero. Returns the partial results as a vector.

Private

Undocumented

FUNCALL-TASK (TASK &REST ARGS)

POP-KEYWORD-ARGS (LIST &REST KEYS)

POP-OPTIONS (LIST)

POP-PLIST (LIST)

WITH-MAX-FILL-POINTER (&WHOLE WHOLE311 (SEQ) &BODY BODY312)

WITH-PARSED-OPTIONS ((SEQS SIZE PARTS-HINT) &BODY BODY)

WITH-PARTS (SEQ-SIZE PARTS-HINT &BODY BODY)