<commit_before>{% extends "_base_core.html" %}{% load url from future %}

{% load staticfiles %}
{% block page_title %} {{ jeditaskid }} ES task {% endblock %}
{% block title %} <a href="{% url 'index' %}">{{ viewParams.MON_VO }} PanDA monitor</a>{% endblock %}
{% block subtitle %}PanDA Event Service task {{ jeditaskid }} at {{ task.site }} {% endblock %}

{% block body %}

{% if columns %}

<table>
<tr bgcolor='lightcyan'><th colspan=20> Event Service Task {{ jeditaskid }} at site <a href="{% url 'siteInfo' task.site %}">{{ task.site }}</a> </th></tr>
<tr bgcolor='lightcyan'>
	<th>Task ID</th>
    {% if task.deftreqid %} <th> Request </th> {% endif %}
	{% if task.reqid != task.jeditaskid and not task.deftreqid %}<th>Jobset</th>{% endif %}
	<th>Type</th>
	<th>Processing type</th>
	<th>Transform</th>
	<th>User</th>
	{% if task.campaign %} <th> Campaign </th> {% endif %}
	<th>Task status </th>{% if task.superstatus %} {% if task.superstatus != task.status %}<th> Detailed JEDI status </th>{% endif %} {% endif %}
{% if task.dsinfo %}
    <th> Nevents | <span class='finished'>used</span> </th>
    <th style="white-space: nowrap">HS06*sec<br> Expected<br> Total<br><span class='done'>done</span><br> <span class='failed'>failed</span></th>
    <th> Ninputfiles | <span class='finished'>finished</span> | <span class='failed'>failed</span> </th>
{% endif %}
	<th>Created</th>
	<th>Modified</th>
	<th>Cores</th>
	<th>Priority</th>
	{% if task.ticketid %} <th>Tracker</th> {% endif %}
</tr>
	<tr>
		<td><a href="{% url 'taskInfo' task.jeditaskid %}">{{ task.jeditaskid }}</a></td>
        {% if task.deftreqid %} <td> <a href="https://prodtask-dev.cern.ch/prodsys/prodtask/inputlist_with_request/{{task.deftreqid}}/">{{task.deftreqid}}</a> </td> {% endif %}
		{% if task.reqid != task.jeditaskid and not task.deftreqid %}<td>{{ task.reqid }}</td>{% endif %}
		<td>{{ task.tasktype }}</td>
		<td>{% if task.processingtype %} {{ task.processingtype }} {% endif %} </td>
		<td> {{ task.transpath }} </td>
		<td><a href="{% url 'taskList' %}?username={{ task.username }}">{{ task.username }}</a></td>
		{% if task.campaign %} <td><a href='/tasks/?campaign={{ task.campaign }}'>{{ task.campaign }}</a></td> {% endif %}
		<td class='{{task.status}}_fill'>{% if task.superstatus %}<b><a href="https://twiki.cern.ch/twiki/bin/view/PanDA/PandaJEDI#Transition_of_task_status">{{ task.superstatus }}</a></b> {% if task.superstatus != task.status %}<td class='{{task.status}}'><a href="https://twiki.cern.ch/twiki/bin/view/PanDA/PandaJEDI#Transition_of_task_status">{{ task.status }}</a></td>{% endif %} {% else %}<a href="https://twiki.cern.ch/twiki/bin/view/PanDA/PandaJEDI#Transition_of_task_status">{{ task.status }}</a>{% endif %}</td>

{% if task.dsinfo %}
        <td> {{task.totev}} |
            <span class='finished'>{{task.totevproc}} ({{task.pctfinished}}%)</span></td>
        <td style="text-align:right;"> {{task.totevhs06}}<br>{{task.currenttotevhs06}}<br><span class='finished'>{{task.totevprochs06}}</span> <br> <span class='failed'>{{task.failedevprochs06}}</span></td>
        <td> {{task.dsinfo.nfiles}} |
            <span class='finished'>{{task.dsinfo.nfilesfinished}} ({{task.dsinfo.pctfinished}}%)</span> {% if task.dsinfo.nfilesfailed > 0 %} | <span class='failed'>{{task.dsinfo.nfilesfailed}} ({{task.dsinfo.pctfailed}}%)</span>  {% endif %} </td>
{% endif %}

		<td>{{ task.creationdate|date:"Y-m-d H:i" }}</td>
		<td>{{ task.modificationtime|date:"m-d H:i" }}</td>
		<td>{{ task.corecount }}</td>
		<td>{{ task.taskpriority }}</td>
{% if task.ticketid %}
        <td><a href="https://its.cern.ch/jira/browse/{{ task.ticketid }}">{{ task.ticketsystemtype }}</a></td>
{% endif %}
	</tr>
</table>

<p>
{% if requestParams.mode and requestParams.mode == 'nodrop' %}
    <a style="cursor: pointer;" href="{{nomodeurl}}mode=drop">Switch to drop mode</a>
{% else%}
    <a style="cursor: pointer;" href="{{nomodeurl}}mode=nodrop">Switch to nodrop mode</a>
{% endif %}

{% if vomode == 'atlas' %}
    {%  if task.tasktype == 'prod' %}
        &emsp;<a href="https://prodtask-dev.cern.ch/prodtask/task_manage/#/?time_period=custom&task_type=production&task_id={{ task.jeditaskid }}" target="_blank">Prod Task view</a>
    {% endif %}
{% endif %}

<script type="text/javascript">
function toggleDetailDisplay(className) {
   el = document.getElementsByClassName(className);
   for (i=0; i<el.length; i++) {
     el[i].style.display = (el[i].style.display=="none") ? "" : "none";
   }
}

function killtasks(taskID, action) {
    var message = ''
    if (action == 0)
        message = 'Are you sure you want to FINISH this task?'
    else
        message = 'Are you sure you want to ABORT this task?'
    if (confirm(message)) {
        $.ajax({
            url: {% url 'killtasks' %},
            data: {'task': taskID, 'action': action},
            async: true
        })
            .done(function (response) {
                var parcedResponse = $.parseJSON(response);
                alert(parcedResponse.detail);
                location.reload();
            });
    } else {
        // Do nothing!
    }
}

</script>

<p>

{% if showtaskprof == True %}
    <a href="{% url 'taskprofileplot' %}?jeditaskid=" target="_blank">Open Task Profile</a>&emsp;
    <a href="{% url 'taskesprofileplot' %}?jeditaskid={{ task.jeditaskid }}" target="_blank">Events Processing Profile (Not dropped finished jobs)</a>&emsp;
{% endif %}

<a href="{% url 'ganttTaskChain' %}?jeditaskid={{ task.jeditaskid }}" target="_blank">Open Task Chain</a>&emsp;

<a style="cursor: pointer;" onclick="javascript:toggleDetailDisplay('nevents_plot');">Show number of events distribution plot</a>&emsp;

<a style="cursor: pointer;" onclick="javascript:toggleDetailDisplay('d3splot');">Show/hide plots</a>&emsp;

