1 <%# Work unit status %>
3 <div class="pull-right" style="padding-left: 1em">
4 Current state: <span class="badge badge-<%= wu.state_bootstrap_class %>" data-wu-state="<%= wu.state_label %>">
5 <% if wu.state_label == "running" %>
13 <% if wu.state_label == 'Paused' %>
15 This work unit is paused. Work unit children that are
16 already running will continue to run, but no new work units will be submitted.
20 <% runningtime = determine_wallclock_runtime(wu.children) %>
23 <% if wu.started_at %>
24 This work unit started at <%= render_localized_date(wu.started_at) %>.
26 <% if wu.state_label == 'Complete' %>
28 <% elsif wu.state_label == 'Failed' %>
34 <% walltime = if wu.finished_at then
35 wu.finished_at - wu.started_at
37 Time.now - wu.started_at
40 <%= if walltime > runningtime
41 render_runtime(walltime, false)
43 render_runtime(runningtime, false)
44 end %><% if wu.finished_at %> at <%= render_localized_date(wu.finished_at) %><% end %>.
46 It is <%= if wu.state_label == 'Running' then 'active' else wu.state.downcase end %>.
50 <% if wu.state_label == 'Failed' %>
51 Check the Log tab for more detail about why it failed.
57 <% if wu.state_label == 'Running' %>
64 cputime = wu.children.map { |c|
66 (c.runtime_constraints.andand[:min_nodes] || 1) * ((c.finished_at || Time.now()) - c.started_at)
71 <%= render_runtime(runningtime, false) %><% if (walltime - runningtime) > 0 %>
72 (<%= render_runtime(walltime - runningtime, false) %> queued)<% end %><% if cputime == 0 %>.<% else %>
74 <%= render_runtime(cputime, false) %>
75 of node allocation time (<%= (cputime/runningtime).round(1) %>⨯ scaling).
80 <%= render partial: 'work_unit/component_detail', locals: {current_obj: wu} %>
83 <%# Work unit children %>
86 job_uuids = wu.children.collect {|c| c.uuid}.compact
88 resource_class = resource_class_for_uuid(job_uuids.first, friendly_name: true)
89 preload_objects_for_dataclass resource_class, job_uuids
92 job_collections = wu.children.collect {|j| j.output}.compact
93 job_collections.concat wu.children.collect {|j| j.docker_image}.uniq.compact
94 job_collections_pdhs = job_collections.select {|x| !(m = CollectionsHelper.match(x)).nil?}.uniq.compact
95 job_collections_uuids = job_collections - job_collections_pdhs
96 preload_collections_for_objects job_collections_uuids if job_collections_uuids.any?
97 preload_for_pdhs job_collections_pdhs if job_collections_pdhs.any?
100 <% @descendent_count = 0 if !@descendent_count %>
102 <% wu.children.each_with_index do |c, i| %>
103 <% @descendent_count += 1 %>
104 <%= render partial: 'work_unit/show_child', locals: {current_obj: c, i: @descendent_count, expanded: false} %>