Sharedwww / msri07 / plan.txtOpen in CoCalc
Author: William A. Stein
1= SEP 2: Parallelization Plans For SAGE =
2
3This is a SAGE enhancement proposal.
4
5AUTHOR: William Stein
7
8The core SAGE library is a collection of Python and sagex files.
9
10== Basic Principles ==
11
12Many of these are motivated by my (Stein's) perspective as the '''maintainer''' and integrated of SAGE, and recruiter of new developers...
13
14  1. Parallel methods should always be viewed as a means to an end -- speedups.  Never parallelize any computation except to speed up a calculation beyond what can be done using sequential techniques.
15  2. Parallel methods should never completely replace sequential implementations.  Parallel algorithms are often very complicated to understand and test, so we need to at a ''minimum'' have a randomized test function that compares with that output of purely sequential code.
16  3. Do not write insanely complicated parallel code that nobody can understand or maintain.  Because SAGE is an open source system that is widely developed, it is ''crucial'' that it be readable.
17  4. It is *crucial* that implementation of parallel methods in SAGE have the following properties:
18      * It can be done incrementally.  One must be able to start with almost any specific operation or algorithm in SAGE and make a parallel version without having to drastically change code all over SAGE.  Any proposed solutions that violate this fail our needs.
19      * It doesn't depend on any libraries or tools that are not open source and free, and all dependencies must work on the SAGE target platforms: Linux, OS X, Windows, (and soon Solaris).
20      * For any core tools that are needed must be made part of SAGE.
21
22== Architecture ==
23
24There are three levels to consider.
25
26=== 1. Low -- shared memory (mostly multicore desktop/laptop) ===
27
29
30Justification:
31   * pthread is available on all target platforms and is well supported
32   * mature
33   * with some thought I think we can make it usable from sagex
34
35Design issues:
36   * Have a global variable nthreads
37
38Alternative tool: multiple processes and a shared memory segment
39   * via UPC -- heavy and hard to build (??)  maybe not right for us, because it's mainly for rather uniform computations.
40   * via shared pages -- might not be fast enough.
41
42
43=== 2. Middle -- homogeneous trusted cluster ===
44
45Proposed tool: ipython1 (with mpi)
46
47Justification:
48  * This is the hardware that the ipython developers use.
49  * It's written in Python, well tested, and will be included in SAGE anyways.
50
51=== 3. High -- heterogenous task farm (both trusted and untrusted) ===
52
53Proposed tool: dsage
54
55Justification:
56  * Written in Python to address specific problems we have.
57
58
59
60