<a href="http://atlas-kibana.mwt2.org:5601/app/kibana#/dashboard/BP_a_task?_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:'{{ task.kibanatimefrom }}',mode:absolute,to:'{{ task.kibanatimeto }}'))&_a=(filters:!(),options:(darkTheme:!t),panels:!((col:1,id:BP_Walltime_all_jobs,panelIndex:1,row:1,size_x:6,size_y:3,type:visualization),(col:7,id:BP_Walltime_failed_jobs,panelIndex:2,row:1,size_x:6,size_y:3,type:visualization),(col:1,id:BP_MAX_PSS_all_jobs,panelIndex:3,row:4,size_x:6,size_y:3,type:visualization),(col:7,id:BP_MAX_PSS_failed_jobs,panelIndex:4,row:4,size_x:6,size_y:3,type:visualization),(col:1,id:BP_MAX_PSS_per_core_all_jobs,panelIndex:5,row:7,size_x:6,size_y:3,type:visualization),(col:7,id:BP_MAX_PSS_per_core_failed_jobs,panelIndex:6,row:7,size_x:6,size_y:3,type:visualization)),query:(query_string:(analyze_wildcard:!t,lowercase_expanded_terms:!f,query:'jeditaskid:{{ task.jeditaskid }}')),title:BP_a_task,uiState:(P-1:(spy:(mode:(fill:!f,name:!n)),vis:(legendOpen:!t))))" target="_blank">  Corresponding dashboard in Kibana</a>&emsp;

{% if request.session.IS_TESTER == True %}
    {% with 'done finished failed ready broken aborted defined' as finalstatelist %}
    {% if not task.status in finalstatelist %}
        <a style="margin-left: 10em;" onclick="javascript:killtasks({{ task.jeditaskid }}, 0);" class='failed'>Finish</a>
        <a style="margin-left: 2em;" onclick="javascript:killtasks({{ task.jeditaskid }}, 1);" class='failed'>Abort</a>
    {% endif %}
    {% endwith %}
{% endif %}

 <p>


{% if  maxpss|length > 0 %} <div class="nevents_plot" id="plot0" style="align:left;display:none;"></div><br> {% endif %}

{% if  maxpss|length > 0 %} <div class="d3splot" id="plot1" style="float:left;display:none"></div> {% endif %}
{% if  walltime|length > 0 %} <div class="d3splot" id="plot2" style="float:left;display:none"></div> {% endif %}
{% if  maxpsspercore|length > 0 %} <div class="d3splot" id="plot5" style="float:left;display:none"></div> {% endif %}
{% if  hs06s|length > 0 %} <div class="d3splot" id="plot7" style="float:left;display:none"></div> {% endif %}
{% if  walltimeperevent|length > 0 %} <div class="d3splot" id="plot9" style="float:left;display:none"></div> {% endif %}
{% if  maxpssf|length > 0 %} <div class="d3splot" id="plot3" style="float:left;display:none"></div> {% endif %}
{% if  walltimef|length > 0 %} <div class="d3splot" id="plot4" style="float:left;display:none"></div> {% endif %}
{% if  maxpssfpercore|length > 0 %} <div class="d3splot" id="plot6" style="float:left;display:none"></div> {% endif %}
{% if  hs06sf|length > 0 %} <div class="d3splot" id="plot8" style="float:left;display:none"></div> {% endif %}

