ganga.GangaCore.Lib.Splitters.ArgSplitter module

Split job by changing the args attribute of the application.

This splitter only applies to the applications which have args attribute (e.g. Executable, Root), or those with extraArgs (GaudiExec). If an application has both, args takes precedence. It is a special case of the GenericSplitter.

This splitter allows the creation of a series of subjobs where the only difference between different jobs are their arguments. Below is an example that executes a ROOT script ~/analysis.C

void analysis(const char* type, int events) {
std::cout << type << ” ” << events << std::endl;

}

with 3 different sets of arguments.

s = ArgSplitter(args=[[‘AAA’,1],[‘BBB’,2],[‘CCC’,3]]) r = Root(version=’5.10.00’,script=’~/analysis.C’) j.Job(application=r, splitter=s)

Notice how each job takes a list of arguments (in this case a list with a string and an integer). The splitter thus takes a list of lists, in this case with 3 elements so there will be 3 subjobs.

Running the subjobs will produce the output: subjob 1 : AAA 1 subjob 2 : BBB 2 subjob 3 : CCC 3

ganga.GangaCore.Lib.Splitters.ArgSplitter.const_lock

This is a context manager which acquires the const write lock on the object’s root object.

This lock acquires exclusive access over an object tree to prevent it from changing. Reading schema attributes on the object is still allowed but changing them is not. Only one thread can hold this lock at once.