Skip to content

Commit

Permalink
drop 1st and last gpu data to exclude artifact in counting
Browse files Browse the repository at this point in the history
  • Loading branch information
Junjie Li committed Jan 21, 2024
1 parent f7b354d commit 23cbe48
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ <h2>Job Detail</h2>
<td style="border: 1px solid lightgrey;"><b>Max GPU Utilization:</b></td>
<td style="border: 1px solid lightgrey; text-align: right;"> &nbsp;&nbsp;&nbsp; {{ gpu_utilization_max }}%</td>
</tr>
<tr>
<td style="border: 1px solid lightgrey;"><b>Mean GPU Utilization:</b></td>
<td style="border: 1px solid lightgrey; text-align: right;">&nbsp;&nbsp;&nbsp; {{ gpu_utilization_mean|floatformat:1 }}%</td>
</tr>
</table> <br></br>
{% endif %}

Expand Down
15 changes: 11 additions & 4 deletions tacc_stats/site/machine/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,17 @@ def get_context_data(self, **kwargs):


# gpu
gpu_data = read_sql("""select type,event,value from host_data where jid = '{0}' and type='nvidia_gpu' and event='utilization'""".format(job.jid), conj)
gpu_utilization_max = gpu_data['value'].max()
context["gpu_active"]=round(gpu_utilization_max/100.0)
context["gpu_utilization_max"]=gpu_utilization_max
try:
gpu_data = read_sql("""select type,event,value from host_data where jid = '{0}' and type='nvidia_gpu' and event='utilization'""".format(job.jid), conj)
gpu_data = gpu_data.iloc[1:-1]
gpu_utilization_max = gpu_data['value'].max()
gpu_utilization_mean = gpu_data['value'].mean()
if not isnan(gpu_utilization_max):
context["gpu_active"]=round(gpu_utilization_max/100.0)
context["gpu_utilization_max"]=gpu_utilization_max
context["gpu_utilization_mean"]=gpu_utilization_mean
except:
print("error getting gpu data")

# xalt
xalt_data=xalt_data_c()
Expand Down

0 comments on commit 23cbe48

Please sign in to comment.