<script src="/static/js/d3jsplot.js"></script>
<script>
    var nevents = {{ nevents|safe }};
    if (nevents.length > 0) {pandamonProdRunTaskSumPlotFunc(nevents, "#plot0", "Number of events histogram (finished non-merge jobs)", 40, 'ES');}
    var values1 = {{ maxpss|safe }};
    var values2 = {{ walltime|safe }};
    var sites1 = {{ sitepss|safe }};
    var sites2 = {{ sitewalltime|safe }};
    var values3 = {{ maxpssf|safe }};
    var values4 = {{ walltimef|safe }};
    var sites3 = {{ sitepssf|safe }};
    var sites4 = {{ sitewalltimef|safe }};
    {#Maxpsspercore, sites is the same as for maxpss#}
    var values5 = {{ maxpsspercore|safe }};
    var values6 = {{ maxpssfpercore|safe }};
    {#HS06s, sites is the same as for walltime#}
    var values7 = {{ hs06s|safe }};
    var values8 = {{ hs06sf|safe }};
    var values9 = {{ walltimeperevent|safe }};
    if (values1.length > 0) {pandamonplotFunc(values1, sites1, "#plot1", "Maximum PSS histogram", {% if  maxpss|length < 100 %} 10 {% else %} 100 {% endif %});}
    if (values3.length > 0) {pandamonplotFunc(values3, sites3, "#plot3", "Maximum PSS histogram (failed jobs)", {% if  maxpss|length < 20 %} 5 {% else %} 20 {% endif %});}
    if (values2.length > 0) {pandamonplotFunc(values2, sites2, "#plot2", "Walltime histogram", {% if  walltime|length < 100 %} 5 {% else %} 40 {% endif %});}
    if (values4.length > 0) {pandamonplotFunc(values4, sites4, "#plot4", "Walltime histogram (failed jobs)", {% if  walltime|length < 20 %} 5 {% else %} 20 {% endif %});}
    if (values5.length > 0) {pandamonplotFunc(values5, sites1, "#plot5", "Maximum PSS per core histogram", {% if  maxpsspercore|length < 100 %} 10 {% else %} 100 {% endif %});}
    if (values6.length > 0) {pandamonplotFunc(values6, sites3, "#plot6", "Maximum PSS per core histogram (failed jobs)", {% if  maxpssfpercore|length < 20 %} 5 {% else %} 20 {% endif %});}
    if (values7.length > 0) {pandamonplotFunc(values7, sites2, "#plot7", "HS06s histogram", {% if  hs06s|length < 100 %} 10 {% else %} 100 {% endif %});}
    if (values8.length > 0) {pandamonplotFunc(values8, sites4, "#plot8", "HS06s histogram (failed jobs)", {% if  hs06sf|length < 20 %} 5 {% else %} 20 {% endif %});}
    if (values9.length > 0) {pandamonplotFunc(values9, sites2, "#plot9", "Walltime per event histogram", {% if  walltimeperevent|length < 100 %} 5 {% else %} 40 {% endif %});}
 </script>






{% if jobsummary %}

<table>
<tr bgcolor="lightcyan"><th colspan=20>
<b>States of jobs in this task</b>   &nbsp; &nbsp; <a href="{% url 'jobList' %}?jeditaskid={{jeditaskid}}&eventservice=not2&display_limit=100">Show jobs</a>
</th></tr>
<tr>
{% for state in jobsummary %}
<td class="{{ state.name}}"> <b> {{ state.name }} </b> </td>
{% endfor %}
</tr><tr>
{% for state in jobsummary %}
<td {% if state.count > 0 %} class='{{state.name}}_fill' {% endif %}> {% if state.count > 0 %} <b> <a href="{% url 'jobList' %}?jeditaskid={{task.jeditaskid}}&jobstatus={{state.name}}{% ifequal requestParams.mode 'nodrop' %}&mode=nodrop{%  endifequal %}{% ifequal requestParams.mode 'drop' %}&mode=drop{%  endifequal %}&eventservice=not2&display_limit=100"><span class='{{state.name}}_fill'>{{ state.count }}</span></a> </b> {% endif %} </td>
{% endfor %}
</table>
{% endif %}

{% if jobsummaryESMerge %}

<table>
<tr bgcolor="lightcyan"><th colspan=20>
<b>States of es_merge jobs in this task</b>   &nbsp; &nbsp; <a href="{% url 'jobList' %}?jeditaskid={{jeditaskid}}&eventservice=2&display_limit=100">Show jobs</a>
</th></tr>
<tr>
{% for state in jobsummaryESMerge %}
<td class="{{ state.name}}"> <b> {{ state.name }} </b> </td>
{% endfor %}
</tr><tr>
{% for state in jobsummaryESMerge %}
<td {% if state.count > 0 %} class='{{state.name}}_fill' {% endif %}> {% if state.count > 0 %} <b> <a href="{% url 'jobList' %}?jeditaskid={{task.jeditaskid}}&jobstatus={{state.name}}{% ifequal requestParams.mode 'nodrop' %}&mode=nodrop{%  endifequal %}{% ifequal requestParams.mode 'drop' %}&mode=drop{%  endifequal %}&display_limit=100&eventservice=2"><span class='{{state.name}}_fill'>{{ state.count }}</span></a> </b> {% endif %} </td>
{% endfor %}
</table>
{% endif %}

{% if eventssummary|length > 0 %}
<script type="text/javascript">
    $(document).ready(function() {
        if ($(".showeventsdetailsrow").is(':visible'))
                $(".showeventsdetailsrow").hide();
    });
    function showEventsDetails(){
        if (!$(".showeventsdetailsrow").is(':visible')){
            $(".showeventsdetailsrow").show()}
        else {
            $(".showeventsdetailsrow").hide()}
    }
</script>
<table>
<tr bgcolor="lightcyan"><th colspan=20>
<b>States of events in this task</b>  {% if requestParams.mode and requestParams.mode == 'nodrop' %} <a style="cursor: pointer;" onclick="javascript:showEventsDetails();" href="#">  Show details</a> {% endif %} &nbsp
</th></tr>
<tr>
{% for state in eventssummary %}
<td> <span class="{{ state.statusname}}"><b> {{ state.statusname }} </b></span>
    <span class="showeventsdetailsrow">
    <br>
        {% if state.count > 0 %}
        <b>ComputingElement, ObjectStoreID : Nevents</b>
        {% endif %}
    </span>
</td>
{% endfor %}
</tr><tr>
{% for state in eventssummary %}
<td {% if state.count > 0 %} class='{{state.statusname}}_fill' {% endif %}> {% if state.count > 0 %}
    <b> <span class='{{state.statusname}}_fill'>
        {% if requestParams.mode == 'nodrop' and state.statusname == 'failed' and state.count > 0 %}
            <a onclick="javascript:loadErrorSummaryData('{{ jeditaskid }}');"> {{ state.count }} </a>
        {% else %} {{ state.count }}
        {% endif %}
    </span></b>
    {% endif %}
</td>
{% endfor %}</tr>
{% if ossummary|length > 0 %}
<tr class="showeventsdetailsrow" >
{% for state in eventssummary %}
    <td {% if state.count > 0 %} class='{{state.name}}_fill' {% endif %}>
    {% for osrow in ossummary %}
        {% if state.statusname == osrow.statusname %} {{ osrow.computingelement }}, {% if osrow.objectstoreid != None %} {{ osrow.objectstoreid }} {% else %} unknown {% endif %} : {{ osrow.nevents }} <br> {% endif %}
    {% endfor %}
    </td>
{% endfor %}
</tr>
{% endif %}
</table>
{% endif %}

<script type="text/javascript">
   function loadErrorSummaryData(jeditaskid) {

       $('#div-error-sum').html("<img src='{% static "images/load.gif" %}'>  ");
       $.ajax({
           url: {% url 'eventsErrorSummary' %},
           data: 'jeditaskid='+jeditaskid,
           async: true
       })
       .done(function (response) {
           $('#div-error-sum').html(response);
       });
   }
</script>

<p>
<div id="div-error-sum">

</div>
<p>

<p>
{% if task.errordialog %}
<table width=1000><tr><td bgcolor="#FFFBDA"><font color='brown'> <b>Logged status: {{ task.errordialog|safe }}</b></font></td></tr>
{% if logtxt %}
<tr><td>
<font size=-1><pre>
{{ logtxt }}
</pre></font>
</td></tr>
{% endif %}
</table>
{% endif %}

<table><tr>
<td bgcolor='lightcyan'><b> View: </b></td>

{% if jobsummary %}
<td>
<a href="{% url 'jobList' %}?jeditaskid={{jeditaskid}}{% ifequal requestParams.mode 'nodrop' %}&mode=nodrop{%  endifequal %}{% ifequal requestParams.mode 'drop' %}&mode=drop{%  endifequal %}&jobtype=eventservice&display_limit=100">job list (access to job details and logs)</a>
</td>
{% endif %}

{% if task.parent_tid != task.jeditaskid and task.parent_tid != None %}
<td>
parent task<a href="{% url 'taskInfo' task.parent_tid %}"> {{ task.parent_tid }}</a>
</td>
{% endif %}

<td>
<a href="{% url 'taskList' %}?parent_tid={{ task.jeditaskid }}&display_limit=100">child tasks</a>
</td>

{% if viewParams.MON_VO == 'ATLAS' %}
<td>
<a href="https://prodtask-dev.cern.ch/prodtask/task/{{ task.jeditaskid }}/">prodsys task page</a>
</td>
{% endif %}

<td>
<a href="{% url 'pandaLogger' %}?type={{ taskbrokerage }}&jeditaskid={{ jeditaskid }}&startdate={{ task.creationdate|date:"Y-m-d H:i:s" }}&enddate={{ task.modificationtime|date:"Y-m-d H:i:s" }}">brokerage lo
gger</a>
</td>

<td>
<a href="{% url 'pandaLogger' %}?category=panda.mon.jedi&jeditaskid={{ jeditaskid }}">JEDI action logger</a>
</td>

<td>
<a href="https://aianalytics01.cern.ch/#/discover?_g=(refreshInterval:(display:Off,pause:!f,section:0,value:0),time:(from:now-2d%2Fd,mode:relative,to:now))&_a=(columns:!('@message.module','@message.Type','@message.name','@message.levelname','@message.message'),index:%5Bpandalogger-%5DYYYY-MM-DD,interval:auto,query:(query_string:(analyze_wildcard:!t,lowercase_expanded_terms:!f,query:'@message.msg:%22jediTaskID%3D{{jeditaskid}}%20%22%20AND%20@message.Type:%22{{taskbrokerage}}%22')),sort:!('@timestamp',desc))">brokerage logger (es)</a>
</td>

<a href="{% url 'pandaLogger' %}?category=panda.mon.jedi&jeditaskid={{ jeditaskid }}">JEDI action logger</a>
<td><a href="https://aianalytics01.cern.ch/#/discover?_g=(refreshInterval:(display:Off,pause:!f,section:0,value:0),time:(from:now-2d%2Fd,mode:relative,to:now))&_a=(columns:!('@message.module','@message.Type','@message.name','@message.levelname','@message.message'),index:%5Bpandalogger-%5DYYYY-MM-DD,interval:auto,query:(query_string:(analyze_wildcard:!t,lowercase_expanded_terms
:!f,query:'@message.msg:%22jediTaskID%3D{{jeditaskid}}%22%20AND%20@message.name:%22panda.mon.jedi%22')),sort:!('@timestamp',desc))">JEDI action logger (es)</a>
</td>


