9.23
周二
配环境
今天 HelloHPC 1st 比赛开始了,持续时间是 9月23日12:00 - 9月30日12:00
刚学会申请和 SSH 连接 HPC 计算节点,完成了填空题:小交问答。第三题 Masked Bitmatrix Density 需要性能分析,有了 CSAPP Cache Lab 的经验,我想看看缓存利用率,但 WSL 下的 perf 不支持包括缓存命中的很多硬件事件,所以配了 Windows 下的 Vtune,此外还配好了 MSYS2 clang64 的 clang 编译器,WSL 的 clang 编译器。终于搞明白了 MSYS2,ming64,ucrt64,clang64 的大致关系,现在 clang 和 gcc 在我的电脑上和谐共生!
为了自动运行 Vtune 测试,终于学会了写 VSCode 配置文件 tasks.json,搞懂了 VSCode 的底层逻辑,感觉自己已经是配环境大师了!
{
"version": "2.0.0",
"tasks": [
{
"label": "make test",
"type": "shell",
"command": "make test",
"options": {
"cwd": "${workspaceFolder}/source_code"
},
"problemMatcher": [
"$gcc"
]
},
{
"label": "vtune:hotspots",
"type": "shell",
"dependsOn": "make test",
"options": {
"cwd": "${workspaceFolder}/vtune_results"
},
"command": "vtune",
"args": [
"-collect",
"hotspots",
"-knob sampling-mode=hw",
"-knob sampling-interval=0.5",
"-knob enable-stack-collection=true",
"--",
"${workspaceFolder}/source_code/test.exe",
"${input:programArgs}"
],
"problemMatcher": []
},
{
"label": "vtune:memory",
"type": "shell",
"dependsOn": "make test",
"options": {
"cwd": "${workspaceFolder}/vtune_results"
},
"command": "vtune.exe",
"args": [
"-collect",
"memory-access",
"-knob sampling-interval=0.5",
"--",
"${workspaceFolder}/source_code/test.exe",
"${input:programArgs}"
],
"problemMatcher": []
},
{
"label": "vtune:uarch",
"type": "shell",
"dependsOn": "make test",
"options": {
"cwd": "${workspaceFolder}/vtune_results"
},
"command": "vtune.exe",
"args": [
"-collect",
"uarch-exploration",
"-knob sampling-interval=0.5",
"--",
"${workspaceFolder}/source_code/test.exe",
"${input:programArgs}"
],
"problemMatcher": []
},
{
"label": "vtune:open-gui",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/vtune_results"
},
"command": "vtune-gui",
"args": [],
"problemMatcher": []
}
],
"inputs": [
{
"id": "programArgs",
"type": "promptString",
"description": "输入程序参数:",
"default": "1024"
}
]
}
总之,烦了 ChatGPT 一整天!