Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
A-Tune
提交
85a9ff59
A
A-Tune
项目概览
openeuler
/
A-Tune
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
A-Tune
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
85a9ff59
编写于
8月 26, 2020
作者:
G
gaoruoshu
提交者:
g00563147
8月 31, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug; add best performance chart
change file name before tuning start update .spec
上级
97f8a043
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
42 addition
and
5 deletion
+42
-5
analysis/engine/utils/utils.py
analysis/engine/utils/utils.py
+15
-0
analysis/optimizer/optimizer.py
analysis/optimizer/optimizer.py
+2
-0
misc/atune.spec
misc/atune.spec
+2
-0
resources/static/js/temp.js
resources/static/js/temp.js
+15
-2
resources/web.py
resources/web.py
+8
-3
未找到文件。
analysis/engine/utils/utils.py
浏览文件 @
85a9ff59
...
...
@@ -16,6 +16,9 @@ Provide an interface to read data from csv.
"""
import
os
import
re
import
time
import
random
import
logging
import
tarfile
import
pandas
as
pd
...
...
@@ -51,3 +54,15 @@ def add_data_to_file(data, mode, filename):
file_handle
.
write
(
str
(
data
))
file_handle
.
write
(
"
\n
"
)
file_handle
.
close
()
def
change_file_name
():
"""change tuning file name"""
path
=
"/etc/atuned/webserver/"
file_list
=
os
.
listdir
(
path
)
file_list
.
sort
(
key
=
lambda
fn
:
os
.
path
.
getmtime
(
path
+
fn
))
if
len
(
file_list
)
>
0
and
re
.
match
(
r
'\S*-\d{17}\S*'
,
file_list
[
-
1
])
is
None
:
old_name
=
file_list
[
-
1
].
split
(
"."
)[
0
]
curr_time
=
time
.
strftime
(
"%Y%m%d%H%M%S"
,
time
.
localtime
())
new_name
=
old_name
+
"-"
+
str
(
curr_time
)
+
str
(
random
.
randint
(
100
,
999
))
os
.
rename
(
path
+
old_name
+
".txt"
,
path
+
new_name
+
".txt"
)
analysis/optimizer/optimizer.py
浏览文件 @
85a9ff59
...
...
@@ -233,6 +233,8 @@ class Optimizer(multiprocessing.Process):
performance
.
append
(
x_num
)
return
x_num
utils
.
change_file_name
()
params
=
{}
options
=
[]
performance
=
[]
...
...
misc/atune.spec
浏览文件 @
85a9ff59
...
...
@@ -105,11 +105,13 @@ atune engine tool for manage atuned AI tuning system.
%defattr(0640,root,root,-)
%attr(0640,root,root) %{_unitdir}/atune-engine.service
%attr(0750,root,root) /usr/libexec/atuned/analysis/*
%attr(0750,root,root) /usr/libexec/atuned/resources/*
%attr(0750,root,root) /etc/atuned/*
%exclude /usr/libexec/atuned/analysis/app.py
%exclude /usr/libexec/atuned/analysis/plugin/
%exclude /usr/libexec/atuned/analysis/atuned/
%attr(0750,root,root) %dir /usr/libexec/atuned/analysis
%attr(0750,root,root) %dir /usr/libexec/atuned/resources
%attr(0640,root,root) %dir /etc/atuned
%post
...
...
resources/static/js/temp.js
浏览文件 @
85a9ff59
...
...
@@ -71,7 +71,15 @@ function updateChart(name, times, value) {
var
oldX
=
chart
.
getOption
().
xAxis
[
0
].
data
;
for
(
var
i
in
times
)
{
oldX
.
push
(
times
[
i
]);
oldData
.
push
(
value
[
i
]);
if
(
name
===
'
best performance
'
)
{
if
(
parseInt
(
value
[
i
],
10
)
>
parseInt
(
oldData
[
oldData
.
length
-
1
],
10
)
||
oldData
[
0
]
===
undefined
)
{
oldData
.
push
(
value
[
i
]);
}
else
{
oldData
.
push
(
oldData
[
oldData
.
length
-
1
]);
}
}
else
{
oldData
.
push
(
value
[
i
]);
}
}
chart
.
setOption
({
xAxis
:
{
data
:
oldX
},
...
...
@@ -93,13 +101,15 @@ function appendPrjList(list, timestamp) {
}
var
ul
=
document
.
createElement
(
'
ul
'
);
container
.
appendChild
(
ul
);
for
(
var
i
in
list
)
{
for
(
let
i
in
list
)
{
var
li
=
document
.
createElement
(
'
li
'
);
li
.
id
=
'
project-name-
'
+
list
[
i
];
li
.
appendChild
(
document
.
createTextNode
(
list
[
i
]));
ul
.
appendChild
(
li
);
li
.
style
.
cursor
=
'
pointer
'
;
li
.
onclick
=
function
()
{
console
.
log
(
list
[
i
]);
socket
.
emit
(
'
inital_chart
'
,
{
'
prj_name
'
:
list
[
i
]},
timestamp
,
namespace
=
'
/tuning
'
);
};
}
...
...
@@ -114,6 +124,9 @@ function updateChartInit(nameList, lineNum, value) {
}
for
(
var
i
in
value
)
{
updateChart
(
nameList
[
i
],
lineList
,
value
[
i
]);
if
(
nameList
[
i
]
===
'
performance
'
)
{
updateChart
(
'
best performance
'
,
lineList
,
value
[
i
]);
}
}
}
...
...
resources/web.py
浏览文件 @
85a9ff59
...
...
@@ -16,11 +16,13 @@ Web UI initialization
"""
from
flask
import
Flask
,
render_template
from
flask_socketio
import
SocketIO
import
os
import
numpy
import
logging
from
flask
import
Flask
,
render_template
from
flask_socketio
import
SocketIO
from
configparser
import
ConfigParser
APP
=
Flask
(
__name__
,
template_folder
=
'./templates'
,
static_folder
=
'./static'
)
APP
.
config
[
'TEMPLATES_AUTO_RELOAD'
]
=
True
...
...
@@ -45,6 +47,7 @@ def show_page(timestamp, _):
"""list all tuning project name on page"""
path
=
'/etc/atuned/webserver'
filelist
=
os
.
listdir
(
path
)
filelist
.
sort
(
key
=
lambda
fn
:
os
.
path
.
getmtime
(
path
+
'/'
+
fn
),
reverse
=
True
)
res
=
[]
for
each
in
filelist
:
res
.
append
(
each
.
split
(
'.'
)[
0
])
...
...
@@ -101,4 +104,6 @@ def update_tuning_page(prj_name, num, timestamp, _):
if
__name__
==
'__main__'
:
socketio
.
run
(
APP
,
host
=
'9.41.51.85'
,
port
=
10086
)
config
=
ConfigParser
()
config
.
read
(
'/etc/atuned/atuned.cnf'
)
socketio
.
run
(
APP
,
host
=
config
.
get
(
"server"
,
"engine_host"
),
port
=
10086
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录