<td>
<a href="{% url 'errorSummary' %}?jeditaskid={{jeditaskid}}">error summary</a>
</td>

</tr></table>

{% if inctrs %}
<table>
<tr bgcolor='lightcyan' >
	<th>Input containers</th>
</tr>
{% for dsrec in inctrs %}
	<tr>
		<td><font size=-1><a href="{% url 'datasetList' %}?containername={{ dsrec }}">{{ dsrec }}</a></font></td>
	</tr>
{% endfor %}
</table>
{% endif %}

{% if outctrs %}
<table>
<tr bgcolor='lightcyan' >
	<th>Output containers</th>
</tr>
{% for dsrec in outctrs %}
	<tr>
		<td><font size=-1><a href="{% url 'datasetList' %}?containername={{ dsrec }}">{{ dsrec }}</a></font></td>
	</tr>
{% endfor %}
</table>
{% endif %}

{% if datasets %}
<script type="text/javascript">    
function toggleRowsDisplay(className) {                                                                                                                                                                                    
   el = document.getElementsByClassName(className)
   for (i=0; i<el.length; i++) {   
     el[i].style.display = (el[i].style.display=="none") ? "" : "none";                                                                                           
   }
}   
</script>

<table>

{% if dstypes %}
<tr bgcolor='lightcyan'> <th colspan=20> 
{{ datasets|length }} datasets, show/hide by type:
&nbsp; <a style="cursor: pointer;" onclick="javascript:toggleRowsDisplay('type-all');">all</a>
{% for dst in dstypes %}
  &nbsp; <a style="cursor: pointer;" onclick="javascript:toggleRowsDisplay('type-{{ dst.type }}');">{{ dst.type }}({{ dst.count }})</a>
{% endfor %}
</th> </tr>
{% endif %}

<tr bgcolor='lightcyan' >
	<th>Dataset, container name</th>
	<th>Type</th>
	<th>Stream</th>
	<th>State</th>
	<th>Status</th>
	<th>Nfiles</th>
	<th>Created</th>
	<th>Modified</th>
</tr>

{% for dsrec in datasets %}
	<tr class="type-{{ dsrec.type }} type-all" style="display:all">
		<td><font size=-1><a href="{% url 'datasetInfo' %}?datasetname={{ dsrec.datasetname }}">{{ dsrec.datasetname }}</a></font></td>
		<td>{{ dsrec.type }}</td>
		<td>{{ dsrec.streamname }}</td>
		<td class='{{dsrec.state}}'>{{ dsrec.state }}</td>
		<td class='{{dsrec.status}}'>{{ dsrec.status }}</td>
		<td>{{ dsrec.nfiles }}</td>
		<td>{{ dsrec.creationtime|date:"Y-m-d H:i" }}</td>
		<td>{{ dsrec.modificationtime|date:"m-d H:i" }}</td>
	</tr>
{% endfor %}
</table>
</p>

{% else %}

No datasets were found for this task

{% endif %}

{% if sumd %}
<table>
{% for fdict in sumd %}
<tr><th> {{ fdict.field }} </th><td>
{% for item in fdict.list %}
{% if fdict.field == 'status' %} <span class='{{item.kname}}'> {% else %} <span> {% endif %}  {{ item.kname }} </span>
<a href="{{xurl}}{{fdict.field}}={{item.kname}}">({{ item.kvalue }})</a> &nbsp; 
{% endfor %}
</td></tr>
{% endfor %}
</table>
{% endif %}

{% if jobparams %}
<table>
<a name="jobparams"></a>
<tr bgcolor='lightcyan'><th colspan=20> Job parameters </th></tr>
{% for p in jobparams %}
<tr><td><font size=-1>{{ p|safe }}</font></td></tr>
{% endfor %}
</table>
<p>
{% endif %}

{% if jobscoutids %}
<table><tr>
<td bgcolor='lightcyan'><b> Scout jobs: </b></td>
    {% if jobscoutids.walltimescoutjob %}
        <td>Walltime: <a href="{% url 'jobInfo' %}?pandaid={{ jobscoutids.walltimescoutjob }}">{{ jobscoutids.walltimescoutjob }}</a> </td>{% endif %}
    {% if jobscoutids.cputimescoutjob %}
        <td>CPU time: <a href="{% url 'jobInfo' %}?pandaid={{ jobscoutids.cputimescoutjob }}">{{ jobscoutids.cputimescoutjob }}</a> </td>{% endif %}
    {% if jobscoutids.ramcountscoutjob %}
        <td>RAM count: <a href="{% url 'jobInfo' %}?pandaid={{ jobscoutids.ramcountscoutjob }}">{{ jobscoutids.ramcountscoutjob }}</a> </td>{% endif %}
    {% if jobscoutids.outdiskcountscoutjob %}
        <td>Out disk count: <a href="{% url 'jobInfo' %}?pandaid={{ jobscoutids.outdiskcountscoutjob }}">{{ jobscoutids.outdiskcountscoutjob }}</a> </td>{% endif %}
    {% if jobscoutids.iointensityscoutjob %}
        <td>IO intensity: <a href="{% url 'jobInfo' %}?pandaid={{ jobscoutids.iointensityscoutjob }}">{{ jobscoutids.iointensityscoutjob }}</a> </td>{% endif %}
</tr>
</table>
{% endif %}

<a name="taskparams"></a>
{% if taskparaml %}
<table>
<tr bgcolor='lightcyan'><th colspan=20> Prodsys task parameters </th></tr>
{% for p in taskparaml %}
{% if p.name != 'jobParameters' and p.name != 'log' %}
<tr><th> {{ p.name }} </th><td>{% if p.value != None %} {{ p.value }} {% endif %}</td></tr>
{% endif %}
{% endfor %}
</table>
<p>
{% endif %}

<table>
<tr bgcolor='lightcyan'><th colspan=20> PanDA/JEDI task parameters </th></tr>
{% for col in columns %}
<tr><th>{{ col.name }} </th><td> {% if col.value != 'None' %} {% if col.name == 'cputimescoutjob' %} <a href="{% url 'jobInfo' %}?pandaid={{ col.value }}">{{ col.value }}</a> {% else %} {{ col.value }} {% endif %} {% endif %}</td></tr>
{% endfor %}
</table>

{% else %}

<p>
PanDA task {% if jeditaskid > 0 %}{{ jeditaskid }}:{% endif %} <b>{{ taskname }}</b> not found.
</p>

{% if viewParams.MON_VO == 'ATLAS' %}

 <p> Note that task info pages are currently only available for JEDI tasks in the new monitor.
 </p><p>
 You can however get a job listing for any task in quick search.
</p>
{% endif%}

{% endif %}

{% endblock %}

{% block helptext %}
{% include "taskInfoHelp.html" with helptitle="Task detail page help" %}
{% endblock %}
<commit_msg>updated prodsys link<commit_after>{% extends "_base_core.html" %}{% load url from future %}

