/[escript]/branches/split/escriptcore/py_src/splitworld.py
ViewVC logotype

Contents of /branches/split/escriptcore/py_src/splitworld.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4734 - (show annotations)
Mon Mar 10 06:38:54 2014 UTC (3 years, 9 months ago) by jfenwick
File MIME type: text/x-python
File size: 2657 byte(s)
Run skeleton jobs with no params.
1 ##############################################################################
2 #
3 # Copyright (c) 2014 by University of Queensland
4 # http://www.uq.edu.au
5 #
6 # Primary Business: Queensland, Australia
7 # Licensed under the Open Software License version 3.0
8 # http://www.opensource.org/licenses/osl-3.0.php
9 #
10 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
11 # Development 2012-2013 by School of Earth Sciences
12 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
13 #
14 ##############################################################################
15
16 __copyright__="""Copyright (c) 2014 by University of Queensland
17 http://www.uq.edu.au
18 Primary Business: Queensland, Australia"""
19 __license__="""Licensed under the Open Software License version 3.0
20 http://www.opensource.org/licenses/osl-3.0.php"""
21 __url__="https://launchpad.net/escript-finley"
22
23 __author__="Joel Fenwick"
24
25 """
26 This module contains the Python side of the SplitWorld functionality.
27
28 :var __author__: name of author
29 :var __copyright__: copyrights
30 :var __license__: licence agreement
31 :var __url__: url entry point on documentation
32 :var __version__: version
33 :var __date__: date of the version
34 """
35
36 import warnings
37 warnings.simplefilter('default', category=DeprecationWarning)
38
39 from . import escriptcpp as escore
40
41 class Job:
42 """
43 Describes a sequence of work to be carried out in a subworld.
44 The instances of this class used in the subworlds will
45 be constructed by the system.
46 The majority of the work done by the Job will be in the
47 *overloaded* work() method
48 """
49
50 def __init__(self, domain, id):
51 """
52 :var domain: Domain to be used as the basis for all ``Data`` and PDEs in this Job.
53 :var id: sequence number of this job [0, number of jobs-1]
54 :type id: Positive ``int``
55 """
56 self.domain=domain
57 self.id=id
58 self.incrates={}
59 self.outcrates={}
60
61 # Now does this take a crate / hamper / ....
62 # There is the issue of only wanting to put in values for initial set up
63 # and so merge is not required
64 def setImportValue(self, name, v):
65 """
66 Use to make a value available to the job (ie called from outside the job)
67 :var name: label used to identify this import
68 :type name: ``str``
69 :var v: value to be imported
70 :type v: crate
71 """
72 pass
73
74
75 def getExportValue(self, name):
76 """
77 get value exported by work()
78 """
79 pass
80
81
82
83 def work(self):
84 """
85 Need to be overloaded for the job to actually do anthing.
86 A return value of True, indicates this job thinks it is done.
87 A return value of False indicates work still to be done
88 """
89 return True

  ViewVC Help
Powered by ViewVC 1.1.26