跳转至

Tutorials

IPCC Preliminary SLIC Analysis

VScode Debug Run

{
    "name": "(gdb) 启动",
    "type": "cppdbg",
    "request": "launch",
    "program": "/home/shaojiemike/github/IPCC/SLIC/SLIC",
    "args": [],
    "stopAtEntry": false,
    "cwd": "${fileDirname}",
    "environment": [],
    "externalConsole": false,
    "MIMode": "gdb",
    "setupCommands": [
        {
            "description": "为 gdb 启用整齐打印",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
        }
    ]
}
g++ -g -std=c++11 SLIC.cpp -o SLIC #把调试信息加到可执行文件中,如果没有-g,你将看不见程序的函数名、变量名,所代替的全是运行时的内存地址。

Debug Process

  1. main
  2. LoadPPM 把数据读入imag
  3. 读类型、像素图片长宽 2599 3898
  4. 读最大像素 255(应该是指rgb颜色,比如red只有256种,也就是8位二进制)
  5. 读长宽的像素的rgb到imag返回,imag是2599*3898大小的unsigned int二维数组,每位存24位数2进制数。
  6. 创建lables来存储分类结果, m_spcount 200, m_compactness 10
  7. 计时运行 slic.PerformSLICO_ForGivenK(img, width, height, labels, numlabels, m_spcount, m_compactness);//for a given number K of superpixels
  8. 结果与check.ppm对比

skills: watch arrays

*(int(*)[100])labels
*labels@10000

SourceTrail Analysis

Vtune Analysis

需要进一步的研究学习

遇到的问题

参考文献

IPCC Preliminary SLIC test

test on node5

g++ -std=c++11 SLIC.cpp -o SLIC
time ./SLIC
./SLIC  28.46s user 0.52s system 99% cpu 29.027 total
slic

test on amd_256

gcc 10.2.0
[1]    122955 segmentation fault (core dumped)  ./SLIC
我傻逼了,我把cpp移动了,但是输入文件忘记动了
cat ./log/job_436960_rank0_fb0707_0.out
Computing time=21872 ms
There are 0 points' labels are different from original file.

要求

  1. 对slic.PerformSLICO_ForGivenK 函数运行时间进行通用优化
  2. 首先是并行化处理
  3. 读取时间不在计分范围
  4. 可以优化编译选项
  5. 可以改变数据结构与类型
  6. 需保证结果正确
  7. 之后有多组数据

需要进一步的研究学习

遇到的问题

北京超算的机器传文件只能用wincp,而且有时候不行,需要刷新缓存

参考文献