{% load staticfiles %}
{% block page_title %} {{ jeditaskid }} ES task {% endblock %}
{% block title %} <a href="{% url 'index' %}">{{ viewParams.MON_VO }} PanDA monitor</a>{% endblock %}
{% block subtitle %}PanDA Event Service task {{ jeditaskid }} at {{ task.site }} {% endblock %}

{% block body %}

{% if columns %}

<table>
<tr bgcolor='lightcyan'><th colspan=20> Event Service Task {{ jeditaskid }} at site <a href="{% url 'siteInfo' task.site %}">{{ task.site }}</a> </th></tr>
<tr bgcolor='lightcyan'>
	<th>Task ID</th>
    {% if task.deftreqid %} <th> Request </th> {% endif %}
	{% if task.reqid != task.jeditaskid and not task.deftreqid %}<th>Jobset</th>{% endif %}
	<th>Type</th>
	<th>Processing type</th>
	<th>Transform</th>
	<th>User</th>
	{% if task.campaign %} <th> Campaign </th> {% endif %}
	<th>Task status </th>{% if task.superstatus %} {% if task.superstatus != task.status %}<th> Detailed JEDI status </th>{% endif %} {% endif %}
{% if task.dsinfo %}
    <th> Nevents | <span class='finished'>used</span> </th>
    <th style="white-space: nowrap">HS06*sec<br> Expected<br> Total<br><span class='done'>done</span><br> <span class='failed'>failed</span></th>
    <th> Ninputfiles | <span class='finished'>finished</span> | <span class='failed'>failed</span> </th>
{% endif %}
	<th>Created</th>
	<th>Modified</th>
	<th>Cores</th>
	<th>Priority</th>
	{% if task.ticketid %} <th>Tracker</th> {% endif %}
</tr>
	<tr>
		<td><a href="{% url 'taskInfo' task.jeditaskid %}">{{ task.jeditaskid }}</a></td>
        {% if task.deftreqid %} <td> <a href="https://prodtask-dev.cern.ch/prodtask/inputlist_with_request/{{task.deftreqid}}/">{{task.deftreqid}}</a> </td> {% endif %}
		{% if task.reqid != task.jeditaskid and not task.deftreqid %}<td>{{ task.reqid }}</td>{% endif %}
		<td>{{ task.tasktype }}</td>
		<td>{% if task.processingtype %} {{ task.processingtype }} {% endif %} </td>
		<td> {{ task.transpath }} </td>
		<td><a href="{% url 'taskList' %}?username={{ task.username }}">{{ task.username }}</a></td>
		{% if task.campaign %} <td><a href='/tasks/?campaign={{ task.campaign }}'>{{ task.campaign }}</a></td> {% endif %}
		<td class='{{task.status}}_fill'>{% if task.superstatus %}<b><a href="https://twiki.cern.ch/twiki/bin/view/PanDA/PandaJEDI#Transition_of_task_status">{{ task.superstatus }}</a></b> {% if task.superstatus != task.status %}<td class='{{task.status}}'><a href="https://twiki.cern.ch/twiki/bin/view/PanDA/PandaJEDI#Transition_of_task_status">{{ task.status }}</a></td>{% endif %} {% else %}<a href="https://twiki.cern.ch/twiki/bin/view/PanDA/PandaJEDI#Transition_of_task_status">{{ task.status }}</a>{% endif %}</td>

{% if task.dsinfo %}
        <td> {{task.totev}} |
            <span class='finished'>{{task.totevproc}} ({{task.pctfinished}}%)</span></td>
        <td style="text-align:right;"> {{task.totevhs06}}<br>{{task.currenttotevhs06}}<br><span class='finished'>{{task.totevprochs06}}</span> <br> <span class='failed'>{{task.failedevprochs06}}</span></td>
        <td> {{task.dsinfo.nfiles}} |
            <span class='finished'>{{task.dsinfo.nfilesfinished}} ({{task.dsinfo.pctfinished}}%)</span> {% if task.dsinfo.nfilesfailed > 0 %} | <span class='failed'>{{task.dsinfo.nfilesfailed}} ({{task.dsinfo.pctfailed}}%)</span>  {% endif %} </td>
{% endif %}

		<td>{{ task.creationdate|date:"Y-m-d H:i" }}</td>
		<td>{{ task.modificationtime|date:"m-d H:i" }}</td>
		<td>{{ task.corecount }}</td>
		<td>{{ task.taskpriority }}</td>
{% if task.ticketid %}
        <td><a href="https://its.cern.ch/jira/browse/{{ task.ticketid }}">{{ task.ticketsystemtype }}</a></td>
{% endif %}
	</tr>
</table>

<p>
{% if requestParams.mode and requestParams.mode == 'nodrop' %}
    <a style="cursor: pointer;" href="{{nomodeurl}}mode=drop">Switch to drop mode</a>
{% else%}
    <a style="cursor: pointer;" href="{{nomodeurl}}mode=nodrop">Switch to nodrop mode</a>
{% endif %}

{% if vomode == 'atlas' %}
    {%  if task.tasktype == 'prod' %}
        &emsp;<a href="https://prodtask-dev.cern.ch/prodtask/task_manage/#/?time_period=custom&task_type=production&task_id={{ task.jeditaskid }}" target="_blank">Prod Task view</a>
    {% endif %}
{% endif %}

<script type="text/javascript">
function toggleDetailDisplay(className) {
   el = document.getElementsByClassName(className);
   for (i=0; i<el.length; i++) {
     el[i].style.display = (el[i].style.display=="none") ? "" : "none";
   }
}

function killtasks(taskID, action) {
    var message = ''
    if (action == 0)
        message = 'Are you sure you want to FINISH this task?'
    else
        message = 'Are you sure you want to ABORT this task?'
    if (confirm(message)) {
        $.ajax({
            url: {% url 'killtasks' %},
            data: {'task': taskID, 'action': action},
            async: true
        })
            .done(function (response) {
                var parcedResponse = $.parseJSON(response);
                alert(parcedResponse.detail);
                location.reload();
            });
    } else {
        // Do nothing!
    }
}

</script>

<p>

{% if showtaskprof == True %}
    <a href="{% url 'taskprofileplot' %}?jeditaskid=" target="_blank">Open Task Profile</a>&emsp;
    <a href="{% url 'taskesprofileplot' %}?jeditaskid={{ task.jeditaskid }}" target="_blank">Events Processing Profile (Not dropped finished jobs)</a>&emsp;
{% endif %}

<a href="{% url 'ganttTaskChain' %}?jeditaskid={{ task.jeditaskid }}" target="_blank">Open Task Chain</a>&emsp;

<a style="cursor: pointer;" onclick="javascript:toggleDetailDisplay('nevents_plot');">Show number of events distribution plot</a>&emsp;

<a style="cursor: pointer;" onclick="javascript:toggleDetailDisplay('d3splot');">Show/hide plots</a>&emsp;

