Skip to content

Commit 1fa697d

Browse files
FOM表示を小数3桁に統一: bk_emit_resultは精度保持、Web表示側で丸め
[skip-ci] - bk_functions.sh: %.3f丸めを削除、科学表記の変換のみ残す - _results_table.html: FOMセルを%.3fでフォーマット表示 - result_detail.html: FOM詳細表示を%.3fでフォーマット
1 parent 44f9e54 commit 1fa697d

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

result_server/templates/_results_table.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,10 @@
163163
{% elif key == "timestamp" %}
164164
{% set ts_parts = row[key].split(' ') %}
165165
<td class="ts-cell">{{ ts_parts[0] }}<br>{{ ts_parts[1] if ts_parts|length > 1 else '' }}</td>
166-
{% elif key in ["code", "fom", "fom_version", "exp", "execution_mode", "ci_trigger", "pipeline_id"] %}
166+
{% elif key in ["code", "fom_version", "exp", "execution_mode", "ci_trigger", "pipeline_id"] %}
167167
<td title="{{ row[key] }}">{{ row[key] }}</td>
168+
{% elif key == "fom" %}
169+
<td title="{{ row[key] }}">{{ "%.3f"|format(row[key]|float) if row[key] not in [None, '', 'N/A', 'null', 'nan'] else row[key] }}</td>
168170
{% endif %}
169171
{% if key == "fom" %}
170172
<td style="text-align: center;">

result_server/templates/result_detail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ <h2>Meta Information</h2>
3535
<tr><th>Code</th><td>{{ result.get('code', 'N/A') }}</td></tr>
3636
<tr><th>System</th><td>{{ result.get('system', 'N/A') }}</td></tr>
3737
<tr><th>Exp</th><td>{{ result.get('Exp', 'N/A') }}</td></tr>
38-
<tr><th>FOM</th><td>{{ result.get('FOM', 'N/A') }}</td></tr>
38+
<tr><th>FOM</th><td>{{ "%.3f"|format(result.get('FOM', 'N/A')|float) if result.get('FOM', 'N/A') not in [None, '', 'N/A', 'null', 'nan'] else result.get('FOM', 'N/A') }}</td></tr>
3939
<tr><th>FOM Unit</th><td>{{ result.get('FOM_unit', 'N/A') }}</td></tr>
4040
<tr><th>Node Count</th><td>{{ result.get('node_count', 'N/A') }}</td></tr>
4141
<tr><th>CPUs per Node</th><td>{{ result.get('cpus_per_node', 'N/A') }}</td></tr>

scripts/bk_functions.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,13 @@ bk_emit_result() {
125125
;;
126126
esac
127127

128-
# Normalize FOM to 3 decimal places (also handles scientific notation)
129-
_bk_fom=$(awk "BEGIN {printf \"%.3f\", $_bk_fom}")
128+
# Normalize scientific notation (e.g. 3.64E+01 -> 36.415) to plain decimal
129+
# result.sh parses with grep -Eo 'FOM:[ ]*[0-9.]*' which doesn't match E notation
130+
case "$_bk_fom" in
131+
*[eE]*)
132+
_bk_fom=$(awk "BEGIN {printf \"%.17g\", $_bk_fom}")
133+
;;
134+
esac
130135

131136
# Build output line
132137
_bk_output="FOM:${_bk_fom}"

0 commit comments

Comments
 (0)