1
2
3
4
5
6
7 import Ganga.Utility.logging
8 logger = Ganga.Utility.logging.getLogger()
9
11 """ The RuntimeHandler is a connector between the application and the backend.
12
13 Application configure methods produce appconfig objects. Backend submit method
14 consumes the jobconfig object. RuntimeHandler translates the appconfig objects
15 into the jobconfig objects. The translation is a part of the job submission.
16 It is implemented by the prepare methods.
17
18 """
20 """ Prepare the shared/master aspect of the job submission.
21 Called once per job (both split and not-split). If the
22 preparation contains some expensive actions it may be factored
23 out in this method.
24
25 Return value:
26 - jobmasterconfig object understood by backend
27
28 Arguments:
29 - app : original application object
30 - appmaster config : result of app.master_configure()
31
32 """
33 return None
34
35 - def prepare(self,app,appsubconfig,appmasterconfig,jobmasterconfig):
36
37 """ Prepare the specific/subjob aspect of the job submission.
38 Called once per subjob if splitting enabled. If splitting
39 disabled called exactly once (the master and specific aspect
40 configured on the same job).
41
42 Return value:
43 - subjobconfig list of objects understood by backends
44
45 Arguments:
46 - app : original application object
47 - appmaster config : result of app.master_configure()
48
49 - appsubconfig : a list of results of app.configure() for each subjob
50 (or a master job if no splitting)
51 - jobmasterconfig : a result of self.master_prepare()
52 """
53
54 raise NotImplementedError
55