File: __init__.py

package info (click to toggle)
python-scientific 2.8-1.2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 6,456 kB
  • ctags: 7,038
  • sloc: python: 16,436; ansic: 4,379; makefile: 135; sh: 18; csh: 1
file content (43 lines) | stat: -rw-r--r-- 1,625 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
High-level parallelization constructs based on the Bulk Synchronous
Parallel (BSP) model.

Parallelization requires a low-level communications library, which can
be either BSPlib or MPI. Programs must be run with the bsppython or
mpipython executables in order to use several processors. When run
with a standard Python interpreter, only one processor is available.

A warning about object identity: when a communication operation
transmits a Python object to the same processor, the object in the
return list can either be the sent object or a copy of it. Application
programs thus should not make any assumptions about received objects
being different from sent objects.

@undocumented: RemoteObjects
@undocumented: Tasks
@undocumented: core
"""

from core import numberOfProcessors, processorID, ParValue, ParConstant, \
     ParData, ParSequence, ParRootSequence, ParMessages, ParTuple, \
     ParAccumulator, ParFunction, ParRootFunction, ParIndex, ParIterator, \
     ParIndexIterator, ParClass, ParBase, ParInvalid, is_invalid

import sys
if sys.modules.has_key('epydoc'):
    import core, types
    imported_names = dir()
    core_name = core.__name__
    for name in dir(core):
        if name not in imported_names:
            continue
        object = getattr(core, name)
        if isinstance(object, type) or type(object) == types.ClassType:
            setattr(object, '__module__', 'Scientific.BSP')
        elif type(object) == types.FunctionType:
            object.func_globals['__name__'] = 'Scientific.BSP'
    core.__name__ = core_name
    del types
    del core_name
    del imported_names
del sys