Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
A-Tune
提交
bba2072c
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 搜索 >>
提交
bba2072c
编写于
9月 01, 2020
作者:
H
hanxinke
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
atune:add the gcc compilation example
上级
58d2b0c1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
158 addition
and
0 deletion
+158
-0
examples/tuning/gcc_compile/README
examples/tuning/gcc_compile/README
+8
-0
examples/tuning/gcc_compile/gcc_compile.sh
examples/tuning/gcc_compile/gcc_compile.sh
+36
-0
examples/tuning/gcc_compile/gcc_compile_client.yaml
examples/tuning/gcc_compile/gcc_compile_client.yaml
+20
-0
examples/tuning/gcc_compile/gcc_compile_server.yaml
examples/tuning/gcc_compile/gcc_compile_server.yaml
+69
-0
examples/tuning/gcc_compile/prepare.sh
examples/tuning/gcc_compile/prepare.sh
+25
-0
未找到文件。
examples/tuning/gcc_compile/README
0 → 100644
浏览文件 @
bba2072c
1. Prepare the environment
sh prepare.sh
2. download stream.c
wget http://www.cs.virginia.edu/stream/FTP/Code/stream.c
3. Start to tuning
atune-adm tuning --project gcc_compile --detail gcc_compile_client.yaml
4. Restore the environment
atune-adm tuning --restore --project gcc_compile
examples/tuning/gcc_compile/gcc_compile.sh
0 → 100644
浏览文件 @
bba2072c
#!/bin/sh
# Copyright (c) 2020 Huawei Technologies Co., Ltd.
# A-Tune is licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
# PURPOSE.
# See the Mulan PSL v2 for more details.
# Create: 2020-09-01
path
=
$(
cd
"
$(
dirname
"
$0
"
)
"
pwd
)
echo
"current run path is
$path
"
tune
=
generic
option
=
O0
array_size
=
20000000
times
=
10
offset
=
1024
isarch
=
no
if
[[
$isarch
==
"yes"
]]
;
then
arch
=
"-march=native"
fi
isopenmp
=
no
if
[[
$isopenmp
==
"yes"
]]
;
then
openmp
=
"-fopenmp"
fi
gcc
-mtune
=
$tune
$arch
-
$option
$openmp
-DSTREAM_ARRAY_SIZE
=
$array_size
-DNTIMES
=
$times
-DOFFSET
=
$offset
$path
/stream.c
-o
$path
/stream.o
$path
/stream.o
echo
"file size:
`
wc
-c
$path
/stream.o
`
"
rm
-rf
$path
/stream.o
examples/tuning/gcc_compile/gcc_compile_client.yaml
0 → 100644
浏览文件 @
bba2072c
project
:
"
gcc_compile"
engine
:
"
bayes"
iterations
:
50
random_starts
:
10
benchmark
:
"
sh
gcc_compile/gcc_compile.sh"
evaluations
:
-
name
:
"
bandwidth"
info
:
get
:
"
echo
'$out'
|
grep
'Triad:'
|
awk
'{print
$2}'"
type
:
"
negative"
weight
:
80
-
name
:
"
size"
info
:
get
:
"
echo
'$out'
|
grep
'file
size:'
|
awk
'{print
$3}'"
type
:
"
positive"
weight
:
20
examples/tuning/gcc_compile/gcc_compile_server.yaml
0 → 100644
浏览文件 @
bba2072c
project
:
"
gcc_compile"
maxiterations
:
500
startworkload
:
"
"
stopworkload
:
"
"
object
:
-
name
:
"
option"
info
:
desc
:
"
The
gcc
compilation
options"
get
:
"
cat
gcc_compile/gcc_compile.sh
|
grep
-i
'^option='
|
awk
-F
'='
'{print
$2}'"
set
:
"
sed
-i
's/^option=.*/option=$value/g'
gcc_compile/gcc_compile.sh"
needrestart
:
"
false"
type
:
"
discrete"
options
:
-
"
O0"
-
"
O1"
-
"
O2"
-
"
O3"
-
"
Os"
-
"
Ofast"
dtype
:
"
string"
-
name
:
"
mtune"
info
:
desc
:
"
Tune
to
cpu-type
everything
applicable
about
the
generated
code"
get
:
"
cat
gcc_compile/gcc_compile.sh
|
grep
-i
'^tune='
|
awk
-F
'='
'{print
$2}'"
set
:
"
sed
-i
's/^tune=.*/tune=$value/g'
gcc_compile/gcc_compile.sh"
needrestart
:
"
false"
type
:
"
discrete"
options
:
-
"
generic"
-
"
native"
dtype
:
"
string"
-
name
:
"
march"
info
:
desc
:
"
Generate
instructions
for
the
machine
type
cpu-type"
get
:
"
cat
gcc_compile/gcc_compile.sh
|
grep
-i
'^isarch='
|
awk
-F
'='
'{print
$2}'"
set
:
"
sed
-i
's/^isarch=.*/isarch=$value/g'
gcc_compile/gcc_compile.sh"
needrestart
:
"
false"
type
:
"
discrete"
options
:
-
"
yes"
-
"
no"
dtype
:
"
string"
-
name
:
"
openmp"
info
:
desc
:
"
Adapts
to
multi-processor
env,
the
defalut
number
of
threads
is
the
number
of
CPU
threads
after
the
function
is
enabled."
get
:
"
cat
gcc_compile/gcc_compile.sh
|
grep
-i
'^isopenmp='
|
awk
-F
'='
'{print
$2}'"
set
:
"
sed
-i
's/^isopenmp=.*/isopenmp=$value/g'
gcc_compile/gcc_compile.sh"
needrestart
:
"
false"
type
:
"
discrete"
options
:
-
"
yes"
-
"
no"
dtype
:
"
string"
-
name
:
"
offset"
info
:
desc
:
"
the
array
offset"
get
:
"
cat
gcc_compile/gcc_compile.sh
|
grep
-i
'^offset='
|
awk
-F
'='
'{print
$2}'"
set
:
"
sed
-i
's/^offset=.*/offset=$value/g'
gcc_compile/gcc_compile.sh"
needrestart
:
"
false"
type
:
"
continuous"
scope
:
-
1024
-
61440
dtype
:
"
int"
examples/tuning/gcc_compile/prepare.sh
0 → 100644
浏览文件 @
bba2072c
#!/bin/sh
# Copyright (c) 2020 Huawei Technologies Co., Ltd.
# A-Tune is licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
# PURPOSE.
# See the Mulan PSL v2 for more details.
# Create: 2020-09-01
path
=
$(
cd
"
$(
dirname
"
$0
"
)
"
pwd
)
echo
"update the client and server yaml files"
sed
-i
"s#sh .*/gcc_compile.sh#sh
$path
/gcc_compile.sh#g"
$path
/gcc_compile_client.yaml
sed
-i
"s#-c .*/stream.o#-c
$path
/stream.o#g"
$path
/gcc_compile_client.yaml
sed
-i
"s#cat .*/gcc_compile.sh#cat
$path
/gcc_compile.sh#g"
$path
/gcc_compile_server.yaml
sed
-i
"s#' .*/gcc_compile.sh#'
$path
/gcc_compile.sh#g"
$path
/gcc_compile_server.yaml
echo
"copy the server yaml file to /etc/atuned/tuning/"
cp
$path
/gcc_compile_server.yaml /etc/atuned/tuning/
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录