Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
z
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
GitLab
LXR
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
InnerDetector
InDetExample
InDetBeamSpotExample
www
JobDetails.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2
3
from
__future__
import
print_function
4
5
"""
6
ATLAS beam spot web page for displaying details of beam spot jobs.
7
"""
8
9
__author__ =
'Juerg Beringer'
10
__version__ =
'JobDetails.py atlas/athena'
11
12
from
BeamSpotWebPage
import
BeamSpotWebPage
13
from
InDetBeamSpotExample.TaskManager
import
*
14
from
InDetBeamSpotExample.Utils
import
fileListSnippet
15
from
InDetBeamSpotExample.Utils
import
blankIfNone
16
import
time
17
18
error =
"""\
19
<div class="errormsg">
20
%s
21
</div>
22
"""
23
24
tableRow =
'<tr><td class="header">%s</td><td>%s</td></tr>\n'
25
tableRowStatus =
'<tr><td class="header">%s</td><td class="%s">%s</td></tr>\n'
26
27
tableSorter =
"""\
28
<script type="text/javascript" src="../js/jquery-latest.js"></script>
29
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
30
<script type="text/javascript" id="js">
31
$(document).ready(function() {
32
$("table").tablesorter({
33
headers: { 0: { sorter: "shortDate" } },
34
sortList: [[0,1]]
35
});
36
});
37
</script>
38
"""
39
40
tableHeader =
"""<table cellspacing="0" class="tablesorter">
41
<thead>
42
<tr>
43
<th>Job</th>
44
<th>Status</th>
45
<th>Exit code</th>
46
<th>Files</th>
47
</tr>
48
</thead>
49
<tbody>
50
"""
51
52
53
class
JobDetails
(
BeamSpotWebPage
):
54
55
def
__init__
(self):
56
BeamSpotWebPage.__init__(self)
57
self.
pageConfig
[
'pageTitle'
] =
'ATLAS Beam Spot Job Details'
58
self.
addToPageHeader
(tableSorter)
59
60
def
content
(self,**args):
61
if
not
'd'
in
args:
62
return
error % (
'CONFIGURATION ERROR: No data set name specified'
)
63
if
not
't'
in
args:
64
return
error % (
'CONFIGURATION ERROR: No task name specified'
)
65
with
TaskManager(self.
globalConfig
[
'taskDb'
])
as
taskman:
66
t = taskman.getTaskDict(args[
'd'
],args[
't'
])
67
if
not
t:
68
return
error % (
'ERROR: Task %s/%s not found'
% (args[
'd'
],args[
't'
]))
69
70
p =
'<div class="text"><h3>Summary for task %s/%s (task id %s):</h3></div>\n'
% (args[
'd'
],args[
't'
],t[
'TASKID'
])
71
p +=
'<table>\n'
72
p += tableRow % (
'Dataset name'
,t[
'DSNAME'
])
73
p += tableRow % (
'Run number'
,
blankIfNone
(t[
'RUNNR'
]))
74
p += tableRow % (
'Task name'
,t[
'TASKNAME'
])
75
stat = t[
'STATUS'
]
76
p += tableRowStatus % (
'Task status'
,
getStatusClass
(stat),
getKey
(TaskManager.StatusCodes,stat))
77
p += tableRow % (
'On-disk status'
,
getKey
(TaskManager.OnDiskCodes,t[
'ONDISK'
]))
78
p += tableRow % (
'Template'
,t[
'TEMPLATE'
])
79
p += tableRow % (
'Postprocessing steps'
,t[
'TASKPOSTPROCSTEPS'
])
80
p += tableRow % (
'ATLAS release'
,t[
'ATLREL'
])
81
p += tableRow % (
'# result files'
,t[
'NRESULTFILES'
])
82
p += tableRow % (
'Result files'
,
fileListSnippet
(t[
'RESULTFILES'
],t[
'DSNAME'
],t[
'TASKNAME'
],self.
globalConfig
[
'jobDir'
]))
83
p += tableRow % (
'Result links'
,t[
'RESULTLINKS'
])
84
cooltags = t[
'COOLTAGS'
]
or
''
85
p += tableRow % (
'COOL tags'
,
'<br>'
.
join
(cooltags.split()))
86
p += tableRow % (
'# jobs'
,t[
'NJOBS'
])
87
p += tableRow % (
'# jobs submitted'
,t[
'NJOBS_SUBMITTED'
])
88
p += tableRow % (
'# jobs running'
,t[
'NJOBS_RUNNING'
])
89
p += tableRow % (
'# jobs postprocessing'
,t[
'NJOBS_POSTPROC'
])
90
p += tableRow % (
'# jobs failed'
,t[
'NJOBS_FAILED'
])
91
p += tableRow % (
'# jobs completed'
,t[
'NJOBS_COMPLETED'
])
92
p += tableRow % (
'Comment'
,t[
'TASKCOMMENT'
])
93
p += tableRow % (
'Created'
,
'%s by %s on host %s'
% (time.ctime(t[
'CREATED'
]),t[
'CREATED_USER'
],t[
'CREATED_HOST'
]))
94
p += tableRow % (
'Last update'
,time.ctime(t[
'UPDATED'
]))
95
p +=
'</table>\n'
96
97
p +=
'<div class="text"><h3>Job details (may be more up-to-date than summary data above):</h3></div>\n'
98
p += tableHeader;
99
a = JobAnalyzer(self.
globalConfig
[
'jobDir'
],t[
'DSNAME'
],t[
'TASKNAME'
])
100
for
j
in
a.jobList():
101
p +=
"<tr>"
102
p +=
"<td>%s</td>"
% (j)
103
(stat,exitcode) = a.jobStatus(j)
104
p +=
'<td class="%s">%s</td>'
% (
getStatusClass
(stat),
getKey
(TaskManager.StatusCodes,stat))
105
p +=
"<td>%s</td>"
% (exitcode)
106
p +=
'<td><a href="../files?u=%s/%s/%s">Files</a></td>'
%(t[
'DSNAME'
],t[
'TASKNAME'
],j)
107
p +=
"</tr>\n"
108
p +=
"</tbody></table>\n"
109
return
p
110
111
112
# Code to test or run locally
113
if
__name__ ==
'__main__'
:
114
p =
JobDetails
()
115
print
(p.index())
WebPage.WebPage.globalConfig
globalConfig
Definition:
WebPage.py:290
WebPage.WebPage.addToPageHeader
def addToPageHeader(self, snippet)
Definition:
WebPage.py:320
JobDetails.JobDetails.content
def content(self, **args)
Definition:
JobDetails.py:60
TaskManager
python.Utils.fileListSnippet
def fileListSnippet(files, dsName, taskName, jobDir=None)
Definition:
InnerDetector/InDetExample/InDetBeamSpotExample/python/Utils.py:30
python.Utils.blankIfNone
def blankIfNone(s)
Definition:
InnerDetector/InDetExample/InDetBeamSpotExample/python/Utils.py:41
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition:
Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
JobDetails.JobDetails.__init__
def __init__(self)
Definition:
JobDetails.py:55
python.TaskManager.getStatusClass
def getStatusClass(status)
Definition:
TaskManager.py:53
pool::getKey
std::string getKey(const std::string &key, const std::string &encoded)
JobDetails.JobDetails
Definition:
JobDetails.py:53
WebPage.WebPage.pageConfig
pageConfig
Definition:
WebPage.py:273
BeamSpotWebPage.BeamSpotWebPage
Definition:
BeamSpotWebPage.py:47
Generated on Mon Mar 31 2025 21:13:05 for ATLAS Offline Software by
1.8.18