<a href="http://atlas-kibana.mwt2.org:5601/app/kibana#/dashboard/BP_a_task?_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:'{{ task.kibanatimefrom }}',mode:absolute,to:'{{ task.kibanatimeto }}'))&_a=(filters:!(),options:(darkTheme:!t),panels:!((col:1,id:BP_Walltime_all_jobs,panelIndex:1,row:1,size_x:6,size_y:3,type:visualization),(col:7,id:BP_Walltime_failed_jobs,panelIndex:2,row:1,size_x:6,size_y:3,type:visualization),(col:1,id:BP_MAX_PSS_all_jobs,panelIndex:3,row:4,size_x:6,size_y:3,type:visualization),(col:7,id:BP_MAX_PSS_failed_jobs,panelIndex:4,row:4,size_x:6,size_y:3,type:visualization),(col:1,id:BP_MAX_PSS_per_core_all_jobs,panelIndex:5,row:7,size_x:6,size_y:3,type:visualization),(col:7,id:BP_MAX_PSS_per_core_failed_jobs,panelIndex:6,row:7,size_x:6,size_y:3,type:visualization)),query:(query_string:(analyze_wildcard:!t,lowercase_expanded_terms:!f,query:'jeditaskid:{{ task.jeditaskid }}')),title:BP_a_task,uiState:(P-1:(spy:(mode:(fill:!f,name:!n)),vis:(legendOpen:!t))))" target="_blank">  Corresponding dashboard in Kibana</a>&emsp;

{% if request.session.IS_TESTER == True %}
    {% with 'done finished failed ready broken aborted defined' as finalstatelist %}
    {% if not task.status in finalstatelist %}
        <a style="margin-left: 10em;" onclick="javascript:killtasks({{ task.jeditaskid }}, 0);" class='failed'>Finish</a>
        <a style="margin-left: 2em;" onclick="javascript:killtasks({{ task.jeditaskid }}, 1);" class='failed'>Abort</a>
    {% endif %}
    {% endwith %}
{% endif %}

 <p>


{% if  maxpss|length > 0 %} <div class="nevents_plot" id="plot0" style="align:left;display:none;"></div><br> {% endif %}

{% if  maxpss|length > 0 %} <div class="d3splot" id="plot1" style="float:left;display:none"></div> {% endif %}
{% if  walltime|length > 0 %} <div class="d3splot" id="plot2" style="float:left;display:none"></div> {% endif %}
{% if  maxpsspercore|length > 0 %} <div class="d3splot" id="plot5" style="float:left;display:none"></div> {% endif %}
{% if  hs06s|length > 0 %} <div class="d3splot" id="plot7" style="float:left;display:none"></div> {% endif %}
{% if  walltimeperevent|length > 0 %} <div class="d3splot" id="plot9" style="float:left;display:none"></div> {% endif %}
{% if  maxpssf|length > 0 %} <div class="d3splot" id="plot3" style="float:left;display:none"></div> {% endif %}
{% if  walltimef|length > 0 %} <div class="d3splot" id="plot4" style="float:left;display:none"></div> {% endif %}
{% if  maxpssfpercore|length > 0 %} <div class="d3splot" id="plot6" style="float:left;display:none"></div> {% endif %}
{% if  hs06sf|length > 0 %} <div class="d3splot" id="plot8" style="float:left;display:none"></div> {% endif %}

