1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 """
21 High-level parallelisation with PVM.
22
23 Python jobs can be distributed from a TrackingJobMaster to many
24 JobSlaves running on different machines. The general mechanism is shown in
25 ExampleMaster.py and ExampleSlave.py
26
27 The package depends on the pypvm_core c-library which has to be compiled
28 in the package directory. With Python versions >= 2.3, platform specific
29 compilations can be placed in subfolders. The name of this folder should
30 be assembled from: 'py' + version + '_' + platform.machine()
31 Where platform is a python module available since Python 2.3.
32 See Biskit.tools.platformFolder!
33
34 The compilation of pypvm_core can be tricky on some architectures. In order
35 to support installations that don't need parallelisation, only a warning is
36 issued if pypvm_core is missing and the public classes are exported as
37 Pseudo-classes. Pseudo classes are empty and raise an ImportError when you
38 try to initialize them. See also L{Biskit.tools.tryImport}.
39 """
40
41
42
43
44
45 try:
46 import Biskit.tools as T
47
48 __path__.insert( 0, T.platformFolder( __path__[0] ) )
49
50 except ImportError, why:
51 pass
52
53
54
55
56 from Biskit import EHandler
57 r = True
58
59 r = T.tryImport( 'TrackingJobMaster', 'TrackingJobMaster', namespace=globals())
60 r = T.tryImport( 'dispatcher', 'JobSlave', namespace=globals() ) and r
61
62 if not r:
63 EHandler.warning('Could not import PVM modules.'+
64 ' Please check that the pypvm_core library is compiled!\n'+
65 '\tParallelisation is not available.')
66
67
68
69
70 del r, EHandler
71