|
ATLAS Offline Software
|
|
def | getRunLumiInfoFragment (jobnumber, task, maxEvents, totalEvents, skipEvents, sequentialEventNumbers=False) |
|
def | getRandomlySampledRunLumiInfoFragment (jobnumber, task, maxEvents, totalEvents, skipEvents, sequentialEventNumbers=False) |
|
def | getFragment (jobnumber, task, maxEvents) |
|
def | findPlaceInTask (jobnumber, task, maxEvents) |
|
def | taskLookupTable (task) |
|
def | defineSequentialEventNumbers (jobnumber, fragment, totalEvents, skipEvents) |
|
◆ defineSequentialEventNumbers()
def python.RunDependentMCTaskIterator.defineSequentialEventNumbers |
( |
|
jobnumber, |
|
|
|
fragment, |
|
|
|
totalEvents, |
|
|
|
skipEvents |
|
) |
| |
Calculate sequential event numbers for the defined getFragment.
Definition at line 164 of file RunDependentMCTaskIterator.py.
165 """ Calculate sequential event numbers for the defined getFragment.
168 evt_nbr = jobnumber * totalEvents + skipEvents
170 for i
in range(t[
'evts']):
175 'starttstamp': t[
'starttstamp'],
◆ findPlaceInTask()
def python.RunDependentMCTaskIterator.findPlaceInTask |
( |
|
jobnumber, |
|
|
|
task, |
|
|
|
maxEvents |
|
) |
| |
Get the 'i'th job in the task, where each job tries to do maxEvents events.
The 'force_new' flag in the LB list ends the task before that LB, ignoring maxEvents.
Returns a taskIterator. Can raise StopIteration, so you should nest in try.
Definition at line 91 of file RunDependentMCTaskIterator.py.
92 """ Get the 'i'th job in the task, where each job tries to do maxEvents events.
93 The 'force_new' flag in the LB list ends the task before that LB, ignoring maxEvents.
94 Returns a taskIterator. Can raise StopIteration, so you should nest in try.
96 jobnumber =
max(
int(jobnumber),0)
97 i, jobs = (0,taskIterator(task,maxEvents))
99 if (i == jobnumber):
return jobs
◆ getFragment()
def python.RunDependentMCTaskIterator.getFragment |
( |
|
jobnumber, |
|
|
|
task, |
|
|
|
maxEvents |
|
) |
| |
Calculate the specific configuration of the current job in the digi task.
Definition at line 80 of file RunDependentMCTaskIterator.py.
81 """ Calculate the specific configuration of the current job in the digi task.
85 raise IndexError(
'There are only %i jobs in this task (not %i).' % (len([1
for i
in taskIterator(task,maxEvents)]) + 1,jobnumber + 1))
◆ getRandomlySampledRunLumiInfoFragment()
def python.RunDependentMCTaskIterator.getRandomlySampledRunLumiInfoFragment |
( |
|
jobnumber, |
|
|
|
task, |
|
|
|
maxEvents, |
|
|
|
totalEvents, |
|
|
|
skipEvents, |
|
|
|
sequentialEventNumbers = False |
|
) |
| |
Calculate the specific configuration of the current job in the digi
task. Sample the mu values randomly.
Definition at line 42 of file RunDependentMCTaskIterator.py.
43 """Calculate the specific configuration of the current job in the digi
44 task. Sample the mu values randomly.
47 random.seed(jobnumber)
51 max_index = len(lookup_table) - 1
55 evt_nbr = jobnumber * totalEvents + skipEvents
56 for i
in range(maxEvents):
59 index = lookup_table[random.randint(0, max_index)]
65 'starttstamp': t[
'starttstamp'],
71 item[
'force_new'] = t[
'force_new']
73 if sequentialEventNumbers:
74 item[
'evt_nbr'] = evt_nbr
78 return sorted(new_frag, key=itemgetter(
'run',
'starttstamp'))
◆ getRunLumiInfoFragment()
def python.RunDependentMCTaskIterator.getRunLumiInfoFragment |
( |
|
jobnumber, |
|
|
|
task, |
|
|
|
maxEvents, |
|
|
|
totalEvents, |
|
|
|
skipEvents, |
|
|
|
sequentialEventNumbers = False |
|
) |
| |
Calculate the specific configuration of the current job in the digi
task. Try to make each fragment utilize the same amount of CPU and
Cache resources. Exploits the fact that the task when sorted by
mu value will have long finishing pieces near the beginning and
short pieces near the end. A more even solution is obtained by
pairing chunks of maxEvents/2 from the beginning and end of the
sorted task.
Definition at line 14 of file RunDependentMCTaskIterator.py.
15 """Calculate the specific configuration of the current job in the digi
16 task. Try to make each fragment utilize the same amount of CPU and
17 Cache resources. Exploits the fact that the task when sorted by
18 mu value will have long finishing pieces near the beginning and
19 short pieces near the end. A more even solution is obtained by
20 pairing chunks of maxEvents/2 from the beginning and end of the
23 hiMaxEvents,loMaxEvents=0,0
25 hiMaxEvents=loMaxEvents=
int(maxEvents/2)
27 hiMaxEvents=
int((maxEvents-1)/2)
28 loMaxEvents=
int((maxEvents+1)/2)
32 hi_mu_frag=
getFragment(jobnumber,
sorted(task,key=
lambda job: job[
'mu'],reverse=
True),hiMaxEvents)
34 lo_mu_frag=
getFragment(jobnumber,
sorted(task,key=
lambda job: job[
'mu']),loMaxEvents)
36 fragment=
sorted(
sum([hi_mu_frag,lo_mu_frag],[]),key=
lambda job: job[
'run'])
37 if sequentialEventNumbers:
◆ taskLookupTable()
def python.RunDependentMCTaskIterator.taskLookupTable |
( |
|
task | ) |
|
Generate task lookup table
Definition at line 155 of file RunDependentMCTaskIterator.py.
156 """ Generate task lookup table
159 for i, item
in enumerate(task):
160 for k
in range(item[
'evts']):
def findPlaceInTask(jobnumber, task, maxEvents)
def taskLookupTable(task)
def getFragment(jobnumber, task, maxEvents)
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
def defineSequentialEventNumbers(jobnumber, fragment, totalEvents, skipEvents)
def getRandomlySampledRunLumiInfoFragment(jobnumber, task, maxEvents, totalEvents, skipEvents, sequentialEventNumbers=False)
def getRunLumiInfoFragment(jobnumber, task, maxEvents, totalEvents, skipEvents, sequentialEventNumbers=False)