Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: github pages

on:
push:
branches:
- master
pull_request:

jobs:
deploy:
runs-on: ubuntu-22.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v2

- name: Setup mdBook
uses: peaceiris/actions-mdbook@v2
with:
# mdbook-version: '0.4.10'
mdbook-version: 'latest'

- run: |
cd docs
mdbook build

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/book
34 changes: 30 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# Purpose of this fork

To extend `make-ptree` so that it takes a test keyword - in this way, ptrees can
be identified with things that are `eq` (e.g., symbols) or `equalp` (e.g.,
strings).

Note: Another way to get this effect is to use the original lparallel system and
the following patch:
```
(cl:handler-case
(require 'lparallel)
(cl:error (c)
(declare (ignore c))
(ql:quickload :lparallel)))

;;; Patch lparallel:make-ptree, so it accepts a :test key.
(in-package :lparallel)
(defconstant +original-make-ptree+ (symbol-function 'lparallel:make-ptree))
(defun lparallel:make-ptree ( &key (test #'eql) )
"Create a ptree instance."
(let ((p (funcall +original-make-ptree+)))
(setf (slot-value p 'lparallel.ptree::nodes) (make-hash-table :test test))
p))
(in-package :cl-user)
```

# lparallel

Expand All @@ -14,7 +39,7 @@ lparallel is a library for parallel programming in Common Lisp, featuring
* task killing by category
* integrated timeouts

See http://lparallel.org for documentation and examples.
See https://sharplispers.github.io/lparallel/ for documentation and examples.

### Running

Expand All @@ -25,13 +50,14 @@ test suite:
* ABCL
* Allegro
* Clozure
* ECL
* LispWorks
* SBCL

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

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

### Author

Expand Down
2 changes: 1 addition & 1 deletion bench/bench.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

(in-package #:lparallel-bench)
(in-package :lparallel/bench)

;;;; helpers

Expand Down
7 changes: 2 additions & 5 deletions bench/package.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

(defpackage #:lparallel-bench
(defpackage :lparallel/bench
(:documentation
"Benchmarks for lparallel.")
(:use #:cl
Expand All @@ -50,7 +50,4 @@
#:compose
#:flatten))

#+sbcl
(require :sb-sprof)

(in-package #:lparallel-bench)
(in-package :lparallel/bench)
7 changes: 3 additions & 4 deletions bench/profile.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

(in-package #:lparallel-bench)
(in-package :lparallel/bench)

;;;; util

Expand Down Expand Up @@ -65,9 +65,8 @@
(profile-fns #.(home-functions-in-packages-passing
(lambda (pkg)
(or (match-package-p "lparallel" pkg)
(match-package-p "bordeaux-threads" pkg)
#+(and sbcl lparallel.with-stealing-scheduler)
(match-package-p "sb-concurrency" pkg))))))
(match-package-p "bordeaux-threads-2" pkg)
#+sbcl (match-package-p "sb-concurrency" pkg))))))

(defun profile (&rest args)
(without-warnings
Expand Down
8 changes: 3 additions & 5 deletions bench/suite.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

(in-package #:lparallel-bench)
(in-package :lparallel/bench)

(defparameter *trials* 12)

(defparameter *rehearsals* 8)

(defparameter *repeat-gc* #-abcl 50
;; (gc) hangs on abcl
#+abcl 0)
(defparameter *repeat-gc* 50)

(defparameter *benches*
`((bench-pmap
Expand Down Expand Up @@ -289,7 +287,7 @@

(defun select-benches (fn-names)
(mapcar (lambda (name)
(assoc (intern (symbol-name name) :lparallel-bench)
(assoc (intern (symbol-name name) :lparallel/bench)
*benches*))
fn-names))

Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
book
5 changes: 5 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[book]
authors = ["James M. Lawrence"]
language = "en"
src = "src"
title = "lparallel"
Loading