<script src="/static/js/d3jsplot.js"></script>
<script>
    var nevents = {{ nevents|safe }};
    if (nevents.length > 0) {pandamonProdRunTaskSumPlotFunc(nevents, "#plot0", "Number of events histogram (finished non-merge jobs)", 40, 'ES');}
    var values1 = {{ maxpss|safe }};
    var values2 = {{ walltime|safe }};
    var sites1 = {{ sitepss|safe }};
    var sites2 = {{ sitewalltime|safe }};
    var values3 = {{ maxpssf|safe }};
    var values4 = {{ walltimef|safe }};
    var sites3 = {{ sitepssf|safe }};
    var sites4 = {{ sitewalltimef|safe }};
    {#Maxpsspercore, sites is the same as for maxpss#}
    var values5 = {{ maxpsspercore|safe }};
    var values6 = {{ maxpssfpercore|safe }};
    {#HS06s, sites is the same as for walltime#}
    var values7 = {{ hs06s|safe }};
    var values8 = {{ hs06sf|safe }};
    var values9 = {{ walltimeperevent|safe }};
    if (values1.length > 0) {pandamonplotFunc(values1, sites1, "#plot1", "Maximum PSS histogram", {% if  maxpss|length < 100 %} 10 {% else %} 100 {% endif %});}
    if (values3.length > 0) {pandamonplotFunc(values3, sites3, "#plot3", "Maximum PSS histogram (failed jobs)", {% if  maxpss|length < 20 %} 5 {% else %} 20 {% endif %});}
    if (values2.length > 0) {pandamonplotFunc(values2, sites2, "#plot2", "Walltime histogram", {% if  walltime|length < 100 %} 5 {% else %} 40 {% endif %});}
    if (values4.length > 0) {pandamonplotFunc(values4, sites4, "#plot4", "Walltime histogram (failed jobs)", {% if  walltime|length < 20 %} 5 {% else %} 20 {% endif %});}
    if (values5.length > 0) {pandamonplotFunc(values5, sites1, "#plot5", "Maximum PSS per core histogram", {% if  maxpsspercore|length < 100 %} 10 {% else %} 100 {% endif %});}
    if (values6.length > 0) {pandamonplotFunc(values6, sites3, "#plot6", "Maximum PSS per core histogram (failed jobs)", {% if  maxpssfpercore|length < 20 %} 5 {% else %} 20 {% endif %});}
    if (values7.length > 0) {pandamonplotFunc(values7, sites2, "#plot7", "HS06s histogram", {% if  hs06s|length < 100 %} 10 {% else %} 100 {% endif %});}
    if (values8.length > 0) {pandamonplotFunc(values8, sites4, "#plot8", "HS06s histogram (failed jobs)", {% if  hs06sf|length < 20 %} 5 {% else %} 20 {% endif %});}
    if (values9.length > 0) {pandamonplotFunc(values9, sites2, "#plot9", "Walltime per event histogram", {% if  walltimeperevent|length < 100 %} 5 {% else %} 40 {% endif %});}
 </script>






{% if jobsummary %}

<table>
<tr bgcolor="lightcyan"><th colspan=20>
<b>States of jobs in this task</b>   &nbsp; &nbsp; <a href="{% url 'jobList' %}?jeditaskid={{jeditaskid}}&eventservice=not2&display_limit=100">Show jobs</a>
</th></tr>
<tr>
{% for state in jobsummary %}
<td class="{{ state.name}}"> <b> {{ state.name }} </b> </td>
{% endfor %}
</tr><tr>
{% for state in jobsummary %}
<td {% if state.count > 0 %} class='{{state.name}}_fill' {% endif %}> {% if state.count > 0 %} <b> <a href="{% url 'jobList' %}?jeditaskid={{task.jeditaskid}}&jobstatus={{state.name}}{% ifequal requestParams.mode 'nodrop' %}&mode=nodrop{%  endifequal %}{% ifequal requestParams.mode 'drop' %}&mode=drop{%  endifequal %}&eventservice=not2&display_limit=100"><span class='{{state.name}}_fill'>{{ state.count }}</span></a> </b> {% endif %} </td>
{% endfor %}
</table>
{% endif %}

{% if jobsummaryESMerge %}

<table>
<tr bgcolor="lightcyan"><th colspan=20>
<b>States of es_merge jobs in this task</b>   &nbsp; &nbsp; <a href="{% url 'jobList' %}?jeditaskid={{jeditaskid}}&eventservice=2&display_limit=100">Show jobs</a>
</th></tr>
<tr>
{% for state in jobsummaryESMerge %}
<td class="{{ state.name}}"> <b> {{ state.name }} </b> </td>
{% endfor %}
</tr><tr>
{% for state in jobsummaryESMerge %}
<td {% if state.count > 0 %} class='{{state.name}}_fill' {% endif %}> {% if state.count > 0 %} <b> <a href="{% url 'jobList' %}?jeditaskid={{task.jeditaskid}}&jobstatus={{state.name}}{% ifequal requestParams.mode 'nodrop' %}&mode=nodrop{%  endifequal %}{% ifequal requestParams.mode 'drop' %}&mode=drop{%  endifequal %}&display_limit=100&eventservice=2"><span class='{{state.name}}_fill'>{{ state.count }}</span></a> </b> {% endif %} </td>
{% endfor %}
</table>
{% endif %}

{% if eventssummary|length > 0 %}
<script type="text/javascript">
    $(document).ready(function() {
        if ($(".showeventsdetailsrow").is(':visible'))
                $(".showeventsdetailsrow").hide();
    });
    function showEventsDetails(){
        if (!$(".showeventsdetailsrow").is(':visible')){
            $(".showeventsdetailsrow").show()}
        else {
            $(".showeventsdetailsrow").hide()}
    }
</script>
<table>
<tr bgcolor="lightcyan"><th colspan=20>
<b>States of events in this task</b>  {% if requestParams.mode and requestParams.mode == 'nodrop' %} <a style="cursor: pointer;" onclick="javascript:showEventsDetails();" href="#">  Show details</a> {% endif %} &nbsp
</th></tr>
<tr>
{% for state in eventssummary %}
<td> <span class="{{ state.statusname}}"><b> {{ state.statusname }} </b></span>
    <span class="showeventsdetailsrow">
    <br>
        {% if state.count > 0 %}
        <b>ComputingElement, ObjectStoreID : Nevents</b>
        {% endif %}
    </span>
</td>
{% endfor %}
</tr><tr>
{% for state in eventssummary %}
<td {% if state.count > 0 %} class='{{state.statusname}}_fill' {% endif %}> {% if state.count > 0 %}
    <b> <span class='{{state.statusname}}_fill'>
        {% if requestParams.mode == 'nodrop' and state.statusname == 'failed' and state.count > 0 %}
            <a onclick="javascript:loadErrorSummaryData('{{ jeditaskid }}');"> {{ state.count }} </a>
        {% else %} {{ state.count }}
        {% endif %}
    </span></b>
    {% endif %}
</td>
{% endfor %}</tr>
{% if ossummary|length > 0 %}
<tr class="showeventsdetailsrow" >
{% for state in eventssummary %}
    <td {% if state.count > 0 %} class='{{state.name}}_fill' {% endif %}>
    {% for osrow in ossummary %}
        {% if state.statusname == osrow.statusname %} {{ osrow.computingelement }}, {% if osrow.objectstoreid != None %} {{ osrow.objectstoreid }} {% else %} unknown {% endif %} : {{ osrow.nevents }} <br> {% endif %}
    {% endfor %}
    </td>
{% endfor %}
</tr>
{% endif %}
</table>
{% endif %}

<script type="text/javascript">
   function loadErrorSummaryData(jeditaskid) {

       $('#div-error-sum').html("<img src='{% static "images/load.gif" %}'>  ");
       $.ajax({
           url: {% url 'eventsErrorSummary' %},
           data: 'jeditaskid='+jeditaskid,
           async: true
       })
       .done(function (response) {
           $('#div-error-sum').html(response);
       });
   }
</script>

<p>
<div id="div-error-sum">

</div>
<p>

<p>
{% if task.errordialog %}
<table width=1000><tr><td bgcolor="#FFFBDA"><font color='brown'> <b>Logged status: {{ task.errordialog|safe }}</b></font></td></tr>
{% if logtxt %}
<tr><td>
<font size=-1><pre>
{{ logtxt }}
</pre></font>
</td></tr>
{% endif %}
</table>
{% endif %}

<table><tr>
<td bgcolor='lightcyan'><b> View: </b></td>

{% if jobsummary %}
<td>
<a href="{% url 'jobList' %}?jeditaskid={{jeditaskid}}{% ifequal requestParams.mode 'nodrop' %}&mode=nodrop{%  endifequal %}{% ifequal requestParams.mode 'drop' %}&mode=drop{%  endifequal %}&jobtype=eventservice&display_limit=100">job list (access to job details and logs)</a>
</td>
{% endif %}

{% if task.parent_tid != task.jeditaskid and task.parent_tid != None %}
<td>
parent task<a href="{% url 'taskInfo' task.parent_tid %}"> {{ task.parent_tid }}</a>
</td>
{% endif %}

<td>
<a href="{% url 'taskList' %}?parent_tid={{ task.jeditaskid }}&display_limit=100">child tasks</a>
</td>

{% if viewParams.MON_VO == 'ATLAS' %}
<td>
<a href="https://prodtask-dev.cern.ch/prodtask/task/{{ task.jeditaskid }}/">prodsys task page</a>
</td>
{% endif %}

<td>
<a href="{% url 'pandaLogger' %}?type={{ taskbrokerage }}&jeditaskid={{ jeditaskid }}&startdate={{ task.creationdate|date:"Y-m-d H:i:s" }}&enddate={{ task.modificationtime|date:"Y-m-d H:i:s" }}">brokerage lo
gger</a>
</td>

<td>
<a href="{% url 'pandaLogger' %}?category=panda.mon.jedi&jeditaskid={{ jeditaskid }}">JEDI action logger</a>
</td>

<td>
<a href="https://aianalytics01.cern.ch/#/discover?_g=(refreshInterval:(display:Off,pause:!f,section:0,value:0),time:(from:now-2d%2Fd,mode:relative,to:now))&_a=(columns:!('@message.module','@message.Type','@message.name','@message.levelname','@message.message'),index:%5Bpandalogger-%5DYYYY-MM-DD,interval:auto,query:(query_string:(analyze_wildcard:!t,lowercase_expanded_terms:!f,query:'@message.msg:%22jediTaskID%3D{{jeditaskid}}%20%22%20AND%20@message.Type:%22{{taskbrokerage}}%22')),sort:!('@timestamp',desc))">brokerage logger (es)</a>
</td>

<a href="{% url 'pandaLogger' %}?category=panda.mon.jedi&jeditaskid={{ jeditaskid }}">JEDI action logger</a>
<td><a href="https://aianalytics01.cern.ch/#/discover?_g=(refreshInterval:(display:Off,pause:!f,section:0,value:0),time:(from:now-2d%2Fd,mode:relative,to:now))&_a=(columns:!('@message.module','@message.Type','@message.name','@message.levelname','@message.message'),index:%5Bpandalogger-%5DYYYY-MM-DD,interval:auto,query:(query_string:(analyze_wildcard:!t,lowercase_expanded_terms
:!f,query:'@message.msg:%22jediTaskID%3D{{jeditaskid}}%22%20AND%20@message.name:%22panda.mon.jedi%22')),sort:!('@timestamp',desc))">JEDI action logger (es)</a>
</td>


