1
2
3
4
5
6
7 from Ganga.GPIDev.Adapters.ISplitter import ISplitter
8 from Ganga.GPIDev.Schema import *
9
11
12 """
13 Split job by changing the args attribute of the application.
14
15 This splitter only applies to the applications which have args attribute (e.g. Executable, Root).
16 It is a special case of the GenericSplitter.
17
18 This splitter allows the creation of a series of subjobs where
19 the only difference between different jobs are their
20 arguments. Below is an example that executes a ROOT script ~/analysis.C
21
22 void analysis(const char* type, int events) {
23 std::cout << type << " " << events << std::endl;
24 }
25
26 with 3 different sets of arguments.
27
28 s = ArgSplitter(args=[['AAA',1],['BBB',2],['CCC',3]])
29 r = Root(version='5.10.00',script='~/analysis.C')
30 j.Job(application=r, splitter=s)
31
32 Notice how each job takes a list of arguments (in this case a list
33 with a string and an integer). The splitter thus takes a list of
34 lists, in this case with 3 elements so there will be 3 subjobs.
35
36 Running the subjobs will produce the output:
37 subjob 1 : AAA 1
38 subjob 2 : BBB 2
39 subjob 3 : CCC 3
40 """
41 _name = "ArgSplitter"
42 _schema = Schema(Version(1,0), {
43 'args' : SimpleItem(defvalue=[],typelist=['list','Ganga.GPIDev.Lib.GangaList.GangaList.GangaList'],sequence=1,checkset='_checksetNestedLists',doc='A list of lists of arguments to pass to script')
44 } )
45
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94