<td>
<a href="{% url 'errorSummary' %}?jeditaskid={{jeditaskid}}">error summary</a>
</td>

</tr></table>

{% if inctrs %}
<table>
<tr bgcolor='lightcyan' >
	<th>Input containers</th>
</tr>
{% for dsrec in inctrs %}
	<tr>
		<td><font size=-1><a href="{% url 'datasetList' %}?containername={{ dsrec }}">{{ dsrec }}</a></font></td>
	</tr>
{% endfor %}
</table>
{% endif %}

{% if outctrs %}
<table>
<tr bgcolor='lightcyan' >
	<th>Output containers</th>
</tr>
{% for dsrec in outctrs %}
	<tr>
		<td><font size=-1><a href="{% url 'datasetList' %}?containername={{ dsrec }}">{{ dsrec }}</a></font></td>
	</tr>
{% endfor %}
</table>
{% endif %}

{% if datasets %}
<script type="text/javascript">    
function toggleRowsDisplay(className) {                                                                                                                                                                                    
   el = document.getElementsByClassName(className)
   for (i=0; i<el.length; i++) {   
     el[i].style.display = (el[i].style.display=="none") ? "" : "none";                                                                                           
   }
}   
</script>

<table>

{% if dstypes %}
<tr bgcolor='lightcyan'> <th colspan=20> 
{{ datasets|length }} datasets, show/hide by type:
&nbsp; <a style="cursor: pointer;" onclick="javascript:toggleRowsDisplay('type-all');">all</a>
{% for dst in dstypes %}
  &nbsp; <a style="cursor: pointer;" onclick="javascript:toggleRowsDisplay('type-{{ dst.type }}');">{{ dst.type }}({{ dst.count }})</a>
{% endfor %}
</th> </tr>
{% endif %}

<tr bgcolor='lightcyan' >
	<th>Dataset, container name</th>
	<th>Type</th>
	<th>Stream</th>
	<th>State</th>
	<th>Status</th>
	<th>Nfiles</th>
	<th>Created</th>
	<th>Modified</th>
</tr>

{% for dsrec in datasets %}
	<tr class="type-{{ dsrec.type }} type-all" style="display:all">
		<td><font size=-1><a href="{% url 'datasetInfo' %}?datasetname={{ dsrec.datasetname }}">{{ dsrec.datasetname }}</a></font></td>
		<td>{{ dsrec.type }}</td>
		<td>{{ dsrec.streamname }}</td>
		<td class='{{dsrec.state}}'>{{ dsrec.state }}</td>
		<td class='{{dsrec.status}}'>{{ dsrec.status }}</td>
		<td>{{ dsrec.nfiles }}</td>
		<td>{{ dsrec.creationtime|date:"Y-m-d H:i" }}</td>
		<td>{{ dsrec.modificationtime|date:"m-d H:i" }}</td>
	</tr>
{% endfor %}
</table>
</p>

{% else %}

No datasets were found for this task

{% endif %}

{% if sumd %}
<table>
{% for fdict in sumd %}
<tr><th> {{ fdict.field }} </th><td>
{% for item in fdict.list %}
{% if fdict.field == 'status' %} <span class='{{item.kname}}'> {% else %} <span> {% endif %}  {{ item.kname }} </span>
<a href="{{xurl}}{{fdict.field}}={{item.kname}}">({{ item.kvalue }})</a> &nbsp; 
{% endfor %}
</td></tr>
{% endfor %}
</table>
{% endif %}

{% if jobparams %}
<table>
<a name="jobparams"></a>
<tr bgcolor='lightcyan'><th colspan=20> Job parameters </th></tr>
{% for p in jobparams %}
<tr><td><font size=-1>{{ p|safe }}</font></td></tr>
{% endfor %}
</table>
<p>
{% endif %}

{% if jobscoutids %}
<table><tr>
<td bgcolor='lightcyan'><b> Scout jobs: </b></td>
    {% if jobscoutids.walltimescoutjob %}
        <td>Walltime: <a href="{% url 'jobInfo' %}?pandaid={{ jobscoutids.walltimescoutjob }}">{{ jobscoutids.walltimescoutjob }}</a> </td>{% endif %}
    {% if jobscoutids.cputimescoutjob %}
        <td>CPU time: <a href="{% url 'jobInfo' %}?pandaid={{ jobscoutids.cputimescoutjob }}">{{ jobscoutids.cputimescoutjob }}</a> </td>{% endif %}
    {% if jobscoutids.ramcountscoutjob %}
        <td>RAM count: <a href="{% url 'jobInfo' %}?pandaid={{ jobscoutids.ramcountscoutjob }}">{{ jobscoutids.ramcountscoutjob }}</a> </td>{% endif %}
    {% if jobscoutids.outdiskcountscoutjob %}
        <td>Out disk count: <a href="{% url 'jobInfo' %}?pandaid={{ jobscoutids.outdiskcountscoutjob }}">{{ jobscoutids.outdiskcountscoutjob }}</a> </td>{% endif %}
    {% if jobscoutids.iointensityscoutjob %}
        <td>IO intensity: <a href="{% url 'jobInfo' %}?pandaid={{ jobscoutids.iointensityscoutjob }}">{{ jobscoutids.iointensityscoutjob }}</a> </td>{% endif %}
</tr>
</table>
{% endif %}

<a name="taskparams"></a>
{% if taskparaml %}
<table>
<tr bgcolor='lightcyan'><th colspan=20> Prodsys task parameters </th></tr>
{% for p in taskparaml %}
{% if p.name != 'jobParameters' and p.name != 'log' %}
<tr><th> {{ p.name }} </th><td>{% if p.value != None %} {{ p.value }} {% endif %}</td></tr>
{% endif %}
{% endfor %}
</table>
<p>
{% endif %}

<table>
<tr bgcolor='lightcyan'><th colspan=20> PanDA/JEDI task parameters </th></tr>
{% for col in columns %}
<tr><th>{{ col.name }} </th><td> {% if col.value != 'None' %} {% if col.name == 'cputimescoutjob' %} <a href="{% url 'jobInfo' %}?pandaid={{ col.value }}">{{ col.value }}</a> {% else %} {{ col.value }} {% endif %} {% endif %}</td></tr>
{% endfor %}
</table>

{% else %}

<p>
PanDA task {% if jeditaskid > 0 %}{{ jeditaskid }}:{% endif %} <b>{{ taskname }}</b> not found.
</p>

{% if viewParams.MON_VO == 'ATLAS' %}

 <p> Note that task info pages are currently only available for JEDI tasks in the new monitor.
 </p><p>
 You can however get a job listing for any task in quick search.
</p>
{% endif%}

{% endif %}

{% endblock %}

{% block helptext %}
{% include "taskInfoHelp.html" with helptitle="Task detail page help" %}
{% endblock %}

{'fraction_non_alphanumeric': 0.22721870475614236, 'fraction_numerical': 0.014089072325345203, 'mean_word_length': 4.422779470353879, 'pattern_counts': {'":': 0, '<': 1063, '<?xml version=': 0, '>': 1107, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2337416', 'n_tokens_mistral': 18395, 'n_tokens_neox': 16622, 'n_words': 3380}